diff --git a/README.rst b/README.rst index 0af843c..d978a8a 100644 --- a/README.rst +++ b/README.rst @@ -26,7 +26,7 @@ Postorius requires Python 2.6 or newer and mailman.client, the official Python bindings for GNU Mailman, it also requires django-social-auth. -The minimum Django version is 1.3. +The minimum Django version is 1.6. Postorius needs a running version of GNU Mailman version 3. diff --git a/setup.py b/setup.py index 8dcca73..0c01869 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ setup( name="postorius", - version='1.0.0b1', + version='1.0.0b3', description="A web user interface for GNU Mailman", long_description=open('README.rst').read(), maintainer="The Mailman GSOC Coders", @@ -39,7 +39,7 @@ packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, - install_requires=['django>=1.5, <1.8', + install_requires=['django>=1.6', 'django-browserid', 'mailmanclient'] ) diff --git a/src/postorius/__init__.py b/src/postorius/__init__.py index d841089..871cc3f 100644 --- a/src/postorius/__init__.py +++ b/src/postorius/__init__.py @@ -16,4 +16,4 @@ # You should have received a copy of the GNU General Public License along with # Postorius. If not, see . -__version__ = '1.0.0b1' +__version__ = '1.0.0b3' diff --git a/src/postorius/context_processors.py b/src/postorius/context_processors.py index 5895b84..6a9a4b4 100644 --- a/src/postorius/context_processors.py +++ b/src/postorius/context_processors.py @@ -15,8 +15,12 @@ # # You should have received a copy of the GNU General Public License along with # Postorius. If not, see . + import logging +from django.conf import settings +from django.core.urlresolvers import reverse, NoReverseMatch + logger = logging.getLogger(__name__) @@ -31,7 +35,16 @@ else: template_to_extend = "postorius/base.html" + # Find the HyperKitty URL if installed + hyperkitty_url = False + if "hyperkitty" in settings.INSTALLED_APPS: + try: + hyperkitty_url = reverse("hk_root") + except NoReverseMatch: + pass + return { 'postorius_base_template': template_to_extend, 'request': request, + 'hyperkitty_url': hyperkitty_url, } diff --git a/src/postorius/doc/news.rst b/src/postorius/doc/news.rst index 824807a..5f61066 100644 --- a/src/postorius/doc/news.rst +++ b/src/postorius/doc/news.rst @@ -20,9 +20,9 @@ along with Postorius. If not, see . -1.0.0 -===== -(2015-04-xx) +1.0 beta 2 +========== +(2015-04-15) * French translation. Provided by Guillaume Libersat * Addedd an improved test harness using WebTest. Contributed by Aurélien Bompard. diff --git a/src/postorius/forms.py b/src/postorius/forms.py index d9eb612..67b937c 100644 --- a/src/postorius/forms.py +++ b/src/postorius/forms.py @@ -40,16 +40,13 @@ description = forms.CharField( label=_('Description'), required=False) - contact_address = forms.EmailField( - label=_('Contact Address'), - required=False) def clean_mail_host(self): mail_host = self.cleaned_data['mail_host'] try: validate_email('mail@' + mail_host) except: - raise forms.ValidationError(_("Enter a valid Mail Host")) + raise forms.ValidationError(_("Please enter a valid domain name")) return mail_host def clean_web_host(self): @@ -57,7 +54,7 @@ try: URLValidator()(web_host) except: - raise forms.ValidationError(_("Please enter a valid Web Host")) + raise forms.ValidationError(_("Please enter a valid domain name")) return web_host class Meta: @@ -425,10 +422,19 @@ # label=_('No reply address'), # required=False, # ) - posting_pipeline = forms.CharField( + posting_pipeline = forms.ChoiceField( label=_('Pipeline'), + widget=forms.Select(), + required=False, + error_messages={ + 'required': _("Please choose a reply-to action.")}, + choices=( + ("default-owner-pipeline", _("default-owner-pipeline")), + ("default-posting-pipeline", _("default-posting-pipeline")), + ("virgin", _("virgin"))), help_text=( 'Type of pipeline you want to use for this mailing list') + ) # post_id = forms.IntegerField( # label=_('Post ID'), @@ -743,6 +749,24 @@ layout = [["Mass subscription", "emails"]] +class ListMassRemoval(FieldsetForm): + + """Form fields to remove multiple list users. + """ + emails = forms.CharField( + label=_('Emails to Unsubscribe'), + widget=forms.Textarea, + ) + + class Meta: + + """ + Class to define the name of the fieldsets and what should be + included in each. + """ + layout = [["Mass Removal", "emails"]] + + class UserPreferences(FieldsetForm): """ diff --git a/src/postorius/static/postorius/css/style.css b/src/postorius/static/postorius/css/style.css index 6ad2f13..af1a86f 100755 --- a/src/postorius/static/postorius/css/style.css +++ b/src/postorius/static/postorius/css/style.css @@ -52,7 +52,7 @@ /***** meta nav *****/ .mm_header { - padding: 5px; + padding: 5px 0; border-bottom: 1px solid #CACACA; background: #fafafa; background: -moz-linear-gradient(top, #fff 0%, #efefef 100%); diff --git a/src/postorius/static/postorius/js/script.js b/src/postorius/static/postorius/js/script.js index 9651f3a..fbd37a8 100755 --- a/src/postorius/static/postorius/js/script.js +++ b/src/postorius/static/postorius/js/script.js @@ -1,5 +1,4 @@ $(document).ready(function(){ $('.collapse').collapse({ - toggle: false, - }); +toggle: false, }); diff --git a/src/postorius/templates/postorius/base.html b/src/postorius/templates/postorius/base.html index 4fe0ec2..3dc4283 100644 --- a/src/postorius/templates/postorius/base.html +++ b/src/postorius/templates/postorius/base.html @@ -3,14 +3,16 @@ - Mailman/Postorius + + {% block title %} + {% block subtitle %}{% endblock %}{{ subtitle|add:"-Mailman/Postorius" }} + {% endblock %} + - - @@ -63,7 +65,6 @@ - - + {% block additionaljs %}{% endblock %} diff --git a/src/postorius/templates/postorius/domain_confirm_delete.html b/src/postorius/templates/postorius/domain_confirm_delete.html index a33cc84..23ea00c 100644 --- a/src/postorius/templates/postorius/domain_confirm_delete.html +++ b/src/postorius/templates/postorius/domain_confirm_delete.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Confirm Domain Removal | " as page_title %}{{ page_title|add:domain}} +{% endblock %} + {% load nav_helpers %} {% block main %} diff --git a/src/postorius/templates/postorius/domain_index.html b/src/postorius/templates/postorius/domain_index.html index 771d238..dfa11a1 100644 --- a/src/postorius/templates/postorius/domain_index.html +++ b/src/postorius/templates/postorius/domain_index.html @@ -2,6 +2,10 @@ {% load url from future %} {% load i18n %} +{% block subtitle %} +{% trans "Domains" as page_title %}{{ page_title }} +{% endblock %} + {% block main %}

{% trans "Domain Index" %}

diff --git a/src/postorius/templates/postorius/domain_new.html b/src/postorius/templates/postorius/domain_new.html index a6b3685..b468b01 100644 --- a/src/postorius/templates/postorius/domain_new.html +++ b/src/postorius/templates/postorius/domain_new.html @@ -2,6 +2,10 @@ {% load url from future %} {% load i18n %} +{% block subtitle %} +{% trans "Add Domain" as page_title %}{{ page_title }} +{% endblock %} + {% block main %} {% include 'postorius/menu/settings_nav.html' %} @@ -37,15 +41,6 @@ -

- {{ form.contact_address.errors }} - -
- {{ form.contact_address}} -

{% trans "Example:" %} {% trans "postmaster@domain.org" %}

-
-
-
diff --git a/src/postorius/templates/postorius/lists/archival_options.html b/src/postorius/templates/postorius/lists/archival_options.html index 99f0594..abc0ad2 100644 --- a/src/postorius/templates/postorius/lists/archival_options.html +++ b/src/postorius/templates/postorius/lists/archival_options.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Archival Options | " as page_title %}{{ page_title|add:list.fqdn_listname}} +{% endblock %} + {% load nav_helpers %} {% block main %} diff --git a/src/postorius/templates/postorius/lists/confirm_delete.html b/src/postorius/templates/postorius/lists/confirm_delete.html index d868e29..a74a19c 100644 --- a/src/postorius/templates/postorius/lists/confirm_delete.html +++ b/src/postorius/templates/postorius/lists/confirm_delete.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Delete | " as page_title %}{{ page_title|add:list.fqdn_listname}} +{% endblock %} + {% load nav_helpers %} {% block main %} diff --git a/src/postorius/templates/postorius/lists/confirm_remove_role.html b/src/postorius/templates/postorius/lists/confirm_remove_role.html index b7e1ccb..f78f85c 100644 --- a/src/postorius/templates/postorius/lists/confirm_remove_role.html +++ b/src/postorius/templates/postorius/lists/confirm_remove_role.html @@ -1,6 +1,11 @@ {% extends "postorius/base.html" %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Confirm Remove Role | " as page_title %}{{ page_title|add:address}} +{% endblock %} + {% load nav_helpers %} {% block main %} diff --git a/src/postorius/templates/postorius/lists/confirm_removeall_subscribers.html b/src/postorius/templates/postorius/lists/confirm_removeall_subscribers.html new file mode 100644 index 0000000..398388c --- /dev/null +++ b/src/postorius/templates/postorius/lists/confirm_removeall_subscribers.html @@ -0,0 +1,14 @@ +{% extends "postorius/base.html" %} +{% load url from future %} +{% load i18n %} +{% load nav_helpers %} + +{% block main %} +

{% trans 'Confirm Removal of All Members' %}

+

{% trans "Are you sure you want to unsubscribe all members from " %}{{list_id}}{% trans " ?"%}

+
+
+ {% csrf_token %} + + {% trans "Cancel" %} +{% endblock main %} diff --git a/src/postorius/templates/postorius/lists/held_messages.html b/src/postorius/templates/postorius/lists/held_messages.html index 8db0c33..7f2014d 100644 --- a/src/postorius/templates/postorius/lists/held_messages.html +++ b/src/postorius/templates/postorius/lists/held_messages.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Held Messages | " as page_title %}{{ page_title|add:list.fqdn_listname}} +{% endblock %} + {% load nav_helpers %} {% block body_class %}list_summary{% endblock %} diff --git a/src/postorius/templates/postorius/lists/index.html b/src/postorius/templates/postorius/lists/index.html index f157d9e..63a692a 100644 --- a/src/postorius/templates/postorius/lists/index.html +++ b/src/postorius/templates/postorius/lists/index.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "List Index" as page_title %}{{ page_title }} +{% endblock %} + {% block main %}
diff --git a/src/postorius/templates/postorius/lists/mass_removal.html b/src/postorius/templates/postorius/lists/mass_removal.html new file mode 100644 index 0000000..8ba5427 --- /dev/null +++ b/src/postorius/templates/postorius/lists/mass_removal.html @@ -0,0 +1,17 @@ +{% extends postorius_base_template %} +{% load url from future %} +{% load i18n %} +{% load nav_helpers %} + +{% block main %} + {% list_nav 'mass_removal' "Mass Removal" %} + + {% csrf_token %} + {{ form.as_p }} +
+ + {% trans 'Unsubscribe All' %} + +
+ +{% endblock main %} diff --git a/src/postorius/templates/postorius/lists/mass_subscribe.html b/src/postorius/templates/postorius/lists/mass_subscribe.html index c9ea714..9f7d999 100644 --- a/src/postorius/templates/postorius/lists/mass_subscribe.html +++ b/src/postorius/templates/postorius/lists/mass_subscribe.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Mass Subscribe | "%}{{ page_title|add:list.fqdn_listname}} +{% endblock %} + {% load nav_helpers %} {% block main %} diff --git a/src/postorius/templates/postorius/lists/memberoptions.html b/src/postorius/templates/postorius/lists/memberoptions.html index ffaa700..06342f0 100644 --- a/src/postorius/templates/postorius/lists/memberoptions.html +++ b/src/postorius/templates/postorius/lists/memberoptions.html @@ -3,6 +3,10 @@ {% load i18n %} {% load nav_helpers %} +{% block subtitle %} +{% trans "Member Options | " as page_title %}{{ page_title|add:user.username}} +{% endblock %} + {% block main %} {% list_nav '' 'Member Options' %} diff --git a/src/postorius/templates/postorius/lists/members.html b/src/postorius/templates/postorius/lists/members.html index 5fccd41..f532595 100644 --- a/src/postorius/templates/postorius/lists/members.html +++ b/src/postorius/templates/postorius/lists/members.html @@ -1,11 +1,15 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Members | " as page_title %}{{ page_title|add:list.fqdn_listname}} +{% endblock %} + {% load nav_helpers %} {% block main %} {% list_nav 'list_members' "List Members" %} -

{% trans "Owners" %}

{{ owner_form.email.errors }} @@ -61,7 +65,6 @@

{% trans "Members" %}

- diff --git a/src/postorius/templates/postorius/lists/metrics.html b/src/postorius/templates/postorius/lists/metrics.html index 75030e4..074a22c 100644 --- a/src/postorius/templates/postorius/lists/metrics.html +++ b/src/postorius/templates/postorius/lists/metrics.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "List Metrics | " as page_title %}{{ page_title|add:list.fqdn_listname }} +{% endblock %} + {% load nav_helpers %} {% block main %} diff --git a/src/postorius/templates/postorius/lists/new.html b/src/postorius/templates/postorius/lists/new.html index 7091031..875ac89 100644 --- a/src/postorius/templates/postorius/lists/new.html +++ b/src/postorius/templates/postorius/lists/new.html @@ -2,6 +2,10 @@ {% load url from future %} {% load i18n %} +{% block subtitle %} +{% trans "Create List" as page_title %}{{ page_title }} +{% endblock %} + {% block main %}

{% trans "Create a new List" %} {{ block.super }}

{% csrf_token %} diff --git a/src/postorius/templates/postorius/lists/settings.html b/src/postorius/templates/postorius/lists/settings.html index 11bd328..b8b1422 100644 --- a/src/postorius/templates/postorius/lists/settings.html +++ b/src/postorius/templates/postorius/lists/settings.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Settings | " as page_title %}{{ page_title|add:list.fqdn_listname}} +{% endblock %} + {% load nav_helpers %} {% block main %} diff --git a/src/postorius/templates/postorius/lists/subscribe.html b/src/postorius/templates/postorius/lists/subscribe.html index 66bba21..4d1f763 100644 --- a/src/postorius/templates/postorius/lists/subscribe.html +++ b/src/postorius/templates/postorius/lists/subscribe.html @@ -2,6 +2,10 @@ {% load url from future %} {% load i18n %} +{% block subtitle %} +{% trans "Subscribe | " as page_title %}{{ page_title|add:list.fqdn_listname }} +{% endblock %} + {% block main %}

{% trans 'Subscribe' %} {{ list.fqdn_listname}}

{% csrf_token %} diff --git a/src/postorius/templates/postorius/lists/summary.html b/src/postorius/templates/postorius/lists/summary.html index 7cf06b6..253bc44 100644 --- a/src/postorius/templates/postorius/lists/summary.html +++ b/src/postorius/templates/postorius/lists/summary.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Info | " as page_title %}{{ page_title|add:list.fqdn_listname}} +{% endblock %} + {% load nav_helpers %} {% block body_class %}list_summary{% endblock %} @@ -15,6 +20,14 @@

{{list.display_name}} - {{ list.fqdn_listname }}

{{list.settings.description }}

+ {% if hyperkitty_url %} +

{% trans 'Archived messages' %}

+ {% blocktrans %} + To see the prior postings to this list, visit + the archives. + {% endblocktrans %} + {% endif %} +
{% trans 'To contact the list owners, use the following email address:' %}
{{ list.settings.owner_address }}
@@ -22,6 +35,7 @@ + {% if user.is_authenticated %} {% if userSubscribed %} @@ -45,4 +59,5 @@

{% trans "Log In" %}

{% endif %} + {% endblock %} diff --git a/src/postorius/templates/postorius/lists/unsubscribe.html b/src/postorius/templates/postorius/lists/unsubscribe.html index 29644e1..dfd709a 100644 --- a/src/postorius/templates/postorius/lists/unsubscribe.html +++ b/src/postorius/templates/postorius/lists/unsubscribe.html @@ -2,6 +2,10 @@ {% load url from future %} {% load i18n %} +{% block subtitle %} +{% trans "Confirm List Delete" as page_title %}{{ page_title|add:list.fqdn_listname}} +{% endblock %} + {% block main %}

