Commit 86c95e10 authored by Ivan Tyagov's avatar Ivan Tyagov

Do not open tab if already opened.

Use gadgets to render some part of ERP5 ui.
parent 212cdcf9
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<tal:block metal:use-macro="here/global_definitions/macros/header_definitions" />\n
<tal:block metal:use-macro="here/context_box_render/macros/master" />
]]></unicode> </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>context_box_render_wrapper</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>iso-8859-15</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts45811421.8</string> </value>
<value> <string>ts62123078.31</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -315,7 +315,24 @@ var ERP5Form = ( function () {\n
window.setTimeout(\'$("#portal_status_message").toggle();\', 4000);\n
}\n
}});\n
},\n
\n
openFormInTabbularGadget: function (container_id, form_id) {\n
/*\n
* Open a new tab containing an ERP5 form using RenderJs\'s TabbularGadget API.\n
*/\n
if (RenderJs.GadgetIndex.getGadgetById(\'gadget-\' + form_id) === undefined) {\n
// do not load already existing tab gadget\n
RenderJs.TabbularGadget.addNewTabGadget(\n
container_id,\n
\'gadget-\' + form_id,\n
form_id + \'/Form_asRenderJSGadget\',\n
\'ERP5Form.update\',\n
\'Form_asJSON?form_id=\' + form_id);;\n
RenderJs.TabbularGadget.toggleVisibility($(\'#\' + form_id));\n
ERP5Form.setCurrentFormId(form_id);\n
}\n
}\n
\n
}} ());\n
......@@ -328,7 +345,7 @@ var ERP5Form = ( function () {\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>14143</int> </value>
<value> <int>14861</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -81,7 +81,7 @@
tal:attributes="id action_form;\n
class python: action == current_action and \'selected\' or \'not_selected\'">\n
\n
<a tal:attributes="onclick python: \'\'\'javascript: RenderJs.TabbularGadget.addNewTabGadget(\'form_gadget\', \'gadget-%s\', \'%s/Form_asRenderJSGadget\', \'ERP5Form.update\', \'Form_asJSON?form_id=%s\');; RenderJs.TabbularGadget.toggleVisibility($(\'#%s\'));; ERP5Form.setCurrentFormId(\'%s\');;return false ;;\'\'\' %(action_form, action_form, action_form, action_form, action_form)">\n
<a tal:attributes="onclick python: \'\'\'javascript: ERP5Form.openFormInTabbularGadget(\'form_gadget\', \'%s\');; return false ;;\'\'\' %(action_form)">\n
<span i18n:translate=""\n
i18n:domain="ui"\n
tal:content="action/name">action_name</span>\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<div id="status" class="status"\n
tal:define="portal here/getPortalObject">\n
\n
<div id="breadcrumb" class="breadcrumb">\n
<tal:block metal:use-macro="here/breadcrumb_render/macros/breadcrumb" />\n
</div>\n
\n
<div id="logged_in_as" class="logged_in_as">\n
<tal:block tal:condition="not: portal/portal_membership/isAnonymousUser">\n
<span class="logged_txt" i18n:translate="" i18n:domain="ui">Logged In as :</span>\n
<tal:block tal:replace="python:portal.portal_membership.getAuthenticatedMember().getUserName()" />\n
</tal:block>\n
</div>\n
\n
<p class="clear"></p>\n
\n
<tal:block tal:condition="preferred_html_style_acknowledgeable_message | nothing">\n
<div id="acknowledgeable_message_render" class="acknowledgeable_message_render">\n
<div tal:content="structure here/acknowledgeable_message_render"/>\n
</div>\n
</tal:block>\n
\n
<div tal:content="request/portal_status_message | nothing" id="transition_message"\n
class="transition_message"/>\n
\n
<tal:block tal:condition="request/field_errors | nothing">\n
<div id="information_area" class="information_area" i18n:translate="" i18n:domain="ui">\n
Input data has errors. Please look at the error messages below.\n
</div>\n
<script type="text/javascript">changed = true;</script>\n
</tal:block>\n
</div>
]]></unicode> </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>status_gadget</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>iso-8859-15</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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>_text</string> </key>
<value> <unicode>\074tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal"\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n"\076\n
\074tal:block tal:replace="nothing"\076\n
\074!--\n
IDEAS:\n
- Add callbacks to ERP5Form object (selection ?) to gather needed fields -\076 put them in http_parameter_list.\n
--\076\n
\074/tal:block\076\n
\074tal:block metal:define-macro="master"\076\n
\074tal:block tal:define="global_definitions_macros here/global_definitions/macros;\n
subject_list subject_list | python:here.getProperty(\'subject_list\', []) or []"\076\n
\074tal:block metal:use-macro="global_definitions_macros/header_definitions" /\076\n
\074!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"\076\n
\074html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"\076\n
\074head\076\n
\074base tal:attributes="href python: \'%s/\' % (url, )" /\076\n
\074meta name="generator" content="ERP5 - Copyright (C) 2001 - 2008. All rights reserved." /\076\n
\074meta name="description" content=""\n
tal:attributes="content description | title | string:ERP5 Free Open Source ERP and CRM" /\076\n
\074meta name="keywords" content=""\n
tal:attributes="content python:\', \'.join(subject_list)" /\076\n
\074meta name="robots" content="index, follow" /\076\n
\074meta http-equiv="Content-Type" content="text/html; charset=utf-8" /\076\n
\074meta http-equiv="Content-Script-Type" content="text/javascript" /\076\n
\074meta http-equiv="Content-Style-Type" content="text/css" /\076\n
\074title tal:define="title title | string:ERP5;\n
header_title header_title | nothing"\n
tal:content="python:header_title or \'%s | %s\' % (title, here.getPortalObject().title_or_id())"\076\074/title\076\n
\074tal:block tal:repeat="css css_list"\076\n
\074link tal:attributes="href css" type="text/css" rel="stylesheet" /\076\n
\074/tal:block\076\n
\074tal:block tal:replace="nothing"\076\n
\074!-- Render each field\'s css and javascript. --\076\n
\074/tal:block\076\n
\074tal:block tal:condition="python: form is not None"\076\n
\074tal:block tal:repeat="group python: [x for x in form.get_groups(include_empty=0) if x != \'hidden\']"\076\n
\074tal:block tal:repeat="field python: form.get_fields_in_group(group)"\076\n
\074tal:block tal:define="css python: field.render_css(REQUEST=request)"\076\n
\074style tal:condition="python: css is not None"\n
tal:content="css"\n
tal:attributes="type python:\'text/css\'"\076\n
\074/style\076\n
\074/tal:block\076\n
\074tal:block tal:define="dummy python: js_list.extend(field.get_javascript_list(REQUEST=request))" /\076\n
\074/tal:block\076\n
\074/tal:block\076\n
\074/tal:block\076\n
\074tal:block tal:repeat="js js_list"\076\n
\074script tal:attributes="src js" type="text/javascript"\076\074/script\076\n
\074/tal:block\076\n
\n
\074!-- RenderJs added libraries (WIP, XXX: use requirejs) --\076\n
\074script src="jquery/ui/js/jquery-ui.js" type="text/javascript"\076\074/script\076\n
\074link rel="stylesheet" type="text/css" media="screen" href="jquery/plugin/jqgrid/ui.jqgrid.css" /\076\n
\074link rel="stylesheet" type="text/css" media="screen" href="jquery/ui/css/erp5-theme/jquery-ui.css" /\076\n
\074script type="text/javascript" src="jquery/plugin/jqgrid/i18n/grid.locale-en.js"\076\074/script\076\n
\074script type="text/javascript" src="jquery/plugin/jqgrid/jquery.jqGrid.src.js"\076\074/script\076\n
\074!--[if IE]\076\n
\074script type="text/javascript" src="jquery/plugin/jstorage/jquery.json-2.3.js"\076\074/script\076\n
\074!--\074![endif]--\076\n
\074script src="jquery/plugin/renderjs/renderjs.js"\076\074/script\076\n
\074script src="erp5_form.js"\076\074/script\076\n
\n
\074script type="text/javascript" language="javascript"\076\n
//\074![CDATA[\n
$(document).ready(function() {\n
// we need to explicitly fire it\n
RenderJs.init();\n
});\n
//]]\076\n
\074/script\076\n
\n
\074link rel="icon" tal:attributes="href string:${portal_path}/favicon.ico" type="image/x-icon" /\076\n
\074link rel="shortcut icon" tal:attributes="href string:${portal_path}/favicon.ico" type="image/x-icon" /\076\n
\074tal:block metal:define-slot="head"\076\n
\074!-- this is a placeholder for different extensions to head which could be required by web themes --\076\n
\074/tal:block\076\n
\074/head\076\n
\074body tal:attributes="class body_css_class|nothing"\076\n
\074form id="main_form"\n
class="main_form"\n
onsubmit="changed=false; return true"\n
tal:attributes="enctype enctype | form/Form_getEnctype | nothing;\n
action url;\n
method python:str(path(\'form/method | string:post\')).lower()"\076\n
\074fieldset id="hidden_fieldset" class="hidden_fieldset"\076\n
\074input tal:condition="form_action | nothing"\n
id="hidden_button" class="hidden_button" type="submit" value="dummy"\n
tal:attributes="name string:${form_action}:method" /\076\n
\074tal:block metal:use-macro="global_definitions_macros/http_definitions" /\076\n
\074/fieldset\076\n
\074tal:block metal:define-slot="layout"\076\n
\n
\074div id="bars" class="bars"\076\n
\n
\074div id="main_bar"\n
data-gadget="ERP5Site_renderCachedNavigationBox"\076\074/div\076\n
\n
\074!-- XXX: make a gadget --\076\n
\074div id="context_bar" class="context_bar"\076\n
\074tal:block metal:define-slot="context_bar" /\076\n
\074/div\076\n
\n
\074/div\076\n
\n
\074div id="status"\n
class="status"\n
data-gadget="status_gadget"\076\074/div\076\n
\n
\074div id="master" class="master"\076\n
\074tal:block metal:define-slot="main" /\076\n
\074/div\076\n
\n
\074/tal:block\076\n
\074/form\076\n
\074/body\076\n
\074/html\076\n
\074/tal:block\076\n
\074/tal:block\076\n
\074/tal:block\076</unicode> </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>template_erp5_xhtml_style_disable</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -34,11 +34,13 @@
</item>
<item>
<key> <string>_text</string> </key>
<value> <unicode>\074tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"\n
<value> <unicode encoding="cdata"><![CDATA[
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal"\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n"\076\n
\074tal:block metal:define-macro="master"\076\n
\074tal:block\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n">\n
<tal:block metal:define-macro="master">\n
<tal:block\n
tal:define="object_uid here/getUid | nothing;\n
object_path here/getPath | nothing;\n
form nocall: form | nothing;\n
......@@ -47,46 +49,28 @@
form_action python: form and form.action not in (\'\', None) and portal.portal_membership.checkPermission(\'Modify portal content\', here) and form.action or nothing;\n
local_parameter_list local_parameter_list | python: {};\n
dummy python: local_parameter_list.update({\'object_uid\': object_uid, \'object_path\': object_path, \'form_id\': form_id});\n
title python: \'%s - %s\' % (portal.Base_translateString(template.title_or_id()), here.getTitle());"\076\n
title python: \'%s - %s\' % (portal.Base_translateString(template.title_or_id()), here.getTitle());">\n
\n
\074tal:block metal:use-macro="here/main_template/macros/master"\076\n
\074tal:block metal:fill-slot="context_bar"\076\n
\074tal:block metal:use-macro="here/context_box_render/macros/master" /\076\n
\074/tal:block\076\n
\074tal:block metal:fill-slot="main"\076\n
<tal:block metal:use-macro="here/main_template/macros/master">\n
<tal:block metal:fill-slot="context_bar">\n
\n
\074!-- Experimental gadget form rendering --\076\n
\074!-- XXX: move to listbox gadget asap --\076\n
\074script src="jquery/ui/js/jquery-ui.js" type="text/javascript"\076\074/script\076\n
<div id="context_box_render"\n
data-gadget="context_box_render_wrapper"></div>\n
\n
\074link rel="stylesheet" type="text/css" media="screen" href="jquery/plugin/jqgrid/ui.jqgrid.css" /\076\n
\074link rel="stylesheet" type="text/css" media="screen" href="jquery/ui/css/erp5-theme/jquery-ui.css" /\076\n
\074script type="text/javascript" src="jquery/plugin/jqgrid/i18n/grid.locale-en.js"\076\074/script\076\n
\074script type="text/javascript" src="jquery/plugin/jqgrid/jquery.jqGrid.src.js"\076\074/script\076\n
\074!--[if IE]\076\n
\074script type="text/javascript" src="jquery/plugin/jstorage/jquery.json-2.3.js"\076\074/script\076\n
\074!--\074![endif]--\076\n
\074script src="jquery/plugin/renderjs/renderjs.js"\076\074/script\076\n
\074script src="erp5_form.js"\076\074/script\076\n
</tal:block>\n
<tal:block metal:fill-slot="main">\n
\n
\074script type="text/javascript" language="javascript"\076\n
//\074![CDATA[\n
$(document).ready(function() {\n
// we need to explicitly fire it\n
RenderJs.init();\n
});\n
//]]\076\n
\074/script\076\n
<div id="content"\n
data-gadget="gadgets/content/gadget"\n
tal:attributes="data-gadget string:gadgets/tabular_gadget/gadget?object_path=${object_path}&current_form_id=${form_id}"></div>\n
\n
\074div id="content"\n
data-gadget="gadgets/content/gadget"\n
tal:attributes="data-gadget string:gadgets/tabular_gadget/gadget?object_path=${object_path}\046current_form_id=${form_id}"\076\074/div\076\n
\n
\074/tal:block\076\n
\074/tal:block\076\n
\074/tal:block\076\n
\074/tal:block\076\n
\074/tal:block\076</unicode> </value>
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>
]]></unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
Ajax-zation of ERP5 tab UI.
Note: To enable this bt5 after install remove "_disable" from ids of "form_view_disable" and "view_main_disable". This is still considered a work in progress.
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.
13
\ No newline at end of file
14
\ 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