56 lines
1.8 KiB
HTML
56 lines
1.8 KiB
HTML
{% extends 'base.html' %}
|
|
|
|
{% block title %}Settings - Packs{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>Settings</h1>
|
|
|
|
{% if messages %}
|
|
<ul class="messages">
|
|
{% for message in messages %}
|
|
<li>{{ message }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
<h2>API Tokens</h2>
|
|
<p>Tokens let non-browser clients (like a Fabric mod) access the API and download packs.</p>
|
|
|
|
<form method="post" action="{% url 'profiles:token_create' %}" class="token-create">
|
|
{% csrf_token %}
|
|
<input type="text" name="label" placeholder="Token label (e.g. Fabric updater)" required>
|
|
<button type="submit">Create token</button>
|
|
</form>
|
|
|
|
{% if tokens %}
|
|
<table class="token-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Label</th>
|
|
<th>Token</th>
|
|
<th>Created</th>
|
|
<th>Last used</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for token in tokens %}
|
|
<tr>
|
|
<td>{{ token.label }}</td>
|
|
<td><code>{{ token.token }}</code></td>
|
|
<td>{{ token.created_at }}</td>
|
|
<td>{{ token.last_used|default:"never" }}</td>
|
|
<td>
|
|
<form method="post" action="{% url 'profiles:token_delete' token.id %}">
|
|
{% csrf_token %}
|
|
<button type="submit">Revoke</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<p>No tokens yet.</p>
|
|
{% endif %}
|
|
{% endblock %} |