Replace type UserID with a structure

This commit is contained in:
2022-04-19 19:40:36 +02:00
parent feb6db09b9
commit 94aeefe450
8 changed files with 17 additions and 15 deletions

View File

@ -5,7 +5,7 @@
<tbody>
<tr>
<th scope="row">User ID</th>
<td>{{ u.uid }}</td>
<td>{{ u.uid.0 }}</td>
</tr>
<tr>
<th scope="row">First name</th>

View File

@ -6,7 +6,7 @@
<div class="form-group">
<label class="form-label mt-4" for="userID">User ID</label>
<input class="form-control" id="userID" type="text" readonly=""
name="uid" value="{{ u.uid }}"/>
name="uid" value="{{ u.uid.0 }}"/>
</div>
<!-- User name -->
@ -145,7 +145,7 @@
return;
const userID = await find_username(usernameEl.value);
usernameEl.classList.add((userID === null || userID === "{{ u.uid }}") ? "is-valid" : "is-invalid");
usernameEl.classList.add((userID === null || userID === "{{ u.uid.0 }}") ? "is-valid" : "is-invalid");
} catch(e) {
console.error(e);

View File

@ -19,7 +19,7 @@
</thead>
<tbody>
{% for u in users %}
<tr id="row-user-{{ u.uid }}">
<tr id="row-user-{{ u.uid.0 }}">
<td>{{ u.username }}</td>
<td>{{ u.first_name }}</td>
<td>{{ u.last_name }}</td>
@ -27,8 +27,8 @@
<td>{% if u.admin %}Admin{% else %}Regular user{% endif %}</td>
<td>{% if u.enabled %}Enabled{% else %}Disabled{% endif %}</td>
<td>
<a href="/admin/edit_user?id={{ u.uid }}">Edit</a>
<a href="javascript:delete_user('{{ u.uid }}', '{{ u.username }}')">Delete</a>
<a href="/admin/edit_user?id={{ u.uid.0 }}">Edit</a>
<a href="javascript:delete_user('{{ u.uid.0 }}', '{{ u.username }}')">Delete</a>
</td>
</tr>
{% endfor %}