{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% block main %}
{% include 'postorius/menu/user_nav.html' %}
<ul class="nav nav-tabs">
   <li><a href="{% url 'user_mailmansettings' %}">{% trans "Global Mailman Preferences" %}</a></li>
   <li class="active"><a href="#">{% trans "Address Based Preferences" %}</a></li>
   <li><a href="{% url 'user_subscription_preferences' %}">{% trans "Subscription Based Preferences" %}</a></li>
</ul>
{% if nolists %}
    <div class="mm_subHeader" >
       <h1>{% trans "No Preferences Available" %}</h1>
    </div>
    <p>{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}</p>
{% else %}
    <form action = "{% url 'user_address_preferences' %}" method = "post" class = "well" id ="address_formset">
       {% csrf_token %}
       {{formset.management_form}}
       {{formset.non_form_errors.as_ul}}
       <table class="table table-bordered table-striped" border = "2">
          <thead>
             <tr>
                <th> {% trans 'Preferences' %} </th>
                {% for form,address in zipped_data %}
                <th> {{address}} </th>
                {% endfor %}
             </tr >
          </thead >
          <tr>
             <td>
                <p>{% trans 'Mail Delivery' %}: </p>
                <p>[<span class="more_info"><a href="#" target="_blank">{% trans 'More info' %}</a><span>{{ helperform.delivery_status.help_text }}
                   </span></span>] 
                </p>
             </td>
             {% for form,address in zipped_data %}
             <td> {{form.delivery_status }}</td>
             {% endfor %} 
          </tr>
          <tr>
             <td>
                <p> {% trans 'Select a Mode of Delivery' %}:  </p>
                <p>[<span class="more_info"><a href="#" target="_blank">{% trans 'More info' %}</a><span>{{ helperform.delivery_mode.help_text }}
                   </span></span>] 
                </p>
             </td>
             {% for form,address in zipped_data %}
             <td> {{form.delivery_mode }} </td>
             {% endfor %} 
          </tr>
          <tr>
             <td>
                <p> {% trans 'Receive your own posts to the list?' %} </p>
                <p>[<span class="more_info"><a href="#" target="_blank">{% trans 'More info' %}</a><span>{{ helperform.receive_own_postings.help_text }}
                   </span></span>] 
                </p>
             </td>
             {% for form,address in zipped_data %}
             <td> {{form.receive_own_postings }} </td>
             {% endfor %} 
          </tr>
          <tr>
             <td>
                <p> {% trans 'Receive acknowledgement mails?' %} </p>
                <p>[<span class="more_info"><a href="#" target="_blank">{% trans 'More info' %}</a><span>{{ helperform.acknowledge_posts.help_text }}
                   </span></span>]
                </p>
             </td>
             {% for form,address in zipped_data %}
             <td> {{form.acknowledge_posts }} </td>
             {% endfor %} 
          </tr>
          <tr>
             <td>
                <p> {% trans 'Conceal yourself from the subscriber list?' %} </p>
                <p>[<span class="more_info"><a href="#" target="_blank">{% trans 'More info' %}</a><span>{{ helperform.hide_address.help_text }}
                   </span></span>]
                </p>
             </td>
             {% for form,address in zipped_data %}
             <td> {{form.hide_address }} </td>
             {% endfor %} 
          </tr>
          <tr>
             <td>
                <p> {% trans 'Avoid duplicate copies of messages?' %} </p>
                <p>[<span class="more_info"><a href="#" target="_blank">{% trans 'More info' %}</a><span>{{ helperform.receive_list_copy.help_text }}
                   </span></span>]
                </p>
             </td>
             {% for form,address in zipped_data %}
             <td> {{form.receive_list_copy }} </td>
             {% endfor %} 
          </tr>
       </table>
       <center><button class="btn btn-success" type="submit">{% trans "Save" %}</button></center>
    </form>
{% endif %}
{% endblock main %}
