Use one big form for priority inc/dec buttons

This commit is contained in:
Joscha 2023-08-17 23:20:44 +02:00
parent a97b229e7d
commit ad396722a0

View file

@ -30,36 +30,37 @@
<h2>Queue ({{ tasks.len() }})</h2> <h2>Queue ({{ tasks.len() }})</h2>
<table id="queue" class="queue-commits" data-count="{{ tasks.len() }}"> <form class="queue-commits" method="post">
<thead> <table id="queue" data-count="{{ tasks.len() }}">
<tr> <thead>
<th>commit</th> <tr>
<th>since</th> <th>commit</th>
<th>priority</th> <th>since</th>
<th>worker</th> <th>priority</th>
</tr> <th>worker</th>
</thead> </tr>
<tbody> </thead>
{% for task in tasks %} <tbody>
<tr {% if task.odd %} class="odd" {% endif %}> {% for task in tasks %}
<td>{{ task.commit|safe }}</td> <tr {% if task.odd %} class="odd" {% endif %}>
<td> <td>{{ task.commit|safe }}</td>
{{ task.since }} <td>
[<a href="{{ task.link_delete }}" title="Delete from queue">del</a>] {{ task.since }}
</td> [<a href="{{ task.link_delete }}" title="Delete from queue">del</a>]
<td> </td>
{{ task.priority }} <td>
[<form method="post" action="{{ task.link_increase }}"><input type="hidden" name="hash" {{ task.priority }}
value="{{ task.hash }}"><button title="Increase priority by 1">inc</button></form>/<form [<button title="Increase priority by 1" formaction="{{ task.link_increase }}" name="hash"
method="post" action="{{ task.link_decrease }}"><input type="hidden" name="hash" value="{{ task.hash }}">inc</button>/<button title="Decrease priority by 1"
value="{{ task.hash }}"><button title="Decrease priority by 1">dec</button></form>] formaction="{{ task.link_decrease }}" name="hash" value="{{ task.hash }}">dec</button>]
</td> </td>
{% if task.workers.is_empty() %} {% if task.workers.is_empty() %}
<td>-</td> <td>-</td>
{% else %} {% else %}
<td>{{ task.workers|join(", ")|safe }}</td> <td>{{ task.workers|join(", ")|safe }}</td>
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</form>