diff --git a/src/postorius/models.py b/src/postorius/models.py index df3cf28..abc277b 100644 --- a/src/postorius/models.py +++ b/src/postorius/models.py @@ -287,7 +287,7 @@ The following settings are recognized: - >>> EMAIL_CONFIRMATION_TEMPLATE = 'postorius/address_confirmation_message.txt' + >>> EMAIL_CONFIRMATION_TEMPLATE = 'postorius/user/address_confirmation_message.txt' >>> EMAIL_CONFIRMATION_FROM = 'postmaster@list.org' >>> EMAIL_CONFIRMATION_SUBJECT = 'Confirmation needed' @@ -306,7 +306,7 @@ if not template_path: template_path = getattr(settings, 'EMAIL_CONFIRMATION_TEMPLATE', - 'postorius/address_confirmation_message.txt') + 'postorius/user/address_confirmation_message.txt') # Create a template context (if there is none) containing # the activation_link and the host_url. if not template_context: diff --git a/src/postorius/templates/postorius/_pagination.html b/src/postorius/templates/postorius/_pagination.html deleted file mode 100644 index 29d6dd2..0000000 --- a/src/postorius/templates/postorius/_pagination.html +++ /dev/null @@ -1,74 +0,0 @@ -{% load i18n %} - -{% if page.paginator.num_pages > 1 %} - -{% endif %} diff --git a/src/postorius/templates/postorius/address_confirmation_message.txt b/src/postorius/templates/postorius/address_confirmation_message.txt deleted file mode 100644 index 8166a13..0000000 --- a/src/postorius/templates/postorius/address_confirmation_message.txt +++ /dev/null @@ -1,6 +0,0 @@ -Please click the link below to add your email address to your mailing list -profile at {{ host_url }}: - -{{ activation_link }} - -Thanks! diff --git a/src/postorius/templates/postorius/address_notification_message.txt b/src/postorius/templates/postorius/address_notification_message.txt deleted file mode 100644 index 73bae33..0000000 --- a/src/postorius/templates/postorius/address_notification_message.txt +++ /dev/null @@ -1,7 +0,0 @@ -Someone has requested to add {{email}} to their mailing list profile at {{ host_url }}. - -If you are that person, please click the link below to confirm. - -{{ activation_link }} - -Thanks! diff --git a/src/postorius/templates/postorius/domain/confirm_delete.html b/src/postorius/templates/postorius/domain/confirm_delete.html new file mode 100644 index 0000000..96fe721 --- /dev/null +++ b/src/postorius/templates/postorius/domain/confirm_delete.html @@ -0,0 +1,24 @@ +{% extends postorius_base_template %} +{% load i18n %} + +{% block subtitle %} +{% trans 'Confirm Domain Removal' %} | {{ domain}} +{% endblock %} + +{% load nav_helpers %} + +{% block main %} + + + +

{% trans 'Are you sure you want to permanently delete this Domain?' %}

+ +
+ {% csrf_token %} + + {% trans 'Cancel' %} +
+ +{% endblock main %} diff --git a/src/postorius/templates/postorius/domain/index.html b/src/postorius/templates/postorius/domain/index.html new file mode 100644 index 0000000..da4c017 --- /dev/null +++ b/src/postorius/templates/postorius/domain/index.html @@ -0,0 +1,39 @@ +{% extends postorius_base_template %} +{% load i18n %} + +{% block subtitle %} +{% trans 'Domains' %} +{% endblock %} + +{% block main %} + + + +

{% trans 'Add Domain' %}

+ +
+ + + + + + + + + + + {% for domain in domains %} + + + + + + + {% endfor %} + +
{% trans 'Mail Host' %}{% trans 'URL Host' %}{% trans 'Description' %} 
{{ domain.mail_host }}{{ domain.base_url }}{{ domain.description }}{% trans 'Delete' %}
+
+ +{% endblock main %} diff --git a/src/postorius/templates/postorius/domain/new.html b/src/postorius/templates/postorius/domain/new.html new file mode 100644 index 0000000..50f2802 --- /dev/null +++ b/src/postorius/templates/postorius/domain/new.html @@ -0,0 +1,19 @@ +{% extends postorius_base_template %} +{% load i18n %} +{% load bootstrap_tags %} + +{% block subtitle %} +{% trans 'Add domain' %} +{% endblock %} + +{% block main %} + + + +
+ {% render_form_horizontal form 2 8 'Create domain' %} +
+ +{% endblock main %} diff --git a/src/postorius/templates/postorius/domain_confirm_delete.html b/src/postorius/templates/postorius/domain_confirm_delete.html deleted file mode 100644 index 96fe721..0000000 --- a/src/postorius/templates/postorius/domain_confirm_delete.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends postorius_base_template %} -{% load i18n %} - -{% block subtitle %} -{% trans 'Confirm Domain Removal' %} | {{ domain}} -{% endblock %} - -{% load nav_helpers %} - -{% block main %} - - - -

