diff --git a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/Base_viewKnowledgePadMacroLibrary.xml b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/Base_viewKnowledgePadMacroLibrary.xml index a6eaccd0d5d5a36f81394ccc9e3a409649a8638c..5ac3e2a2d8aee532d3c75e078a9cd6068c461c81 100644 --- a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/Base_viewKnowledgePadMacroLibrary.xml +++ b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/Base_viewKnowledgePadMacroLibrary.xml @@ -183,8 +183,9 @@ <tal:block tal:repeat="knowledge_pad knowledge_pads">\n \n <tal:block \n - tal:define="is_active python:\n - knowledge_pad.getRelativeUrl()==active_knowledge_pad.getRelativeUrl()"> \n + tal:define="knowledge_pad_relative_url knowledge_pad/getRelativeUrl;\n + active_knowledge_pad_relative_url active_knowledge_pad/getRelativeUrl;\n + is_active python: knowledge_pad_relative_url==active_knowledge_pad_relative_url"> \n \n <li tal:condition="is_active"\n class="tab tab_selected">\n @@ -201,37 +202,20 @@ i18n:attributes="title"\n i18n:domain="ui"\n class="clickable_image remove_tab_dialog_image"\n - tal:condition="python: mode==\'erp5_front\'"\n - tal:attributes="onclick python: \'removeKnowledgePadFromServer(\n - \\\'%s\\\', \\\'%s\\\',\\\'/%s\\\')\' \n - %(active_knowledge_pad.getRelativeUrl(), \n - mode,\n - context.getId())"></span>\n - <span title="Remove"\n - i18n:attributes="title"\n - i18n:domain="ui"\n - class="clickable_image remove_tab_dialog_image"\n - tal:condition="python: mode!=\'erp5_front\'"\n - tal:attributes="onclick python: \'removeKnowledgePadFromServer(\n - \\\'%s\\\', \\\'%s\\\',\\\'/%s/%s\\\')\' \n - %(active_knowledge_pad.getRelativeUrl(), \n - mode,\n - context.getPortalObject().getId(),\n - context.getRelativeUrl())"></span>\n -\n + tal:attributes="onclick string: removeKnowledgePadFromServer(\n + \'${active_knowledge_pad_relative_url}\', \'${mode}\')"/>\n </li>\n \n <li tal:condition="not: is_active"\n class="tab">\n - <a tal:attributes="href python:\n + <a tal:attributes="href python:\n \'ERP5Site_toggleActiveKnowledgePad?knowledge_pad_url=%s&mode=%s\'\n %(knowledge_pad.getRelativeUrl(), mode)">\n <span tal:content="knowledge_pad/getTitle"/>\n </a>\n -<!-- XXX: instant switch\n - <span tal:attributes="onclick string:loadPadFromServer(\'${knowledge_pad.getRelativeUrl()}\', \'page_wrapper\', \'${mode}\')" \n - tal:content="knowledge_pad/getTitle"/>\n --->\n + <!-- XXX: instant switch-->\n +<!-- <span tal:attributes="onclick string:loadPadFromServer(\'${knowledge_pad_relative_url}\', \'page_wrapper\', \'${mode}\')" \n + tal:content="knowledge_pad/getTitle"/>-->\n \n </li>\n </tal:block>\n diff --git a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getActiveKnowledgePadForUser.xml b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getActiveKnowledgePadForUser.xml index 4d2ace1131a5bc03ca66cac2d70db99baacb74ae..238384553b65b910a58ebc3faab57bfd27cc97c3 100644 --- a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getActiveKnowledgePadForUser.xml +++ b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getActiveKnowledgePadForUser.xml @@ -89,7 +89,6 @@ for knowledge_pad in knowledge_pads:\n # ERP5 Site front gadget \n return knowledge_pad, knowledge_pads \n \n -\n # no customized version found for this context so\n # try finding pad by group\n for knowledge_pad in knowledge_pads:\n diff --git a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml index c6c08281811c97e1a32e2c05abfd4d2431f33c26..5c49298d50882b5b8d9ab97774bb79a7cbc5c6f8 100644 --- a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml +++ b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml @@ -111,7 +111,6 @@ if active_pad is not None and active_pad.getValidationState() != \'deleted\':\n results = filterKnowledgePadListForContext(results, mode, \n default_pad_group)\n \n -\n if not len(results) and not isAnon:\n # try getting default knowledge pads for user from global site preference\n user_pref = context.Base_getActiveGlobalKnowledgePadPreference()\n diff --git a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/KnowledgePag_getPadAsHTML.xml b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/KnowledgePag_getPadAsHTML.xml index 52d2e6013afb6aef1ab3f55210f52ec0c7bb9f9f..88badf17f12d12bcc49e9fb4aaeb8483828bd24f 100644 --- a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/KnowledgePag_getPadAsHTML.xml +++ b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/KnowledgePag_getPadAsHTML.xml @@ -53,19 +53,21 @@ <value> <string>"""\n Render an entire PAD plus navigation (XXX)\n Used to in AJAX calls for instan PAD switching.\n + XXX: rather than return HTML we should return JSON as some parts like JS needs to be evaluated explicitly by\n + browser.\n """\n pad = context.restrictedTraverse(pad_relative_url)\n +# we set this as a temp hack to force all gadgets rendering as synchronous\n context.REQUEST.set(\'force_synchronous_gadget_rendering\', 1)\n -html = pad.WebSection_viewDashboardWidget(real_context=context, page_wrapper_id=\'\')\n -#WebSection_viewDashboardWidget\n -#KnowledgePad_viewDashboardWidget\n -# XXX: merge both to KnowledgePad_viewDashboardWidget !\n +\n +# render Pad\'s html\n +\n +html = pad.KnowledgePad_viewDashboardWidget(real_context=context, page_wrapper_id=\'\')\n # toggle new active pad \n context.ERP5Site_toggleActiveKnowledgePad(pad_relative_url, mode, redirect=False)\n -context.REQUEST.RESPONSE.setHeader(\'Content-Type\', \'text/html;; charset=utf-8\')\n \n -print html\n -return printed\n +context.REQUEST.RESPONSE.setHeader(\'Content-Type\', \'text/html;; charset=utf-8\')\n +return html\n </string> </value> </item> <item> @@ -104,8 +106,6 @@ return printed\n <tuple> <string>pad_relative_url</string> <string>mode</string> - <string>_print_</string> - <string>_print</string> <string>_getattr_</string> <string>context</string> <string>pad</string> diff --git a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/erp5_knowledge_box.js.xml b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/erp5_knowledge_box.js.xml index f69513e56bb4fdce600386c73630826f15a93cf3..1d5d3d5103ae82341367329c76ed6ec10b33aaeb 100644 --- a/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/erp5_knowledge_box.js.xml +++ b/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/erp5_knowledge_box.js.xml @@ -12,7 +12,7 @@ </item> <item> <key> <string>_EtagSupport__etag</string> </key> - <value> <string>ts91191957.42</string> </value> + <value> <string>ts91216542.63</string> </value> </item> <item> <key> <string>__name__</string> </key> @@ -261,7 +261,7 @@ function showAddNewPadPopup(popup_id, input_id){\n \n function loadPadFromServer(pad_relative_url, wrapper_dom_id, mode){\n /* Load Pad from server */\n - d = MochiKit.Async.doSimpleXMLHttpRequest(\'A\', \n + d = MochiKit.Async.doSimpleXMLHttpRequest(\'KnowledgePag_getPadAsHTML\', \n {\'pad_relative_url\':pad_relative_url,\n \'mode\':mode});\n d.addCallback(handleServerSuccess);\n @@ -299,7 +299,7 @@ function addPadOnServer(create_url,\n };\n };\n \n -function removeKnowledgePadFromServer(knowledge_pad_relative_url, mode, base_path){\n +function removeKnowledgePadFromServer(knowledge_pad_relative_url, mode){\n /* remove pad from server*/\n if (is_knowledge_template_used){\n showCreateDefaultKnowledgePadWarningMessage();}\n @@ -442,7 +442,7 @@ MochiKit.DOM.addLoadEvent(initialize);\n </item> <item> <key> <string>size</string> </key> - <value> <int>16302</int> </value> + <value> <int>16315</int> </value> </item> <item> <key> <string>title</string> </key> diff --git a/bt5/erp5_knowledge_pad/bt/revision b/bt5/erp5_knowledge_pad/bt/revision index b697ae4122fcdfdbac82d12992705514b0f2cb07..748e6f1af544d497e99e1f5c583027349aa4a4c3 100644 --- a/bt5/erp5_knowledge_pad/bt/revision +++ b/bt5/erp5_knowledge_pad/bt/revision @@ -1 +1 @@ -635 \ No newline at end of file +637 \ No newline at end of file