admins can edit and remove links

This commit is contained in:
2018-10-18 14:44:13 +02:00
parent a2e2b8992b
commit 6fca90977f
3 changed files with 32 additions and 10 deletions
+12 -3
View File
@@ -1,12 +1,21 @@
{% extends 'base.html' %}
{% block content %}
<form action=/edit method="post">
<form action=/edit id="editform" method="post">
<input type="hidden" name="code" value="{{code}}" />
QR-code:<br />
<input type="text" value="{{code}}" disabled /><br />
URL:<br />
<input type="url" name="url" value=""/><br />
<button type="submit" class="graybar" >Save </button>
<input type="url" id="url" name="url" value="{{url}}"/><br />
<button type="submit" class="graybar" >Save</button>
</form>
{% if admin == True %}
<button class="graybar" onclick="removeLink()">Remove link</button>
{% endif %}
<script>
function removeLink() {
document.getElementById("url").value = "";
document.getElementById("editform").submit();
}
</script>
{% endblock %}