{% trans 'Are you sure you want to permanently delete this Domain?' %}

- -
- {% csrf_token %} - - {% trans 'Cancel' %} -
- -{% endblock main %} diff --git a/src/postorius/templates/postorius/domain_index.html b/src/postorius/templates/postorius/domain_index.html deleted file mode 100644 index da4c017..0000000 --- a/src/postorius/templates/postorius/domain_index.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends postorius_base_template %} -{% load i18n %} - -{% block subtitle %} -{% trans 'Domains' %} -{% endblock %} - -{% block main %} - - - -

{% trans 'Add Domain' %}

- -
- - - - - - - - - - - {% for domain in domains %} - - - - - - - {% endfor %} - -
{% trans 'Mail Host' %}{% trans 'URL Host' %}{% trans 'Description' %} 
{{ domain.mail_host }}{{ domain.base_url }}{{ domain.description }}{% trans 'Delete' %}
-
- -{% endblock main %} diff --git a/src/postorius/templates/postorius/domain_new.html b/src/postorius/templates/postorius/domain_new.html deleted file mode 100644 index 50f2802..0000000 --- a/src/postorius/templates/postorius/domain_new.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends postorius_base_template %} -{% load i18n %} -{% load bootstrap_tags %} - -{% block subtitle %} -{% trans 'Add domain' %} -{% endblock %} - -{% block main %} - - - -
- {% render_form_horizontal form 2 8 'Create domain' %} -
- -{% endblock main %} diff --git a/src/postorius/templates/postorius/index.html b/src/postorius/templates/postorius/index.html new file mode 100644 index 0000000..df2a2fe --- /dev/null +++ b/src/postorius/templates/postorius/index.html @@ -0,0 +1,54 @@ +{% extends postorius_base_template %} +{% load i18n %} + +{% block subtitle %} +{% trans 'List Index' %} +{% endblock %} + +{% block main %} + + + + {% if user.is_superuser %} +

+ {% if domain_count < 2 %} + {% trans 'Create New Domain' %} + {% endif %} + {% trans 'Create New List' %} +

+ {% endif %} + {% if lists|length > 0 %} +
+ + + + + + + + + + {% for list in lists %} + + + + + + {% endfor %} + +
{% trans 'List name' %}{% trans 'Post address' %}{% trans 'Description' %}
+ {{ list.display_name }} + {% if not list.settings.advertised %} ({% trans 'unadvertised' %}*){% endif %} + {{ list.fqdn_listname }}{{ list.settings.description }}
+
+ {% if user.is_superuser %} + * {% trans 'Only admins see unadvertised lists in the list index.' %} + {% endif %} + {% include 'postorius/lib/pagination.html' with page=lists %} + {% else %} +

{% trans 'There are currently no mailing lists.' %}

+ {% endif %} + +{% endblock main %} diff --git a/src/postorius/templates/postorius/lib/pagination.html b/src/postorius/templates/postorius/lib/pagination.html new file mode 100644 index 0000000..29d6dd2 --- /dev/null +++ b/src/postorius/templates/postorius/lib/pagination.html @@ -0,0 +1,74 @@ +{% load i18n %} + +{% if page.paginator.num_pages > 1 %} + +{% endif %} diff --git a/src/postorius/templates/postorius/lists/held_messages.html b/src/postorius/templates/postorius/lists/held_messages.html index 95e210d..5a48e97 100644 --- a/src/postorius/templates/postorius/lists/held_messages.html +++ b/src/postorius/templates/postorius/lists/held_messages.html @@ -82,7 +82,7 @@ - {% include 'postorius/_pagination.html' with page=held_messages %} + {% include 'postorius/lib/pagination.html' with page=held_messages %} {% else %}

{% trans 'There are currently no held messages.' %}

