Richard Wackerbarth has proposed merging lp:~wacky/postorius/GSoC2012 into
lp:postorius.
Requested reviews:
Florian Fuchs (flo-fuchs)
For more details, see:
https://code.launchpad.net/~wacky/postorius/GSoC2012/+merge/166629
Changes from GSoc2012. Each commit is a separate patch.
--
https://code.launchpad.net/~wacky/postorius/GSoC2012/+merge/166629
Your team Mailman Coders is subscribed to branch lp:postorius.
=== modified file 'src/postorius/context_processors.py'
--- src/postorius/context_processors.py 2012-11-18 19:51:08 +0000
+++ src/postorius/context_processors.py 2013-05-31 02:30:36 +0000
@@ -23,13 +23,13 @@
def postorius(request):
"""Add template variables to context.
"""
- # extend_template (no page header/footer when requested via AJAX)
+ # Use a template so that the page header/footer is suppressed when requested via AJAX
if request.is_ajax():
- extend_template = "postorius/base_ajax.html"
+ template_to_extend = "postorius/base_ajax.html"
else:
- extend_template = "postorius/base.html"
+ template_to_extend = "postorius/base.html"
return {
- 'extend_template': extend_template,
+ 'postorius_base_template': template_to_extend,
'request': request,
}
=== modified file 'src/postorius/management/commands/mmclient.py'
--- src/postorius/management/commands/mmclient.py 2012-09-30 14:54:41 +0000
+++ src/postorius/management/commands/mmclient.py 2013-05-31 02:30:36 +0000
@@ -19,6 +19,7 @@
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from mailmanclient import Client, MailmanConnectionError
+from postorius import utils
from urllib2 import HTTPError
class Command(BaseCommand):
@@ -44,7 +45,6 @@
shell = code.InteractiveConsole(globals())
console_fn = shell.interact
# connect to mailmanclient
- client = Client('%s/3.0' % settings.REST_SERVER,
- settings.API_USER, settings.API_PASS)
+ client = utils.get_client()
# run the interpreter
console_fn()
=== modified file 'src/postorius/models.py'
--- src/postorius/models.py 2013-03-17 18:15:36 +0000
+++ src/postorius/models.py 2013-05-31 02:30:36 +0000
@@ -25,6 +25,7 @@
from django.dispatch import receiver
from django.http import Http404
from mailmanclient import Client, MailmanConnectionError
+from postorius import utils
from urllib2 import HTTPError
@@ -48,8 +49,7 @@
"""
def __init__(self, resource_name, resource_name_plural, cls_name=None):
- self.client = Client('%s/3.0' % settings.REST_SERVER,
- settings.API_USER, settings.API_PASS)
+ self.client = utils.get_client()
self.resource_name = resource_name
self.resource_name_plural = resource_name_plural
=== modified file 'src/postorius/templates/postorius/confirm_dialog.html'
--- src/postorius/templates/postorius/confirm_dialog.html 2012-09-28 20:21:51 +0000
+++ src/postorius/templates/postorius/confirm_dialog.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/domain_confirm_delete.html'
--- src/postorius/templates/postorius/domain_confirm_delete.html 2013-03-17 18:15:36 +0000
+++ src/postorius/templates/postorius/domain_confirm_delete.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load nav_helpers %}
=== modified file 'src/postorius/templates/postorius/domain_index.html'
--- src/postorius/templates/postorius/domain_index.html 2013-03-19 22:54:34 +0000
+++ src/postorius/templates/postorius/domain_index.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends "postorius/base.html" %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/domain_new.html'
--- src/postorius/templates/postorius/domain_new.html 2012-09-28 20:21:51 +0000
+++ src/postorius/templates/postorius/domain_new.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/errors/generic.html'
--- src/postorius/templates/postorius/errors/generic.html 2012-09-28 20:21:51 +0000
+++ src/postorius/templates/postorius/errors/generic.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends "postorius/base.html" %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/lists/confirm_delete.html'
--- src/postorius/templates/postorius/lists/confirm_delete.html 2012-11-18 19:51:08 +0000
+++ src/postorius/templates/postorius/lists/confirm_delete.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load nav_helpers %}
=== modified file 'src/postorius/templates/postorius/lists/held_messages.html'
--- src/postorius/templates/postorius/lists/held_messages.html 2013-03-17 18:15:36 +0000
+++ src/postorius/templates/postorius/lists/held_messages.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends "postorius/base.html" %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load nav_helpers %}
=== modified file 'src/postorius/templates/postorius/lists/index.html'
--- src/postorius/templates/postorius/lists/index.html 2013-03-21 00:32:25 +0000
+++ src/postorius/templates/postorius/lists/index.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends "postorius/base.html" %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/lists/mass_subscribe.html'
--- src/postorius/templates/postorius/lists/mass_subscribe.html 2012-11-18 19:51:08 +0000
+++ src/postorius/templates/postorius/lists/mass_subscribe.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends "postorius/base.html" %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load nav_helpers %}
=== modified file 'src/postorius/templates/postorius/lists/members.html'
--- src/postorius/templates/postorius/lists/members.html 2013-03-29 22:04:06 +0000
+++ src/postorius/templates/postorius/lists/members.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends "postorius/base.html" %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load nav_helpers %}
=== modified file 'src/postorius/templates/postorius/lists/metrics.html'
--- src/postorius/templates/postorius/lists/metrics.html 2012-11-18 19:51:08 +0000
+++ src/postorius/templates/postorius/lists/metrics.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends "postorius/base.html" %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load nav_helpers %}
=== modified file 'src/postorius/templates/postorius/lists/new.html'
--- src/postorius/templates/postorius/lists/new.html 2012-09-28 20:21:51 +0000
+++ src/postorius/templates/postorius/lists/new.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/lists/settings.html'
--- src/postorius/templates/postorius/lists/settings.html 2013-04-06 13:24:52 +0000
+++ src/postorius/templates/postorius/lists/settings.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load nav_helpers %}
=== modified file 'src/postorius/templates/postorius/lists/subscribe.html'
--- src/postorius/templates/postorius/lists/subscribe.html 2012-09-28 20:21:51 +0000
+++ src/postorius/templates/postorius/lists/subscribe.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/lists/subscriptions.html'
--- src/postorius/templates/postorius/lists/subscriptions.html 2012-09-28 20:21:51 +0000
+++ src/postorius/templates/postorius/lists/subscriptions.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/lists/summary.html'
--- src/postorius/templates/postorius/lists/summary.html 2013-03-17 18:15:36 +0000
+++ src/postorius/templates/postorius/lists/summary.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends "postorius/base.html" %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load nav_helpers %}
=== modified file 'src/postorius/templates/postorius/lists/unsubscribe.html'
--- src/postorius/templates/postorius/lists/unsubscribe.html 2012-09-28 20:21:51 +0000
+++ src/postorius/templates/postorius/lists/unsubscribe.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/login.html'
--- src/postorius/templates/postorius/login.html 2013-03-19 18:25:30 +0000
+++ src/postorius/templates/postorius/login.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load staticfiles %}
=== added file 'src/postorius/templates/postorius/site_settings.html'
--- src/postorius/templates/postorius/site_settings.html 1970-01-01 00:00:00 +0000
+++ src/postorius/templates/postorius/site_settings.html 2013-05-31 02:30:36 +0000
@@ -0,0 +1,7 @@
+{% extends postorius_base_template %}
+{% load i18n %}
+
+{% block main %}
+ {% include 'postorius/menu/settings_nav.html' %}
+ <h1>General Settings</h1>
+{% endblock main %}
=== modified file 'src/postorius/templates/postorius/user_mailmansettings.html'
--- src/postorius/templates/postorius/user_mailmansettings.html 2013-04-08 04:07:50 +0000
+++ src/postorius/templates/postorius/user_mailmansettings.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/user_profile.html'
--- src/postorius/templates/postorius/user_profile.html 2012-12-15 21:19:58 +0000
+++ src/postorius/templates/postorius/user_profile.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/user_settings.html'
--- src/postorius/templates/postorius/user_settings.html 2012-09-28 20:21:51 +0000
+++ src/postorius/templates/postorius/user_settings.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/user_subscriptions.html'
--- src/postorius/templates/postorius/user_subscriptions.html 2012-11-04 19:54:09 +0000
+++ src/postorius/templates/postorius/user_subscriptions.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/templates/postorius/user_tasks.html'
--- src/postorius/templates/postorius/user_tasks.html 2013-03-18 21:55:33 +0000
+++ src/postorius/templates/postorius/user_tasks.html 2013-05-31 02:30:36 +0000
@@ -1,4 +1,4 @@
-{% extends extend_template %}
+{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
=== modified file 'src/postorius/urls.py'
--- src/postorius/urls.py 2013-03-29 22:04:06 +0000
+++ src/postorius/urls.py 2013-05-31 02:30:36 +0000
@@ -24,6 +24,40 @@
from postorius.views.generic import *
+per_list_urlpatterns = patterns('postorius.views',
+ url(r'^members/(?P<page>\d+)/$',
+ ListMembersView.as_view(), name='list_members_paged'),
+ url(r'^members/$',
+ ListMembersView.as_view(), name='list_members'),
+ url(r'^metrics$',
+ ListMetricsView.as_view(), name='list_metrics'),
+ url(r'^$',
+ ListSummaryView.as_view(), name='list_summary'),
+ url(r'^subscribe$',
+ ListSubsribeView.as_view(), name='list_subscribe'),
+ url(r'^unsubscribe/(?P<email>[^/]+)$',
+ ListUnsubscribeView.as_view(), name='list_unsubscribe'),
+ url(r'^subscriptions$',
+ 'list_subscriptions', name='list_subscriptions'),
+ url(r'^mass_subscribe/$',
+ ListMassSubsribeView.as_view(), name='mass_subscribe'),
+ url(r'^delete$',
+ 'list_delete', name='list_delete'),
+ url(r'^held_messages/(?P<msg_id>[^/]+)/'
+ 'accept$', 'accept_held_message', name='accept_held_message'),
+ url(r'^held_messages/(?P<msg_id>[^/]+)/'
+ 'discard$', 'discard_held_message', name='discard_held_message'),
+ url(r'^held_messages/(?P<msg_id>[^/]+)/'
+ 'defer$', 'defer_held_message', name='defer_held_message'),
+ url(r'^held_messages/(?P<msg_id>[^/]+)/'
+ 'reject$', 'reject_held_message', name='reject_held_message'),
+ url(r'^held_messages$',
+ 'list_held_messages', name='list_held_messages'),
+ url(r'^settings/(?P<visible_section>[^/]+)?'
+ '(?:/(?P<visible_option>.*))?$', 'list_settings',
+ name='list_settings'),
+)
+
urlpatterns = patterns(
'postorius.views',
(r'^$', 'list_index'),
@@ -46,41 +80,10 @@
# /lists/
url(r'^lists/$', 'list_index', name='list_index'),
url(r'^lists/new/$', 'list_new', name='list_new'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/members/(?P<page>\d+)/$',
- ListMembersView.as_view(), name='list_members_paged'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/members/$',
- ListMembersView.as_view(), name='list_members'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/metrics$',
- ListMetricsView.as_view(), name='list_metrics'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/$',
- ListSummaryView.as_view(), name='list_summary'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/subscribe$',
- ListSubsribeView.as_view(), name='list_subscribe'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/unsubscribe/(?P<email>[^/]+)$',
- ListUnsubscribeView.as_view(), name='list_unsubscribe'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/subscriptions$',
- 'list_subscriptions', name='list_subscriptions'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/mass_subscribe/$',
- ListMassSubsribeView.as_view(), name='mass_subscribe'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/delete$',
- 'list_delete', name='list_delete'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/held_messages/(?P<msg_id>[^/]+)/'
- 'accept$', 'accept_held_message', name='accept_held_message'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/held_messages/(?P<msg_id>[^/]+)/'
- 'discard$', 'discard_held_message', name='discard_held_message'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/held_messages/(?P<msg_id>[^/]+)/'
- 'defer$', 'defer_held_message', name='defer_held_message'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/held_messages/(?P<msg_id>[^/]+)/'
- 'reject$', 'reject_held_message', name='reject_held_message'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/held_messages$',
- 'list_held_messages', name='list_held_messages'),
url(r'^user_settings/$', 'user_settings', kwargs={"tab": "user"},
name='user_settings'),
- url(r'^lists/(?P<fqdn_listname>[^/]+)/settings/(?P<visible_section>[^/]+)?'
- '(?:/(?P<visible_option>.*))?$', 'list_settings',
- name='list_settings'),
url(r'^more_info/(?P<formid>[^/]+)/(?P<helpid>[^/]+)$', 'more_info_tab', name='more_info_tab'),
-
+ url(r'^lists/(?P<fqdn_listname>[^/]+)/', include(per_list_urlpatterns)),
# /users/
url(r'^users/(?P<page>\d+)/$', 'user_index', name='user_index_paged'),
url(r'^users/$', 'user_index', name='user_index'),
@@ -88,4 +91,4 @@
url(r'^users/(?P<user_id>[^/]+)/$',
UserSummaryView.as_view(), name='user_summary'),
url(r'^api/lists/$', 'api_list_index', name='api_list_index'),
-) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
+)
=== modified file 'src/postorius/utils.py'
--- src/postorius/utils.py 2013-04-08 17:59:47 +0000
+++ src/postorius/utils.py 2013-05-31 02:30:36 +0000
@@ -33,9 +33,9 @@
def get_client():
- return Client('{0}/3.0'.format(settings.REST_SERVER),
- settings.API_USER,
- settings.API_PASS)
+ return Client('{0}/3.0'.format(settings.MAILMAN_API_URL),
+ settings.MAILMAN_USER,
+ settings.MAILMAN_PASS)
def render_api_error(request):
=== modified file 'src/postorius/views/api.py'
--- src/postorius/views/api.py 2012-12-15 14:17:14 +0000
+++ src/postorius/views/api.py 2013-05-31 02:30:36 +0000
@@ -54,8 +54,7 @@
@basic_auth_login
@loggedin_or_403
def api_list_index(request):
- client = Client('%s/3.0' % settings.REST_SERVER,
- settings.API_USER, settings.API_PASS)
+ client = utils.get_client()
res, content = client._connection.call('lists')
return HttpResponse(json.dumps(content['entries']),
content_type="application/json")
=== modified file 'src/postorius/views/generic.py'
--- src/postorius/views/generic.py 2013-03-29 22:04:06 +0000
+++ src/postorius/views/generic.py 2013-05-31 02:30:36 +0000
@@ -33,8 +33,7 @@
def client(self):
if getattr(self._client, '_client', None) is None:
- self._client = Client('%s/3.0' % settings.REST_SERVER,
- settings.API_USER, settings.API_PASS)
+ self._client = utils.get_client()
return self._client
@@ -114,7 +113,7 @@
memberships = []
if (self.mm_user):
for a in self.mm_user.addresses:
- members = self._client._connection.call('members/find',
+ members = self.client()._connection.call('members/find',
{'subscriber': a})
try:
for m in members[1]['entries']:
=== modified file 'src/postorius/views/settings.py'
--- src/postorius/views/settings.py 2012-12-15 23:25:29 +0000
+++ src/postorius/views/settings.py 2013-05-31 02:30:36 +0000
@@ -95,8 +95,7 @@
"""
if request.method == 'POST':
try:
- client = Client(settings.REST_SERVER + '/3.0', settings.API_USER,
- settings.API_PASS)
+ client = utils.get_client()
client.delete_domain(domain)
messages.success(request,
_('The domain %s has been deleted.' % domain))
_______________________________________________
Mailman-coders mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-coders