| 1 |
{% extends "django_mailman3/profile/base.html" %} |
| 2 |
|
| 3 |
{% load i18n %} |
| 4 |
{% load bootstrap_tags %} |
| 5 |
|
| 6 |
{% block head_title %}{% trans "Account" %}{% endblock %} |
| 7 |
|
| 8 |
{% block user_profile_content %} |
| 9 |
|
| 10 |
{% if user.emailaddress_set.all %} |
| 11 |
<p>{% trans 'The following e-mail addresses are associated with your account:' %}</p> |
| 12 |
|
| 13 |
<form action="{% url 'account_email' %}" class="email_list" method="post"> |
| 14 |
{% csrf_token %} |
| 15 |
<fieldset class="blockLabels"> |
| 16 |
|
| 17 |
{% for emailaddress in user.emailaddress_set.all %} |
| 18 |
<div class="ctrlHolder radio"> |
| 19 |
<label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}"> |
| 20 |
|
| 21 |
<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}}"/> |
| 22 |
|
| 23 |
{{ emailaddress.email }} |
| 24 |
{% if emailaddress.verified %} |
| 25 |
<span class="badge bg-success">{% trans "Verified" %}</span> |
| 26 |
{% else %} |
| 27 |
<span class="badge bg-warning">{% trans "Unverified" %}</span> |
| 28 |
{% endif %} |
| 29 |
{% if emailaddress.primary %}<span class="badge bg-primary">{% trans "Primary" %}</span>{% endif %} |
| 30 |
</label> |
| 31 |
</div> |
| 32 |
{% endfor %} |
| 33 |
|
| 34 |
<div class="form-group buttonHolder"> |
| 35 |
<button class="btn btn-outline-primary secondaryAction" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button> |
| 36 |
<button class="btn btn-outline-primary secondaryAction" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button> |
| 37 |
<button class="btn btn-danger primaryAction" type="submit" name="action_remove" >{% trans 'Remove' %}</button> |
| 38 |
</div> |
| 39 |
|
| 40 |
</fieldset> |
| 41 |
</form> |
| 42 |
|
| 43 |
{% else %} |
| 44 |
<p><strong>{% trans 'Warning:'%}</strong> {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}</p> |
| 45 |
|
| 46 |
{% endif %} |
| 47 |
|
| 48 |
|
| 49 |
<h3>{% trans "Add E-mail Address" %}</h3> |
| 50 |
|
| 51 |
<form method="post" action="{% url 'account_email' %}" class="add_email form-horizontal"> |
| 52 |
{% bootstrap_form_horizontal form 2 4 %} |
| 53 |
<div class="form-group"> |
| 54 |
<div class="col-lg-offset-2 col-lg-10"> |
| 55 |
<button class="btn btn-primary" name="action_add" type="submit">{% trans "Add E-mail" %}</button> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
</form> |
| 59 |
|
| 60 |
{% endblock %} |
| 61 |
|
| 62 |
|
| 63 |
{% block extra_body %} |
| 64 |
<script type="text/javascript"> |
| 65 |
(function() { |
| 66 |
var message = "{% trans 'Do you really want to remove the selected e-mail address?' %}"; |
| 67 |
var actions = document.getElementsByName('action_remove'); |
| 68 |
if (actions.length) { |
| 69 |
actions[0].addEventListener("click", function(e) { |
| 70 |
if (! confirm(message)) { |
| 71 |
e.preventDefault(); |
| 72 |
} |
| 73 |
}); |
| 74 |
} |
| 75 |
})(); |
| 76 |
</script> |
| 77 |
{% endblock %} |