{% endif %} diff --git a/src/postorius/templates/postorius/lists/index.html b/src/postorius/templates/postorius/lists/index.html deleted file mode 100644 index 6c76705..0000000 --- a/src/postorius/templates/postorius/lists/index.html +++ /dev/null @@ -1,54 +0,0 @@ -{% extends postorius_base_template %} -{% load i18n %} - -{% block subtitle %} -{% trans 'List Index' %} -{% endblock %} - -{% block main %} - - - - {% if user.is_superuser %} -

- {% if domain_count < 2 %} - {% trans 'Create New Domain' %} - {% endif %} - {% trans 'Create New List' %} -

- {% endif %} - {% if lists|length > 0 %} -
- - - - - - - - - - {% for list in lists %} - - - - - - {% endfor %} - -
{% trans 'List name' %}{% trans 'Post address' %}{% trans 'Description' %}
- {{ list.display_name }} - {% if not list.settings.advertised %} ({% trans 'unadvertised' %}*){% endif %} - {{ list.fqdn_listname }}{{ list.settings.description }}
-
- {% if user.is_superuser %} - * {% trans 'Only admins see unadvertised lists in the list index.' %} - {% endif %} - {% include 'postorius/_pagination.html' with page=lists %} - {% else %} -

{% trans 'There are currently no mailing lists.' %}

- {% endif %} - -{% endblock main %} diff --git a/src/postorius/templates/postorius/lists/members.html b/src/postorius/templates/postorius/lists/members.html index 3af847e..503e301 100644 --- a/src/postorius/templates/postorius/lists/members.html +++ b/src/postorius/templates/postorius/lists/members.html @@ -77,7 +77,7 @@ {% if role == 'subscriber' %} - {% include 'postorius/_pagination.html' with page=members %} + {% include 'postorius/lib/pagination.html' with page=members %} {% endif %} {% else %}

{{ empty_error }}

diff --git a/src/postorius/templates/postorius/user/address_activation.html b/src/postorius/templates/postorius/user/address_activation.html new file mode 100644 index 0000000..e97586a --- /dev/null +++ b/src/postorius/templates/postorius/user/address_activation.html @@ -0,0 +1,18 @@ +{% extends postorius_base_template %} +{% load i18n %} +{% load bootstrap_tags %} +{% load nav_helpers %} + +{% block subtitle %} +{% trans 'Add email' %} | {{ user.username }} +{% endblock %} + +{% block main %} + + {% user_nav 'add_email' 'Add email address' %} + +
+ {% render_form_horizontal form 2 5 'Add email address' %} +
+ +{% endblock main %} diff --git a/src/postorius/templates/postorius/user/address_activation_sent.html b/src/postorius/templates/postorius/user/address_activation_sent.html new file mode 100644 index 0000000..dd6390f --- /dev/null +++ b/src/postorius/templates/postorius/user/address_activation_sent.html @@ -0,0 +1,15 @@ +{% extends postorius_base_template %} +{% load i18n %} +{% load nav_helpers %} + +{% block subtitle %} +{% trans "Confirmation Sent" as page_title %}{{ page_title }} +{% endblock %} + +{% block main %} + + {% user_nav 'add_email' 'Add Email Address' %} + +

{% trans 'Email address activation sent' %}

+

{% trans "A confirmation link has been sent to the email address you submitted. Please check your email account and click on the confirmation link to add this address for your account." %}

+{% endblock main %} diff --git a/src/postorius/templates/postorius/user/address_confirmation_message.txt b/src/postorius/templates/postorius/user/address_confirmation_message.txt new file mode 100644 index 0000000..8166a13 --- /dev/null +++ b/src/postorius/templates/postorius/user/address_confirmation_message.txt @@ -0,0 +1,6 @@ +Please click the link below to add your email address to your mailing list +profile at {{ host_url }}: + +{{ activation_link }} + +Thanks! diff --git a/src/postorius/templates/postorius/user/address_preferences.html b/src/postorius/templates/postorius/user/address_preferences.html new file mode 100644 index 0000000..3ffacd8 --- /dev/null +++ b/src/postorius/templates/postorius/user/address_preferences.html @@ -0,0 +1,77 @@ +{% extends postorius_base_template %} + +{% load i18n %} +{% load bootstrap_tags %} +{% load nav_helpers %} + +{% block subtitle %} +{% trans 'Subscription Preferences' %} | {{ user.username }} +{% endblock %} + +{% block main %} + + {% user_nav 'settings' 'Subscription Settings' %} + + + + {% if nolists %} +

