This commit is contained in:
Jocelyn Fiat
2013-02-27 21:50:14 +01:00
27 changed files with 290 additions and 139 deletions

View File

@@ -4,5 +4,5 @@ site.email=your@email.com
root-dir=../www root-dir=../www
var-dir=var var-dir=var
files-dir=files files-dir=files
themes-dir=../www/themes themes-dir=${root-dir}/themes
theme=test #theme=test

View File

@@ -8,11 +8,6 @@ class
WEB_CMS WEB_CMS
inherit inherit
-- CMS_SERVICE
-- redefine
-- modules
-- end
WSF_DEFAULT_SERVICE WSF_DEFAULT_SERVICE
redefine redefine
initialize initialize

View File

@@ -25,9 +25,20 @@ feature {NONE} -- Initialization
make make
configuration_location := a_filename configuration_location := a_filename
import (a_filename) import (a_filename)
resolve
analyze analyze
end end
resolve
-- Resolve options related to variable ${..}
do
across
options as c
loop
options.replace (resolved_string (c.item), c.key)
end
end
analyze analyze
do do
get_root_location get_root_location
@@ -42,7 +53,7 @@ feature -- Access
option (a_name: READABLE_STRING_GENERAL): detachable ANY option (a_name: READABLE_STRING_GENERAL): detachable ANY
do do
Result := options.item (a_name.as_string_8) Result := options.item (a_name.as_string_8.as_lower)
end end
options: HASH_TABLE [STRING, STRING] options: HASH_TABLE [STRING, STRING]
@@ -114,6 +125,7 @@ feature -- Access
end end
if Result /= Void then if Result /= Void then
if Result.is_empty then if Result.is_empty then
-- ok
elseif not Result.ends_with ("/") then elseif not Result.ends_with ("/") then
Result := Result + "/" Result := Result + "/"
end end
@@ -242,4 +254,43 @@ feature {NONE} -- Environment
create Result create Result
end end
resolved_string (s: READABLE_STRING_8): STRING
-- Resolved `s' using `options' or else environment variables.
local
i,n,b,e: INTEGER
k: detachable READABLE_STRING_8
do
from
i := 1
n := s.count
create Result.make (s.count)
until
i > n
loop
if i + 1 < n and then s[i] = '$' and then s[i+1] = '{' then
b := i + 2
e := s.index_of ('}', b) - 1
if e > 0 then
k := s.substring (b, e)
if attached option (k) as v then
Result.append (v.out)
i := e + 1
elseif attached execution_environment.get (k) as v then
Result.append (v)
i := e + 1
else
Result.extend (s[i])
end
else
Result.extend (s[i])
end
else
Result.extend (s[i])
end
i := i + 1
end
end
end end

View File

@@ -7,13 +7,6 @@ note
deferred class deferred class
CMS_SETUP CMS_SETUP
feature -- Initialization
initialize_storage (a_cms: CMS_SERVICE)
do
end
feature -- Access feature -- Access
configuration: detachable CMS_CONFIGURATION configuration: detachable CMS_CONFIGURATION

View File

@@ -125,6 +125,18 @@ feature -- Access
Result := url ("/node/" + n.id.out, Void) Result := url ("/node/" + n.id.out, Void)
end end
absolute_url (a_path: STRING; opts: detachable CMS_API_OPTIONS): STRING
local
l_opts: detachable CMS_API_OPTIONS
do
l_opts := opts
if l_opts = Void then
create l_opts.make (1)
end
l_opts.force (True, "absolute")
Result := url (a_path, l_opts)
end
url (a_path: STRING; opts: detachable CMS_API_OPTIONS): STRING url (a_path: STRING; opts: detachable CMS_API_OPTIONS): STRING
local local
q,f: detachable STRING_8 q,f: detachable STRING_8
@@ -132,7 +144,6 @@ feature -- Access
do do
l_abs := False l_abs := False
Result := based_path (a_path)
if opts /= Void then if opts /= Void then
l_abs := opts.boolean_item ("absolute", l_abs) l_abs := opts.boolean_item ("absolute", l_abs)
if attached opts.item ("query") as l_query then if attached opts.item ("query") as l_query then
@@ -157,18 +168,36 @@ feature -- Access
f := s_frag f := s_frag
end end
end end
if l_abs then
if a_path.substring_index ("://", 1) = 0 then
create Result.make_from_string (service.site_url)
if a_path.is_empty then
elseif Result.ends_with ("/") then
if a_path[1] = '/' then
Result.append_string (a_path.substring (2, a_path.count))
else
Result.append_string (a_path)
end
else
if a_path[1] = '/' then
Result.append_string (a_path)
else
Result.append_character ('/')
Result.append_string (a_path)
end
end
else
Result := a_path
end
else
Result := based_path (a_path)
end
if q /= Void then if q /= Void then
Result.append ("?" + q) Result.append ("?" + q)
end end
if f /= Void then if f /= Void then
Result.append ("#" + f) Result.append ("#" + f)
end end
if l_abs then
Result := based_path (Result)
if Result.substring_index ("://", 1) = 0 then
Result.prepend (service.site_url)
end
end
end end
checked_url (a_url: STRING): STRING checked_url (a_url: STRING): STRING

