diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_view/my_description.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_view/my_description.xml index c97f4d723c78b995214bc3024af97910296659ed..ba24e91747a4eda7f1b0d2b81d0b9f7a2308d742 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_view/my_description.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_view/my_description.xml @@ -219,7 +219,7 @@ </item> <item> <key> <string>description</string> </key> - <value> <string></string> </value> + <value> <string>Short description that will appear in the search result list.</string> </value> </item> <item> <key> <string>editable</string> </key> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getBreadcrumb.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getBreadcrumb.xml index 0f5cfc32fc1a5cda3841ddd8271b938a9531ba47..05430d4c75e33eed3c0b519957aed91ac670216a 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getBreadcrumb.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getBreadcrumb.xml @@ -71,10 +71,10 @@ html_list = []\n \n for crumb in context.WebSite_getBreadcrumbValue():\n - if crumb.getTitle() is None or crumb.getTitle() == \'\':\n - text = crumb.getId()\n - else:\n - text = crumb.getTitle()\n + text = None\n + for property in (\'title\', \'short_title\', \'id\'):\n + if text in (None, \'\') and hasattr(crumb, property):\n + text = getattr(crumb, property)\n html_list.append(\'<a href="%s">%s</a>\' % (crumb.WebSite_getUrl(), text))\n \n return \' > \'.join(html_list)\n @@ -127,6 +127,9 @@ return \' > \'.join(html_list)\n <string>crumb</string> <string>None</string> <string>text</string> + <string>property</string> + <string>hasattr</string> + <string>getattr</string> </tuple> </value> </item> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml index bfa343f276279b5bfac9cad1f2f58329f9fa315d..c6e5bd3ee80a83462c80f5cf9f3fdb1614fb1284 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml @@ -66,9 +66,10 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>document = context.WebSite_getDocumentValue()\n + <value> <string>#XXX This script should be named WebSite_getDocument\n +document = context.WebSite_getDocumentValue()\n if document is not None:\n - return document.WebSite_getUrl()\n + return \'%s/%s\' % (context.WebSite_getSection(),document.getReference())\n return context.WebSite_getUrl()\n </string> </value> </item> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentValue.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentValue.xml index e7e471acee798d6c888d5853fc19e0696f3e9265..7ec35856bc4679d2c123570ba5bb06ad03ab0597 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentValue.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentValue.xml @@ -70,6 +70,8 @@ if portal_type == \'Web Site\':\n return None\n if portal_type == \'Web Section\':\n + if context.REQUEST[\'editable_mode\']:\n + return context\n return context.getDefaultSourceValue()\n return context\n </string> </value> @@ -122,6 +124,7 @@ return context\n <string>context</string> <string>portal_type</string> <string>None</string> + <string>_getitem_</string> </tuple> </value> </item> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getSection.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getSection.xml index c7faadc30c158f34a1c8a3deb7f0216e714d569d..7dac58199491b2107cc9d5f63efa9964c04d4b7f 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getSection.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getSection.xml @@ -68,7 +68,7 @@ <key> <string>_body</string> </key> <value> <string>section = context.WebSite_getSectionValue()\n if section is not None:\n - return section.getTitle()\n + return section.WebSite_getUrl()\n return None\n </string> </value> </item> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_globalDefinition.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_globalDefinition.xml index d889886575a645121c328d35b1ba247d8ee4d0a6..aadcb2483d232a1d37e3425b0f45ae4ffa227123 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_globalDefinition.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_globalDefinition.xml @@ -55,16 +55,18 @@ <value> <string encoding="cdata"><![CDATA[ <tal:block metal:define-macro="global_definition"\n - tal:define="filtered_actions python:context.portal_actions.listFilteredActionsFor(context);\n - object_actions filtered_actions/object_action | nothing;\n - global object_actions python: context.WebSite_replaceActionUrl(object_actions);\n - workflow_actions filtered_actions/workflow | nothing;\n - global workflow_actions python: context.WebSite_replaceActionUrl(workflow_actions);\n - jump_actions filtered_actions/object_jump | nothing;\n - global jump_actions python: context.WebSite_replaceActionUrl(jump_actions);\n - view_actions filtered_actions/object_view | nothing;\n - global view_actions python: context.WebSite_replaceActionUrl(view_actions);\n -"/> + tal:define="document context/WebSite_getDocumentValue">\n + <tal:block tal:define="filtered_actions python:document.portal_actions.listFilteredActionsFor(document);\n + object_actions filtered_actions/object_action | nothing;\n + global object_actions python: document.WebSite_replaceActionUrl(object_actions);\n + workflow_actions filtered_actions/workflow | nothing;\n + global workflow_actions python: document.WebSite_replaceActionUrl(workflow_actions);\n + jump_actions filtered_actions/object_jump | nothing;\n + global jump_actions python: document.WebSite_replaceActionUrl(jump_actions);\n + view_actions filtered_actions/object_view | nothing;\n + global view_actions python: document.WebSite_replaceActionUrl(view_actions);\n + "/>\n +</tal:block> ]]></string> </value> </item> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/section_form_view.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/section_form_view.xml index 789ef83e8f490f1d1248737749ee3e630d49d236..8f142663324fbf273aa7090723e2af9acf6aca93 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/section_form_view.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/section_form_view.xml @@ -59,7 +59,8 @@ ignore_layout request/ignore_layout | nothing;\n editable_mode request/editable_mode | nothing;\n layout_form python:not(layout_form_id) or ignore_layout or getattr(here, layout_form_id, None);\n - layout_id layout_form/pt | string:view_master;">\n + default_layout string:view_master;\n + layout_id layout_form/pt | default_layout;">\n <tal:block metal:use-macro="python:getattr(here,layout_id).macros[\'master\']">\n <tal:block metal:fill-slot="main">\n <tal:block tal:condition="python:(not editable_mode) and (not ignore_layout) and default_content is not None">\n @@ -67,10 +68,6 @@ global form python:here.WebPage_view;\n global default_content_title python:here.getTitle()"/>\n </tal:block>\n - <tal:block tal:replace="here/getPath"/><br/>\n - <tal:block tal:condition="not: editable_mode">not </tal:block>editable_mode<br/>\n - <tal:block tal:condition="not: ignore_layout">not </tal:block>ignore_layout<br/>\n - <tal:block tal:replace="default_content/getPath"/><br/>\n <tal:block metal:use-macro="here/form_view/macros/form_render" />\n </tal:block>\n </tal:block>\n diff --git a/bt5/erp5_web/bt/template_action_path_list b/bt5/erp5_web/bt/template_action_path_list index c52f89074fa645a0a670765dec32a10fae4ae34d..6b16ae536c93732805780cf80e7da02f6f40ddcc 100644 --- a/bt5/erp5_web/bt/template_action_path_list +++ b/bt5/erp5_web/bt/template_action_path_list @@ -1,11 +1,13 @@ Web Page Module | list_ui Web Page Module | sort_on Web Page Module | view +Web Page | history Web Page | list Web Page | metadata Web Page | related Web Page | render Web Page | view +Web Section | history Web Section | metadata Web Section | predicate Web Section | section @@ -13,6 +15,7 @@ Web Section | view Web Site Module | list_ui Web Site Module | sort_on Web Site Module | view +Web Site | history Web Site | metadata Web Site | predicate Web Site | view \ No newline at end of file