{% trans 'No Preferences Available' %}

+

{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}

+ {% else %} +

{% trans 'Each email address can have specific Mailman preferences.' %}

+
+ {% csrf_token %} + {{ formset.management_form }} +
+ + {% for form,address in zipped_data %} + {% if forloop.first %} + + + + {% for field in form.visible_fields %} + + {% endfor %} + + + {% endif %} + + + {% for field in form %} + {% if field|fieldtype == 'RadioSelect' %} + + {% else %} + + {% endif %} + {% endfor %} + + {% endfor %} +
{% trans 'Address' %} + +
{{ address }} + {% for choice in field %} + + {% endfor %} + {{ field|add_form_control }}
+
+
+ +
+
+ {% endif %} + +{% endblock main %} +{% block additionaljs %} + +{% endblock %} diff --git a/src/postorius/templates/postorius/user/mailman_settings.html b/src/postorius/templates/postorius/user/mailman_settings.html new file mode 100644 index 0000000..44a312a --- /dev/null +++ b/src/postorius/templates/postorius/user/mailman_settings.html @@ -0,0 +1,31 @@ +{% extends postorius_base_template %} +{% load i18n %} +{% load bootstrap_tags %} +{% load nav_helpers %} + +{% block subtitle %} +{% trans 'Subscription settings' %} | {{ user.username }} +{% endblock %} + +{% block main %} + + {% user_nav 'settings' 'Subscription settings' %} + + + + {% if not mm_user %} +
+

{% trans 'No preferences available' %}

+
+

{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}

+ {% else %} +
+ {% render_form_horizontal settingsform 3 8 'Save changes' %} +
+ {% endif %} + +{% endblock main %} diff --git a/src/postorius/templates/postorius/user/profile.html b/src/postorius/templates/postorius/user/profile.html new file mode 100644 index 0000000..c6e99b3 --- /dev/null +++ b/src/postorius/templates/postorius/user/profile.html @@ -0,0 +1,38 @@ +{% extends postorius_base_template %} +{% load i18n %} +{% load nav_helpers %} + +{% block subtitle %} +{% trans 'Profile' %} | {{ user.username }} +{% endblock %} + +{% block main %} + + {% user_nav 'profile' 'User Profile' %} + + + + + + + + + + + + + + + + + + + + +
{% trans 'Mailman display name' %}{{ mm_user.display_name }}
{% trans 'Username' %}{{ user.username }}
{% trans 'Main email' %}{{ user.email}}
{% trans 'Other emails' %}
    + {% for email in user.other_emails %} +
  • {{ email }}
  • + {% endfor %} +
+ +{% endblock main %} diff --git a/src/postorius/templates/postorius/user/subscription_preferences.html b/src/postorius/templates/postorius/user/subscription_preferences.html new file mode 100644 index 0000000..6ba48ec --- /dev/null +++ b/src/postorius/templates/postorius/user/subscription_preferences.html @@ -0,0 +1,77 @@ +{% extends postorius_base_template %} +{% load i18n %} +{% load bootstrap_tags %} +{% load nav_helpers %} + +{% block subtitle %} +{% trans 'Subscription Preferences' %} | {{ user.username }} +{% endblock %} + +{% block main %} + + {% user_nav 'settings' 'Subscription Settings' %} + + + {% if nolists %} +
+

{% trans 'No Preferences Available' %}

+
+

{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}

+ {% else %} +

{% trans 'Each list subscription can have specific Mailman preferences.' %}

+
+ {% csrf_token %} + {{ formset.management_form }} +
+ + {% for form, subscription in zipped_data %} + {% if forloop.first %} + + + + {% for field in form.visible_fields %} + + {% endfor %} + + + {% endif %} + + + {% for field in form %} + {% if field|fieldtype == 'RadioSelect' %} + + {% else %} + + {% endif %} + {% endfor %} + + {% endfor %} +
{% trans 'Subscription' %} + +
{{ subscription.list_id }} + {% for choice in field %} + + {% endfor %} + {{ field|add_form_control }}
+
+
+ +
+
+ {% endif %} + +{% endblock main %} +{% block additionaljs %} + +{% endblock %} diff --git a/src/postorius/templates/postorius/user/subscriptions.html b/src/postorius/templates/postorius/user/subscriptions.html new file mode 100644 index 0000000..4a6151b --- /dev/null +++ b/src/postorius/templates/postorius/user/subscriptions.html @@ -0,0 +1,36 @@ +{% extends postorius_base_template %} + +{% load i18n %} +{% load nav_helpers %} + +{% block subtitle %} +{% trans 'Subscriptions' %} | {{ user.username }} +{% endblock %} + +{% block main %} + + {% user_nav 'subscriptions' 'List Subscriptions' %} + +

