Skip to content
Snippets Groups Projects

Resolve "Always show getNext button"

Files

@@ -50,17 +50,10 @@
<div class="float-right btn-toolbar">
<form th:each="lab : ${activeLabs}" th:action="@{'/requests/next/' + ${lab.id}}"
class="float-right" style="padding-right:2px;" method="POST">
<th:block th:if="${queued.get(lab.id) > 0}">
<button type="submit" class="btn btn-sm btn-primary" >Get next for
[[${lab.course.code}]] [[${lab.toString()}]] (<span th:id="${'span-' + lab.id}">[[${queued.get(lab.id)}]]</span>)
</button>
</th:block>
<th:block th:unless="${queued.get(lab.id) > 0}">
<button th:id="${'lab-' + lab.id}" style="display:none;" type="submit"
class="btn btn-sm btn-primary" >Get next for
[[${lab.course.code}]] [[${lab.toString()}]] (<span th:id="${'span-' + lab.id}">[[${queued.get(lab.id)}]]</span>)
</button>
</th:block>
<button type="submit" class="btn btn-sm btn-primary"
th:classappend="${queued.get(lab.id) == 0} ? disabled : ''">Get next for
[[${lab.course.code}]] [[${lab.toString()}]] (<span th:id="${'span-' + lab.id}">[[${queued.get(lab.id)}]]</span>)
</button>
</form>
<a class="btn btn-sm btn-secondary text-white float-right" style="margin-right:2px;"
onclick='location.reload();'>Refresh</a>
Loading