1f0710bad117343ff35e1cc04545d5ba50599306
[wolnelektury.git] / wolnelektury / templates / account / email.html
1 {% extends "account/base.html" %}
2 {% load i18n %}
3 {% load ajaxable_tags %}
4
5 {% block titleextra %}{% trans "Account" %}{% endblock %}
6
7 {% block body %}
8     <h1>{% trans "E-mail Addresses" %}</h1>
9
10 {% if user.emailaddress_set.all %}
11 <p class="normal-text">{% trans 'The following e-mail addresses are associated to your account:' %}</p>
12     
13 <form action="{% url account_email %}" class="cuteform" method="post">
14 {% csrf_token %}
15   {% for emailaddress in user.emailaddress_set.all %}
16       <label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}">
17       <input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
18
19 {{ emailaddress.email }}
20     {% if emailaddress.verified %}
21     <span class="verified">{% trans "Verified" %}</span>
22     {% else %}
23     <span class="unverified">{% trans "Unverified" %}</span>
24     {% endif %}
25       {% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %}
26 </label>
27 {% endfor %}
28
29 <div style="margin-top:1em;">
30       <button class="secondaryAction" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
31       <button class="secondaryAction" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button>
32       <button class="primaryAction" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
33 </div>
34 </form>
35
36 {% else %} 
37 <p class="normal-text"><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>
38 {% endif %}
39
40
41     <h1>{% trans "Add E-mail Address" %}</h1>
42     
43     <form method="post" action="" class="cuteform hidelabels">
44     <ul>
45         {% csrf_token %}
46                 {{ add_email_form|placeholdized_ul }}
47         <li><button name="action_add" type="submit">{% trans "Add E-mail" %}</button></li>
48     </ul>
49     </form>
50     
51 {% endblock %}
52
53
54 {% block extrabody %}
55 <script type="text/javascript">
56 $(function(){
57 $("button[name='action_remove']").click(function(){
58 if (confirm("{% trans 'Do you really want to remove the selected e-mail address?' %}")) {
59 return true;
60 }
61 return false;
62 });
63 });
64 </script>
65 {% endblock %}