diff --git a/src/postorius/templates/postorius/lists/summary.html b/src/postorius/templates/postorius/lists/summary.html index 06f7ee9..6dc2a77 100644 --- a/src/postorius/templates/postorius/lists/summary.html +++ b/src/postorius/templates/postorius/lists/summary.html @@ -18,12 +18,20 @@

{% trans 'To contact the list owners, use the following email address:' %} {{ list.settings.owner_address }}

{# Archives #} - {% if 'hyperkitty' in INSTALLED_APPS %} + {% if hyperkitty_enabled %} + {% if not public_archive and not user.is_authenticated %} +

+ {% trans 'You have to login to visit the archives of this list.' %} +

+ {% else %} {% url 'hk_list_overview' list.fqdn_listname as hyperkitty_list_url %} - {% blocktrans %} -

To see the prior postings to this list, visit - the archives.

- {% endblocktrans %} +

+ {% blocktrans %} + To see the prior postings to this list, visit + the archives. + {% endblocktrans %} +

+ {% endif %} {% endif %}
diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py index 2936ed2..51ba88d 100644 --- a/src/postorius/views/list.py +++ b/src/postorius/views/list.py @@ -24,6 +24,7 @@ from allauth.account.models import EmailAddress from django.http import HttpResponse, HttpResponseNotAllowed, Http404 +from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse @@ -202,7 +203,15 @@ def get(self, request, list_id): data = {'list': self.mailing_list, 'userSubscribed': False, - 'subscribed_address': None} + 'subscribed_address': None, + 'public_archive': False, + 'hyperkitty_enabled': False} + if self.mailing_list.settings['archive_policy'] == 'public': + data['public_archive'] = True + if ('hyperkitty' in settings.INSTALLED_APPS and + 'hyperkitty' in self.mailing_list.archivers and + self.mailing_list.archivers['hyperkitty']): + data['hyperkitty_enabled'] = True if request.user.is_authenticated(): user_emails = EmailAddress.objects.filter( user=request.user, verified=True).order_by(