View File

@@ -102,6 +102,20 @@ feature -- Items
Result := fields_by_name_from (Current, a_name) Result := fields_by_name_from (Current, a_name)
end end
items_by_css_id (a_id: READABLE_STRING_GENERAL): detachable LIST [CMS_FORM_ITEM]
do
Result := items_by_css_id_from (Current, a_id)
end
first_item_by_css_id (a_id: READABLE_STRING_GENERAL): detachable CMS_FORM_ITEM
do
if attached items_by_css_id_from (Current, a_id) as lst then
if not lst.is_empty then
Result := lst.first
end
end
end
feature {NONE} -- Implementation: Items feature {NONE} -- Implementation: Items
container_has_field (a_container: ITERABLE [CMS_FORM_ITEM]; a_name: READABLE_STRING_GENERAL): BOOLEAN container_has_field (a_container: ITERABLE [CMS_FORM_ITEM]; a_name: READABLE_STRING_GENERAL): BOOLEAN
@@ -144,6 +158,35 @@ feature {NONE} -- Implementation: Items
Result := res Result := res
end end
items_by_css_id_from (a_container: ITERABLE [CMS_FORM_ITEM]; a_id: READABLE_STRING_GENERAL): detachable ARRAYED_LIST [CMS_FORM_ITEM]
local
res: detachable ARRAYED_LIST [CMS_FORM_ITEM]
do
across
a_container as i
loop
if
attached {WITH_CSS_ID} i.item as l_with_css_id and then
attached l_with_css_id.css_id as l_css_id and then
l_css_id.same_string_general (a_id)
then
if res = Void then
create res.make (1)
end
res.force (i.item)
elseif attached {ITERABLE [CMS_FORM_ITEM]} i.item as l_cont then
if attached items_by_css_id_from (l_cont, a_id) as lst then
if res = Void then
res := lst
else
res.append (lst)
end
end
end
end
Result := res
end
feature -- Change feature -- Change
extend (i: CMS_FORM_ITEM) extend (i: CMS_FORM_ITEM)
@@ -167,11 +210,11 @@ feature -- Change
feature -- Conversion feature -- Conversion
to_html (a_theme: CMS_THEME): STRING_8 append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
local local
s: STRING s: STRING_8
do do
Result := "<form action=%""+ action +"%" id=%""+ id +"%" method=%""+ method +"%" " a_html.append ("<form action=%""+ action +"%" id=%""+ id +"%" method=%""+ method +"%" ")
if not html_classes.is_empty then if not html_classes.is_empty then
create s.make_empty create s.make_empty
across across
@@ -182,15 +225,21 @@ feature -- Conversion
end end
s.append (cl.item) s.append (cl.item)
end end
Result.append (" class=%"" + s + "%" ") a_html.append (" class=%"" + s + "%" ")
end end
Result.append (">%N") a_html.append (">%N")
across across
items as c items as c
loop loop
Result.append (c.item.to_html (a_theme)) c.item.append_to_html (a_theme, a_html)
end end
Result.append ("</form>%N") a_html.append ("</form>%N")
end
to_html (a_theme: CMS_THEME): STRING_8
do
create Result.make_empty
append_to_html (a_theme, Result)
end end
feature {NONE} -- Implementation feature {NONE} -- Implementation

View File

