Better control on path alias.

If user has permission to edit, provide a text input, otherwise just a label if path are required.
Reviewed html generated for taxonomy field in node edit form.
Improved the blog entries list by providing (if permitted) link to blog entry creation, and link to the user entries or all entries.
This commit is contained in:
2017-03-06 21:27:35 +01:00
parent 7cde24a439
commit 67f6591851
7 changed files with 152 additions and 71 deletions

View File

@@ -257,11 +257,11 @@ feature -- Web forms
local
ti: detachable WSF_FORM_TEXT_INPUT
th: WSF_FORM_HIDDEN_INPUT
w_set: WSF_FORM_FIELD_SET
w_div: WSF_FORM_DIV
w_select: WSF_FORM_SELECT
w_opt: WSF_FORM_SELECT_OPTION
w_cb: WSF_FORM_CHECKBOX_INPUT
w_voc_set: WSF_FORM_FIELD_SET
w_voc_set: WSF_FORM_DIV
s: STRING_32
voc: CMS_VOCABULARY
t: detachable CMS_TERM
@@ -274,15 +274,15 @@ feature -- Web forms
l_has_edit_permission := a_response.has_permissions (<<"update any taxonomy", "update " + a_content_type_name + " taxonomy">>)
-- Handle Taxonomy fields, if any associated with `content_type'.
create w_set.make
w_set.add_css_class ("taxonomy")
create w_div.make
w_div.add_css_class ("taxonomy")
l_vocs.sort
across
l_vocs as vocs_ic
loop
voc := vocs_ic.item
create th.make_with_text ({STRING_32} "taxonomy_vocabularies[" + voc.id.out + "]", voc.name)
w_set.extend (th)
w_div.extend (th)
l_terms := Void
if a_content /= Void then
@@ -292,10 +292,11 @@ feature -- Web forms
end
end
create w_voc_set.make
w_set.extend (w_voc_set)
w_div.extend (w_voc_set)
if voc.is_tags then
w_voc_set.set_legend (cms_api.translation (voc.name, Void))
w_voc_set.extend_text ("<strong><label>" + cms_api.html_encoded (cms_api.translation (voc.name, Void)) + "</label></strong>")
-- set_legend (cms_api.translation (voc.name, Void))
create ti.make ({STRING_32} "taxonomy_" + voc.id.out)
w_voc_set.extend (ti)
@@ -336,9 +337,11 @@ feature -- Web forms
if not voc.terms.is_empty then
if voc.multiple_terms_allowed then
if attached voc.description as l_desc then
w_voc_set.set_legend (cms_api.html_encoded (l_desc))
w_voc_set.extend_text ("<strong><label>" + cms_api.html_encoded (l_desc) + "</label></strong>")
-- w_voc_set.set_legend (cms_api.html_encoded (l_desc))
else
w_voc_set.set_legend (cms_api.html_encoded (voc.name))
w_voc_set.extend_text ("<strong><label>" + cms_api.html_encoded (voc.name) + "</label></strong>")
-- w_voc_set.set_legend (cms_api.html_encoded (voc.name))
end
across
voc as voc_terms_ic
@@ -363,7 +366,8 @@ feature -- Web forms
else
w_select.set_description (cms_api.html_encoded (voc.name))
end
w_voc_set.set_legend (cms_api.html_encoded (voc.name))
w_voc_set.extend_text ("<strong><label>" + cms_api.html_encoded (voc.name) + "</label></strong>")
-- w_voc_set.set_legend (cms_api.html_encoded (voc.name))
across
voc as voc_terms_ic
@@ -390,9 +394,9 @@ feature -- Web forms
attached a_form.fields_by_name ("title") as l_title_fields and then
attached l_title_fields.first as l_title_field
then
a_form.insert_after (w_set, l_title_field)
a_form.insert_after (w_div, l_title_field)
else
a_form.extend (w_set)
a_form.extend (w_div)
end
end
end