diff --git a/context_processors.py b/context_processors.py index 9a84b91..0f6834c 100644 --- a/context_processors.py +++ b/context_processors.py @@ -12,12 +12,13 @@ if "HTTP_HOST" in request.META.keys() :#TODO only lists of current domains if possible #get the URL web_host = request.META["HTTP_HOST"].split(":")[0] + domainname = "unregistered Domain" #querry the Domain object try: c = Client('http://localhost:8001/3.0', API_USER, API_PASS) try: d = c.get_domain(None,web_host) - #workaround LP:802971 + #workaround LP:802971 - only lists of the current domain #todo a8 domainname= d.email_host for list in c.lists: if list.host_name == domainname: @@ -29,7 +30,7 @@ message="REST API not found / Offline" #return a Dict with the key used in templates - return {"lists":domain_lists, "message":message} + return {"lists":domain_lists,"domain":domainname, "message":message} def render_MAILMAN_THEME(request): """ This function is a wrapper to render the Mailman Theme Variable from Settings diff --git a/templates/mailman-django/lists/index.html b/templates/mailman-django/lists/index.html index 50e6e49..71e86aa 100644 --- a/templates/mailman-django/lists/index.html +++ b/templates/mailman-django/lists/index.html @@ -1,31 +1,33 @@ {% extends "mailman-django/base.html" %} {% load i18n %} -{% block content %} +{% block heading %} + All available Lists on {{domain}} +{% endblock %} -

{% trans "All mailing lists" %}

+{% block smallBoxLeft %} + {% for list in lists %} +
+
{{ list.real_name }}
+ +
+ {% endfor %} +{% endblock %} - - - - - - - -{% for list in lists %} - - - - - - - -{% endfor %} -
{% trans "Real Name" %}{% trans "List Name" %} 
{{ list.real_name }}{{ list.fqdn_listname }} - {%trans "Info / Subscribe" %} #TODO - LINK - - {%trans "Settings" %} - - {%trans "Delete list" %} -
+{% block header %} +
+
{% trans "About" %}
+ {% trans "list_index site shows all available lists, either on the registered Domain or the whole server. Please bare in mind that we can only show public advertised lists."%} +
+{% endblock %} + +{% block actionButtonsList %} + {% endblock %} diff --git a/views.py b/views.py index c7e386a..8f78c40 100644 --- a/views.py +++ b/views.py @@ -187,13 +187,7 @@ if request.method == 'POST': return redirect("list_summary", fqdn_listname=request.POST["list"]) else: - try: - c = Client('http://localhost:8001/3.0', API_USER, API_PASS) - lists = c.lists - except AttributeError, e: - return render_to_response('mailman-django/errors/generic.html', - {'error': "REST API not found / Offline"},context_instance=RequestContext(request)) - return render_to_response(template, {'lists': lists,'error':error},context_instance=RequestContext(request)) + return render_to_response(template, {'error':error},context_instance=RequestContext(request)) #lists by context processor def list_summary(request,fqdn_listname=None,option=None):