diff --git a/src/mailman_django.egg-info/PKG-INFO b/src/mailman_django.egg-info/PKG-INFO index b5c5ffc..c3a10b9 100644 --- a/src/mailman_django.egg-info/PKG-INFO +++ b/src/mailman_django.egg-info/PKG-INFO @@ -10,6 +10,8 @@ mailman-django - web ui for GNU Mailman ======================================= + Copyright (C) 1998-2010 by the Free Software Foundation, Inc. + The ``mailman-django`` Django app provides a web user interface to access GNU Mailman. diff --git a/src/mailman_django/context_processors.py b/src/mailman_django/context_processors.py index 994e2a3..f825a4c 100644 --- a/src/mailman_django/context_processors.py +++ b/src/mailman_django/context_processors.py @@ -1,48 +1,25 @@ +import logging + + from django.conf import settings from django.utils.translation import gettext as _ from mailman.client import Client from urllib2 import HTTPError -def lists_of_domain(request): - """ This function is a wrapper to render a list of all - available List registered to the current request URL - """ - domain_lists = [] - domain_name = 'unknown domain' - message = "" - if "HTTP_HOST" in request.META.keys() :#TODO only lists of current domains if possible - #get the URL - web_host = ('http://%s' % request.META["HTTP_HOST"].split(":")[0]) - #querry the Domain object - try: - c = Client('http://localhost:8001/3.0', settings.API_USER, settings.API_PASS) - except AttributeError, e: - message="REST API not found / Offline" - d = c.get_domain(web_host=web_host) - #workaround LP:802971 - only lists of the current domain #todo a8 - if d is not None: - domain_name = d.mail_host - for list in c.lists: - if list.mail_host == domain_name: - domain_lists.append(list) - else: - domain_lists = c.lists - message = _(" - Accessing from an unknown domain - showing all lists") - #return a Dict with the key used in templates - return {"lists": domain_lists,"domain": domain_name, "message": message} - -def render_css_theme(request): - """ This function is a wrapper to render the Mailman Theme Variable from Settings - """ - return {"MAILMAN_THEME": settings.MAILMAN_THEME} +logger = logging.getLogger(__name__) -def extend_ajax(request): - """ This function checks if the request was made using AJAX - Using Ajax template_extend will base_ajax.html else it will be base.html + +def mailmanweb(request): + """Add template variables to context. """ + # extend_template (no page header/footer when requested via AJAX) if request.is_ajax(): extend_template = "mailman-django/base_ajax.html" else: extend_template = "mailman-django/base.html" - return {"extend_template":extend_template} + + return { + 'MAILMAN_THEME': settings.MAILMAN_THEME, + 'extend_template': extend_template, + } diff --git a/src/mailman_django/forms.py b/src/mailman_django/forms.py index 1c74727..0034714 100644 --- a/src/mailman_django/forms.py +++ b/src/mailman_django/forms.py @@ -126,8 +126,8 @@ }, required = True, choices = ( - (True, _("Advertise this list in List Index")), - (False, _("Hide this list in Liste Index")), + (True, _("Advertise this list in list index")), + (False, _("Hide this list in list index")), )) languages = forms.MultipleChoiceField( diff --git a/src/mailman_django/templates/mailman-django/base.html b/src/mailman_django/templates/mailman-django/base.html index feff3de..6f650d5 100644 --- a/src/mailman_django/templates/mailman-django/base.html +++ b/src/mailman_django/templates/mailman-django/base.html @@ -44,7 +44,6 @@ {% block smallBoxRight %}{% endblock %} -{% endblock %} diff --git a/src/mailman_django/templates/mailman-django/lists/index.html b/src/mailman_django/templates/mailman-django/lists/index.html index fc829a5..50e2ec0 100644 --- a/src/mailman_django/templates/mailman-django/lists/index.html +++ b/src/mailman_django/templates/mailman-django/lists/index.html @@ -2,14 +2,7 @@ {% load i18n %} {% block heading %} - All available Lists on {{domain}} -{% endblock %} - -{% block header %} -
-
{% trans "About" %}
- {% trans "This site shows all available lists, either on the registered Domain or the whole server."%} -
+ Lists on {{ domain_name }} {% endblock %} {% block actionButtonsList %} diff --git a/src/mailman_django/urls.py b/src/mailman_django/urls.py index 5fa8a23..73753da 100644 --- a/src/mailman_django/urls.py +++ b/src/mailman_django/urls.py @@ -30,14 +30,13 @@ url(r'^domains/new/$', 'domain_new', name = 'domain_new'), url(r'^lists/$', 'list_index', name = 'list_index'), url(r'^lists/new/$', 'list_new', name = 'list_new'), - url(r'^lists/(?P[^/]+)/$', 'list_summary', name = 'list_summary'), #PUBLIC - url(r'^subscriptions/(?P[^/]+)/(?:(?P