{% trans 'You are subscribed to the following mailing lists:' %}

+
+ + + + + + + + + + {% for subscription in memberships %} + + + + + + {% endfor %} + +
{% trans 'List Name' %}{% trans 'Subscription Address' %}{% trans 'Delivery Mode' %}
{{ subscription.list_id }}{{ subscription.address }}{{ subscription.preferences.delivery_mode }}
+
+ +{% endblock main %} diff --git a/src/postorius/templates/postorius/user_address_activation.html b/src/postorius/templates/postorius/user_address_activation.html deleted file mode 100644 index e97586a..0000000 --- a/src/postorius/templates/postorius/user_address_activation.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends postorius_base_template %} -{% load i18n %} -{% load bootstrap_tags %} -{% load nav_helpers %} - -{% block subtitle %} -{% trans 'Add email' %} | {{ user.username }} -{% endblock %} - -{% block main %} - - {% user_nav 'add_email' 'Add email address' %} - -
- {% render_form_horizontal form 2 5 'Add email address' %} -
- -{% endblock main %} diff --git a/src/postorius/templates/postorius/user_address_activation_sent.html b/src/postorius/templates/postorius/user_address_activation_sent.html deleted file mode 100644 index dd6390f..0000000 --- a/src/postorius/templates/postorius/user_address_activation_sent.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends postorius_base_template %} -{% load i18n %} -{% load nav_helpers %} - -{% block subtitle %} -{% trans "Confirmation Sent" as page_title %}{{ page_title }} -{% endblock %} - -{% block main %} - - {% user_nav 'add_email' 'Add Email Address' %} - -

{% trans 'Email address activation sent' %}

-

{% trans "A confirmation link has been sent to the email address you submitted. Please check your email account and click on the confirmation link to add this address for your account." %}

-{% endblock main %} diff --git a/src/postorius/templates/postorius/user_address_preferences.html b/src/postorius/templates/postorius/user_address_preferences.html deleted file mode 100644 index 3ffacd8..0000000 --- a/src/postorius/templates/postorius/user_address_preferences.html +++ /dev/null @@ -1,77 +0,0 @@ -{% extends postorius_base_template %} - -{% load i18n %} -{% load bootstrap_tags %} -{% load nav_helpers %} - -{% block subtitle %} -{% trans 'Subscription Preferences' %} | {{ user.username }} -{% endblock %} - -{% block main %} - - {% user_nav 'settings' 'Subscription Settings' %} - - - - {% if nolists %} -

{% trans 'No Preferences Available' %}

-

{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}

- {% else %} -

{% trans 'Each email address can have specific Mailman preferences.' %}

-
- {% csrf_token %} - {{ formset.management_form }} -
- - {% for form,address in zipped_data %} - {% if forloop.first %} - - - - {% for field in form.visible_fields %} - - {% endfor %} - - - {% endif %} - - - {% for field in form %} - {% if field|fieldtype == 'RadioSelect' %} - - {% else %} - - {% endif %} - {% endfor %} - - {% endfor %} -
{% trans 'Address' %} - -
{{ address }} - {% for choice in field %} - - {% endfor %} - {{ field|add_form_control }}
-
-
- -
-
- {% endif %} - -{% endblock main %} -{% block additionaljs %} - -{% endblock %} diff --git a/src/postorius/templates/postorius/user_mailmansettings.html b/src/postorius/templates/postorius/user_mailmansettings.html deleted file mode 100644 index 44a312a..0000000 --- a/src/postorius/templates/postorius/user_mailmansettings.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends postorius_base_template %} -{% load i18n %} -{% load bootstrap_tags %} -{% load nav_helpers %} - -{% block subtitle %} -{% trans 'Subscription settings' %} | {{ user.username }} -{% endblock %} - -{% block main %} - - {% user_nav 'settings' 'Subscription settings' %} - - - - {% if not mm_user %} -
-

{% trans 'No preferences available' %}

-
-

{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}