@@ -14,7 +14,7 @@ inherit
redefine redefine
set_value, set_value,
specific_input_attributes_string, specific_input_attributes_string,
child_to_html append_child_to_html
end end
CMS_FORM_SELECTABLE_ITEM CMS_FORM_SELECTABLE_ITEM
@@ -83,16 +83,16 @@ feature -- Change
feature {NONE} -- Implementation feature {NONE} -- Implementation
child_to_html (a_theme: CMS_THEME): detachable READABLE_STRING_8 append_child_to_html (a_theme: CMS_THEME; a_html: STRING_8)
-- Specific child element if any. -- Specific child element if any.
--| To redefine if needed --| To redefine if needed
do do
if attached raw_text as t then if attached raw_text as t then
Result := t a_html.append (t)
elseif attached text as t then elseif attached text as t then
Result := a_theme.html_encoded (t) a_html.append (a_theme.html_encoded (t))
elseif attached value as v then elseif attached value as v then
Result := a_theme.html_encoded (v) a_html.append (a_theme.html_encoded (v))
end end
end end

View File

@@ -17,6 +17,7 @@ inherit
create create
make, make,
make_with_item, make_with_item,
make_with_items,
make_with_text make_with_text
feature {NONE} -- Initialization feature {NONE} -- Initialization
@@ -38,6 +39,16 @@ feature {NONE} -- Initialization
extend (i) extend (i)
end end
make_with_items (it: ITERABLE [CMS_FORM_ITEM])
do
create items.make (2)
across
it as c
loop
extend (c.item)
end
end
feature -- Access feature -- Access
new_cursor: ITERATION_CURSOR [CMS_FORM_ITEM] new_cursor: ITERATION_CURSOR [CMS_FORM_ITEM]
@@ -55,20 +66,20 @@ feature -- Change
feature -- Conversion feature -- Conversion
to_html (a_theme: CMS_THEME): STRING_8 append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
do do
Result := "<div" a_html.append ("<div")
append_css_class_to (Result, Void) append_css_class_to (a_html, Void)
append_css_id_to (Result) append_css_id_to (a_html)
append_css_style_to (Result) append_css_style_to (a_html)
Result.append (">%N") a_html.append (">%N")
across across
items as c items as c
loop loop
Result.append (c.item.to_html (a_theme)) c.item.append_to_html (a_theme, a_html)
end end
Result.append ("%N</div>%N") a_html.append ("%N</div>%N")
end end
feature {NONE} -- Implementation feature {NONE} -- Implementation

View File

@@ -102,7 +102,7 @@ feature -- Element change
feature -- Conversion feature -- Conversion
to_html (a_theme: CMS_THEME): STRING_8 append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
local local
l_class_items: detachable ARRAYED_LIST [READABLE_STRING_8] l_class_items: detachable ARRAYED_LIST [READABLE_STRING_8]
do do
@@ -117,28 +117,28 @@ feature -- Conversion
l_class_items := Void l_class_items := Void
end end
create Result.make_from_string ("<div") a_html.append ("<div")
append_css_class_to (Result, l_class_items) append_css_class_to (a_html, l_class_items)
Result.append_character ('>') a_html.append_character ('>')
if attached label as lab then if attached label as lab then
Result.append ("<strong><label for=%"" + name + "%">" + lab + "</label></strong>") a_html.append ("<strong><label for=%"" + name + "%">" + lab + "</label></strong>")
if is_required then if is_required then
Result.append (" (<em>required</em>)") a_html.append (" (<em>required</em>)")
end end
Result.append ("<br/>%N") a_html.append ("<br/>%N")
end end
Result.append (item_to_html (a_theme)) append_item_to_html (a_theme, a_html)
if attached description as desc then if attached description as desc then
if is_description_collapsible then if is_description_collapsible then
Result.append ("<div class=%"description collapsible%"><div>Description ...</div><div>" + desc + "</div></div>") a_html.append ("<div class=%"description collapsible%"><div>Description ...</div><div>" + desc + "</div></div>")
else else
Result.append ("<div class=%"description%">" + desc + "</div>") a_html.append ("<div class=%"description%">" + desc + "</div>")
end end
end end
Result.append ("</div>") a_html.append ("</div>")
end end
item_to_html (a_theme: CMS_THEME): STRING_8 append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
deferred deferred
end end

View File

