Commit 6dcfcea4 authored by Ivan Tyagov's avatar Ivan Tyagov

Use a dedicated script to check if a Pad is empty or not.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42626 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a97f1901
master allow_login_change allow_login_change_differentiate_id_and_login allow_login_change_wip arnau arnau-kns arnau-kns-without-property-mapping arnau-merge arnau-poc authentication_policy_fixes auto_extend_select_list autoflake backup_erp5_workflow bk_erp5ish_actions_tool bk_sqlcatalog boc-interaction-drop bt_owner cache catalog_fulltext catalog_fulltext_old cedric cedriclen cedriclen-eos certificate_authority cherry-pick-4a8e045d cherry-pick-bca64206 cleanJSByJSLint clean_up_upgrader compact_title_no_reference credential_update_action datetimefield deferred_listbox douglas_forum dream_distributor drop-legacy-simulation eos-dev erp5-component erp5-data-notebook erp5-forum erp5-preference erp5-release erp5-slapos-upgrade erp5-util-testing erp5-vifib erp5-vifib-cleanup erp5_calendar erp5_free_subscription erp5_workflow fix_system_processes_ownership floatArrayTest for_testrunner_1 for_testrunner_2 formbox gabriel gabriel-fix-rounding-in-accounting-generation gabriel-fix-rounding-in-accounting-generation2 gadget-json-value http_cache_fix import_fixes import_fixes_complete improve_default_caching_policy_manager interaction-drop isDeletable item_tracking_graph_editor ivan jerome-bt-reference-doc jerome-test jerome_events jerome_graph_editor_renderjs jerome_new_style_solve_divergence jerome_promise_in_tests jerome_user_preference_time_zone jio jm/form-action-guard joblib-activity jupyter_egg_tests jupyter_import_dot_fix jupyter_import_dot_quickfix jupyter_kernel_fixes jupyter_reference_warning jupyter_restricted kns lazy_simulation_causality lignan lingnan listbox-generator mame mame-bt5-cleanup mame-erp5_project-cleanup mame-naming-convention mame-naming-convention-list_method mame-test-stock-indexation mame-work mame2 master-erp5-test-result-scalability master-erp5-test-result-scalability-rebase master-test-fix-additionalbt5path master_calendar_wip_patches master_calendar_wip_patches_extend_security master_no_guard_on_workflow_transition master_no_guard_on_workflow_transition_plus_calendar_wip_patchs merge_xhtml_jquery mmariani-inventory mrp new-render-presentation nexedi-erp5-jp no_reindex_data_stream officejs pere portal_callables portal_solver_process_security_configuration presentation rebased_mrp reindex_calendar_after_change_calendar_exception removed_portal_skin_redundancy romain-fulltext scalability-master2 scalability-master2-rebase scalability-rebase shop-box shop-box-rebased simulation sms_more_than_140_characters strict_catalog syncml test_page testnode_software_link timezones tristan tristan-merge tristan-performance ttr ttrm upgradeSite view-aggregated-amounts vivekpab_erp5webrenderjs_layoutconfig vivekpab_jabberclient vivekpab_renderjs_interfaces wenjie wenjie_branch xiaowu_newui yryr yryr-components-cp yryr-inventory-cache yryr-test yryr-with-components yusei erp5.util-0.4.46 erp5.util-0.4.44 erp5.util-0.4.43 erp5.util-0.4.41 erp5.util-0.4.40 erp5.util-0.4.37 erp5.util-0.4.1 erp5.util-0.4 erp5.util-0.3 erp5.util-0.2 erp5.util-0.1
No related merge requests found
......@@ -56,7 +56,7 @@
<!-- Render active Knowledge pad -->\n
<div id="pad-body-wrapper"\n
tal:condition="active_knowledge_pad">\n
<tal:block tal:replace="structure python: active_knowledge_pad.KnowledgePad_viewDashboardWidget(\n
<tal:block tal:replace="structure python: active_knowledge_pad.KnowledgePad_viewDashboardWidget(\n
columns=columns,\n
real_context=here,\n
cancel_url=cancel_url)"/>\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_body</string> </key>
<value> <string>"""\n
Is Knowledge Pad empty (i.e. no gadgets inside).\n
Use current Pad\'s layout.\n
"""\n
layout = context.KnowledgePad_getBoxColumnLayout()\n
return not sum([len(x) for x in layout])\n
</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>KnowledgePad_isEmpty</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -38,36 +38,33 @@
<div id="page_wrapper"\n
tal:define="layout here/KnowledgePad_getBoxColumnLayout;\n
real_context python: options.get(\'real_context\', None);\n
cancel_url python: options.get(\'cancel_url\', None);\n
isAnon python: here.portal_membership.isAnonymousUser();\n
is_tab_empty python: (len(layout)==1 and len(layout[0])==0) or\n
(len(layout)==3 and len(layout[0]+layout[1]+layout[2])==0);\n
columns python: options.get(\'columns\', 3);\n
column_css_class python: test(isAnon, \n
\'portal-column portal-column-undraggable\', \n
\'portal-column\');">\n
real_context python: options.get(\'real_context\', None);\n
cancel_url python: options.get(\'cancel_url\', None);\n
isAnon python: here.portal_membership.isAnonymousUser();\n
is_tab_empty here/KnowledgePad_isEmpty;\n
columns python: options.get(\'columns\', 3);\n
column_css_class python: test(isAnon, \n
\'portal-column portal-column-undraggable\', \n
\'portal-column\');">\n
\n
<!-- No gadgets message -->\n
<span metal:use-macro="container/Base_viewKnowledgePadMacroLibrary/macros/add_new_gadget_message"/> \n
\n
<!-- Render pad columns -->\n
<tal:block tal:repeat="column_index python: range(0, columns)">\n
<div tal:attributes="class column_css_class;\n
id string:portal-column-${column_index}"\n
tal:condition="python: columns>=1+column_index">\n
<div tal:condition="python: columns>=1+column_index"\n
tal:attributes="class column_css_class;\n
id string:portal-column-${column_index}">\n
\n
<tal:block tal:condition="python: len(layout)>=1+column_index"\n
tal:replace="structure python:\n
here.KnowledgePad_viewColumnWidget(section_layout=layout[column_index],\n
real_context=real_context,\n
cancel_url=cancel_url)"/>\n
\n
real_context=real_context,\n
cancel_url=cancel_url)"/>\n
</div>\n
</tal:block>\n
\n
</div>\n
</div>
]]></unicode> </value>
</item>
......@@ -85,7 +82,7 @@
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
<value> <string>iso-8859-15</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
686
\ No newline at end of file
688
\ 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