Added "chain" marker to portlets which don't override configuration from parent or template
authorThierry Florac <thierry.florac@onf.fr>
Wed, 12 Jul 2017 12:24:37 +0200
changeset 41 00358b9d4dad
parent 40 71ff4ade6995
child 42 efb5e2a4255c
Added "chain" marker to portlets which don't override configuration from parent or template
src/pyams_portal/zmi/templates/layout.pt
--- a/src/pyams_portal/zmi/templates/layout.pt	Wed Jul 12 12:24:05 2017 +0200
+++ b/src/pyams_portal/zmi/templates/layout.pt	Wed Jul 12 12:24:37 2017 +0200
@@ -103,8 +103,14 @@
 										 tal:repeat="portlet_id template_config.slot_config[slot_name].portlet_ids"
 										 tal:attributes="data-ams-portlet-id portlet_id;">
 										<div class="header padding-x-5"
-											 tal:define="portlet_name portlet_config.get_portlet_configuration(portlet_id).portlet_name"
-											 tal:content="view.get_portlet_label(portlet_name)"></div>
+											 tal:define="current_config portlet_config.get_portlet_configuration(portlet_id);
+														 portlet_name current_config.portlet_name;">
+											<tal:var content="view.get_portlet_label(portlet_name)" />
+											<tal:if condition="current_config.can_inherit">
+												<i title="Override parent or template settings" i18n:attributes="title"
+												   tal:attributes="class python:'fa fa-fw {0} fa-rotate-90 hint opaque align-base'.format('fa-chain-broken' if not current_config.inherit_parent else '')"></i>
+											</tal:if>
+										</div>
 										<div class="preview"
 											 tal:content="structure view.get_portlet_preview(portlet_id)"></div>
 									</div>