Frontend improvements

This commit is contained in:
2024-02-16 15:30:00 +01:00
parent 799bb0c796
commit d2ab905185
2 changed files with 48 additions and 34 deletions

View File

@ -6,12 +6,15 @@
{% block navbar_center %} {% block navbar_center %}
<div class="dropdown"> <div class="dropdown">
<button class="btn btn-outline-danger dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <button class="btn btn-outline-danger dropdown-toggle" type="button" data-bs-toggle="dropdown"
aria-expanded="false">
{{ chosenusername }} {{ chosenusername }}
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item" href="/race/Everyone">Everyone</a></li> <li><a class="dropdown-item" href="/race/Everyone">Everyone</a></li>
<li><hr class="dropdown-divider"></li> <li>
<hr class="dropdown-divider">
</li>
{% for user in users %} {% for user in users %}
<li><a class="dropdown-item" href="/race/{{ user.name }}">{{ user.name }}</a></li> <li><a class="dropdown-item" href="/race/{{ user.name }}">{{ user.name }}</a></li>
{% endfor %} {% endfor %}
@ -25,7 +28,11 @@
<thead> <thead>
<tr> <tr>
<th scope="col" rowspan="2" class="text-center" style="width: 200px;">Race</th> <th scope="col" rowspan="2" class="text-center" style="width: 200px;">Race</th>
<th scope="col" colspan="{{ chosenusers | length }}" class="text-center">Call</th>
{% if chosenusers | length > 0 %}
<th scope="col" colspan="{{ chosenusers | length }}" class="text-center">Call</th>
{% endif %}
<th scope="col" rowspan="2" class="text-center" style="width: 200px;">Result</th> <th scope="col" rowspan="2" class="text-center" style="width: 200px;">Result</th>
</tr> </tr>
</thead> </thead>
@ -37,7 +44,7 @@
<td>&nbsp;</td> <td>&nbsp;</td>
{% for user in chosenusers %} {% for user in chosenusers %}
<td class="text-center text-nowrap">{{ user.name }}</td> <td class="text-center text-nowrap" style="min-width: 100px;">{{ user.name }}</td>
{% endfor %} {% endfor %}
<td>&nbsp;</td> <td>&nbsp;</td>

View File

@ -13,7 +13,8 @@
<form action="/adduser" method="post"> <form action="/adduser" method="post">
<div class="input-group"> <div class="input-group">
<div class="form-floating"> <div class="form-floating">
<input type="text" class="form-control" id="select-add-user" name="select-add-user" placeholder="Username:"> <input type="text" class="form-control" id="select-add-user" name="select-add-user"
placeholder="Username:">
<label for="select-add-user">Username:</label> <label for="select-add-user">Username:</label>
</div> </div>
@ -23,41 +24,47 @@
</div> </div>
</div> </div>
<div class="card mt-2"> {% if users | length > 0 %}
<div class="card-body"> <div class="card mt-2">
<h5 class="card-title">Registered Users</h5> <div class="card-body">
<h5 class="card-title">Registered Users</h5>
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
{% for user in users %} {% for user in users %}
<li class="list-group-item">{{ user.name }}</li> <li class="list-group-item">{{ user.name }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
</div>
</div> </div>
</div>
<div class="card mt-2"> <div class="card mt-2">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Delete User</h5> <h5 class="card-title">Delete User</h5>
<form action="/deleteuser" method="post"> <form action="/deleteuser" method="post">
<div class="input-group"> <div class="input-group">
<select class="form-control form-select" aria-label="select-delete-user" name="select-delete-user"> <select class="form-control form-select" aria-label="select-delete-user"
<option selected="selected">Select User</option> name="select-delete-user">
{% for user in users %} <option selected="selected" disabled="disabled" hidden="hidden">Select User</option>
<option value="{{ user.name }}">{{ user.name }}</option> {% for user in users %}
{% endfor %} <option value="{{ user.name }}">{{ user.name }}</option>
</select> {% endfor %}
</select>
<input type="submit" class="form-control btn btn-danger" value="Delete" style="max-width: 200px;"> <input type="submit" class="form-control btn btn-danger" value="Delete"
</div> style="max-width: 200px;">
</div>
<div class="form-text"> <div class="form-text">
"Deleting" a user just hides it from the user interface without deleting any inputs, your "pERsoNaL "Deleting" a user just hides it from the user interface without deleting any inputs, your
DaTa" belongs to ME now.<br> "pERsoNaL
Re-adding a user with the same name will "restore" it. That doesn't mean you're allowed to remove everyone though. DaTa" belongs to ME now.<br>
</div> Re-adding a user with the same name will "restore" it. That doesn't mean you're allowed to
</form> remove everyone though.
</div>
</form>
</div>
</div> </div>
</div> {% endif %}
{% endblock body %} {% endblock body %}