- {% else %} -
- {% render_form_horizontal settingsform 3 8 'Save changes' %} -
- {% endif %} - -{% endblock main %} diff --git a/src/postorius/templates/postorius/user_profile.html b/src/postorius/templates/postorius/user_profile.html deleted file mode 100644 index c6e99b3..0000000 --- a/src/postorius/templates/postorius/user_profile.html +++ /dev/null @@ -1,38 +0,0 @@ -{% extends postorius_base_template %} -{% load i18n %} -{% load nav_helpers %} - -{% block subtitle %} -{% trans 'Profile' %} | {{ user.username }} -{% endblock %} - -{% block main %} - - {% user_nav 'profile' 'User Profile' %} - - - - - - - - - - - - - - - - - - - - -
{% trans 'Mailman display name' %}{{ mm_user.display_name }}
{% trans 'Username' %}{{ user.username }}
{% trans 'Main email' %}{{ user.email}}
{% trans 'Other emails' %}
    - {% for email in user.other_emails %} -
  • {{ email }}
  • - {% endfor %} -
- -{% endblock main %} diff --git a/src/postorius/templates/postorius/user_subscription_preferences.html b/src/postorius/templates/postorius/user_subscription_preferences.html deleted file mode 100644 index 6ba48ec..0000000 --- a/src/postorius/templates/postorius/user_subscription_preferences.html +++ /dev/null @@ -1,77 +0,0 @@ -{% extends postorius_base_template %} -{% load i18n %} -{% load bootstrap_tags %} -{% load nav_helpers %} - -{% block subtitle %} -{% trans 'Subscription Preferences' %} | {{ user.username }} -{% endblock %} - -{% block main %} - - {% user_nav 'settings' 'Subscription Settings' %} - - - {% if nolists %} -
-

{% trans 'No Preferences Available' %}

-
-

{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}

- {% else %} -

{% trans 'Each list subscription can have specific Mailman preferences.' %}

-
- {% csrf_token %} - {{ formset.management_form }} -
- - {% for form, subscription in zipped_data %} - {% if forloop.first %} - - - - {% for field in form.visible_fields %} - - {% endfor %} - - - {% endif %} - - - {% for field in form %} - {% if field|fieldtype == 'RadioSelect' %} - - {% else %} - - {% endif %} - {% endfor %} - - {% endfor %} -
{% trans 'Subscription' %} - -
{{ subscription.list_id }} - {% for choice in field %} - - {% endfor %} - {{ field|add_form_control }}
-
-
- -
-
- {% endif %} - -{% endblock main %} -{% block additionaljs %} - -{% endblock %} diff --git a/src/postorius/templates/postorius/user_subscriptions.html b/src/postorius/templates/postorius/user_subscriptions.html deleted file mode 100644 index 4a6151b..0000000 --- a/src/postorius/templates/postorius/user_subscriptions.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends postorius_base_template %} - -{% load i18n %} -{% load nav_helpers %} - -{% block subtitle %} -{% trans 'Subscriptions' %} | {{ user.username }} -{% endblock %} - -{% block main %} - - {% user_nav 'subscriptions' 'List Subscriptions' %} - -

{% trans 'You are subscribed to the following mailing lists:' %}

