[Erp5-report] r10545 - in /erp5/trunk/bt5/erp5_html_style: SkinTemplateItem/portal_skins/er...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Oct 4 19:24:15 CEST 2006
Author: vincent
Date: Wed Oct 4 19:24:11 2006
New Revision: 10545
URL: http://svn.erp5.org?rev=10545&view=rev
Log:
Factorise multiple calls in deveopper mode buttons rendering.
Put the variables containing function results in navigation_box.
Make developper mode images paths absolute.
Rename documentation_view to documentation_template, as in xhtml_style.
Added:
erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/documentation_template.xml
Modified:
erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/form_developper_buttons.xml
erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/navigation_box.xml
erp5/trunk/bt5/erp5_html_style/bt/revision
Added: erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/documentation_template.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/documentation_template.xml?rev=10545&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/documentation_template.xml (added)
+++ erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/documentation_template.xml Wed Oct 4 19:24:11 2006
@@ -1,0 +1,390 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <tuple>
+ <string>Products.PageTemplates.ZopePageTemplate</string>
+ <string>ZopePageTemplate</string>
+ </tuple>
+ <none/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>name_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_owner</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n
+<tal:block metal:define-macro="render_listbox">\n
+ <tal:block tal:define="field_names field_names | python: ();\n
+ toggleable_field_name toggleable_field_name | python: nothing;\n
+ zope_structured_text_field_names zope_structured_text_field_names | python: ();\n
+ structured_text_field_names structured_text_field_names | python: ();\n
+ structured_text_field_names python: structured_text_field_names+zope_structured_text_field_names;">\n
+ <tal:block tal:repeat="field_name field_names">\n
+ <tal:block tal:condition="python: form.has_field(field_name)">\n
+ <tal:block tal:define="listbox python: form.get_field(field_name);\n
+ listboxline_list python: listbox.get_value(\'default\', render_format=\'list\', REQUEST=request);">\n
+ <tal:block tal:define="field listbox">\n
+ <tal:block metal:use-macro="here/form_developper_buttons/macros/field"/>\n
+ </tal:block>\n
+ <div class="frame">\n
+ <div tal:attributes="class listbox/css_class">\n
+ <div class="frame_title" tal:content="listbox/title"></div>\n
+ <div class="listbox_description" tal:content="python: listbox.get_value(\'description\')"></div>\n
+ <tal:block tal:condition="python: len(listboxline_list) > 1">\n
+ <tal:block tal:repeat="listboxline python: listboxline_list">\n
+ <tal:block tal:define="lineid python: \'%s_%s\' % (listbox.id,repeat[\'listboxline\'].index)">\n
+ <div class="listbox_titleline" tal:condition="python: listboxline.isTitleLine()">\n
+ <tal:block tal:repeat="column_id python: listboxline.getColumnItemList()">\n
+ <div tal:content="python: column_id[1]"\n
+ tal:attributes="class python: column_id[0]"/>\n
+ </tal:block>\n
+ </div>\n
+ <div class="listbox_dataline" tal:condition="python: listboxline.isDataLine()"\n
+ tal:attributes="onclick python: toggleable_field_name and \'toggle(\\\'%s\\\')\' % (lineid) or nothing;\n
+ id python: \'toggle_%s_%s\' % (listbox.id, repeat[\'listboxline\'].index);">\n
+ <tal:block tal:repeat="column_id python: listboxline.getColumnItemList()">\n
+ <tal:block tal:define="is_structured_text python: column_id[0] in structured_text_field_names;\n
+ is_toggleable python: column_id[0] == toggleable_field_name;\n
+ content python: (column_id[1] is None) and (\' \') or (column_id[1]);\n
+ content python: column_id[0] in zope_structured_text_field_names and modules[\'Products\'].PythonScripts.standard.structured_text(content) or content;">\n
+ <div tal:attributes="class python: column_id[0]; id python: is_toggleable and lineid or None; name python: is_toggleable and \'toggleable\' or None"><tal:block tal:condition="is_structured_text"><a tal:condition="repeat/column_id/start" class="anchor" tal:content="structure content" tal:attributes="id python: \'a_%s_%s\' % (listbox.id, repeat[\'listboxline\'].index)"></a><tal:block tal:condition="not: repeat/column_id/start" tal:replace="structure content"/></tal:block><tal:block tal:condition="not: is_structured_text"><a tal:condition="repeat/column_id/start" class="anchor" tal:content="content" tal:attributes="id python: \'a_%s_%s\' % (listbox.id, repeat[\'listboxline\'].index)"></a><tal:block tal:condition="not: repeat/column_id/start" tal:replace="content"/></tal:block></div>\n
+ </tal:block>\n
+ </tal:block>\n
+ </div>\n
+ </tal:block>\n
+ </tal:block>\n
+ </tal:block>\n
+ </div>\n
+ </div>\n
+ </tal:block>\n
+ </tal:block>\n
+ </tal:block>\n
+ </tal:block>\n
+</tal:block>\n
+<tal:block tal:replace="nothing">\n
+<!--\n
+Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.\n
+ Vincent Pelletier <vincent at nexedi.com>\n
+\n
+This program is Free Software; you can redistribute it and/or\n
+modify it under the terms of the GNU General Public License\n
+as published by the Free Software Foundation; either version 2\n
+of the License, or (at your option) any later version.\n
+\n
+This program is distributed in the hope that it will be useful,\n
+but WITHOUT ANY WARRANTY; without even the implied warranty of\n
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
+GNU General Public License for more details.\n
+\n
+You should have received a copy of the GNU General Public License\n
+along with this program; if not, write to the Free Software\n
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
+-->\n
+</tal:block>\n
+<html tal:define="global preferred_html_style_developper_mode here/portal_preferences/getPreferredHtmlStyleDevelopperMode;\n
+ global preferred_html_style_translator_mode here/portal_preferences/getPreferredHtmlStyleTranslatorMode;\n
+ global portal_path here/portal_url/getPortalPath;">\n
+ <head>\n
+ <title></title>\n
+ <style type="text/css">\n
+a img {\n
+ border: none;\n
+}\n
+\n
+ul {\n
+ margin: 0;\n
+}\n
+\n
+p, li {\n
+ margin: 0;\n
+ padding: 0;\n
+}\n
+\n
+span.toggle {\n
+ border: 1px solid #000;\n
+}\n
+\n
+span.toggle:hover {\n
+ background: #0F0;\n
+}\n
+\n
+div.frame {\n
+ margin-bottom : 1em;\n
+ border: 1px solid #000;\n
+}\n
+\n
+div.frame_title {\n
+ text-align: center;\n
+ width: 100%;\n
+ background: #555;\n
+ color: #FFF;\n
+ border-bottom: 1px solid #000;\n
+}\n
+\n
+div.quick_links_group {\n
+ display: table-row;\n
+}\n
+\n
+div.quick_links_group div,\n
+div.quick_links_group ul {\n
+ display: table-cell;\n
+}\n
+\n
+div.quick_links_group div {\n
+ white-space: nowrap;\n
+}\n
+\n
+div.quick_links_group ul {\n
+ list-style: none;\n
+ padding-left: 1em;\n
+}\n
+\n
+div.quick_links_group li {\n
+ display: inline;\n
+}\n
+\n
+/* Table mode */\n
+\n
+div.table div.listbox_dataline,\n
+div.table div.listbox_titleline {\n
+ display: table-row;\n
+ margin-left: 0.5em;\n
+ margin-right: 0.5em;\n
+}\n
+\n
+div.table div.listbox_titleline div {\n
+ text-align: center;\n
+}\n
+\n
+div.table div.listbox_dataline div,\n
+div.table div.listbox_titleline div {\n
+ display: table-cell;\n
+ padding: 2px;\n
+}\n
+\n
+div.table div.listbox_titleline div {\n
+ font-weight: bold;\n
+}\n
+\n
+/* List mode */\n
+\n
+div.list div.listbox_titleline {\n
+ display: none;\n
+}\n
+\n
+div.accessors div,\n
+div.list div.listbox_dataline div {\n
+ margin-left: 0.5em;\n
+ margin-right: 0.5em;\n
+}\n
+\n
+div.accessors div.title,\n
+div.list div.listbox_dataline div.title {\n
+ margin-left: 0;\n
+ margin-right: 0;\n
+ font-weight: bold;\n
+ display: inline;\n
+}\n
+\n
+div.list div.listbox_dataline div.argument {\n
+ display: inline;\n
+ margin-left: 0;\n
+}\n
+\n
+div.list div.listbox_dataline div.type {\n
+ display: inline;\n
+ font-style: italic;\n
+}\n
+\n
+/* Global styles (that apply both to list and table modes) */\n
+\n
+table div.description,\n
+table div.source_path,\n
+div.listbox_dataline div.description,\n
+div.listbox_dataline div.source_path,\n
+div.listbox_dataline div.source_code,\n
+div.listbox_dataline div.content {\n
+ font-family: fixed, "Courier New", Courier, monospace;\n
+ white-space: pre;\n
+ overflow: auto;\n
+}\n
+\n
+div.listbox_dataline div.source_code {\n
+ border-left: 1px dotted #000;\n
+ background: #FFF;\n
+}\n
+\n
+div.listbox_description {\n
+ margin: 0.5em;\n
+ font-size: 70%;\n
+ white-space: pre;\n
+ color: #555;\n
+}\n
+\n
+div.listbox_dataline {\n
+ margin: 0.5em;\n
+/* margin-bottom: 1em; */\n
+ padding-left: 0.5em;\n
+ padding-right: 0.5em;\n
+ border: 1px solid #FFF;\n
+}\n
+\n
+div.listbox_dataline:hover {\n
+ background: #EEE;\n
+ border-color: #999;\n
+}\n
+ </style>\n
+ </head>\n
+ <body onload="toggle_all()">\n
+ <script type="text/javascript">\n
+ function toggle_all() {\n
+ my_elements = document.getElementsByName("toggleable");\n
+ for(i=0; i<my_elements.length; i++) {\n
+ toggle(my_elements[i].id);\n
+ }\n
+ }\n
+ function toggle(id) {\n
+ with(document.getElementById(id).style) {\n
+ if (display == "") {\n
+ display = "none";\n
+ with(document.getElementById("toggle_"+id).style) {\n
+ backgroundColor = "";\n
+ borderColor = "";\n
+ }\n
+ } else {\n
+ display = "";\n
+ with(document.getElementById("toggle_"+id).style) {\n
+ backgroundColor = "#EEE";\n
+ borderColor = "#999";\n
+ }\n
+ }\n
+ }\n
+ }\n
+ </script>\n
+ <span class="toggle" onclick="toggle_all()">Toggle all</span>\n
+ <tal:block tal:define="field_errors python: request.get(\'field_errors\',{});\n
+ dummy python: request.set(\'here\',here)">\n
+ <div class="frame">\n
+ <div class="frame_title">General information</div>\n
+ <table>\n
+ <tal:block tal:repeat="field_name python: (\'my_title\', \'argument_list\', \'inheritance_list\', \'my_type\', \'my_source_path\', \'my_description\')">\n
+ <tal:block tal:condition="python: form.has_field(field_name)">\n
+ <tal:block tal:define="field python: form.get_field(field_name)">\n
+ <tal:block metal:use-macro="here/field_render/macros/field_render"/>\n
+ </tal:block>\n
+ </tal:block>\n
+ </tal:block>\n
+ </table>\n
+ </div>\n
+ <div class="frame">\n
+ <div class="frame_title">Quick links</div>\n
+ <tal:block tal:repeat="field_name python: (\'my_static_property_list\', \'my_dynamic_property_list\', \'my_dynamic_category_list\', \'my_static_method_list\', \'my_dynamic_method_list\', \'my_dynamic_accessor_list\')">\n
+ <tal:block tal:condition="python: form.has_field(field_name)">\n
+ <div class="quick_links_group" tal:define="field python: form.get_field(field_name)">\n
+ <div tal:content="field/title"></div>\n
+ <ul>\n
+ <li tal:repeat="item python: field.get_value(\'list_method\')()">\n
+ <a tal:attributes="href python: \'#a_%s_%s\' % (field_name,repeat[\'item\'].index+1)"\n
+ tal:content="item/getTitle"></a>\n
+ </li>\n
+ </ul>\n
+ </div>\n
+ </tal:block>\n
+ </tal:block>\n
+ </div>\n
+ <tal:block tal:define="field_names python: (\'my_static_property_list\',);\n
+ structured_text_field_names python: (\'title\',);">\n
+ <tal:block metal:use-macro="here/documentation_template/macros/render_listbox"/>\n
+ </tal:block>\n
+ <tal:block tal:define="field_names python: (\'my_dynamic_property_list\',);\n
+ structured_text_field_names python: (\'title\',);">\n
+ <tal:block metal:use-macro="here/documentation_template/macros/render_listbox"/>\n
+ </tal:block>\n
+ <tal:block tal:define="field_names python: (\'my_dynamic_category_list\',)">\n
+ <tal:block metal:use-macro="here/documentation_template/macros/render_listbox"/>\n
+ </tal:block>\n
+ <tal:block tal:define="field_names python: (\'my_static_method_list\',);\n
+ structured_text_field_names python: (\'title\',);\n
+ zope_structured_text_field_names python: (\'description\',);\n
+ toggleable_field_name python: \'source_code\';">\n
+ <tal:block metal:use-macro="here/documentation_template/macros/render_listbox"/>\n
+ </tal:block>\n
+ <tal:block tal:define="field_names python: (\'my_dynamic_method_list\',);\n
+ structured_text_field_names python: (\'title\',);\n
+ zope_structured_text_field_names python: (\'description\',);">\n
+ <tal:block metal:use-macro="here/documentation_template/macros/render_listbox"/>\n
+ </tal:block>\n
+ <tal:block tal:define="field_names python: (\'my_dynamic_accessor_list\',);\n
+ structured_text_field_names python: (\'accessors\',);\n
+ toggleable_field_name python: \'accessors\';">\n
+ <tal:block metal:use-macro="here/documentation_template/macros/render_listbox"/>\n
+ </tal:block>\n
+ </tal:block>\n
+ </body>\n
+</html>
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>content_type</string> </key>
+ <value> <string>text/html</string> </value>
+ </item>
+ <item>
+ <key> <string>expand</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>documentation_template</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/form_developper_buttons.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/form_developper_buttons.xml?rev=10545&r1=10544&r2=10545&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/form_developper_buttons.xml (original)
+++ erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/form_developper_buttons.xml Wed Oct 4 19:24:11 2006
@@ -55,16 +55,18 @@
<value> <string encoding="cdata"><![CDATA[
<tal:block metal:define-macro="edit_link">\n
- <a tal:condition="python: hasattr(object, \'meta_type\') and object.Base_getSourceVisibility()"\n
+ <a tal:condition="python: preferred_html_style_developper_mode and hasattr(object, \'meta_type\')"\n
tal:attributes="href python: \'%s/%s\' % (\'/\'.join(object.getPhysicalPath()[len(object.getPortalObject().getPhysicalPath()):]), manage) # XXX: quick hack to get path;\n
- title info;"><img tal:attributes="src python: \'images/%s\' % (image, );\n
+ title info;"><img tal:attributes="src python: \'%s/images/%s\' % (portal_path, image);\n
alt info;"/></a>\n
</tal:block>\n
-<tal:block metal:define-macro="translate_link" tal:define="image image | python: \'translate.png\'">\n
- <a tal:condition="python: context.Base_getTranslationVisibility()"\n
- tal:attributes="href python: \'%s/manage_messages?regex=^%s%%24&lang=%s\' % (\'/\'.join(context.Localizer.erp5_ui.getPhysicalPath()[len(context.Localizer.erp5_ui.getPortalObject().getPhysicalPath()):]), message, context.Localizer.get_selected_language());\n
- title info;"><img tal:attributes="src python: \'images/%s\' % (image, );\n
- alt info;"/></a>\n
+<tal:block metal:define-macro="translate_link">\n
+ <tal:block tal:condition="preferred_html_style_translator_mode">\n
+ <a tal:define="image image | python: \'translate.png\'"\n
+ tal:attributes="href python: \'%s/manage_messages?regex=^%s%%24&lang=%s\' % (\'/\'.join(context.Localizer.erp5_ui.getPhysicalPath()[len(context.Localizer.erp5_ui.getPortalObject().getPhysicalPath()):]), message, context.Localizer.get_selected_language());\n
+ title info;"><img tal:attributes="src python: \'%s/images/%s\' % (portal_path, image);\n
+ alt info;"/></a>\n
+ </tal:block>\n
</tal:block>\n
<tal:block metal:define-macro="form">\n
<tal:block tal:define="image python: \'editform.png\';\n
@@ -92,14 +94,11 @@
image python: \'translate.png\'">\n
<tal:block metal:use-macro="context/form_developper_buttons/macros/translate_link"/>\n
</tal:block>\n
- <tal:block tal:define="desc python: context.Base_getFieldDescription(field)">\n
- <tal:block tal:condition="python: desc not in (None, \'\')">\n
- <tal:block tal:define="info python: \'Translate this field description\';\n
- message desc;\n
- image python: \'translate_tooltip.png\'">\n
- <tal:block metal:use-macro="context/form_developper_buttons/macros/translate_link"/>\n
- </tal:block>\n
- </tal:block>\n
+ <tal:block tal:define="message python: context.Base_getFieldDescription(field);\n
+ info python: \'Translate this field description\';\n
+ image python: \'translate_tooltip.png\'"\n
+ tal:condition="python: message not in (None, \'\')">\n
+ <tal:block metal:use-macro="context/form_developper_buttons/macros/translate_link"/>\n
</tal:block>\n
</tal:block>
Modified: erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/navigation_box.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/navigation_box.xml?rev=10545&r1=10544&r2=10545&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/navigation_box.xml (original)
+++ erp5/trunk/bt5/erp5_html_style/SkinTemplateItem/portal_skins/erp5_html_style/navigation_box.xml Wed Oct 4 19:24:11 2006
@@ -93,6 +93,9 @@
\n
<body>\n
<table width="100%" metal:define-macro="navigation_box">\n
+ <tal:block tal:define="global preferred_html_style_developper_mode here/portal_preferences/getPreferredHtmlStyleDevelopperMode;\n
+ global preferred_html_style_translator_mode here/portal_preferences/getPreferredHtmlStyleTranslatorMode;\n
+ global portal_path here/portal_url/getPortalPath;"/>\n
<tr>\n
<td valign="middle" align="center" nowrap="nowrap">\n
<!-- Hidden button as explained in http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html -->\n
Modified: erp5/trunk/bt5/erp5_html_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_html_style/bt/revision?rev=10545&r1=10544&r2=10545&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_html_style/bt/revision (original)
+++ erp5/trunk/bt5/erp5_html_style/bt/revision Wed Oct 4 19:24:11 2006
@@ -1,1 +1,1 @@
-13
+18
More information about the Erp5-report
mailing list