2024-02-14 21:59:31 +00:00
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/forms.css') }}" />
|
|
|
|
|
|
|
|
<div id="form-wrapper">
|
|
|
|
<h2>Update User</h2>
|
2024-02-14 22:13:34 +00:00
|
|
|
{% if updating_user != None %}
|
|
|
|
<form class="input-form" action="{{ url_for('main.users.update', id=updating_user.id) }}" method="POST">
|
2024-02-14 21:59:31 +00:00
|
|
|
<div class="form-row">
|
2024-02-14 22:13:34 +00:00
|
|
|
<input type="text" id="firstname" name="firstname" placeholder="First Name" value="{{updating_user.firstName}}" required>
|
|
|
|
<input type="text" id="lastname" name="lastname" placeholder="Last Name" value="{{updating_user.lastName}}" required>
|
2024-02-14 21:59:31 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
2024-02-14 22:13:34 +00:00
|
|
|
<input type="text" id="username" name="username" placeholder="Username" value="{{updating_user.username}}" required>
|
|
|
|
<input type="email" id="email" name="email" placeholder="Email Address" value="{{updating_user.email}}" required>
|
2024-02-14 21:59:31 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
2024-02-14 22:13:34 +00:00
|
|
|
<input type="tel" id="phone" name="phone" placeholder="Telephone Number" value="{{updating_user.phone}}" required>
|
2024-02-14 21:59:31 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
|
|
|
<select name="role" id="role">
|
|
|
|
{% for role in roles %}
|
2024-02-14 22:13:34 +00:00
|
|
|
{% if role == updating_user.role %}
|
2024-02-14 21:59:31 +00:00
|
|
|
<option value="{{role}}" selected>{{role}}</option>
|
|
|
|
{% else %}
|
|
|
|
<option value="{{role}}">{{role}}</option>
|
|
|
|
{% endif%}
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
|
|
|
<input type="submit" id="Update" value="Update User">
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% else %}
|
|
|
|
<p>No user found with the given ID.</p>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div id="form-footer">
|
|
|
|
<p>Already have an account? <a href="{{ url_for('main.users.display_login') }}">Login</a><p>
|
|
|
|
</div>
|
|
|
|
</div>
|