@@ -51,6 +51,11 @@ feature -- Change
items.force (i) items.force (i)
end end
prepend (i: CMS_FORM_ITEM)
do
items.put_front (i)
end
extend_text (t: READABLE_STRING_8) extend_text (t: READABLE_STRING_8)
do do
items.force (create {CMS_FORM_RAW_TEXT}.make (t)) items.force (create {CMS_FORM_RAW_TEXT}.make (t))
@@ -77,23 +82,23 @@ feature -- Change
feature -- Conversion feature -- Conversion
to_html (a_theme: CMS_THEME): STRING_8 append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
do do
Result := "<fieldset" a_html.append ("<fieldset")
append_css_class_to (Result, Void) append_css_class_to (a_html, Void)
append_css_id_to (Result) append_css_id_to (a_html)
append_css_style_to (Result) append_css_style_to (a_html)
Result.append (">%N") a_html.append (">%N")
if attached legend as leg then if attached legend as leg then
Result.append ("<legend>" + leg + "</legend>%N") a_html.append ("<legend>" + leg + "</legend>%N")
end end
across across
items as c items as c
loop loop
Result.append (c.item.to_html (a_theme)) c.item.append_to_html (a_theme, a_html)
end end
Result.append ("%N</fieldset>%N") a_html.append ("%N</fieldset>%N")
end end
feature {NONE} -- Implementation feature {NONE} -- Implementation

View File

@@ -11,7 +11,7 @@ inherit
CMS_FORM_INPUT CMS_FORM_INPUT
redefine redefine
input_type, input_type,
item_to_html append_item_to_html
end end
create create
@@ -27,11 +27,11 @@ feature -- Access
feature -- Conversion feature -- Conversion
item_to_html (a_theme: CMS_THEME): STRING_8 append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
do do
Result := "<div style=%"display:none%">" a_html.append ("<div style=%"display:none%">")
Result.append (Precursor (a_theme)) Precursor (a_theme, a_html)
Result.append ("</div>") a_html.append ("</div>")
end end
end end

View File

@@ -78,45 +78,50 @@ feature -- Element change
feature -- Conversion feature -- Conversion
item_to_html (a_theme: CMS_THEME): STRING_8 append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
local
old_count: INTEGER
do do
Result := "<input type=%""+ input_type +"%" name=%""+ name +"%"" a_html.append ("<input type=%""+ input_type +"%" name=%""+ name +"%"")
append_css_class_to (Result, Void) append_css_class_to (a_html, Void)
append_css_id_to (Result) append_css_id_to (a_html)
append_css_style_to (Result) append_css_style_to (a_html)
if is_readonly then if is_readonly then
Result.append (" readonly=%"readonly%"") a_html.append (" readonly=%"readonly%"")
end end
if attached default_value as dft then if attached default_value as dft then
Result.append (" value=%"" + a_theme.html_encoded (dft) + "%"") a_html.append (" value=%"" + a_theme.html_encoded (dft) + "%"")
end end
if disabled then if disabled then
Result.append (" disabled=%"disabled%"") a_html.append (" disabled=%"disabled%"")
end end
if size > 0 then if size > 0 then
Result.append (" size=%"" + size.out + "%"") a_html.append (" size=%"" + size.out + "%"")
end end
if maxlength > 0 then if maxlength > 0 then
Result.append (" maxlength=%"" + maxlength.out + "%"") a_html.append (" maxlength=%"" + maxlength.out + "%"")
end end
if attached specific_input_attributes_string as s then if attached specific_input_attributes_string as s then
Result.append_character (' ') a_html.append_character (' ')
Result.append (s) a_html.append (s)
end end
if attached child_to_html (a_theme) as s then a_html.append (">")
Result.append (">") old_count := a_html.count
Result.append (s) append_child_to_html (a_theme, a_html)
Result.append ("</input>") if a_html.count > old_count then
a_html.append ("</input>")
else else
Result.append ("/>") check a_html.item (a_html.count) = '>' end
a_html.put ('/', a_html.count) -- replace previous '>'
a_html.append (">")
end end
end end
feature {NONE} -- Implementation feature {NONE} -- Implementation
child_to_html (a_theme: CMS_THEME): detachable READABLE_STRING_8 append_child_to_html (a_theme: CMS_THEME; a_html: STRING_8)
-- Specific child element if any. -- Specific child element if any.
--| To redefine if needed --| To redefine if needed
do do

View File

@@ -14,8 +14,14 @@ inherit
feature -- Conversion feature -- Conversion
to_html (a_theme: CMS_THEME): STRING_8 append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
deferred deferred
end end
to_html (a_theme: CMS_THEME): STRING_8
do
create Result.make_empty
append_to_html (a_theme, Result)
end
end end

