Tweak templates for editing and managing rules
This commit is contained in:
parent
5e65755ec0
commit
1ff6c9d0d3
|
@ -2,7 +2,7 @@
|
|||
|
||||
{% block content %}
|
||||
<p>
|
||||
Urejate pravilo #{{ index }}.
|
||||
Urejate pravilo #{{ index }}. <a href="{{ url_for('rules.index') }}">Seznam pravil.</a>
|
||||
|
||||
<form id="request" method="POST">
|
||||
<p>
|
||||
|
|
|
@ -9,12 +9,12 @@ Urejate prioritete pravil za požarni zid. Pravilo odstranite tako, da izbrišet
|
|||
<tbody>
|
||||
{% for rule in rules %}
|
||||
<tr>
|
||||
<td><input name="index" type="number" min="0" size="2" value="{{ loop.index * 10 }}" />
|
||||
<td><input name="index" type="number" min="0" size="4" value="{{ loop.index * 10 }}" />
|
||||
<td><input type="hidden" name="name" value="{{ rule.name }}" />
|
||||
<a href="{{ url_for('rules.edit', index=loop.index0) }}">{{ rule.name }}</a>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td><input name="index" type="number" min="0" size="2" />
|
||||
<td><input name="index" type="number" min="0" size="4" />
|
||||
<td><input name="name" type="text" size="40" />
|
||||
</table>
|
||||
<p><button id="submit" type="submit">Shrani</button>
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
<p>
|
||||
Tu lahko vklopite in izklopite posamezna pravila za požarni zid.
|
||||
|
||||
<dl>
|
||||
{% for rule in rules %}
|
||||
<dt>
|
||||
<details>
|
||||
<summary>
|
||||
{% if rule.enabled %}
|
||||
<font color="green">●</font> {{ rule.name }} <a href="{{ url_for('rules.toggle', index=rule.index, enable='false') }}">onemogoči</a>
|
||||
<font color="green">●</font> {{ rule.name }} <a href="{{ url_for('rules.toggle', index=rule.index, enable='false') }}">izklopi</a>
|
||||
{% else %}
|
||||
<font color="red">●</font> {{ rule.name }} <a href="{{ url_for('rules.toggle', index=rule.index, enable='true') }}">omogoči</a>
|
||||
<font color="red">●</font> {{ rule.name }} <a href="{{ url_for('rules.toggle', index=rule.index, enable='true') }}">vklopi</a>
|
||||
{% endif %}
|
||||
<dd>
|
||||
</summary>
|
||||
<pre><code>{{ rule.text }}</code></pre>
|
||||
</details>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue