diff --git a/src/postorius/forms.py b/src/postorius/forms.py index 2abfd18..db98aaa 100644 --- a/src/postorius/forms.py +++ b/src/postorius/forms.py @@ -302,7 +302,7 @@ coerce=lambda x: x == 'True', choices=((True, _('Yes')), (False, _('No'))), widget=forms.RadioSelect, - label=_('Advertise the existance of this list?'), + label=_('Advertise the existence of this list?'), help_text=( 'Choose whether to include this list on the list of all lists')) filter_content = forms.TypedChoiceField( diff --git a/src/postorius/models.py b/src/postorius/models.py index 2f002cb..296dd31 100644 --- a/src/postorius/models.py +++ b/src/postorius/models.py @@ -69,7 +69,7 @@ raise MailmanApiError(e) except HTTPError, e: if e.code == 404: - raise Mailman404Error + raise Mailman404Error('Mailman resource could not be found.') else: raise except MailmanConnectionError, e: diff --git a/src/postorius/static/postorius/css/style.css b/src/postorius/static/postorius/css/style.css index 440698e..6423b93 100755 --- a/src/postorius/static/postorius/css/style.css +++ b/src/postorius/static/postorius/css/style.css @@ -245,12 +245,22 @@ } /* Mouseover help */ -span.more_info {border-bottom: thin dotted; background: #ffeedd;} -span.more_info:hover {text-decoration: none; background: #ffffff; z-index: 6; } -span.more_info span {position: absolute; left: -9999px; - margin: 0em; padding: 0.5em; - border-style:solid; border-color:black; border-width:1px; z-index: 6;} -span.more_info:hover span {left: 2%; background: #ffffff;} +span.more_info { + border-bottom: thin dotted; + background: #ffeedd; + font-weight: normal; +} +span.more_info:hover { + text-decoration: none; background: #ffffff; z-index: 6; +} +span.more_info span { + position: absolute; left: -9999px; + margin: 0em; padding: 0.5em; + border-style:solid; border-color:black; border-width:1px; z-index: 6; +} +span.more_info:hover span { + left: 2%; background: #ffffff; +} span.more_info span { position: absolute; left: -9999px; margin: 2em; padding: 0.5em; diff --git a/src/postorius/templates/postorius/user_address_preferences.html b/src/postorius/templates/postorius/user_address_preferences.html index e8092df..96e4141 100644 --- a/src/postorius/templates/postorius/user_address_preferences.html +++ b/src/postorius/templates/postorius/user_address_preferences.html @@ -8,121 +8,93 @@
Table to view the preferences(for testing only)
- -{% trans 'Email Address' %} | -{% trans 'Delivery Status' %} | -{% trans 'Delivery Mode' %} | -{% trans 'Receive Own Postings' %} | -{% trans 'Acknowledge Posts' %} | -{% trans 'Hide Address' %} | -{% trans 'Receive List Copy' %} | -
---|---|---|---|---|---|---|
{{ a }} | -{{ a.preferences.delivery_status }} | -{{ a.preferences.delivery_mode }} | -{{ a.preferences.receive_own_postings }} | -{{ a.preferences.acknowledge_posts }} | -{{ a.preferences.hide_address }} | -{{ a.preferences.receive_list_copy }} | -
{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}
+{% else %} + +{% endif %} {% endblock main %} - - diff --git a/src/postorius/templates/postorius/user_mailmansettings.html b/src/postorius/templates/postorius/user_mailmansettings.html index 22a791b..1f442d6 100644 --- a/src/postorius/templates/postorius/user_mailmansettings.html +++ b/src/postorius/templates/postorius/user_mailmansettings.html @@ -8,108 +8,76 @@Table to view the preferences(for testing only)
- -{% trans 'Preference' %} | -{% trans 'Value' %} | -
---|---|
{% trans 'Delivery Status' %} | -{{ mm_user.preferences.delivery_status }} | -
{% trans 'Delivery Mode' %} | -{{ mm_user.preferences.delivery_mode }} | -
{% trans 'Receive Own Postings' %} | -{{ mm_user.preferences.receive_own_postings }} | -
{% trans 'Acknowledge Posts' %} | -{{ mm_user.preferences.acknowledge_posts }} | -
{% trans 'Hide Address' %} | -{{ mm_user.preferences.hide_address }} | -
{% trans 'Receive List Copy' %} | -{{ mm_user.preferences.receive_list_copy }} | -
{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}
+{% else %} + +{% endif %} {% endblock main %} diff --git a/src/postorius/templates/postorius/user_subscription_preferences.html b/src/postorius/templates/postorius/user_subscription_preferences.html index 541ac0f..74678db 100644 --- a/src/postorius/templates/postorius/user_subscription_preferences.html +++ b/src/postorius/templates/postorius/user_subscription_preferences.html @@ -3,82 +3,48 @@ {% load i18n %} {% block main %} {% include 'postorius/menu/user_nav.html' %} -{% if nolists %} -{ % trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' % }
-{% else %} - - +{% if nolists %} +{% trans 'You are not yet subscribed to any lists, so you have no Mailman preferences.' %}
+{% else %} + {% endif %} {% endblock main %} diff --git a/src/postorius/views/generic.py b/src/postorius/views/generic.py index d85e6a9..fb24f90 100644 --- a/src/postorius/views/generic.py +++ b/src/postorius/views/generic.py @@ -136,6 +136,7 @@ self.mm_user = self._get_user(user_id) except MailmanApiError: return utils.render_api_error(request) + # set the template if 'template' in kwargs: diff --git a/src/postorius/views/user.py b/src/postorius/views/user.py index 05267fd..aee9d9f 100644 --- a/src/postorius/views/user.py +++ b/src/postorius/views/user.py @@ -50,7 +50,6 @@ class UserMailmanSettingsView(MailmanUserView): - """The logged-in user's global Mailman Preferences.""" @method_decorator(login_required) @@ -70,7 +69,7 @@ messages.error(request, 'Something went wrong.') except MailmanApiError: return utils.render_api_error(request) - except HTTPError, e: + except Mailman404Error as e: messages.error(request, e.msg) return redirect("user_mailmansettings") @@ -81,6 +80,9 @@ settingsform = UserPreferences(initial=mm_user.preferences) except MailmanApiError: return utils.render_api_error(request) + except Mailman404Error: + mm_user = None + settingsform = None return render_to_response('postorius/user_mailmansettings.html', {'mm_user': mm_user, 'settingsform': settingsform}, @@ -88,7 +90,6 @@ class UserAddressPreferencesView(MailmanUserView): - """The logged-in user's address-based Mailman Preferences.""" @method_decorator(login_required) @@ -131,6 +132,11 @@ form.initial = address.preferences except MailmanApiError: return utils.render_api_error(request) + except Mailman404Error: + return render_to_response( + 'postorius/user_address_preferences.html', + {'nolists': 'true'}, + context_instance=RequestContext(request)) return render_to_response('postorius/user_address_preferences.html', {'mm_user': mm_user, 'addresses': addresses, @@ -141,7 +147,6 @@ class UserSubscriptionPreferencesView(MailmanUserView): - """The logged-in user's subscription-based Mailman Preferences.""" @method_decorator(login_required) @@ -185,7 +190,6 @@ 'postorius/user_subscription_preferences.html', {'nolists': 'true'}, context_instance=RequestContext(request)) - return render_to_response( 'postorius/user_subscription_preferences.html', {'mm_user': mm_user,