Commit e60f49d2 authored by Ivan Tyagov's avatar Ivan Tyagov

Refactor code and use proper default page templates names so no need to rename...

Refactor code and use proper default page templates names so no need to rename manually to enable this bt5.
parent 45681c86
...@@ -59,51 +59,6 @@ ...@@ -59,51 +59,6 @@
onChange="submitAction(this.form,\'Base_doAction\')"\076\n onChange="submitAction(this.form,\'Base_doAction\')"\076\n
\074option selected="selected" value=""\n \074option selected="selected" value=""\n
i18n:translate="" i18n:domain="ui"\076Action...\074/option\076\n i18n:translate="" i18n:domain="ui"\076Action...\074/option\076\n
\074!-- \074tal:block tal:repeat="content_id here/getVisibleAllowedContentTypeList | nothing"\076\n
\074option tal:attributes="value string:add $content_id"\n
i18n:translate="" i18n:domain="ui"\076Add \074tal:block tal:content="content_id"\n
i18n:name="portal_type" i18n:translate="" i18n:domain="ui" /\076\074/option\076\n
\074/tal:block\076\n
\074tal:block tal:define="document_template_list here/getDocumentTemplateList | nothing"\n
tal:condition="document_template_list"\076\n
\074option disabled="disabled"\076-- \074tal:block i18n:translate="" i18n:domain="ui"\076Templates\074/tal:block\076 --\074/option\076\n
\074tal:block tal:repeat="document_template document_template_list"\076\n
\074option tal:attributes="value string:template ${document_template/getRelativeUrl}"\n
i18n:translate="" i18n:domain="ui"\076Add \074tal:block tal:content="document_template/getTitle"\n
i18n:name="document_template" /\076\074/option\076\n
\074/tal:block\076\n
\074/tal:block\076\n
\n
\074option disabled="disabled"\076-- \074tal:block i18n:translate="" i18n:domain="ui"\076Workflows\074/tal:block\076 --\074/option\076\n
\074tal:block tal:repeat="action actions/workflow"\076\n
\074option tal:content="action/name"\n
tal:attributes="value string:workflow ${action/url}"\n
i18n:translate="" i18n:domain="ui" /\076\n
\074/tal:block\076\n
\074option disabled="disabled"\076-- \074tal:block i18n:translate="" i18n:domain="ui"\076Object\074/tal:block\076 --\074/option\076\n
\074tal:block tal:repeat="action actions/object_action | nothing"\076\n
\074option tal:content="action/name"\n
tal:attributes="value string:object ${action/url}"\n
i18n:translate="" i18n:domain="ui" /\076\n
\074/tal:block\076\n
\074tal:block tal:define="object_view_list actions/object_view|nothing;\n
module_view_list python:[i for i in object_view_list if i[\'id\']==\'module_view\']"\n
tal:condition="module_view_list"\076\n
\074tal:block tal:repeat="action module_view_list"\076\n
\074option tal:content="action/name"\n
tal:attributes="value string:object ${action/url}"\n
i18n:translate="" i18n:domain="ui" /\076\n
\074/tal:block\076\n
\074/tal:block\076--\076\n
\074tal:block tal:replace=\'nothing\'\076\n
\074!-- XXX folder actions is inherited from CMF, but not used in ERP5 (for now) --\076\n
\074!-- \074option disabled="disabled"\076-- \074tal:block i18n:translate="" i18n:domain="ui"\076Folder\074/tal:block\076 --\074/option\076\n
\074tal:block tal:repeat="action actions/folder"\076\n
\074option tal:content="action/name"\n
tal:attributes="value string:folder ${action/url}"\n
i18n:translate="" i18n:domain="ui" /\076\n
\074/tal:block\076--\076\n
\074/tal:block\076\n
\074/select\076\n \074/select\076\n
\074button type="submit" name="Base_doAction:method" title="Action"\n \074button type="submit" name="Base_doAction:method" title="Action"\n
i18n:attributes="title" i18n:domain="ui"\076\n i18n:attributes="title" i18n:domain="ui"\076\n
......
...@@ -87,6 +87,13 @@ def unLazyActionList(action_list):\n ...@@ -87,6 +87,13 @@ def unLazyActionList(action_list):\n
return fixed_action_list\n return fixed_action_list\n
\n \n
result = {}\n result = {}\n
result[\'type_info_list\'] = []\n
result[\'workflow_list\'] = []\n
result[\'document_template_list\'] = []\n
result[\'object_workflow_action_list\'] = []\n
result[\'object_action_list\'] = []\n
result[\'object_view_list\'] = []\n
result[\'folder_action_list\'] = []\n
result[\'object_jump_list\'] = unLazyActionList(actions[\'object_jump\'])\n result[\'object_jump_list\'] = unLazyActionList(actions[\'object_jump\'])\n
\n \n
# add links to edit current portal type\n # add links to edit current portal type\n
...@@ -103,7 +110,6 @@ if preferred_html_style_developper_mode:\n ...@@ -103,7 +110,6 @@ if preferred_html_style_developper_mode:\n
# add links for workflows\n # add links for workflows\n
if portal.portal_workflow.Base_getSourceVisibility():\n if portal.portal_workflow.Base_getSourceVisibility():\n
workflow_list = portal.portal_workflow.getWorkflowsFor(context)\n workflow_list = portal.portal_workflow.getWorkflowsFor(context)\n
result[\'workflow_list\'] = []\n
if workflow_list:\n if workflow_list:\n
result[\'workflow_list\'] = [{"title": "-- %s --" %translate("Workflows"),\n result[\'workflow_list\'] = [{"title": "-- %s --" %translate("Workflows"),\n
"url": ""}]\n "url": ""}]\n
...@@ -114,7 +120,6 @@ visible_allowed_content_type_list = context.getVisibleAllowedContentTypeList()\n ...@@ -114,7 +120,6 @@ visible_allowed_content_type_list = context.getVisibleAllowedContentTypeList()\n
result[\'visible_allowed_content_type_list\'] = [{"title": "Add %s" %x,\n result[\'visible_allowed_content_type_list\'] = [{"title": "Add %s" %x,\n
"url": "add %s" %x} for x in visible_allowed_content_type_list]\n "url": "add %s" %x} for x in visible_allowed_content_type_list]\n
\n \n
result[\'document_template_list\'] = []\n
document_template_list = context.getDocumentTemplateList()\n document_template_list = context.getDocumentTemplateList()\n
if document_template_list:\n if document_template_list:\n
result[\'document_template_list\'] = [{"title": "-- %s --" %translate("Templates"),\n result[\'document_template_list\'] = [{"title": "-- %s --" %translate("Templates"),\n
...@@ -152,6 +157,7 @@ if folder_action_list:\n ...@@ -152,6 +157,7 @@ if folder_action_list:\n
"url": ""}]\n "url": ""}]\n
result[\'folder_action_list\'].extend([{"title": "%s" %x[\'title\'],\n result[\'folder_action_list\'].extend([{"title": "%s" %x[\'title\'],\n
"url": "folder %s" %x[\'url\']} for x in object_action_list])\n "url": "folder %s" %x[\'url\']} for x in object_action_list])\n
# XXX: buttons\n
\n \n
return dumps(result)\n return dumps(result)\n
......
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[ <value> <unicode encoding="cdata"><![CDATA[
<div tal:define="portal here/getPortalObject">\n <div tal:define="portal here/getPortalObject;\n
portal_url portal/absolute_url;">\n
\n \n
<div id="breadcrumb" class="breadcrumb">\n <div id="breadcrumb" class="breadcrumb">\n
<tal:block metal:use-macro="here/breadcrumb_render/macros/breadcrumb" />\n <tal:block metal:use-macro="here/breadcrumb_render/macros/breadcrumb" />\n
...@@ -52,6 +53,7 @@ ...@@ -52,6 +53,7 @@
<p class="clear"></p>\n <p class="clear"></p>\n
\n \n
<div data-gadget="ERP5Site_renderPortalStatusMessage"\n <div data-gadget="ERP5Site_renderPortalStatusMessage"\n
tal:attributes="data-gadget string:${portal_url}/ERP5Site_renderPortalStatusMessage"\n
id="portal_status_message"></div>\n id="portal_status_message"></div>\n
\n \n
\n \n
......
...@@ -43,7 +43,9 @@ ...@@ -43,7 +43,9 @@
\074/head\076\n \074/head\076\n
\074body\076\n \074body\076\n
\n \n
\074p class="portal-status-message" style="display:none; color:red;font-weight:bold;"\076\074/p\076\n \074div class="transition_message" \n
id="transition_message"\n
style="display:none; color:red;font-weight:bold;"\076\074/div\076\n
\n \n
\074script type="text/javascript" language="javascript"\076\n \074script type="text/javascript" language="javascript"\076\n
//\074![CDATA[\n //\074![CDATA[\n
...@@ -59,20 +61,20 @@ ...@@ -59,20 +61,20 @@
\n \n
gadget.showMessage = function (message, timeout) {\n gadget.showMessage = function (message, timeout) {\n
// show message in UI\n // show message in UI\n
var msg_element = $("#portal_status_message p");\n var msg_element = $("#transition_message");\n
if (timeout===undefined) {\n if (timeout===undefined) {\n
timeout = 4000;\n timeout = 4000;\n
}\n }\n
msg_element.toggle();\n msg_element.toggle();\n
msg_element.html(message);\n msg_element.html(message);\n
window.setTimeout(\'$("#portal_status_message p").toggle();\', timeout);\n window.setTimeout(\'$("#transition_message").toggle();\', timeout);\n
};\n };\n
\n \n
// in some cases a message can be inside current URL as well\n // in some cases a message can be inside current URL as well\n
// so show it.\n // so show it.\n
portal_status_message = getURLParameter("portal_status_message");\n portal_status_message = getURLParameter("portal_status_message");\n
if (portal_status_message!==undefined \046\046 portal_status_message!==null \046\046 portal_status_message!==\'null\') {\n if (portal_status_message!==undefined \046\046 portal_status_message!==null \046\046 portal_status_message!==\'null\') {\n
gadget.showMessage(portal_status_message, 10000);\n gadget.showMessage(portal_status_message, 5000);\n
}\n }\n
});\n });\n
//]]\076\n //]]\076\n
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>form_view_disable</string> </value> <value> <string>form_view</string> </value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>output_encoding</string> </key>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts63864401.96</string> </value> <value> <string>ts63878317.05</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -71,9 +71,9 @@ var ERP5UI = ( function () {\n ...@@ -71,9 +71,9 @@ var ERP5UI = ( function () {\n
url: "ERP5Site_getContextBoxActionList",\n url: "ERP5Site_getContextBoxActionList",\n
dataType: "json",\n dataType: "json",\n
success: function (data) {\n success: function (data) {\n
console.log(data.object_jump);\n
var jump_dom = $(\'select[name="select_jump"]\'),\n var jump_dom = $(\'select[name="select_jump"]\'),\n
action_dom = $(\'select[name="select_action"]\');\n action_dom = $(\'select[name="select_action"]\');\n
console.log(data);\n
addOptionTagDict(jump_dom, data.object_jump_list);\n addOptionTagDict(jump_dom, data.object_jump_list);\n
addOptionTagDict(jump_dom, data.type_info_list);\n addOptionTagDict(jump_dom, data.type_info_list);\n
addOptionTagDict(jump_dom, data.workflow_list);\n addOptionTagDict(jump_dom, data.workflow_list);\n
...@@ -82,6 +82,7 @@ var ERP5UI = ( function () {\n ...@@ -82,6 +82,7 @@ var ERP5UI = ( function () {\n
addOptionTagDict(action_dom, data.object_workflow_action_list);\n addOptionTagDict(action_dom, data.object_workflow_action_list);\n
addOptionTagDict(action_dom, data.object_action_list);\n addOptionTagDict(action_dom, data.object_action_list);\n
addOptionTagDict(action_dom, data.object_view_list);\n addOptionTagDict(action_dom, data.object_view_list);\n
addOptionTagDict(action_dom, data.folder_action_list);\n
}\n }\n
});\n });\n
}\n }\n
...@@ -100,7 +101,7 @@ var ERP5UI = ( function () {\n ...@@ -100,7 +101,7 @@ var ERP5UI = ( function () {\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>2922</int> </value> <value> <int>2993</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -47,6 +47,8 @@ IDEAS:\n ...@@ -47,6 +47,8 @@ IDEAS:\n
</tal:block>\n </tal:block>\n
<tal:block metal:define-macro="master">\n <tal:block metal:define-macro="master">\n
<tal:block tal:define="global_definitions_macros here/global_definitions/macros;\n <tal:block tal:define="global_definitions_macros here/global_definitions/macros;\n
portal here/getPortalObject;\n
portal_url portal/absolute_url;\n
subject_list subject_list | python:here.getProperty(\'subject_list\', []) or []">\n subject_list subject_list | python:here.getProperty(\'subject_list\', []) or []">\n
<tal:block metal:use-macro="global_definitions_macros/header_definitions" />\n <tal:block metal:use-macro="global_definitions_macros/header_definitions" />\n
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n
...@@ -117,7 +119,7 @@ IDEAS:\n ...@@ -117,7 +119,7 @@ IDEAS:\n
<div id="bars" class="bars">\n <div id="bars" class="bars">\n
\n \n
<div id="main_bar"\n <div id="main_bar"\n
data-gadget="ERP5Site_renderNavigationBox"></div>\n tal:attributes="data-gadget string:${portal_url}/ERP5Site_renderNavigationBox"></div>\n
\n \n
<div id="context_bar" class="context_bar">\n <div id="context_bar" class="context_bar">\n
<tal:block metal:define-slot="context_bar" />\n <tal:block metal:define-slot="context_bar" />\n
...@@ -153,7 +155,7 @@ IDEAS:\n ...@@ -153,7 +155,7 @@ IDEAS:\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>template_erp5_xhtml_style_disable</string> </value> <value> <string>template_erp5_xhtml_style</string> </value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>output_encoding</string> </key>
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>view_main_disable</string> </value> <value> <string>view_main</string> </value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>output_encoding</string> </key>
......
2012-03-02 Ivan 2012-03-02 Ivan
* Initial worka * Initial work
\ No newline at end of file \ No newline at end of file
Ajax-zation of ERP5 user interface. Ajax-zation of ERP5 user interface.
Note: To enable this bt5 after install remove "_disable" from ids of "form_view_disable" , "view_main_disable" and "template_erp5_xhtml_style"
This is still considered a work in progress. This is still considered a work in progress.
23 24
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment