NDOJ/templates/user/edit-profile.html

185 lines
5.1 KiB
HTML
Raw Permalink Normal View History

2020-01-21 06:35:58 +00:00
{% extends "user/user-base.html" %}
{% block user_media %}
2023-01-27 23:11:10 +00:00
{% include "timezone/media-css.html" %}
{{ form.media.css }}
<style>
.sortedm2m-container, .sortedm2m-container p.selector-filter {
width: 300px;
}
.sortedm2m-container p.selector-filter input {
width: 262px;
}
ul.sortedm2m {
width: 284px;
min-height: 70px;
max-height: 200px;
height: 70px
}
.inline-header {
float: left;
font-size: 1.1em;
padding: 4px 8px;
padding-left: 0;
}
.block-header {
font-size: 1.1em;
}
.fullwidth {
display: block;
overflow: hidden;
}
#edit-form {
border: unset;
background: unset;
max-width: 700px;
}
#center-float {
position: relative;
2023-08-24 04:30:17 +00:00
width: 100%;
display: flex;
justify-content: center;
2023-01-27 23:11:10 +00:00
}
2023-08-25 20:36:38 +00:00
.main-info tr td {
padding-bottom: 1em;
}
2023-01-27 23:11:10 +00:00
</style>
2020-01-21 06:35:58 +00:00
{% endblock %}
{% block js_media %}
2023-01-27 23:11:10 +00:00
{% include "timezone/media-js.html" %}
{{ form.media.js }}
<script type="text/javascript">
$(function () {
$('#disable-2fa-button').click(function () {
alert("The administrators for this site require all the staff to have two-factor authentication enabled, so it may not be disabled at this time.");
});
});
</script>
2020-01-21 06:35:58 +00:00
{% endblock %}
{% block title_ruler %}{% endblock %}
{% block title_row %}
2023-01-27 23:11:10 +00:00
{% set tab = 'edit' %}
{% set user = request.profile %}
{% include "user/user-tabs.html" %}
2020-01-21 06:35:58 +00:00
{% endblock %}
{% block body %}
2023-01-27 23:11:10 +00:00
<div id="center-float">
2023-08-24 03:14:09 +00:00
<form id="edit-form" action="" method="post" class="form-area" enctype="multipart/form-data">
2024-04-27 03:51:16 +00:00
{% if form.errors or form_user.errors or form_info.errors %}
2023-01-27 23:11:10 +00:00
<div class="alert alert-danger alert-dismissable">
<a href="#" class="close">x</a>
2023-08-24 03:14:09 +00:00
{{ form.errors }}
<br>
2024-04-27 03:51:16 +00:00
{{ form_info.errors }}
<br>
2023-08-24 03:14:09 +00:00
{{ form_user.errors }}
2023-01-27 23:11:10 +00:00
</div>
{% endif %}
{% csrf_token %}
2023-08-25 20:36:38 +00:00
<table class="block-header grayed main-info">
2023-01-27 23:11:10 +00:00
<tr>
2024-04-27 03:51:16 +00:00
<td> {{ _('Full name') }}: </td>
2023-01-27 23:11:10 +00:00
<td> {{ form_user.first_name }} </td>
</tr>
<tr>
<td> {{ _('School') }}: </td>
<td> {{ form_user.last_name }} </td>
</tr>
2024-04-27 03:51:16 +00:00
<tr>
<td> {{ _('Date of birth') }}: </td>
<td> {{ form_info.date_of_birth }} </td>
</tr>
<tr>
<td> {{ _('Address') }}: </td>
<td> {{ form_info.address }} </td>
</tr>
<tr>
<td> {{ _('T-Shirt size') }}: </td>
<td> {{ form_info.tshirt_size }} </td>
</tr>
2023-08-24 03:14:09 +00:00
<tr>
2023-08-25 20:36:38 +00:00
<td> {{ _('Password') }}: </td>
<td>
<a href="{{ url('password_change') }}">
{{ _('Change your password') }}
</a>
</td>
</tr>
<tr>
<td> {{ _('Email') }}: </td>
<td>
{{ request.user.email }}
<a href="{{ url('email_change') }}">
({{ _('Change email') }})
</a>
</td>
</tr>
<tr>
<td>{{ _('Avatar') }}: </td>
<td>{{ form.profile_image }}</td>
2023-08-24 03:14:09 +00:00
</tr>
2023-01-27 23:11:10 +00:00
</table>
<hr>
<div style="padding-top:0.5em" class="block-header">{{ _('Self-description') }}:</div>
{{ form.about }}
<hr>
<table border="0" style="padding-top:0.7em">
<tr>
<td style="vertical-align:top;">
<table style="padding-right:0.8em">
<tr title="{{ _('Select your closest major city') }}">
<td><label class="inline-header grayed">{{ _('Timezone') }}:</label></td>
<td><span class="fullwidth">{{ form.timezone }}</span></td>
</tr>
<tr>
<td><label class="inline-header grayed">{{ _('Preferred language') }}:</label></td>
<td><span class="fullwidth">{{ form.language }}</span></td>
</tr>
<tr>
<td><label class="inline-header grayed">{{ _('Editor theme') }}:</label></td>
<td><span class="fullwidth">{{ form.ace_theme }}</span></td>
</tr>
2020-01-21 06:35:58 +00:00
</table>
2023-01-27 23:11:10 +00:00
</td>
</tr>
</table>
2023-08-25 20:36:38 +00:00
<br>
2023-01-27 23:11:10 +00:00
<div>
{% if profile.is_totp_enabled %}
{{ _('Two Factor Authentication is enabled.') }}
{% if require_staff_2fa and request.user.is_staff %}
<a id="disable-2fa-button" class="button inline-button">Disable</a>
{% else %}
2023-08-25 20:36:38 +00:00
<a href="{{ url('disable_2fa') }}" class="button inline-button">{{_('Disable')}}</a>
2023-01-27 23:11:10 +00:00
{% endif %}
{% else %}
{{ _('Two Factor Authentication is disabled.') }}
2023-08-25 20:36:38 +00:00
<a href="{{ url('enable_2fa') }}" class="button inline-button">{{_('Enable')}}</a>
2023-01-27 23:11:10 +00:00
{% endif %}
</div>
<br><hr>
2023-09-02 00:42:58 +00:00
<span class="block-header">{{ _('CSS background') }}:</span>
{{ form.css_background }}
<div><i>{{form.css_background.help_text}}</i></div>
<br><br>
2023-01-27 23:11:10 +00:00
<input type="submit" style="float:right" value="{{ _('Update profile') }}">
</form>
</div>
2020-01-21 06:35:58 +00:00
{% endblock %}