2022-05-04 23:09:46 +00:00
{% extends "default.html" %}
2022-11-21 08:52:22 +00:00
{% block pagetitle %}{{"Badge Grant" if grant else "Badge Remove"}}{% endblock %}
2022-05-04 23:09:46 +00:00
{% block pagetype %}message{% endblock %}
{% block content %}
2022-12-11 23:44:34 +00:00
2023-01-01 05:55:16 +00:00
< link rel = "stylesheet" href = "{{('css/admin/badges.css') | asset}}" >
2022-12-11 23:44:34 +00:00
{% if error %}{{macros.alert(error, true)}}{% endif %}
{% if msg %}{{macros.alert(msg, false)}}{% endif %}
2022-05-04 23:09:46 +00:00
2022-11-21 08:52:22 +00:00
{% set form_action = "/admin/badge_grant" if grant else "/admin/badge_remove" %}
2022-05-04 23:09:46 +00:00
2022-10-29 06:11:05 +00:00
< form action = "{{form_action}}" method = "post" >
2023-01-24 05:10:16 +00:00
< input hidden name = "formkey" value = "{{v|formkey}}" >
2022-05-04 23:09:46 +00:00
2023-08-04 16:50:29 +00:00
< div class = "overflow-x-auto mt-4" > < table class = "table table-striped" >
2022-05-04 23:09:46 +00:00
< thead class = "bg-primary text-white" >
< tr >
2022-12-10 08:47:15 +00:00
< th > Select< / th >
< th > Image< / th >
< th > Name< / th >
< th > Default Description< / th >
2022-05-04 23:09:46 +00:00
< / tr >
< / thead >
< tbody >
{% for badge in badge_types %}
< tr >
< td >
< div class = "custom-control" >
2022-11-01 20:12:05 +00:00
< input autocomplete = "off" class = "custom-control-input" type = "radio" id = "{{badge.id}}" name = "badge_id" value = "{{badge.id}}" required >
2022-05-04 23:09:46 +00:00
< label class = "custom-control-label" for = "{{badge.id}}" > < / label >
2023-01-01 11:36:20 +00:00
< / div >
2022-05-04 23:09:46 +00:00
< / td >
2022-08-25 17:50:18 +00:00
< td >
< label for = "badge-{{badge.id}}" >
2023-03-15 04:05:59 +00:00
< img class = "contain" alt = "{{badge.name}}" loading = "lazy" src = "{{badge.path}}" 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 >
2023-08-03 04:42:58 +00:00
< label for = "input-usernames" > Usernames< / label >
2023-08-05 10:24:37 +00:00
{% set usernames = request.values.get('usernames') %}
< input autocomplete = "off" id = "input-usernames" class = "form-control" type = "text" name = "usernames" placeholder = "Required (separated by space)" { % if usernames % } value = "{{usernames}}" { % endif % } required >
2023-08-03 04:34:46 +00:00
2022-10-29 06:08:29 +00:00
{% if grant %}
2023-08-03 04:34:46 +00:00
< label class = "mt-2" for = "input-url" > URL< / label >
2022-05-04 23:09:46 +00:00
< input autocomplete = "off" id = "input-url" class = "form-control" type = "text" name = "url" type = "url" placeholder = "Optional" >
2023-08-03 04:34:46 +00:00
< label class = "mt-2" for = "input-description" > Custom description< / label >
2023-08-03 04:42:58 +00:00
< input autocomplete = "off" id = "input-description" class = "form-control" type = "text" name = "description" placeholder = "Optional" >
2022-10-29 06:08:29 +00:00
{% endif %}
2023-03-07 00:21:08 +00:00
< input autocomplete = "off" class = "btn btn-primary mt-3" type = "submit" >
2022-05-04 23:09:46 +00:00
< / form >
{% endblock %}