diff --git a/src/postorius/templates/postorius/lists/archival_options.html b/src/postorius/templates/postorius/lists/archival_options.html index 2ace6a2..17deb37 100644 --- a/src/postorius/templates/postorius/lists/archival_options.html +++ b/src/postorius/templates/postorius/lists/archival_options.html @@ -2,7 +2,7 @@ {% load i18n %} {% block subtitle %} -{% trans "Archival Options | " as page_title %}{{ page_title|add:list.fqdn_listname}} +{% trans 'Archival Options' %} | {{ list.fqdn_listname }} {% endblock %} {% load nav_helpers %} @@ -10,18 +10,21 @@ {% block main %} {% if message %}<p class="alert">{{ message }}</p>{% endif %} {% list_nav 'list_archival_options' 'Archivers' %} - - <h2>{% trans 'Archivers' %}</h2> - - <div class="well"> - - <form action="{% url 'list_archival_options' list.list_id %}" method="POST">{% csrf_token %} - <div class="archival-options-form"> - {{ form }} - </div> - <button class="btn btn-primary" type="submit">{% trans 'Save Archivers' %}</button> - </form> - + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Archivers' %}</h1></div> + <div class="panel-body"> + <form action="{% url 'list_archival_options' list.list_id %}" method="POST"> + {% csrf_token %} + {% for choice in form.archivers %} + <div class="col-md-offset-2 checkbox"> + <label> + {{ choice }} {{ choice.label }} + </label> + </div> + {% endfor %} + <button class="col-md-offset-2 btn btn-primary" type="submit">{% trans 'Save Archivers' %}</button> + </form> + </div> </div> {% endblock %} diff --git a/src/postorius/templates/postorius/lists/confirm_delete.html b/src/postorius/templates/postorius/lists/confirm_delete.html index 7685c74..e74a3f4 100644 --- a/src/postorius/templates/postorius/lists/confirm_delete.html +++ b/src/postorius/templates/postorius/lists/confirm_delete.html @@ -2,18 +2,23 @@ {% load i18n %} {% block subtitle %} -{% trans "Delete | " as page_title %}{{ page_title|add:list.fqdn_listname}} +{% trans 'Delete' %} | {{ list.fqdn_listname }} {% endblock %} {% load nav_helpers %} {% block main %} - {% list_nav 'list_delete' "Delete List" %} - - <p>{% trans "Are you sure you want to permanently delete this list?" %}</p> - <p>{% trans "All settings and membership data will be lost!" %}</p> - <form action="{{submit_url}}" method="post"> {% csrf_token %} - <button class="btn btn-danger" type="submit">{% trans "Delete" %} {{ list.fqdn_listname }}</button> - <a class="btn" href="{% url 'list_summary' list_id=list.list_id %}">{% trans "Cancel" %}</a> - </form> + {% list_nav 'list_delete' 'Delete List' %} + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Delete List' %}</h1></div> + <div class="panel-body"> + <p class="col-md-offset-2">{% trans 'Are you sure you want to permanently delete this list?' %}</p> + <p class="col-md-offset-2">{% trans 'All settings and membership data will be lost!' %}</p> + <form action="{{submit_url}}" method="post"> + {% csrf_token %} + <button class="col-md-offset-2 btn btn-danger" type="submit">{% trans "Delete" %} {{ list.fqdn_listname }}</button> + <a class="btn btn-default" href="{% url 'list_summary' list_id=list.list_id %}">{% trans 'Cancel' %}</a> + </form> + </div> + </div> {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/confirm_remove_role.html b/src/postorius/templates/postorius/lists/confirm_remove_role.html index f763a69..4d7cfae 100644 --- a/src/postorius/templates/postorius/lists/confirm_remove_role.html +++ b/src/postorius/templates/postorius/lists/confirm_remove_role.html @@ -1,18 +1,23 @@ -{% extends "postorius/base.html" %} +{% extends postorius_base_template %} {% load i18n %} {% block subtitle %} -{% trans "Confirm Remove Role | " as page_title %}{{ page_title|add:address}} +{% trans 'Confirm Remove Role' %} | {{ address }} {% endblock %} {% load nav_helpers %} {% block main %} - <h1>{% trans 'Confirm Remove Role' %}</h1> - <p>{% trans "Are you sure you want to remove?" %}</p> - <form method="post" action="{% url 'remove_role' list_id role address %}"> - {% csrf_token %} - <button class="btn btn-danger" type="submit">{% trans "Remove " %}{{ address }}</button> - <a class="btn" href="{% url 'list_members' list_id %}">{% trans "Cancel" %}</a> - </form> + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Confirm Remove Role' %}</h1></div> + <div class="panel-body"> + <p>{% trans 'Are you sure?' %}</p> + <form method="post" action="{% url 'remove_role' list_id role address %}"> + {% csrf_token %} + <button class="btn btn-danger" type="submit">{% trans 'Remove' %} {{ address }}</button> + <a class="btn btn-default" href="{% url 'list_members' list_id %}">{% trans 'Cancel' %}</a> + </form> + </div> + </div> + {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/confirm_removeall_subscribers.html b/src/postorius/templates/postorius/lists/confirm_removeall_subscribers.html index a2550f2..cf44861 100644 --- a/src/postorius/templates/postorius/lists/confirm_removeall_subscribers.html +++ b/src/postorius/templates/postorius/lists/confirm_removeall_subscribers.html @@ -1,14 +1,18 @@ -{% extends "postorius/base.html" %} +{% extends postorius_base_template %} {% load i18n %} {% load nav_helpers %} {% block main %} - <h1>{% trans 'Confirm Removal of All Members' %}</h1> - <p>{% trans "Are you sure you want to unsubscribe all members from " %}{{list_id}}{% trans " ?"%}</p> - <hr /> - <form method="post" action="{% url 'unsubscribe_all' list_id %}"> - {% csrf_token %} - <button class="btn btn-danger" type="submit" >{% trans "Unsubscribe All " %}</button> - <a class="btn" href="{% url 'list_members' list_id %}">{% trans "Cancel" %}</a> - </form> + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Confirm Removal of All Members' %}</h1></div> + <div class="panel-body"> + <p>{% trans 'Are you sure you want to unsubscribe all members from' %} {{ list_id }}{% trans '?' %}</p> + <hr /> + <form method="post" action="{% url 'unsubscribe_all' list_id %}"> + {% csrf_token %} + <button class="btn btn-danger" type="submit" >{% trans 'Unsubscribe All' %}</button> + <a class="btn btn-default" href="{% url 'mass_removal' list_id %}">{% trans 'Cancel' %}</a> + </form> + </div> + </div> {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/held_messages.html b/src/postorius/templates/postorius/lists/held_messages.html index 163dd6a..fc91842 100644 --- a/src/postorius/templates/postorius/lists/held_messages.html +++ b/src/postorius/templates/postorius/lists/held_messages.html @@ -8,81 +8,87 @@ {% block main %} {% list_nav 'list_held_messages' 'Held Messages' %} - {% if held_messages|length > 0 %} - <form method="post"> - {% if form.choices.errors %} - {% for error in form.choices.errors %} - <div class="alert alert-error">{{ error }}</div> - {% endfor %} + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Held Messages' %}</h1></div> + <div class="panel-body"> + {% if held_messages|length > 0 %} + <form method="post"> + {% if form.choices.errors %} + {% for error in form.choices.errors %} + <div class="alert alert-danger">{{ error }}</div> + {% endfor %} + {% endif %} + {% csrf_token %} + <div class="table-responsive"> + <table class="table table-bordered table-striped"> + <thead> + <tr> + <td colspan="5">{% trans 'Perform action on selected messages' %}</td> + <td> + <input type="submit" class="btn btn-xs btn-success" name="accept" value="{% trans 'Accept' %}" /> + <input type="submit" class="btn btn-xs btn-warning" name="reject" value="{% trans 'Reject' %}" /> + <input type="submit" class="btn btn-xs btn-danger" name="discard" value="{% trans 'Discard' %}" /> + </td> + </tr> + <tr> + <th><input type="checkbox" id="all-messages-checkbox" /></th> + <th>{% trans 'Subject' %}</th> + <th>{% trans 'Sender' %}</th> + <th>{% trans 'Reason' %}</th> + <th>{% trans 'Hold Date' %}</th> + <th></th> + </tr> + </thead> + <tbody> + {% for msg in held_messages %} + <tr> + <td><input type="checkbox" id="id_choices_{{ forloop.counter0 }}" class="message-checkbox" name="choices" value="{{ msg.request_id }}"/></td> + <td>{{ msg.subject }}</td> + <td>{{ msg.sender }}</td> + <td> + {% if msg.reasons %} + {{ msg.reason }} + {% else %} + {% for reason in msg.moderation_reasons %} + <p>{{ reason }}</p> + {% endfor %} + {% endif %} + </td> + <td>{{ msg.hold_date }}</td> + <td> + <a href="#" class="btn btn-xs btn-info" data-toggle="modal" data-target="#msg-{{ msg.request_id }}">{% trans 'View' %}</a> + <a href="{% url 'accept_held_message' list.list_id msg.request_id %}" class="btn btn-xs btn-success">{% trans 'Accept' %}</a> + <a href="{% url 'reject_held_message' list.list_id msg.request_id %}" class="btn btn-xs btn-warning">{% trans 'Reject' %}</a> + <a href="{% url 'discard_held_message' list.list_id msg.request_id %}" class="btn btn-xs btn-danger">{% trans 'Discard' %}</a> + <div class="modal fade held-message-details" id="msg-{{ msg.request_id }}" tabindex="-1" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> + <h4 class="modal-title">{{ msg.subject }}</h4> + </div> + <div class="modal-body"> + {{ msg.msg | linebreaks }} + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">{% trans 'Close' %}</button> + </div> + </div> + </div> + </div> + </td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + </form> + {% include 'postorius/_pagination.html' with page=held_messages %} + {% else %} + <p>{% trans 'There are currently no held messages.' %}</p> {% endif %} - {% csrf_token %} - <table class="table table-bordered table-striped"> - <thead> - <tr> - <td colspan="5">{% trans 'Perform action on selected messages' %}</td> - <td class="mm_action"> - <input type="submit" class="btn btn-mini btn-success" name="accept" value="{% trans 'Accept' %}" /> - <input type="submit" class="btn btn-mini btn-danger" name="reject" value="{% trans 'Reject' %}" /> - <input type="submit" class="btn btn-mini btn-danger" name="discard" value="{% trans 'Discard' %}" /> - </td> - </tr> - <tr> - <th><input type="checkbox" id="all-messages-checkbox" /></th> - <th>{% trans 'Subject' %}</th> - <th>{% trans 'Sender' %}</th> - <th>{% trans 'Reason' %}</th> - <th>{% trans 'Hold Date' %}</th> - <th></th> - </tr> - </thead> - <tbody> - {% for msg in held_messages %} - <tr> - <td><input type="checkbox" id="id_choices_{{ forloop.counter0 }}" class="message-checkbox" name="choices" value="{{ msg.request_id }}"/></td> - <td>{{ msg.subject }}</td> - <td>{{ msg.sender }}</td> - <td> - {% if msg.reason %} - {{ msg.reason }} - {% else %} - {% for reason in msg.moderation_reasons %} - <p>{{ reason }}</p> - {% endfor %} - {% endif %} - </td> - <td>{{ msg.hold_date }}</td> - - <td class="mm_action"> - <a href="#" class="btn btn-mini btn-info" data-toggle="modal" data-target="#msg-{{ msg.request_id }}">{% trans 'View' %}</a> - <a href="{% url 'accept_held_message' list.list_id msg.request_id %}" class="btn btn-mini btn-success">{% trans 'Accept' %}</a> - <a href="{% url 'reject_held_message' list.list_id msg.request_id %}" class="btn btn-mini btn-danger">{% trans 'Reject' %}</a> - <a href="{% url 'discard_held_message' list.list_id msg.request_id %}" class="btn btn-mini btn-danger">{% trans 'Discard' %}</a> - - <div class="modal hide fade held-message-details" id="msg-{{ msg.request_id }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title">Subject: {{ msg.subject }}</h4> - </div> - <div class="modal-body"> - {{ msg.msg | linebreaks }} - </div> - </div> - </div> - </div> - </td> - </tr> - {% endfor %} - </tbody> - </table> - </form> - - {% include 'postorius/_pagination.html' with page=held_messages %} - - {% else %} - <p>{% trans 'There are currently no held messages.' %}</p> - {% endif %} + </div> + </div> {% endblock %} {% block additionaljs %} diff --git a/src/postorius/templates/postorius/lists/index.html b/src/postorius/templates/postorius/lists/index.html index eaa02da..df07dc5 100644 --- a/src/postorius/templates/postorius/lists/index.html +++ b/src/postorius/templates/postorius/lists/index.html @@ -2,60 +2,52 @@ {% load i18n %} {% block subtitle %} -{% trans "List Index" as page_title %}{{ page_title }} +{% trans 'List Index' %} {% endblock %} {% block main %} - - <div class="mm_subHeader"> - <h1>{% trans "Mailing Lists" %}</h1> + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Mailing Lists' %}</h1></div> + <div class="panel-body"> + {% if user.is_superuser %} + <p class="text-right"> + {% if domain_count < 2 %} + <a class="btn btn-success" href="{% url 'domain_new' %}">{% trans 'Create New Domain' %}</a> + {% endif %} + <a class="btn btn-success" href="{% url 'list_new' %}">{% trans 'Create New List' %}</a> + </p> + {% endif %} + {% if lists|length > 0 %} + <div class="table-responsive"> + <table class="table table-bordered table-striped"> + <thead> + <tr> + <th>{% trans 'List name' %}</th> + <th>{% trans 'Post address' %}</th> + <th>{% trans 'Description' %}</th> + </tr> + </thead> + <tbody> + {% for list in lists %} + <tr> + <td> + <a href="{% url 'list_summary' list_id=list.list_id %}">{{ list.display_name }}</a> + {% if not list.settings.advertised %} ({% trans 'unadvertised' %}*){% endif %} + </td> + <td>{{ list.fqdn_listname }}</td> + <td>{{ list.settings.description }}</td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + {% if user.is_superuser %} + <small>* {% trans 'Only admins see unadvertised lists in the list index.' %}</small> + {% endif %} + {% include 'postorius/_pagination.html' with page=lists %} + {% else %} + <p>{% trans 'There are currently no mailing lists.' %}</p> + {% endif %} + </div> </div> - - {% if user.is_superuser %} - <p> - {% if domain_count < 2 %} - <a class="btn btn-success" href="{% url 'domain_new' %}">{% trans "Create New Domain" %}</a> - {% else %} - <a class="btn btn-success" href="{% url 'list_new' %}">{% trans "Create New List" %}</a> - {% endif %} - </p> - {% endif %} - - {% if lists|length > 0 %} - - <table class="table table-bordered table-striped"> - <thead> - <tr> - <th>{% trans 'List name' %}</th> - <th>{% trans 'Post address' %}</th> - <th>{% trans 'Description' %}</th> - </tr> - </thead> - <tbody> - {% for list in lists %} - {% with settings=list.settings %} - <tr> - <td> - <a href="{% url 'list_summary' list_id=list.list_id %}">{{ list.display_name }}</a>{% if not settings.advertised %} ({% trans 'unadvertised' %}*){% endif %} - </td> - <td>{{ list.fqdn_listname }}</td> - <td>{{ settings.description }}</td> - </tr> - {% endwith %} - {% endfor %} - </tbody> - </table> - - {% if user.is_superuser %} - <small>* {% trans 'Only admins see unadvertised lists in the list index.' %}</small> - {% endif %} - - {% include 'postorius/_pagination.html' with page=lists %} - - {% else %} - - <p>There are currently no mailing lists.</p> - - {% endif %} - {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/mass_removal.html b/src/postorius/templates/postorius/lists/mass_removal.html index 6d82b16..68cd4e1 100644 --- a/src/postorius/templates/postorius/lists/mass_removal.html +++ b/src/postorius/templates/postorius/lists/mass_removal.html @@ -1,16 +1,34 @@ {% extends postorius_base_template %} {% load i18n %} {% load nav_helpers %} +{% load bootstrap_tags %} {% block main %} - {% list_nav 'mass_removal' "Mass Removal" %} - - <form action="{% url 'mass_removal' list.list_id %}" method="post" class="well"> {% csrf_token %} - {{ form.as_p }} - <hr /> - <button class="btn btn-warning" type="submit">{% trans "Unsubscribe users" %}</button> - <a style="float:right" href="{% url 'unsubscribe_all' list.list_id %}" class="btn btn-danger">{% trans 'Unsubscribe All' %}</a> - </form> - <hr /> + {% list_nav 'mass_removal' 'Mass Removal' %} + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Mass Removal' %}</h1></div> + <div class="panel-body"> + <form action="{% url 'mass_removal' list.list_id %}" method="post" class="form-horizontal"> + {% csrf_token %} + {% if form.non_field_errors %} + <div class="alert alert-danger"> + {{ form.non_field_errors }} + </div> + {% endif %} + <div class="form-group"> + {% if form.emails.errors %} + <div class="alert alert-danger"> + {{ form.emails.errors }} + </div> + {% endif %} + <label class="control-label col-md-2" for="{{ form.emails.id_for_label }}">{{ form.emails.label }}:</label> + <div class="col-md-8">{{ form.emails|add_form_control }}</div> + </div> + <hr /> + <button class="col-md-offset-2 btn btn-warning" type="submit">{% trans 'Unsubscribe users' %}</button> + <a href="{% url 'unsubscribe_all' list.list_id %}" class="btn btn-danger col-md-offset-5">{% trans 'Unsubscribe All' %}</a> + </form> + </div> + </div> {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/mass_subscribe.html b/src/postorius/templates/postorius/lists/mass_subscribe.html index 1878928..5f0258c 100644 --- a/src/postorius/templates/postorius/lists/mass_subscribe.html +++ b/src/postorius/templates/postorius/lists/mass_subscribe.html @@ -1,17 +1,33 @@ {% extends postorius_base_template %} {% load i18n %} - -{% block subtitle %} -{% trans "Mass Subscribe | "%}{{ page_title|add:list.fqdn_listname}} -{% endblock %} - +{% load bootstrap_tags %} {% load nav_helpers %} -{% block main %} - {% list_nav 'mass_subscribe' "Mass Subscription" %} +{% block subtitle %} +{% trans 'Mass Subscribe' %} | {{ list.fqdn_listname }} +{% endblock %} - <form action="{% url 'mass_subscribe' list.list_id %}" method="post" class="well"> {% csrf_token %} - {{ form.as_p }} - <button class="btn btn-primary" type="submit">{% trans "Subscribe users" %}</button> - </form> +{% block main %} + {% list_nav 'mass_subscribe' 'Mass Subscription' %} + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Mass Subscription' %}</h1></div> + <div class="panel-body"> + <form action="{% url 'mass_subscribe' list.list_id %}" method="post" class="form-horizontal"> + {% csrf_token %} + {% if form.non_field_errors %} + <div class="alert alert-danger"> + {{ form.non_field_errors }} + </div> + {% endif %} + <div class="form-group"> + {% if form.emails.errors %} + <div class="alert alert-danger">{{ form.emails.errors }}</div> + {% endif %} + <label class="control-label col-md-2" for="{{ form.emails.id_for_label }}">{{ form.emails.label }}:</label> + <div class="col-md-8">{{ form.emails|add_form_control }}</div> + </div> + <button class="col-md-offset-2 btn btn-primary" type="submit">{% trans 'Subscribe users' %}</button> + </form> + </div> + </div> {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/memberoptions.html b/src/postorius/templates/postorius/lists/memberoptions.html index bdcdf92..8360794 100644 --- a/src/postorius/templates/postorius/lists/memberoptions.html +++ b/src/postorius/templates/postorius/lists/memberoptions.html @@ -1,87 +1,60 @@ {% extends postorius_base_template %} {% load i18n %} {% load nav_helpers %} +{% load bootstrap_tags %} {% block subtitle %} -{% trans "Member Options | " as page_title %}{{ page_title|add:user.username}} +{% trans 'Member Options' %} | {{ user.username }} {% endblock %} {% block main %} - {% list_nav '' 'Member Options' %} - -{% if not user.is_superuser and not user.is_list_owner %} - <div class="mm_subHeader" > - <h1>{% trans "No Preferences Available" %}</h1> - </div> - <p>{% trans 'You are not the owner for this list' %}</p> -{% else %} - <h1>{% trans 'Member preferences' %}</h1> - <form class="well" action="" method="post" > - <legend>{% trans 'Preferences for Member' %} {{ mm_member.email }}</legend> - {% csrf_token %} - <table class="table table-bordered table-striped" border="2"> - <thead> - <tr> - <th>{% trans 'Preference' %}</th> - <th>{% trans 'Setting' %} </th> - </tr> - </thead > - <tr> - <td> - <p>{% trans 'Mail Delivery:' %} </p> - </p> - [<span class="more_info"><a href="#">{% trans "More info" %}</a><span>{{ settingsform.delivery_status.help_text }} - </span></span>] </p> - </td> - <td> {{settingsform.delivery_status }} </td> - </tr> - <tr> - <td> - <p>{% trans 'Mode of Delivery:' %}</p> - <p> - [<span class="more_info"><a href="#">{% trans "More info" %}</a><span>{{ settingsform.delivery_mode.help_text }} - </span></span>] </p> - </td> - <td> {{settingsform.delivery_mode }} </td> - </tr> - <tr> - <td> - <p>{% trans 'Receive own posts to the list?' %}</p> - <p> - [<span class="more_info"><a href="#">{% trans "More info" %}</a><span>{{ settingsform.receive_own_postings.help_text }} - </span></span>] </p> - </td> - <td> {{settingsform.receive_own_postings }} </td> - </tr> - <tr> - <td> - <p>{% trans 'Receive acknowledgement mails?' %}</p> - </p> - [<span class="more_info"><a href="#">{% trans "More info" %}</a><span>{{ settingsform.acknowledge_posts.help_text }} - </span></span>] </p> - </td> - <td> {{settingsform.acknowledge_posts }} </td> - </tr> - <tr> - <td> - <p>{% trans 'Conceal address from the subscriber list?' %}</p> - </p> - [<span class="more_info"><a href="#">{% trans "More info" %}</a><span>{{ settingsform.hide_address.help_text }} - </span></span>] </p> - </td> - <td> {{settingsform.hide_address }} </td> - </tr> - <tr> - <td> - <p>{% trans 'Avoid duplicate copies of messages? ' %}</p> - </p> - [<span class="more_info"><a href="#">{% trans "More info" %}</a><span>{{ settingsform.receive_list_copy.help_text }} - </span></span>] </p> - </td> - <td> {{settingsform.receive_list_copy }} </td> - </tr> - </table> - <center><button class="btn btn-success" type="submit">{% trans "Save" %}</button></center> - </form> -{% endif %} + {% list_nav 'list_members' 'Member Options' %} + {% if not user.is_superuser and not user.is_list_owner %} + <h1>{% trans 'No Preferences Available' %}</h1> + <p>{% trans 'You are not the owner for this list' %}</p> + {% else %} + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Preferences for Member' %} {{ mm_member.email }}</h1></div> + <div class="panel-body"> + <form action="" method="post" > + {% csrf_token %} + <div class="table-responsive"> + <table class="table table-bordered table-striped" border="2"> + <thead> + <tr> + <th class="col-md-10">{% trans 'Preference' %}</th> + <th class="col-md-2">{% trans 'Setting' %} </th> + </tr> + </thead > + {% for field in settingsform %} + <tr> + <td> + <p>{{ field.label_tag }}</p> + <span id="help-{{ field.label }}" class="help-block"> + {{ field.help_text }} + </span> + </td> + <td class="text-center"> + {% if field|fieldtype == 'RadioSelect' %} + {% for choice in field %} + <label class="radio-inline"> + {{ choice.tag }} + {{ choice.choice_label }} + </label> + {% endfor %} + {% else %} + {{ field|add_form_control }} + {% endif %} + </td> + </tr> + {% endfor %} + </table> + </div> + <div class="text-center"> + <button class="btn btn-success" type="submit">{% trans 'Save' %}</button> + </div> + </form> + </div> + </div> + {% endif %} {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/members.html b/src/postorius/templates/postorius/lists/members.html index 7d2b978..6ab9b7f 100644 --- a/src/postorius/templates/postorius/lists/members.html +++ b/src/postorius/templates/postorius/lists/members.html @@ -1,95 +1,102 @@ {% extends postorius_base_template %} {% load i18n %} - -{% block subtitle %} -{% trans "Members | " as page_title %}{{ page_title|add:list.fqdn_listname}} -{% endblock %} - +{% load bootstrap_tags %} {% load nav_helpers %} +{% block subtitle %} +{% trans 'Members' %} | {{ list.fqdn_listname}} +{% endblock %} + {% block main %} - {% list_nav 'list_members' "List Members" %} - <h2>{% trans "Owners" %}</h2> - - {{ owner_form.email.errors }} - <form action="{% url 'list_members' list.list_id %}" method="POST" class="form-inline">{% csrf_token %} - <label for="id_owner_email">{% trans 'Email Address' %}</label> - {{ owner_form.owner_email }} - <button type="submit" class="btn">{% trans 'Add Owner' %}</button> - </form> - <table class="table table-bordered table-striped"> - <thead> - <tr> - <th>{% trans 'Address' %}</th> - <th> </th> - </tr> - </thead> - <tbody> - {% for member in list.owners %} - <tr> - <td>{{ member }}</td> - <td> - <a href="{% url 'remove_role' list.list_id 'owner' member %}" class="btn btn-mini btn-danger">{% trans 'Delete' %}</a> - </td> - </tr> - {% endfor %} - </tbody> - </table> - - <h2>{% trans "Moderators" %}</h2> - {{ moderator_form.email.errors }} - <form action="{% url 'list_members' list.list_id %}" method="POST" class="form-inline">{% csrf_token %} - <label for="id_moderator_email">{% trans 'Email Address' %}</label> - {{ moderator_form.moderator_email }} - <button type="submit" class="btn">{% trans 'Add Moderator' %}</button> - </form> - - <table class="table table-bordered table-striped"> - <thead> - <tr> - <th>{% trans 'Address' %}</th> - <th> </th> - </tr> - </thead> - <tbody> - {% for member in list.moderators %} - <tr> - <td>{{ member }}</td> - <td> - <a href="{% url 'remove_role' list.list_id 'moderator' member %}" class="btn btn-mini btn-danger">{% trans 'Delete' %}</a> - </td> - </tr> - {% endfor %} - </tbody> - </table> - - <h2>{% trans "Members" %}</h2> - <table class="table table-bordered table-striped"> - <thead> - <tr> - <th>{% trans 'Address' %}</th> - <th>{% trans 'Role' %}</th> - <th> </th> - </tr> - </thead> - <tbody> - <form action="{% url 'csv_view' list.list_id %}" method="post" class="well"> {% csrf_token %} - <button type="submit" class="btn">{% trans 'CSV Export' %}</button> - </form> - - {% for member in members %} - <tr> - <td> <a href="{% url 'list_member_options' list.list_id member.email %}"> - {{ member.email }}</a></td> - <td>{% trans member.role %}</td> - <td> - <a href="{% url 'list_unsubscribe' list.list_id member.email %}" class="btn btn-mini btn-danger">{% trans 'Unsubscribe' %}</a> - </td> - </tr> - {% endfor %} - </tbody> - </table> - - {% include 'postorius/_pagination.html' with page=members %} - + {% list_nav 'list_members' 'List Members' %} + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'List Members' %}</h1></div> + <div class="panel-body"> + <h2>{% trans 'Owners' %}</h2> + <form action="{% url 'list_members' list.list_id %}" method="POST" class="form-inline"> + {% csrf_token %} + {% if owner_form.owner_email.errors %} + <div class="alert alert-danger">{{ owner_form.owner_email.errors }}</div> + {% endif %} + <label for="id_owner_email">{% trans 'Email Address' %}:</label> + {{ owner_form.owner_email|add_form_control }} + <button type="submit" class="btn btn-default">{% trans 'Add Owner' %}</button> + </form> + <br /> + <div class="table-responsive"> + <table class="table table-bordered table-striped"> + <thead> + <tr> + <th>{% trans 'Address' %}</th> + <th> </th> + </tr> + </thead> + <tbody> + {% for member in list.owners %} + <tr> + <td>{{ member }}</td> + <td><a href="{% url 'remove_role' list.list_id 'owner' member %}" class="btn btn-xs btn-danger">{% trans 'Delete' %}</a></td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + <h2>{% trans 'Moderators' %}</h2> + <form action="{% url 'list_members' list.list_id %}" method="POST" class="form-inline"> + {% csrf_token %} + {% if moderator_form.moderator_email.errors %} + <div class="alert alert-danger">{{ moderator_form.moderator_email.errors }}</div> + {% endif %} + <label for="id_moderator_email">{% trans 'Email Address' %}:</label> + {{ moderator_form.moderator_email|add_form_control }} + <button type="submit" class="btn btn-default">{% trans 'Add Moderator' %}</button> + </form> + <br /> + <div class="table-responsive"> + <table class="table table-bordered table-striped"> + <thead> + <tr> + <th>{% trans 'Address' %}</th> + <th> </th> + </tr> + </thead> + <tbody> + {% for member in list.moderators %} + <tr> + <td>{{ member }}</td> + <td><a href="{% url 'remove_role' list.list_id 'moderator' member %}" class="btn btn-xs btn-danger">{% trans 'Delete' %}</a></td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + <h2>{% trans 'Members' %}</h2> + <form action="{% url 'csv_view' list.list_id %}" method="post"> + {% csrf_token %} + <button type="submit" class="btn btn-default">{% trans 'CSV Export' %}</button> + </form> + <br /> + <div class="table-responsive"> + <table class="table table-bordered table-striped"> + <thead> + <tr> + <th>{% trans 'Address' %}</th> + <th>{% trans 'Role' %}</th> + <th> </th> + </tr> + </thead> + <tbody> + {% for member in members %} + <tr> + <td><a href="{% url 'list_member_options' list.list_id member.email %}">{{ member.email }}</a></td> + <td>{% trans member.role %}</td> + <td><a href="{% url 'list_unsubscribe' list.list_id member.email %}" class="btn btn-xs btn-danger">{% trans 'Unsubscribe' %}</a></td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + {% include 'postorius/_pagination.html' with page=members %} + </div> + </div> {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/new.html b/src/postorius/templates/postorius/lists/new.html index 187ed3e..6a215a4 100644 --- a/src/postorius/templates/postorius/lists/new.html +++ b/src/postorius/templates/postorius/lists/new.html @@ -1,14 +1,44 @@ {% extends postorius_base_template %} {% load i18n %} +{% load bootstrap_tags %} {% block subtitle %} -{% trans "Create List" as page_title %}{{ page_title }} +{% trans 'Create List' %} {% endblock %} {% block main %} - <h1>{% trans "Create a new List" %} {{ block.super }}</h1> - <form action="{% url 'list_new' %}" method="post" class="well"> {% csrf_token %} - {{ form.as_p }} - <button class="btn btn-success" type="submit">{% trans "Create List" %}</button> - </form> + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Mailing Lists' %}</h1></div> + <div class="panel-body"> + <form action="{% url 'list_new' %}" method="post" class="form-horizontal"> + <legend>{% trans 'Create a new List' %}</legend> + {% csrf_token %} + {% for field in form %} + <div class="form-group"> + {% if field.errors %} + <div class="row"> + <div class="col-md-offset-2 col-md-8 alert alert-danger">{{ field.errors }}</div> + </div> + {% endif %} + <label class="control-label col-md-2" for="{{ field.id_for_label }}">{{ field.label }}:</label> + <div class="col-md-8"> + {% if field|fieldtype == 'RadioSelect' %} + {% for choice in field %} + <label class="radio-inline"> + {{ choice.tag }} + {{ choice.choice_label }} + </label> + {% endfor %} + {% else %} + {{ field|add_form_control }} + {% endif %} + </div> + </div> + {% endfor %} + <div class="text-center"> + <button class="btn btn-success" type="submit">{% trans 'Create List' %}</button> + </div> + </form> + </div> + </div> {% endblock %} diff --git a/src/postorius/templates/postorius/lists/settings.html b/src/postorius/templates/postorius/lists/settings.html index 8308bbf..ef4804a 100644 --- a/src/postorius/templates/postorius/lists/settings.html +++ b/src/postorius/templates/postorius/lists/settings.html @@ -1,49 +1,54 @@ {% extends postorius_base_template %} {% load i18n %} - -{% block subtitle %} -{% trans "Settings | " as page_title %}{{ page_title|add:list.fqdn_listname}} -{% endblock %} - +{% load bootstrap_tags %} {% load nav_helpers %} +{% block subtitle %} +{% trans 'Settings' %} | {{ list.fqdn_listname}} +{% endblock %} + {% block main %} - {% if message %}<p class="alert">{{ message }}</p>{% endif %} {% list_nav 'list_settings' 'Settings' %} - <ul class="nav nav-tabs"> - {% for section in section_names %} - <li {% if section.0 == visible_section %}class="active"{% endif %}><a href="{% url 'list_settings' list_id=list.list_id visible_section=section.0 %}">{{section.1}}</a></li> - {% endfor %} - </ul> - - <form action="{% url 'list_settings' list_id=list.list_id visible_section=visible_section %}" method="post" class="well form-horizontal list_settings">{% csrf_token %} - - {% for field in form %} - - {% if field.errors %} - <div class="field-errors">{{ field.errors }}</div> - {% endif %} - - <div class="control-group"> - - <div class="control-label"> - {{ field.label_tag }} - <span class="more_info">[<a>?</a><span>{{ field.help_text }}</span>]</span> - </div> - - <div class="controls"> - {{ field }} - </div> - </div> - - {% endfor %} - - <div class="form-actions"> - - <button class="btn btn-primary btn-success" type="submit">{% trans "Save changes" %}</button> - + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'List Settings' %}</h1></div> + <div class="panel-body"> + <ul class="nav nav-tabs"> + {% for section in section_names %} + <li {% if section.0 == visible_section %}class="active"{% endif %}><a href="{% url 'list_settings' list_id=list.list_id visible_section=section.0 %}">{{ section.1 }}</a></li> + {% endfor %} + </ul> + <br> + <form action="{% url 'list_settings' list_id=list.list_id visible_section=visible_section %}" method="post" class="form-horizontal list_settings"> + {% csrf_token %} + {% for field in form %} + <div class="form-group"> + {% if field.errors %} + <div class="alert alert-danger">{{ field.errors }}</div> + {% endif %} + <label class="control-label col-md-2" for="{{ field.id_for_label }}"> + {{ field.label }}: + </label> + <div class="col-md-8"> + {% if field|fieldtype == 'RadioSelect' %} + {% for choice in field %} + <label class="radio-inline"> + {{ choice.tag }} + {{ choice.choice_label }} + </label> + {% endfor %} + {% else %} + {{ field|add_form_control }} + {% endif %} + </div> + <div class="row"> + <span id="help-{{ field.label }}" class="col-md-offset-2 col-md-8 help-block"> + {{ field.help_text }} + </span> + </div> + </div> + {% endfor %} + <button class="col-md-offset-2 btn btn-primary btn-success" type="submit">{% trans 'Save changes' %}</button> + </form> </div> - - </form> - + </div> {% endblock %} diff --git a/src/postorius/templates/postorius/lists/subscription_requests.html b/src/postorius/templates/postorius/lists/subscription_requests.html index 75c2929..4e043ff 100644 --- a/src/postorius/templates/postorius/lists/subscription_requests.html +++ b/src/postorius/templates/postorius/lists/subscription_requests.html @@ -2,39 +2,38 @@ {% load i18n %} {% load nav_helpers %} -{% block body_class %}list_summary{% endblock %} - {% block main %} - {% list_nav 'list_subscription_requests' "Subscription Requests" %} + {% list_nav 'list_subscription_requests' 'Subscription Requests' %} + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Subscription Requests' %}</h1></div> - {% if list.requests|length > 0 %} - - <table class="table table-bordered table-striped"> - <thead> - <tr> - <th>{% trans 'E-Mail Address' %}</th> - <th> </th> - </tr> - </thead> - <tbody> - {% for request in list.requests %} - <tr> - <td>{{ request.email }}</td> - - <td class="mm_action"> - <a href="{% url 'handle_subscription_request' list.list_id request.token 'accept' %}" class="btn btn-mini btn-success">{% trans 'Accept' %}</a> - <a href="{% url 'handle_subscription_request' list.list_id request.token 'reject' %}" class="btn btn-mini btn-danger">{% trans 'Reject' %}</a> - <a href="{% url 'handle_subscription_request' list.list_id request.token 'discard' %}" class="btn btn-mini btn-danger">{% trans 'Discard' %}</a> - </td> - </tr> - {% endfor %} - </tbody> - </table> - - {% else %} - - <p>{% trans 'There are currently no subscription requests for this list.' %}</p> - - {% endif %} - + <div class="panel-body"> + {% if list.requests|length > 0 %} + <div class="table-responsive"> + <table class="table table-bordered table-striped"> + <thead> + <tr> + <th>{% trans 'E-Mail Address' %}</th> + <th>{% trans 'Actions' %}</th> + </tr> + </thead> + <tbody> + {% for request in list.requests %} + <tr> + <td>{{ request.email }}</td> + <td> + <a href="{% url 'handle_subscription_request' list.list_id request.token 'accept' %}" class="btn btn-xs btn-success">{% trans 'Accept' %}</a> + <a href="{% url 'handle_subscription_request' list.list_id request.token 'reject' %}" class="btn btn-xs btn-danger">{% trans 'Reject' %}</a> + <a href="{% url 'handle_subscription_request' list.list_id request.token 'discard' %}" class="btn btn-xs btn-danger">{% trans 'Discard' %}</a> + </td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + {% else %} + <p>{% trans 'There are currently no subscription requests for this list.' %}</p> + {% endif %} + </div> + </div> {% endblock %} diff --git a/src/postorius/templates/postorius/lists/summary.html b/src/postorius/templates/postorius/lists/summary.html index 3fbd1a0..d9011ae 100644 --- a/src/postorius/templates/postorius/lists/summary.html +++ b/src/postorius/templates/postorius/lists/summary.html @@ -1,105 +1,86 @@ {% extends postorius_base_template %} {% load i18n %} - -{% block subtitle %} -{% trans "Info | " as page_title %}{{ page_title|add:list.fqdn_listname}} -{% endblock %} - +{% load bootstrap_tags %} {% load nav_helpers %} -{% block body_class %}list_summary{% endblock %} +{% block subtitle %} +{% trans 'Info' %} | {{ list.fqdn_listname }} +{% endblock %} {% block main %} {% if user.is_superuser or user.is_list_owner or user.is_list_moderator %} {% list_nav 'list_summary' 'Summary' %} {% endif %} - - <div class="well"> - - <h1>{{list.display_name}} - {{ list.fqdn_listname }}</h1> - <p>{{list.settings.description }}</p> - - {% if hyperkitty_url %} - <h2>{% trans 'Archived messages' %}</h2> - {% url 'hk_list_overview' list.fqdn_listname as hyperkitty_list_url %} - {% blocktrans %} - To see the prior postings to this list, visit - <a href="{{ hyperkitty_list_url }}">the archives</a>. - {% endblocktrans %} - {% endif %} - - <dl> - <dt>{% trans 'To contact the list owners, use the following email address:' %}</dt> - <dd>{{ list.settings.owner_address }}</dd> - </dl> - - {% if user.is_authenticated %} - {% if user.is_list_owner or user.is_superuser %} - <h2>{% trans 'List Metrics' %}</h2> - <table class="table table-bordered table-striped"> - <tbody> - <tr> - <th>{% trans 'Created at' %}</th> - <td>{{list.settings.created_at}}</td> - </tr> - <tr> - <th>{% trans 'Last post at' %}</th> - <td>{{list.settings.last_post_at}}</td> - </tr> - <tr> - <th>{% trans 'Digest last sent at' %}</th> - <td>{{list.settings.digest_last_sent_at}}</td> - </tr> - <tr> - <th>{% trans 'Volume' %}</th> - <td>{{list.settings.volume}}</td> - </tr> - </tbody> - </table> - {% endif %} - {% endif %} - + <div class="panel panel-default"> + <div class="panel-heading"><h1 class="panel-title">{% trans 'Summary' %}</h1></div> + <div class="panel-body"> + <h1>{{list.display_name }} - {{ list.fqdn_listname }}</h1> + <p>{{ list.settings.description }}</p> + {% if hyperkitty_url %} + {% url 'hk_list_overview' list.fqdn_listname as hyperkitty_list_url %} + {% blocktrans %} + To see the prior postings to this list, visit + <a href="{{ hyperkitty_list_url }}">the archives</a>. + {% endblocktrans %} + {% endif %} + {% if user.is_authenticated %} + {% if user.is_list_owner or user.is_superuser %} + <hr /> + <p><label>{% trans 'Created at' %}:</label> {{ list.settings.created_at }}</p> + <p><label>{% trans 'Last post at' %}:</label> {{ list.settings.last_post_at }}</p> + <p><label>{% trans 'Digest last sent at' %}:</label> {{ list.settings.digest_last_sent_at }}</p> + <p><label>{% trans 'Volume' %}:</label> {{ list.settings.volume }}</p> + <hr /> + {% endif %} + {% endif %} + {% trans 'To contact the list owners, use the following email address' %}: <em>{{ list.settings.owner_address }}</em> + {% if user.is_authenticated %} + {% if userSubscribed %} + <p> + {% trans 'You are subscribed to this list with the following address' %}: <em>{{ subscribed_address }}</em> + </p> + <hr /> + <form action="{% url 'change_subscription' list.list_id %}" method="POST" class="form-horizontal"> + {% csrf_token %} + {% if change_subscription_form.non_field_errors %} + <div class="alert alert-danger">{{ change_subscription_form.non_field_erros }}</div> + {% endif %} + {% for field in change_subscription_form %} + <div class="form-group"> + {% if field.errors %} + <div class="alert alert-danger">{{ field.errors }}</div> + {% endif %} + <label class="control-label col-md-2" for="{{ field.id_for_label }}">{{ field.label }}:</label> + <div class="col-md-8">{{ field|add_form_control }}</div> + </div> + {% endfor %} + <input class="col-md-offset-2 btn btn-success" type="submit" value="{% trans 'Change Subscription' %}"> + </form> + <hr /> + <a href="{% url 'list_unsubscribe' list.list_id subscribed_address %}" class="col-md-offset-2 btn btn-danger">{% trans 'Unsubscribe' %} {{ subscribed_address }}</a> + {% else %} + <h2>{% trans 'Subscribe to this list' %}</h2> + <form action="{% url 'list_subscribe' list.list_id %}" method="post" class="form-horizontal"> + {% csrf_token %} + {% if subscribe_form.non_field_errors %} + <div class="alert alert-danger">{{ subscribe_form.non_field_erros }}</div> + {% endif %} + {% for field in subscribe_form %} + <div class="form-group"> + {% if field.errors %} + <div class="alert alert-danger">{{ field.errors }}</div> + {% endif %} + <label class="control-label col-md-2" for="{{ field.id_for_label }}">{{ field.label }}:</label> + <div class="col-md-8">{{ field|add_form_control }}</div> + </div> + {% endfor %} + <input class="col-md-offset-2 btn btn-success" type="submit" value="{% trans 'Subscribe' %}" /> + </form> + {% endif %} + {% else %} + <p>{% trans 'You have to log in to subscribe to this list.' %}</p> + <p><a href="{% url 'user_login' %}"class="btn btn-primary">{% trans 'Log In' %}</a></p> + {% endif %} + </div> </div> - - - {% if user.is_authenticated %} - - {% if userSubscribed %} - - - <p> - {% trans "You are subscribed to this list with the following address" %}: <em>{{ subscribed_address }}</em> - </p> - - <hr /> - - <form action="{% url 'change_subscription' list.list_id %}" method="POST" class="change_subscription"> - {% csrf_token %} - {{change_subscription_form.as_p}} - <input class="btn btn-success" type="submit" value="{% trans 'Change Subscription' %}"> - </form> - - <hr /> - - <a href="{% url 'list_unsubscribe' list.list_id subscribed_address %}" class="btn btn-danger">{% trans "Unsubscribe" %} {{ subscribed_address }}</a> - - - {% else %} - - <h2>{% trans 'Subscribe to this list' %}</h2> - - <form action="{% url 'list_subscribe' list.list_id %}" method="post" class="list_subscribe"> {% csrf_token %} - {{subscribe_form.as_p}} - <input class="btn btn-success" type="submit" value="{% trans 'Subscribe' %}" /> - </form> - - {% endif %} - - {% else %} - - <p>{% trans "You have to log in to subscribe to this list." %}</p> - <p><a href="{{ login_url }}?next={{ request.path|urlencode }}" class="btn btn-primary">{% trans "Log In" %}</a></p> - - {% endif %} - {% endblock %}