Improve anonymous gadget

When render dashbord, we should look if we use anonymous gadget
When get active knowledge pad, do the same for anonymous and for user else we can get the wrong active gadget (ex : when rendering login_form on web site root, we get front pad for anonymous and default_section_pad for connected)
parent 6548ad65
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ERP5TypeInformation" module="Products.ERP5Type.ERP5Type"/> <global name="Base Type" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -189,6 +189,10 @@ ...@@ -189,6 +189,10 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>type_class</string> </key>
<value> <string>XMLObject</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
...@@ -206,7 +210,9 @@ ...@@ -206,7 +210,9 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>domain_name</string> </key> <key> <string>domain_name</string> </key>
<value> <none/> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>property_name</string> </key> <key> <string>property_name</string> </key>
...@@ -229,7 +235,9 @@ ...@@ -229,7 +235,9 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>domain_name</string> </key> <key> <string>domain_name</string> </key>
<value> <none/> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>property_name</string> </key> <key> <string>property_name</string> </key>
......
...@@ -50,18 +50,11 @@ ...@@ -50,18 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>MARKER = (\'\', None,)\n
MARKER = (\'\', None,)\n
visible_state_list = [\'visible\', \'public\']\n visible_state_list = [\'visible\', \'public\']\n
isAnon = context.portal_membership.isAnonymousUser()\n
\n \n
knowledge_pads = context.ERP5Site_getKnowledgePadListForUser(mode=mode,\n knowledge_pads = context.ERP5Site_getKnowledgePadListForUser(mode=mode,\n
default_pad_group=default_pad_group)\n default_pad_group=default_pad_group)\n
if isAnon and len(knowledge_pads)>=1:\n
# for anonymous we return the first one found \n
return knowledge_pads[0], knowledge_pads\n
\n
# use info from REQUEST\n # use info from REQUEST\n
active_pad, knowledge_pads = \\\n active_pad, knowledge_pads = \\\n
context.ERP5Site_getActiveKnowledgePadForUserFromRequest(knowledge_pads,\n context.ERP5Site_getActiveKnowledgePadForUserFromRequest(knowledge_pads,\n
...@@ -104,9 +97,7 @@ for knowledge_pad in knowledge_pads:\n ...@@ -104,9 +97,7 @@ for knowledge_pad in knowledge_pads:\n
return knowledge_pad, knowledge_pads\n return knowledge_pad, knowledge_pads\n
\n \n
return None, knowledge_pads\n return None, knowledge_pads\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
tal:define="layout here/KnowledgePad_getBoxColumnLayout;\n tal:define="layout here/KnowledgePad_getBoxColumnLayout;\n
real_context python: options.get(\'real_context\', None);\n real_context python: options.get(\'real_context\', None);\n
cancel_url python: options.get(\'cancel_url\', None);\n cancel_url python: options.get(\'cancel_url\', None);\n
is_anonymous_user python: here.portal_membership.isAnonymousUser();\n isAnonymousKnowledgePadUsed python: request.get(\'is_anonymous_knowledge_pad_used\',False);\n
isAnon python: here.portal_membership.isAnonymousUser();\n
is_anonymous_user python: isAnon or isAnonymousKnowledgePadUsed;\n
is_tab_empty here/KnowledgePad_isEmpty;\n is_tab_empty here/KnowledgePad_isEmpty;\n
columns python: options.get(\'columns\', 3);\n columns python: options.get(\'columns\', 3);\n
column_css_class python: test(is_anonymous_user, \n column_css_class python: test(is_anonymous_user, \n
...@@ -49,7 +51,7 @@ ...@@ -49,7 +51,7 @@
\n \n
<!-- No gadgets message -->\n <!-- No gadgets message -->\n
<span metal:use-macro="container/Base_viewKnowledgePadMacroLibrary/macros/add_new_gadget_message"/> \n <span metal:use-macro="container/Base_viewKnowledgePadMacroLibrary/macros/add_new_gadget_message"/> \n
\n \n
<!-- Render pad columns -->\n <!-- Render pad columns -->\n
<tal:block tal:repeat="column_index python: range(0, columns)">\n <tal:block tal:repeat="column_index python: range(0, columns)">\n
<div tal:condition="python: columns>=1+column_index"\n <div tal:condition="python: columns>=1+column_index"\n
......
718 719
\ 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