View File

@@ -10,7 +10,7 @@ class
inherit inherit
CMS_FORM_ITEM CMS_FORM_ITEM
redefine redefine
to_html append_to_html
end end
create create
@@ -36,14 +36,14 @@ feature -- Element change
feature -- Conversion feature -- Conversion
to_html (a_theme: CMS_THEME): STRING_8 append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
do do
Result := item_to_html (a_theme) append_item_html_to (a_theme, a_html)
end end
item_to_html (a_theme: CMS_THEME): STRING_8 append_item_html_to (a_theme: CMS_THEME; a_html: STRING_8)
do do
Result := text a_html.append (text)
end end
end end

View File

@@ -63,7 +63,6 @@ feature -- Element change
select_value_by_text (a_text: detachable READABLE_STRING_GENERAL) select_value_by_text (a_text: detachable READABLE_STRING_GENERAL)
local local
opt: CMS_FORM_SELECT_OPTION
l_found: BOOLEAN l_found: BOOLEAN
v: READABLE_STRING_8 v: READABLE_STRING_8
do do
@@ -104,38 +103,38 @@ feature -- Element change
feature -- Conversion feature -- Conversion
item_to_html (a_theme: CMS_THEME): STRING_8 append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
local local
l_is_already_selected: BOOLEAN l_is_already_selected: BOOLEAN
h: detachable STRING_8 h: detachable STRING_8
do do
Result := "<select name=%""+ name +"%" " a_html.append ("<select name=%""+ name +"%" ")
if css_id = Void then if css_id = Void then
set_css_id (name +"-select") set_css_id (name + "-select")
end end
append_css_class_to (Result, Void) append_css_class_to (a_html, Void)
append_css_id_to (Result) append_css_id_to (a_html)
append_css_style_to (Result) append_css_style_to (a_html)
if is_readonly then if is_readonly then
Result.append (" readonly=%"readonly%" />") a_html.append (" readonly=%"readonly%" />")
else else
Result.append ("/>") a_html.append ("/>")
end end
across across
options as o options as o
loop loop
Result.append ("<option value=%"" + o.item.value + "%" ") a_html.append ("<option value=%"" + o.item.value + "%" ")
-- if not l_is_already_selected then -- if not l_is_already_selected then
if if
o.item.is_selected o.item.is_selected
then then
l_is_already_selected := True l_is_already_selected := True
Result.append (" selected=%"selected%"") a_html.append (" selected=%"selected%"")
end end
-- end -- end
Result.append (">" + o.item.text + "</option>%N") a_html.append (">" + o.item.text + "</option>%N")
if attached o.item.description as d then if attached o.item.description as d then
if h = Void then if h = Void then
create h.make_empty create h.make_empty
@@ -143,9 +142,9 @@ feature -- Conversion
h.append ("<div id=%"" + name + "-" + o.item.value + "%" class=%"option%"><strong>"+ o.item.text +"</strong>:"+ d + "</div>") h.append ("<div id=%"" + name + "-" + o.item.value + "%" class=%"option%"><strong>"+ o.item.text +"</strong>:"+ d + "</div>")
end end
end end
Result.append ("</select>%N") a_html.append ("</select>%N")
if h /= Void then if h /= Void then
Result.append ("<div class=%"select help collapsible%" id=%"" + name + "-help%">" + h + "</div>%N") a_html.append ("<div class=%"select help collapsible%" id=%"" + name + "-help%">" + h + "</div>%N")
end end
end end

View File

@@ -61,30 +61,29 @@ feature -- Element change
feature -- Conversion feature -- Conversion
item_to_html (a_theme: CMS_THEME): STRING_8 append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
do do
Result := "<textarea name=%""+ name +"%"" a_html.append ("<textarea name=%""+ name +"%"")
if rows > 0 then if rows > 0 then
Result.append (" rows=%"" + rows.out + "%"") a_html.append (" rows=%"" + rows.out + "%"")
end end
if cols > 0 then if cols > 0 then
Result.append (" cols=%"" + cols.out + "%"") a_html.append (" cols=%"" + cols.out + "%"")
end end
append_css_class_to (Result, Void) append_css_class_to (a_html, Void)
append_css_id_to (Result) append_css_id_to (a_html)
append_css_style_to (Result) append_css_style_to (a_html)
if is_readonly then if is_readonly then
Result.append (" readonly=%"readonly%">") a_html.append (" readonly=%"readonly%">")
else else
Result.append (">") a_html.append (">")
end end
if attached default_value as dft then if attached default_value as dft then
Result.append (a_theme.html_encoded (dft)) a_html.append (a_theme.html_encoded (dft))
end end
Result.append ("</textarea>") a_html.append ("</textarea>")
end end
end end