-
- - - - - - - - - - {% for subscription in memberships %} - - - - - - {% endfor %} - -
{% trans 'List Name' %}{% trans 'Subscription Address' %}{% trans 'Delivery Mode' %}
{{ subscription.list_id }}{{ subscription.address }}{{ subscription.preferences.delivery_mode }}
-
- -{% endblock main %} diff --git a/src/postorius/tests/test_address_activation.py b/src/postorius/tests/test_address_activation.py index c1e9f43..2efedf7 100644 --- a/src/postorius/tests/test_address_activation.py +++ b/src/postorius/tests/test_address_activation.py @@ -81,8 +81,8 @@ def test_view_renders_correct_template(self): # The view should render the user_address_activation template. response = self.client.get(reverse('address_activation')) - self.assertTrue('postorius/user_address_activation.html' - in [t.name for t in response.templates]) + self.assertIn('postorius/user/address_activation.html', + [t.name for t in response.templates]) def test_post_invalid_form_shows_error_msg(self): # Entering an invalid email address should render an error message. @@ -99,8 +99,8 @@ 'email': 'new_address@example.org', 'user_email': self.user.email}) self.assertEqual(mock_send_confirmation_link.call_count, 1) - self.assertTrue('postorius/user_address_activation_sent.html' - in [t.name for t in response.templates]) + self.assertIn('postorius/user/address_activation_sent.html', + [t.name for t in response.templates]) class TestAddressConfirmationProfile(TestCase): diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py index 1506fac..9d24fbb 100644 --- a/src/postorius/views/list.py +++ b/src/postorius/views/list.py @@ -457,7 +457,7 @@ context_instance=RequestContext(request)) -def list_index(request, template='postorius/lists/index.html'): +def list_index(request, template='postorius/index.html'): """Show a table of all public mailing lists. """ if request.method == 'POST': diff --git a/src/postorius/views/settings.py b/src/postorius/views/settings.py index 52eb560..ff574ba 100644 --- a/src/postorius/views/settings.py +++ b/src/postorius/views/settings.py @@ -53,7 +53,7 @@ existing_domains = Domain.objects.all() except MailmanApiError: return utils.render_api_error(request) - return render_to_response('postorius/domain_index.html', + return render_to_response('postorius/domain/index.html', {'domains': existing_domains}, context_instance=RequestContext(request)) @@ -80,7 +80,7 @@ return redirect("domain_index") else: form = DomainNew() - return render_to_response('postorius/domain_new.html', + return render_to_response('postorius/domain/new.html', {'form': form, 'message': message}, context_instance=RequestContext(request)) @@ -101,6 +101,6 @@ return redirect("domain_index") submit_url = reverse('domain_delete', kwargs={'domain': domain}) - return render_to_response('postorius/domain_confirm_delete.html', + return render_to_response('postorius/domain/confirm_delete.html', {'domain': domain, 'submit_url': submit_url}, context_instance=RequestContext(request)) diff --git a/src/postorius/views/user.py b/src/postorius/views/user.py index 6ca0329..acc1d93 100644 --- a/src/postorius/views/user.py +++ b/src/postorius/views/user.py @@ -76,7 +76,7 @@ except MailmanApiError: return utils.render_api_error(request) settingsform = UserPreferences(initial=mm_user.preferences) - return render_to_response('postorius/user_mailmansettings.html', + return render_to_response('postorius/user/mailman_settings.html', {'mm_user': mm_user, 'settingsform': settingsform}, context_instance=RequestContext(request)) @@ -121,10 +121,10 @@ return utils.render_api_error(request) except Mailman404Error: return render_to_response( - 'postorius/user_address_preferences.html', + 'postorius/user/address_preferences.html', {'nolists': 'true'}, context_instance=RequestContext(request)) - return render_to_response('postorius/user_address_preferences.html', + return render_to_response('postorius/user/address_preferences.html', {'mm_user': mm_user, 'addresses': addresses, 'helperform': helperform, @@ -171,11 +171,11 @@ return utils.render_api_error(request) except Mailman404Error: return render_to_response( - 'postorius/user_subscription_preferences.html', + 'postorius/user/subscription_preferences.html', {'nolists': 'true'}, context_instance=RequestContext(request)) return render_to_response( - 'postorius/user_subscription_preferences.html', + 'postorius/user/subscription_preferences.html', {'zipped_data': zipped_data, 'formset': formset}, context_instance=RequestContext(request)) @@ -188,7 +188,7 @@ def get(self, request): memberships = self._get_memberships() - return render_to_response('postorius/user_subscriptions.html', + return render_to_response('postorius/user/subscriptions.html', {'memberships': memberships}, context_instance=RequestContext(request)) @@ -202,7 +202,7 @@ @method_decorator(login_required) def get(self, request): form = AddressActivationForm(initial={'user_email': request.user.email}) - return render_to_response('postorius/user_address_activation.html', + return render_to_response('postorius/user/address_activation.html', {'form': form}, context_instance=RequestContext(request)) @@ -217,9 +217,9 @@ except SMTPException: messages.error(request, _('The email confirmation message could not be sent. %s') % profile.activation_key) - return render_to_response('postorius/user_address_activation_sent.html', + return render_to_response('postorius/user/address_activation_sent.html', context_instance=RequestContext(request)) - return render_to_response('postorius/user_address_activation.html', + return render_to_response('postorius/user/address_activation.html', {'form': form}, context_instance=RequestContext(request)) @@ -231,7 +231,7 @@ mm_user = MailmanUser.objects.get_or_create_from_django(request.user) except MailmanApiError: return utils.render_api_error(request) - return render_to_response('postorius/user_profile.html', + return render_to_response('postorius/user/profile.html', {'mm_user': mm_user}, context_instance=RequestContext(request))