MarseyWorld/files/templates/admin/badge_admin.html

98 lines
2.8 KiB
HTML
Raw Normal View History

2022-05-04 23:09:46 +00:00
{% extends "default.html" %}
{% if grant %}
{% set title="Badge Grant" %}
{% else %}
{% set title="Badge Remove" %}
{% endif %}
{% block pagetitle %}{{title}}{% endblock %}
2022-05-04 23:09:46 +00:00
{% block pagetype %}message{% endblock %}
{% block content %}
{% if error %}
<div class="alert alert-danger alert-dismissible fade show my-3" role="alert">
<i class="fas fa-exclamation-circle my-auto"></i>
<span>
{{error}}
</span>
2022-10-28 23:35:14 +00:00
<button type="button" class="close" data-bs-dismiss="alert" aria-label="Close">
2022-09-08 17:24:00 +00:00
<span aria-hidden="true"><i class="far fa-times"></i></span>
2022-05-04 23:09:46 +00:00
</button>
</div>
{% endif %}
{% if msg %}
<div class="alert alert-success alert-dismissible fade show my-3" role="alert">
<i class="fas fa-check-circle my-auto" aria-hidden="true"></i>
<span>
{{msg}}
</span>
2022-10-28 23:35:14 +00:00
<button type="button" class="close" data-bs-dismiss="alert" aria-label="Close">
2022-09-08 17:24:00 +00:00
<span aria-hidden="true"><i class="far fa-times"></i></span>
2022-05-04 23:09:46 +00:00
</button>
</div>
{% endif %}
<h5 class="mt-2">{{title}}</h5>
2022-05-04 23:09:46 +00:00
{% if grant %}
{% set form_action="/admin/badge_grant" %}
{% else %}
{% set form_action="/admin/badge_remove" %}
{% endif %}
2022-05-04 23:09:46 +00:00
<form action="{{form_action}}", method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
2022-05-04 23:09:46 +00:00
<label for="input-username">Username</label><br>
<input autocomplete="off" id="input-username" class="form-control" type="text" name="username" required>
<div class="overflow-x-auto"><table class="table table-striped">
<thead class="bg-primary text-white">
<tr>
<th scope="col">Select</th>
<th scope="col">Image</th>
<th scope="col">Name</th>
<th scope="col">Default Description</th>
</tr>
</thead>
<tbody>
{% for badge in badge_types %}
<tr>
<td>
<div class="custom-control">
<input autocomplete="off" class="custom-control-input" type="radio" id="{{badge.id}}" name="badge_id" value="{{badge.id}}">
<label class="custom-control-label" for="{{badge.id}}"></label>
</div>
</td>
2022-08-25 17:50:18 +00:00
<td>
<label for="badge-{{badge.id}}">
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}?b=4" width=64.16 height=70>
2022-08-25 17:50:18 +00:00
</label>
</td>
2022-05-04 23:09:46 +00:00
<td>{{badge.name}}</td>
<td>{{badge.description}}</td>
</tr>
{% endfor %}
</table>
{% if grant %}
2022-05-04 23:09:46 +00:00
<label for="input-url">URL</label><br>
<input autocomplete="off" id="input-url" class="form-control" type="text" name="url" type="url" placeholder="Optional">
<label for="input-description">Custom description</label><br>
<input autocomplete="off" id="input-description" class="form-control" type="text" name="description" placeholder="Leave blank for badge default">
{% endif %}
2022-09-20 15:44:45 +00:00
<input autocomplete="off" class="btn btn-primary mt-3" type="submit" onclick="disable(this)">
2022-05-04 23:09:46 +00:00
</form>
<style>
@media (max-width: 767.98px) {
table {
display: inline-block;
overflow: auto;
}
}
</style>
{% endblock %}