View File

@@ -29,6 +29,8 @@ feature -- Status report
is_expandable: BOOLEAN = False is_expandable: BOOLEAN = False
has_children: BOOLEAN = False
children: detachable LIST [CMS_LINK] children: detachable LIST [CMS_LINK]
do do
end end

View File

@@ -86,7 +86,7 @@ feature -- Handler
s.append ("<hr/>") s.append ("<hr/>")
append_info_to ("Current dir", (create {EXECUTION_ENVIRONMENT}).current_working_path.name, e, s) append_info_to ("Current dir", (create {EXECUTION_ENVIRONMENT}).current_working_directory, e, s)
append_info_to ("Base url", cms.base_url, e, s) append_info_to ("Base url", cms.base_url, e, s)
append_info_to ("Script url", cms.script_url, e, s) append_info_to ("Script url", cms.script_url, e, s)
s.append ("<hr/>") s.append ("<hr/>")

View File

@@ -25,7 +25,7 @@ feature -- Execution
create b.make_empty create b.make_empty
if attached non_empty_string_path_parameter ("type") as s_type then if attached non_empty_string_path_parameter ("type") as s_type then
if attached service.content_type (s_type) as l_type then if attached service.content_type (s_type) as l_type then
f := edit_form (Void, request.path_info, "add-" + l_type.name, l_type) f := edit_form (Void, url (request.path_info, Void), "add-" + l_type.name, l_type)
if request.is_post_request_method then if request.is_post_request_method then
create fd.make (request, f) create fd.make (request, f)
l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview")
@@ -82,7 +82,7 @@ feature -- Execution
end end
fd.apply_to_associated_form fd.apply_to_associated_form
end end
b.append (f.to_html (theme)) f.append_to_html (theme, b)
end end
else else
set_title ("Access denied") set_title ("Access denied")

View File

@@ -30,7 +30,7 @@ feature -- Execution
then then
if attached service.content_type (l_node.content_type_name) as l_type then if attached service.content_type (l_node.content_type_name) as l_type then
if has_permission ("edit " + l_type.name) then if has_permission ("edit " + l_type.name) then
f := edit_form (l_node, request.path_info, "edit-" + l_type.name, l_type) f := edit_form (l_node, url (request.path_info, Void), "edit-" + l_type.name, l_type)
if request.is_post_request_method then if request.is_post_request_method then
create fd.make (request, f) create fd.make (request, f)
l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview") l_preview := attached {WSF_STRING} fd.item ("op") as l_op and then l_op.same_string ("Preview")
@@ -87,7 +87,7 @@ feature -- Execution
end end
fd.apply_to_associated_form fd.apply_to_associated_form
end end
b.append (f.to_html (theme)) f.append_to_html (theme, b)
end end
else else
b.append ("<h1>Access denied</h1>") b.append ("<h1>Access denied</h1>")

View File

@@ -112,7 +112,7 @@ feature -- Execution
end end
fd.apply_to_associated_form fd.apply_to_associated_form
end end
b.append (f.to_html (theme)) f.append_to_html (theme, b)
set_main_content (b) set_main_content (b)
end end
end end

View File

@@ -47,7 +47,7 @@ feature -- Execution
set_redirection (url ("/user/register", Void)) set_redirection (url ("/user/register", Void))
else else
service.storage.fill_user_profile (u) service.storage.fill_user_profile (u)
f := edit_form (u, request.path_info, "user-edit") f := edit_form (u, url (request.path_info, Void), "user-edit")
if request.is_post_request_method then if request.is_post_request_method then
create fd.make (request, f) create fd.make (request, f)
@@ -105,7 +105,7 @@ feature -- Execution
end end
fd.apply_to_associated_form fd.apply_to_associated_form
end end
b.append (f.to_html (theme)) f.append_to_html (theme, b)
end end
end end
set_main_content (b) set_main_content (b)

View File

