2018-07-07 15:11:27 +02:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block main %}
|
|
|
|
|
|
|
|
<section id="moduser-account">
|
2024-12-07 15:50:37 +01:00
|
|
|
<h1>Modify {{ user.name }}</h1>
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2018-07-09 22:38:39 +02:00
|
|
|
<form id="moduser-account-form" method="post" action="/moduser?change=update" enctype="multipart/form-data" accept-charset="UTF-8">
|
2024-12-07 15:50:37 +01:00
|
|
|
<label class="form-label" for="moduser-account-username">Username: </label>
|
|
|
|
<input class="form-control" id="moduser-account-username" type="text" name="username" value="{{ user.name }}" /><br/>
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<label class="form-label" for="moduser-account-email">E-Mail: </label>
|
|
|
|
<input class="form-control" id="moduser-account-email" type="text" name="email" value="{% if user.email is not none %}{{ user.email }}{% endif %}" /><br/>
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<label class="form-label" for="moduser-account-password">Password: </label>
|
|
|
|
<input class="form-control" id="moduser-account-password" type="password" name="password" /><br/>
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<label class="form-label" for="moduser-account-receipt-pref">Receipts: </label>
|
|
|
|
<select class="form-select" id="moduser-account-receipt-pref" name="receipt_pref">
|
2018-08-31 20:57:08 +02:00
|
|
|
{% for pref in receipt_preference_class %}
|
|
|
|
<option value="{{ pref.value }}" {% if user.receipt_pref == pref %} selected="selected" {% endif %}>{{ pref.human_readable }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2018-09-08 21:05:03 +02:00
|
|
|
{% if config_smtp_enabled != '1' %}Sending receipts is disabled by your administrator.{% endif %}
|
2018-08-31 20:57:08 +02:00
|
|
|
<br/>
|
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<div class="form-check">
|
|
|
|
<input class="form-check-input" id="moduser-account-ismember" name="ismember" type="checkbox" {% if user.is_member %} checked="checked" {% endif %}>
|
|
|
|
<label class="form-check-label" for="moduser-account-ismember">Member</label>
|
|
|
|
</div>
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<div class="form-check">
|
|
|
|
<input class="form-check-input" id="moduser-account-isadmin" name="isadmin" type="checkbox" {% if user.is_admin %} checked="checked" {% endif %}/>
|
|
|
|
<label class="form-check-label" for="moduser-account-isadmin">Admin</label>
|
|
|
|
</div>
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<div class="form-check">
|
|
|
|
<input class="form-check-input" id="admin-myaccount-logout-after-purchase" type="checkbox" name="logout_after_purchase" {% if user.logout_after_purchase %} checked="checked" {% endif %}/>
|
|
|
|
<label class="form-check-label" for="admin-myaccount-logout-after-purchase">Logout after purchase</label>
|
|
|
|
</div>
|
2024-04-09 22:35:37 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<label class="form-label" for="moduser-account-balance">Balance: </label>
|
|
|
|
<div class="input-group mb-3">
|
|
|
|
<span class="input-group-text">CHF</span>
|
|
|
|
<input class="form-control" id="moduser-account-balance" name="balance" type="number" step="0.01" value="{{ user.balance|chf(False) }}" />
|
|
|
|
</div>
|
2018-07-07 15:11:27 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<label class="form-label" for="moduser-account-balance-reason">Reason for balance modification: </label>
|
|
|
|
<input class="form-control" id="moduser-account-balance-reason" type="text" name="reason" placeholder="Shows up on receipt" /><br/>
|
2018-09-01 23:48:10 +02:00
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<label class="form-label" for="moduser-account-avatar">
|
2023-03-25 22:51:57 +01:00
|
|
|
<img src="/static/upload/thumbnails/users/{{ user.id }}.png?cacheBuster={{ now }}" alt="Avatar of {{ user.name }}" />
|
2018-07-07 15:11:27 +02:00
|
|
|
</label><br/>
|
2024-12-07 15:50:37 +01:00
|
|
|
<input class="form-control" id="moduser-account-avatar" type="file" name="avatar" accept="image/*" /><br/>
|
2018-07-07 15:11:27 +02:00
|
|
|
|
|
|
|
<input id="moduser-account-userid" type="hidden" name="userid" value="{{ user.id }}" /><br/>
|
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<input class="btn btn-primary" type="submit" value="Save changes">
|
2018-07-07 15:11:27 +02:00
|
|
|
</form>
|
|
|
|
|
2024-12-01 21:58:16 +01:00
|
|
|
<h2>Tokens</h2>
|
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<table class="table table-striped">
|
2024-12-01 21:58:16 +01:00
|
|
|
<tr>
|
|
|
|
<th>Token</th>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Created</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
{% for token in tokens %}
|
|
|
|
<tr>
|
|
|
|
<td>••••••••</td>
|
|
|
|
<td>{{ token.name }}</td>
|
|
|
|
<td>{{ token.date }}</td>
|
2024-12-07 15:50:37 +01:00
|
|
|
<td><a class="btn btn-danger" href="/moduser?change=deltoken&token={{ token.id }}">Delete</a></td>
|
2024-12-01 21:58:16 +01:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
|
2024-12-07 15:50:37 +01:00
|
|
|
<h2>Delete Account</h2>
|
|
|
|
|
2018-07-09 22:38:39 +02:00
|
|
|
<form id="moduser-deluser-form" method="post" action="/moduser?change=del" accept-charset="UTF-8">
|
2018-07-07 15:11:27 +02:00
|
|
|
<input id="moduser-deluser-userid" type="hidden" name="userid" value="{{ user.id }}" /><br/>
|
2024-12-07 15:50:37 +01:00
|
|
|
<input class="btn btn-danger" type="submit" value="Delete user account {{ user.name }}" />
|
2018-07-07 15:11:27 +02:00
|
|
|
</form>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
{{ super() }}
|
|
|
|
|
|
|
|
{% endblock %}
|