Commit 9c5f1d9e authored by Johannes Knödtel's avatar Johannes Knödtel 🎶
Browse files

only use one button for locking or unlocking session

parent a0885660
......@@ -53,7 +53,7 @@ ORDER BY
-- :name get-sessions :? :*
-- :doc retrives all sessions with names and ids
SELECT
id, name
id, name, locked
FROM
sessions
ORDER BY
......
......@@ -12,15 +12,12 @@
<li class="collection-item" style="padding-bottom:1.75em;">
<a href="/{{session.id}}" style="vertical-align:center;margin-top=0.5em">{{session.id}}. {{session.name}}</a>
<span class="secondary-content">
<form method="POST" action="/unlock-session" style="display:inline;margin-right:.5em">
{% csrf-field %}
<input type="text" name="session" value="{{session.id}}" style="display:none" />
<button class="btn btn-floating" type="submit"><i class="material-icons small cyan">lock_open</i></input>
</form>
<form method="POST" action="/lock-session" style="display:inline">
<form method="POST" action="/{% if session.locked %}unlock{% else %}lock{% endif %}-session" style="display:inline">
{% csrf-field %}
<input type="text" name="session" value="{{session.id}}" style="display:none;" />
<button class="btn btn-floating" type="submit"><i class="material-icons small red">lock</i></input>
<button class="btn btn-floating" type="submit">
<i class="material-icons small {% if session.locked %}cyan{% else %}red{% endif %}">{% if session.locked %}lock_open{% else %}lock{% endif %}</i>
</button>
</form>
</span>
</li>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment