Tweak templates for editing and managing rules

This commit is contained in:
Timotej Lazar 2023-07-04 12:18:01 +02:00
parent 5e65755ec0
commit 1ff6c9d0d3
3 changed files with 9 additions and 9 deletions

View file

@ -2,7 +2,7 @@
{% block content %} {% block content %}
<p> <p>
Urejate pravilo #{{ index }}. Urejate pravilo #{{ index }}. <a href="{{ url_for('rules.index') }}">Seznam pravil.</a>
<form id="request" method="POST"> <form id="request" method="POST">
<p> <p>

View file

@ -9,12 +9,12 @@ Urejate prioritete pravil za požarni zid. Pravilo odstranite tako, da izbrišet
<tbody> <tbody>
{% for rule in rules %} {% for rule in rules %}
<tr> <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 }}" /> <td><input type="hidden" name="name" value="{{ rule.name }}" />
<a href="{{ url_for('rules.edit', index=loop.index0) }}">{{ rule.name }}</a> <a href="{{ url_for('rules.edit', index=loop.index0) }}">{{ rule.name }}</a>
{% endfor %} {% endfor %}
<tr> <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" /> <td><input name="name" type="text" size="40" />
</table> </table>
<p><button id="submit" type="submit">Shrani</button> <p><button id="submit" type="submit">Shrani</button>

View file

@ -4,17 +4,17 @@
<p> <p>
Tu lahko vklopite in izklopite posamezna pravila za požarni zid. Tu lahko vklopite in izklopite posamezna pravila za požarni zid.
<dl>
{% for rule in rules %} {% for rule in rules %}
<dt> <details>
<summary>
{% if rule.enabled %} {% 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 %} {% 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 %} {% endif %}
<dd> </summary>
<pre><code>{{ rule.text }}</code></pre> <pre><code>{{ rule.text }}</code></pre>
</details>
{% endfor %} {% endfor %}
</dl>
{% endblock %} {% endblock %}