Commit 1ead881f authored by Ivan Tyagov's avatar Ivan Tyagov

All kind of gadget column renders use global gadget definitions now (rather...

All kind of gadget column renders use global gadget definitions now (rather than copy / paste code approach).
Allow more flexible renderer configuration from outside caller.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42611 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b1b9756f
...@@ -48,11 +48,15 @@ ...@@ -48,11 +48,15 @@
global columns python: options.get(\'columns\', 3);\n global columns python: options.get(\'columns\', 3);\n
global hasUserActivity python: here.ERP5Site_hasUserActivity(active_knowledge_pad, **kw);\n global hasUserActivity python: here.ERP5Site_hasUserActivity(active_knowledge_pad, **kw);\n
global isAnon python: here.portal_membership.isAnonymousUser();\n global isAnon python: here.portal_membership.isAnonymousUser();\n
global createDefaultPadForUser python: len(knowledge_pads)==0 and not hasUserActivity;\n
global waitForActivitiesOnServer python: active_knowledge_pad is None and hasUserActivity;\n global waitForActivitiesOnServer python: active_knowledge_pad is None and hasUserActivity;\n
global isUserAllowedToCreateKnowledgePads context/Base_isUserAllowedToUseKnowledgePad;\n global isUserAllowedToCreateKnowledgePads context/Base_isUserAllowedToUseKnowledgePad;\n
global isKnowledgePadTemplateUsed python: request.get(\'is_knowledge_pad_template_used\', 0);\n global isKnowledgePadTemplateUsed python: request.get(\'is_knowledge_pad_template_used\', 0);\n
global isAnonymousKnowledgePadUsed python: request.get(\'use_anonymous_knowledge_pad\', False);\n global isAnonymousKnowledgePadUsed python: request.get(\'use_anonymous_knowledge_pad\', False);\n
dummy python: request.set(\'is_anonymous_knowledge_pad_used\', isAnonymousKnowledgePadUsed); \n
global createDefaultPadForUser python: options.get(\'create_default_pad\', False) and \n
len(knowledge_pads)==0 and not hasUserActivity;\n
global make_security_check python: options.get(\'make_security_check\', False);\n
global pad_column python: options.get(\'pad_column\', 0);\n
global cancel_url here/absolute_url;"></tal:block>\n global cancel_url here/absolute_url;"></tal:block>\n
</tal:block>\n </tal:block>\n
\n \n
...@@ -72,7 +76,7 @@ ...@@ -72,7 +76,7 @@
\n \n
<tal:block metal:define-macro="knowledge_pad_security_check">\n <tal:block metal:define-macro="knowledge_pad_security_check">\n
\n \n
<div tal:condition="python: not ( isUserAllowedToCreateKnowledgePads or isAnon or isAnonymousKnowledgePadUsed)">\n <div tal:condition="python: not (isUserAllowedToCreateKnowledgePads or isAnon or isAnonymousKnowledgePadUsed)">\n
<div class="wait_block">\n <div class="wait_block">\n
<p i18n:translate="" i18n:domain="ui"> \n <p i18n:translate="" i18n:domain="ui"> \n
You are not allowed to use knowledge pad system due to security restrictions.\n You are not allowed to use knowledge pad system due to security restrictions.\n
......
...@@ -36,35 +36,13 @@ ...@@ -36,35 +36,13 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[ <value> <unicode encoding="cdata"><![CDATA[
<span metal:use-macro="container/Base_viewKnowledgePadMacroLibrary/macros/global_definitions"/>\n
\n
<tal:block \n <tal:block \n
tal:define="mode python: options.get(\'mode\', \'web_section\');\n tal:define="current_web_section python: context.REQUEST.get(\'current_web_section\', here);\n
default_pad_group python: options.get(\'default_pad_group\', None);\n
kw python: dict(mode=mode, default_pad_group=default_pad_group);\n
isAnonymousKnowledgePadUsed python: options.get(\'use_anonymous_knowledge_pad\', False);\n
pad_column python: options.get(\'pad_column\', 0);\n
create_default_pad python: options.get(\'create_default_pad\', False);\n
make_security_check python: options.get(\'make_security_check\', False);\n
dummy python: request.set(\'is_anonymous_knowledge_pad_used\', isAnonymousKnowledgePadUsed);\n
knowledge_pads python: here.ERP5Site_getKnowledgePadListForUser(**kw);\n
struct python: here.ERP5Site_getActiveKnowledgePadForUser(knowledge_pads, **kw);\n
active_knowledge_pad python: struct[0];\n
knowledge_pads python: struct[1];\n
hasUserActivity python: here.ERP5Site_hasUserActivity(active_knowledge_pad, **kw);\n
isAnon python: context.portal_membership.isAnonymousUser();\n
createDefaultPadForUser python: len(knowledge_pads)==0 and\n
not hasUserActivity and create_default_pad;\n
waitForActivitiesOnServer python: active_knowledge_pad is None and\n
hasUserActivity;\n
current_web_section python:\n
context.REQUEST.get(\'current_web_section\', here);\n
current_web_section python:\n current_web_section python:\n
test(current_web_section.getPortalType()==\'Web Site\',\n test(current_web_section.getPortalType()==\'Web Site\', here, current_web_section);\n
here, current_web_section);\n
current_web_section_url python: current_web_section.absolute_url();\n current_web_section_url python: current_web_section.absolute_url();\n
isUserAllowedToCreateKnowledgePads\n
context/Base_isUserAllowedToUseKnowledgePad;\n
isKnowledgePadTemplateUsed python:\n
request.get(\'is_knowledge_pad_template_used\', 0);\n
cancel_url string:${current_web_section_url}/view">\n cancel_url string:${current_web_section_url}/view">\n
\n \n
<tal:block tal:condition="python: not createDefaultPadForUser and \n <tal:block tal:condition="python: not createDefaultPadForUser and \n
......
683 685
\ 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