all repos — myprecious @ 537992b95025dee96ceaf488d003a09bdea99dc4

A lightweight web service to backup precious game saves.

myprecious/templates/admin.html (view raw)

 1{% extends "base.html" %}
 2{% block title %}admin{% endblock %}
 3{% block content %}
 4    <h2>queue</h2>
 5    <table>
 6        <thead>
 7            <tr class="t-row">
 8                <td>Requested</td>
 9                <td>Username</td>
10                <td>E-Mail</td>
11                <td>Actions</td>
12            </tr>
13        </thead>
14        <tbody>
15        {% for entry in queue %}
16            <tr class="t-row">
17                <td>{{ entry[4] }}</td>
18                <td>{{ entry[0] }}</td>
19                <td>{% if entry[3] %}{{ entry[3] }}{% else %}&#8212;{% endif %}</td>
20                <td class="t-center" data-username="{{ entry[0] }}">
21                    <input type="button" onclick="allow_or_deny(this)" value="allow" />&nbsp;
22                    <input type="button" onclick="allow_or_deny(this, false)" value="deny" />
23                </td>
24            </tr>
25        {% endfor %}
26        </tbody>
27    </table>
28<script>
29    function allow_or_deny(button, allow=true) {
30        const username = button.parentElement.getAttribute("data-username");
31        action = allow ? "allow" : "deny";
32        window.location.href="/admin/" + action + "/" + username;
33    }
34</script>
35{% endblock %}