@@ -34,7 +34,7 @@ feature -- Execution
if attached u.email as l_email then if attached u.email as l_email then
f := new_password_form (url (request.path_info, Void), "new-password") f := new_password_form (url (request.path_info, Void), "new-password")
b.append ("Password reset instructions will be mailed to <em>" + l_email + "</em>. You must " + link ("log out", "/user/logout", Void) + " to use the password reset link in the e-mail.") b.append ("Password reset instructions will be mailed to <em>" + l_email + "</em>. You must " + link ("log out", "/user/logout", Void) + " to use the password reset link in the e-mail.")
b.append (f.to_html (theme)) f.append_to_html (theme, b)
else else
b.append ("Your account does not have any email address set!") b.append ("Your account does not have any email address set!")
set_redirection (url ("/user/"+ u.id.out +"/edit", Void)) set_redirection (url ("/user/"+ u.id.out +"/edit", Void))
@@ -43,7 +43,7 @@ feature -- Execution
b.append ("Unexpected issue") b.append ("Unexpected issue")
end end
else else
f := new_password_form (request.path_info, "new-password") f := new_password_form (url (request.path_info, Void), "new-password")
if request.is_post_request_method then if request.is_post_request_method then
create fd.make (request, f) create fd.make (request, f)
if attached {WSF_STRING} fd.item ("name") as s_name then if attached {WSF_STRING} fd.item ("name") as s_name then
@@ -84,7 +84,7 @@ feature -- Execution
end end
fd.apply_to_associated_form fd.apply_to_associated_form
end end
b.append (f.to_html (theme)) f.append_to_html (theme, b)
end end
end end
set_main_content (b) set_main_content (b)

View File

@@ -103,7 +103,7 @@ feature -- Execution
end end
fd.apply_to_associated_form fd.apply_to_associated_form
end end
b.append (f.to_html (theme)) f.append_to_html (theme, b)
end end
end end
set_main_content (b) set_main_content (b)

View File

@@ -84,8 +84,11 @@ feature {NONE} -- Implementation
date_to_rfc1123_http_date_format (dt: DATE_TIME): STRING_8 date_to_rfc1123_http_date_format (dt: DATE_TIME): STRING_8
-- String representation of `dt' using the RFC 1123 -- String representation of `dt' using the RFC 1123
local
d: HTTP_DATE
do do
Result := dt.formatted_out ("ddd,[0]dd mmm yyyy [0]hh:[0]mi:[0]ss.ff2") + " GMT" create d.make_from_date_time (dt)
Result := d.rfc1123_string
end end
invariant invariant

View File

@@ -70,9 +70,10 @@ div#main-wrapper {
} }
div#main { margin: 0; padding: 0; clear: both; height:0; display: block; } div#main { margin: 0; padding: 0; clear: both; height:0; display: block; }
div#content { padding: 5px 3px 5px 20px; div#content {
padding: 5px 3px 5px 20px;
margin-top: 10px; margin-top: 10px;
min-width: 80%; min-width: 60%;
display: inline; display: inline;
float: left; float: left;
position: relative; position: relative;
@@ -81,7 +82,7 @@ div#content { padding: 5px 3px 5px 20px;
} }
div#first_sidebar { div#first_sidebar {
width: 200px; width: 20%;
margin: 5px; margin: 5px;
padding: 5px; padding: 5px;
display: inline; display: inline;
@@ -89,11 +90,11 @@ div#first_sidebar {
position: relative; position: relative;
} }
div#second_sidebar { div#second_sidebar {
width: 100px; width: 20%;
margin: 5px; margin: 5px;
padding: 5px; padding: 5px;
display: inline; display: inline;
float: right; float: left;
position: relative; position: relative;
background-color: #eee; background-color: #eee;
} }

View File

@@ -559,13 +559,16 @@ feature -- Cookie
if if
domain /= Void and then not domain.same_string ("localhost") domain /= Void and then not domain.same_string ("localhost")
then then
s.append ("; Domain=" + domain) s.append ("; Domain=")
s.append (domain)
end end
if path /= Void then if path /= Void then
s.append ("; Path=" + path) s.append ("; Path=")
s.append (path)
end end
if expiration /= Void then if expiration /= Void then
s.append ("; Expires=" + expiration) s.append ("; Expires=")
s.append (expiration)
end end
if secure then if secure then
s.append ("; Secure") s.append ("; Secure")