{% trans 'Delete List' %} {{ list.fqdn_listname}}

{% trans 'Are you sure you want to delete' %} {{ list.fqdn_listname }}?

diff --git a/src/postorius/templates/postorius/login.html b/src/postorius/templates/postorius/login.html index d469816..69f8d42 100644 --- a/src/postorius/templates/postorius/login.html +++ b/src/postorius/templates/postorius/login.html @@ -3,6 +3,11 @@ {% load i18n %} {% load staticfiles %} {% load browserid %} + +{% block subtitle %} +{% trans "Login" as page_title %}{{ page_title }} +{% endblock %} + {% block main %} {% browserid_info %} diff --git a/src/postorius/templates/postorius/menu/list_nav.html b/src/postorius/templates/postorius/menu/list_nav.html index 132837c..98900a6 100644 --- a/src/postorius/templates/postorius/menu/list_nav.html +++ b/src/postorius/templates/postorius/menu/list_nav.html @@ -21,6 +21,9 @@ {% if user.is_superuser or user.is_list_owner %}
  • {% trans "Mass Subscribe" %}
  • {% endif %} + {% if user.is_superuser or user.is_list_owner %} +
  • {% trans "Mass Removal" %}
  • + {% endif %} {% if user.is_superuser or user.is_list_owner %}
  • {% trans "Archivers" %}
  • {% endif %} diff --git a/src/postorius/templates/postorius/user_address_activation.html b/src/postorius/templates/postorius/user_address_activation.html index aee976c..e98cb34 100644 --- a/src/postorius/templates/postorius/user_address_activation.html +++ b/src/postorius/templates/postorius/user_address_activation.html @@ -2,6 +2,10 @@ {% load url from future %} {% load i18n %} +{% block subtitle %} +{% trans "Add Email | " as page_title %}{{ page_title|add:user.username }} +{% endblock %} + {% block main %} {% include 'postorius/menu/user_nav.html' %} diff --git a/src/postorius/templates/postorius/user_address_activation_sent.html b/src/postorius/templates/postorius/user_address_activation_sent.html index a369f77..5afaae5 100644 --- a/src/postorius/templates/postorius/user_address_activation_sent.html +++ b/src/postorius/templates/postorius/user_address_activation_sent.html @@ -1,6 +1,11 @@ {% extends postorius_base_template %} {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Confirmation Sent" as page_title %}{{ page_title }} +{% endblock %} + {% block main %} {% include 'postorius/menu/user_nav.html' %} diff --git a/src/postorius/templates/postorius/user_address_preferences.html b/src/postorius/templates/postorius/user_address_preferences.html index 71b1789..7435c7e 100644 --- a/src/postorius/templates/postorius/user_address_preferences.html +++ b/src/postorius/templates/postorius/user_address_preferences.html @@ -1,6 +1,12 @@ {% extends postorius_base_template %} + {% load url from future %} {% load i18n %} + +{% block subtitle %} +{% trans "Subscription Preferences | " as page_title %}{{ page_title|add:user.username }} +{% endblock %} + {% block main %} {% include 'postorius/menu/user_nav.html' %}