Further work on email settings page

This commit is contained in:
Oliver 2021-11-02 12:49:44 +11:00
parent d1f2d960be
commit ec147ea25f

View File

@ -45,50 +45,51 @@
</div> </div>
</div> </div>
<div> <div class='row'>
{% if user.emailaddress_set.all %} <div class='col-sm-6'>
<p>{% trans 'The following email addresses are associated with your account:' %}</p> {% if user.emailaddress_set.all %}
<p>{% trans 'The following email addresses are associated with your account:' %}</p>
<form action="{% url 'account_email' %}" class="email_list" method="post"> <form action="{% url 'account_email' %}" class="email_list" method="post">
{% csrf_token %} {% csrf_token %}
<fieldset class="blockLabels"> <fieldset class="blockLabels">
{% for emailaddress in user.emailaddress_set.all %} {% for emailaddress in user.emailaddress_set.all %}
<div class="ctrlHolder"> <div class="ctrlHolder">
<label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}"> <label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}">
<input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary or user.emailaddress_set.count == 1 %}checked="checked"{%endif %} value="{{emailaddress.email}}"/> <input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary or user.emailaddress_set.count == 1 %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
{{ emailaddress.email }} {{ emailaddress.email }}
{% if emailaddress.verified %} {% if emailaddress.verified %}
<span class="verified">{% trans "Verified" %}</span> <span class="verified">{% trans "Verified" %}</span>
{% else %} {% else %}
<span class="unverified">{% trans "Unverified" %}</span> <span class="unverified">{% trans "Unverified" %}</span>
{% endif %} {% endif %}
{% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %} {% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %}
</label> </label>
</div>
{% endfor %}
<div class="buttonHolder">
<button class="btn btn-primary secondaryAction" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
<button class="btn btn-primary secondaryAction" type="submit" name="action_send" {% if not mail_conf %}disabled{% endif %}>{% trans 'Re-send Verification' %}</button>
<button class="btn btn-primary primaryAction" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
</div> </div>
{% endfor %}
<div class="buttonHolder"> </fieldset>
<button class="btn btn-primary secondaryAction" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button> </form>
<button class="btn btn-primary secondaryAction" type="submit" name="action_send" {% if not mail_conf %}disabled{% endif %}>{% trans 'Re-send Verification' %}</button>
<button class="btn btn-primary primaryAction" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
</div>
</fieldset> {% else %}
</form> <p><strong>{% trans 'Warning:'%}</strong>
{% trans "You currently do not have any email address set up. You should really add an email address so you can receive notifications, reset your password, etc." %}
</p>
{% else %} {% endif %}
<p><strong>{% trans 'Warning:'%}</strong> </div>
{% trans "You currently do not have any email address set up. You should really add an email address so you can receive notifications, reset your password, etc." %} <div class='col-sm-6'>
</p> {% if can_add_email %}
<h5>{% trans "Add Email Address" %}</h5>
{% endif %}
{% if can_add_email %}
<br>
<h4>{% trans "Add Email Address" %}</h4>
<form method="post" action="{% url 'account_email' %}" class="add_email"> <form method="post" action="{% url 'account_email' %}" class="add_email">
{% csrf_token %} {% csrf_token %}
@ -106,7 +107,7 @@
</form> </form>
{% endif %} {% endif %}
<br> </div>
</div> </div>
<div class='panel-heading'> <div class='panel-heading'>
@ -168,26 +169,26 @@
<div class='row'> <div class='row'>
<form action='{% url "settings-appearance" %}' method='post'> <div class='col-sm-6'>
{% csrf_token %} <form action='{% url "settings-appearance" %}' method='post'>
<input name='next' type='hidden' value='{% url "settings" %}'> {% csrf_token %}
<div class="col-sm-6" style="width: 200px;"> <input name='next' type='hidden' value='{% url "settings" %}'>
<div id="div_id_themes" class="form-group"> <label for='theme' class=' requiredField'>
<div class="controls "> {% trans "Select theme" %}
<select name='theme' class='select form-control'> </label>
{% get_available_themes as themes %} <div class='form-group input-group mb-3'>
{% for theme in themes %} <select id='theme' name='theme' class='select form-control'>
<option value='{{ theme.key }}'>{{ theme.name }}</option> {% get_available_themes as themes %}
{% endfor %} {% for theme in themes %}
</select> <option value='{{ theme.key }}'>{{ theme.name }}</option>
{% endfor %}
</select>
<div class='input-group-append'>
<input type="submit" value="{% trans 'Set Theme' %}" class="btn btn-primary">
</div> </div>
</div> </div>
</div> </form>
<div class="col-sm-6" style="width: auto;"> </div>
<input type="submit" value="{% trans 'Set Theme' %}" class="btn btn btn-primary">
</div>
</form>
</div> </div>
<div class='panel-heading'> <div class='panel-heading'>
@ -199,7 +200,10 @@
<form action="{% url 'set_language' %}" method="post"> <form action="{% url 'set_language' %}" method="post">
{% csrf_token %} {% csrf_token %}
<input name="next" type="hidden" value="{% url 'settings' %}"> <input name="next" type="hidden" value="{% url 'settings' %}">
<div class="col-sm-6" style="width: 200px;"><div id="div_id_language" class="form-group"><div class="controls "> <label for='language' class=' requiredField'>
{% trans "Select language" %}
</label>
<div class='form-group input-group mb-3'>
<select name="language" class="select form-control"> <select name="language" class="select form-control">
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %} {% get_available_languages as LANGUAGES %}
@ -217,11 +221,11 @@
</option> </option>
{% endfor %} {% endfor %}
</select> </select>
</div></div></div> <div class='input-group-append'>
<div class="col-sm-6" style="width: auto;"> <input type="submit" value="{% trans 'Set Language' %}" class="btn btn btn-primary">
<input type="submit" value="{% trans 'Set Language' %}" class="btn btn btn-primary"> </div>
</div> </div>
</form> </form>
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<h4>{% trans "Help the translation efforts!" %}</h4> <h4>{% trans "Help the translation efforts!" %}</h4>