2015-01-17 23:08:41 +01:00
{% extends "account/base.html" %}
{% load i18n crispy_forms_tags %}
2023-04-16 22:11:32 +02:00
{% block title %}{% translate "Account" %}{% endblock title %}
{% block page_title %}{% translate "E-mail Addresses" %}{% endblock page_title %}
2015-01-17 23:08:41 +01:00
{% block content %}
{% if user.emailaddress_set.all %}
2023-04-16 22:11:32 +02:00
< p > {% translate 'The following e-mail addresses are associated with your account:' %}< / p >
2015-01-17 23:08:41 +01:00
< form action = "{% url 'account_email' %}" class = "email_list" method = "post" >
{% csrf_token %}
< table class = "table table-condensed" >
< thead >
< tr >
2023-04-16 22:11:32 +02:00
< th > {% translate "Email address" %}< / th >
< th > {% translate "Verified" %}< / th >
< th > {% translate "Primary" %}< / th >
2015-01-17 23:08:41 +01:00
< / tr >
< / thead >
< tbody >
{% for emailaddress in user.emailaddress_set.all %}
< tr >
< td > {{ emailaddress.email }}< / td >
< td >
{% if emailaddress.verified %}
2023-04-16 22:11:32 +02:00
< span class = "verified" > {% translate "Verified" %}< / span >
2015-01-17 23:08:41 +01:00
{% else %}
2023-04-16 22:11:32 +02:00
< span class = "unverified" > {% translate "Unverified" %}< / span >
2015-01-17 23:08:41 +01:00
{% endif %}
< / td >
< td >
{% if emailaddress.primary %}
2023-04-16 22:11:32 +02:00
< span class = "glyphicon glyphicon-star" title = "{% translate " This is the current primary Email address " % } " > < / span >
2015-01-17 23:08:41 +01:00
{% else %}
< span class = "glyphicon glyphicon-star-empty" > < / span >
{% endif %}
< input id = "email_radio_{{forloop.counter}}" type = "radio" name = "email" { % if emailaddress . primary % } checked = "checked" { % endif % } value = "{{emailaddress.email}}" / >
< / td >
< / tr >
{% endfor %}
< / tbody >
< / table >
< p >
2023-04-16 22:11:32 +02:00
< button class = "btn btn-default" type = "submit" name = "action_primary" > {% translate 'Make Primary' %}< / button >
< button class = "btn btn-default" type = "submit" name = "action_send" > {% translate 'Re-send Verification' %}< / button >
< button class = "btn btn-warning" type = "submit" name = "action_remove" > {% translate 'Remove' %}< / button >
2015-01-17 23:08:41 +01:00
< / p >
< / form >
{% else %}
2023-04-16 22:11:32 +02:00
< p class = "text-warning" > < strong > {% translate 'Warning:'%}< / strong > {% translate "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 >
2015-01-17 23:08:41 +01:00
{% endif %}
2023-04-16 22:11:32 +02:00
< h2 > {% translate "Add E-mail Address" %}< / h2 >
2015-01-17 23:08:41 +01:00
< form method = "post" action = "{% url 'account_email' %}" class = "add_email" >
{% csrf_token %}
{{ form | crispy }}
2023-04-16 22:11:32 +02:00
< button name = "action_add" type = "submit" class = "btn btn-primary" > {% translate "Add E-mail" %}< / button >
2015-01-17 23:08:41 +01:00
< / form >
{% endblock content %}
{% block extra_js %}
< script type = "text/javascript" >
(function() {
2023-04-16 22:11:32 +02:00
var message = "{% translate 'Do you really want to remove the selected e-mail address?' %}";
2015-01-17 23:08:41 +01:00
var actions = document.getElementsByName('action_remove');
if (actions.length) {
actions[0].addEventListener("click", function(e) {
if (! confirm(message)) {
e.preventDefault();
}
});
}
})();
< / script >
{% endblock extra_js %}