Skip to content

Commit

Permalink
improve rules overview
Browse files Browse the repository at this point in the history
  • Loading branch information
agitator committed Jan 12, 2022
1 parent d6e4094 commit c41e552
Showing 1 changed file with 50 additions and 39 deletions.
89 changes: 50 additions & 39 deletions plone/app/contentrules/browser/templates/controlpanel.pt
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@
<form name="ruleSettings" method="POST"
tal:attributes="action string:${context/absolute_url}/@@rules-controlpanel">
<span tal:replace="structure context/@@authenticator/authenticator"/>
<div class="field">
<div class="form-check">
<input type="hidden" name="global_disable:boolean:default" value="" />
<input type="checkbox"
class="form-check-input"
id="rules_disable_globally"
name="global_disable:boolean"
value="True"
tal:attributes="checked python:view.globally_disabled() and 'checked' or None" />
<label for="rules_disable_globally" i18n:translate="">Disable globally</label>
<div class="formHelp" i18n:translate="">
<label class="form-check-label" for="rules_disable_globally" i18n:translate="">Disable globally</label>
<div class="form-text" i18n:translate="">
Whether or not content rules should be disabled globally. If this is selected,
no rules will be executed anywhere in the portal.
</div>
Expand Down Expand Up @@ -109,11 +110,11 @@
metal:define-macro="rules_table_form">
<table class="listing nosort controlpanel-listing table"
tal:condition="rules">
<thead>
<thead class="">
<tr>
<th scope="col" i18n:translate="label_contentrules_rule_listing">Content rule</th>
<th scope="col" i18n:translate="label_contentrules_rule_event">Event</th>
<!-- <th scope="col" i18n:translate="label_contentrules_rule_enabled">Enabled</th> -->
<th scope="col" i18n:translate="label_contentrules_rule_status"><span class="ps-2">Status</span></th>
<th scope="col" i18n:translate="label_contentrules_rule_actions">Actions</th>
</tr>
</thead>
Expand All @@ -122,63 +123,73 @@
<tr tal:define="oddrow repeat/rule/odd"
tal:attributes="class python:(oddrow and 'even ' or 'odd ') + rule['row_class'];">
<td>
<dl>
<dt>
<a tal:attributes="href string:${context/absolute_url}/++rule++${rule/id}/@@manage-elements"><span
tal:replace="rule/title">Rule Title</span></a>
</dt>
<dd tal:content="rule/description">
Rule Description.
</dd>
</dl>
<h5>
<span
tal:replace="rule/title">Rule Title</span>
</h5>
<div tal:content="rule/description">
Rule Description.
</div>
</td>
<td>
<span class="trigger"
tal:content="rule/trigger"
i18n:translate="">trigger</span>
</td>
<!-- <td class="checker">
</td> -->
<td>
<span
class="badge bg-primary icon-contentrule-enabled-assigned"
alt="enabled"
i18n:attributes="alt label_contentrules_rule_enabled;">
<i class="glyphicon glyphicon-ok"></i>enabled
</span>
<td class="status">

<span
class="badge bg-danger icon-contentrule-enabled-unassigned"
alt="unassigned"
title="this rule has not been assigned"
i18n:attributes="alt label_contentrules_rule_unassigned;
title title_contentrule_rule_unassigned;">
<i class="glyphicon glyphicon-remove"></i>not assigned
</span>
<form style="display: inline" method="POST"
tal:attributes="action string:${context/absolute_url}/@@rules-controlpanel">
<span tal:replace="structure context/@@authenticator/authenticator"/>
<input type="hidden"
name="rule-id"
tal:attributes="value rule/id">
<button class="context btn-rule-action btn-rule-enable btn btn-primary" type="submit" value="Enable"
<button class="context btn-rule-action btn-rule-enable btn btn-sm btn-link" type="submit" value="Enable"
name="form.button.EnableRule"
tal:attributes="data-value rule/id;
data-url string:$portal_url/@@contentrule-enable"
tal:condition="python:not rule['enabled']"
i18n:translate=""
i18n:attributes="value label_enable;">Enable</button>
<button class="standalone btn-rule-action btn-rule-disable btn btn-secondary" type="submit" value="Disable"
i18n:attributes="value label_enable;">
<tal:icon tal:replace="structure python:icons.tag('square', tag_alt='Toggle to show')" /><span class="ms-2" i18n:translate="">enabled</span>
</button>
<button class="standalone btn-rule-action btn-rule-disable btn btn-sm btn-link" type="submit" value="Disable"
name="form.button.DisableRule"
tal:attributes="data-value rule/id;
data-url string:$portal_url/@@contentrule-disable"
tal:condition="python:rule['enabled']"
i18n:translate=""
i18n:attributes="value label_disable;">Disable</button>
<a href="" class="btn btn-primary"
i18n:attributes="value label_disable;">
<tal:icon tal:replace="structure python:icons.tag('check-square', tag_alt='Toggle to show')" /><span class="ms-2" i18n:translate="">enabled</span>
</button>
</form>

<span
class="badge bg-warning text-dark icon-contentrule-enabled-unassigned"
alt="unassigned"
title="this rule has not been assigned"
tal:condition="python:not rule['assigned']"
i18n:attributes="alt label_contentrules_rule_unassigned;
title title_contentrule_rule_unassigned;">
<tal:icon tal:replace="structure python:icons.tag('exclamation-triangle-fill', tag_alt='not assigned')" /><span class="ms-2" i18n:translate="">not assigned</span>
</span>



</td>
<td>
<form style="display: inline" method="POST"
tal:attributes="action string:${context/absolute_url}/@@rules-controlpanel">
<span tal:replace="structure context/@@authenticator/authenticator"/>
<input type="hidden"
name="rule-id"
tal:attributes="value rule/id">
<a href="" class="btn btn-sm btn-primary"
tal:attributes="href string:${context/absolute_url}/++rule++${rule/id}/@@manage-elements">Configure</a>
<a href="" class="btn btn-sm btn-secondary"
tal:attributes="href string:${context/absolute_url}/++rule++${rule/id}/@@edit">Edit</a>
<a href="" class="btn btn-primary"
tal:attributes="href string:${context/absolute_url}/++rule++${rule/id}/@@manage-elements">Configure</a>

<button class="destructive btn-rule-action btn-rule-delete btn btn-danger" type="submit" value="Delete"
<button class="destructive btn-rule-action btn-rule-delete btn btn-sm btn-danger" type="submit" value="Delete"
tal:attributes="data-value rule/id;
data-url string:$portal_url/@@contentrule-delete"
name="form.button.DeleteRule"
Expand Down

0 comments on commit c41e552

Please sign in to comment.