user settings
[wolnelektury.git] / wolnelektury / templates / account / email.html
diff --git a/wolnelektury/templates/account/email.html b/wolnelektury/templates/account/email.html
new file mode 100644 (file)
index 0000000..1f0710b
--- /dev/null
@@ -0,0 +1,65 @@
+{% extends "account/base.html" %}
+{% load i18n %}
+{% load ajaxable_tags %}
+
+{% block titleextra %}{% trans "Account" %}{% endblock %}
+
+{% block body %}
+    <h1>{% trans "E-mail Addresses" %}</h1>
+
+{% if user.emailaddress_set.all %}
+<p class="normal-text">{% trans 'The following e-mail addresses are associated to your account:' %}</p>
+    
+<form action="{% url account_email %}" class="cuteform" method="post">
+{% csrf_token %}
+  {% for emailaddress in user.emailaddress_set.all %}
+      <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 %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
+
+{{ emailaddress.email }}
+    {% if emailaddress.verified %}
+    <span class="verified">{% trans "Verified" %}</span>
+    {% else %}
+    <span class="unverified">{% trans "Unverified" %}</span>
+    {% endif %}
+      {% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %}
+</label>
+{% endfor %}
+
+<div style="margin-top:1em;">
+      <button class="secondaryAction" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
+      <button class="secondaryAction" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button>
+      <button class="primaryAction" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
+</div>
+</form>
+
+{% else %} 
+<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>
+{% endif %}
+
+
+    <h1>{% trans "Add E-mail Address" %}</h1>
+    
+    <form method="post" action="" class="cuteform hidelabels">
+    <ul>
+        {% csrf_token %}
+               {{ add_email_form|placeholdized_ul }}
+        <li><button name="action_add" type="submit">{% trans "Add E-mail" %}</button></li>
+    </ul>
+    </form>
+    
+{% endblock %}
+
+
+{% block extrabody %}
+<script type="text/javascript">
+$(function(){
+$("button[name='action_remove']").click(function(){
+if (confirm("{% trans 'Do you really want to remove the selected e-mail address?' %}")) {
+return true;
+}
+return false;
+});
+});
+</script>
+{% endblock %}