diff --git a/src/mailman_django/models.py b/src/mailman_django/models.py index 578f3b6..1fab6d9 100644 --- a/src/mailman_django/models.py +++ b/src/mailman_django/models.py @@ -95,6 +95,34 @@ pass +class MailmanListManager(MailmanRestManager): + + def __init__(self): + super(MailmanListManager, self).__init__('list', 'lists') + + def all(self, only_public=False): + try: + objects = getattr(self.client, self.resource_name_plural) + except AttributeError: + raise MailmanApiError + if only_public: + public = [] + for obj in objects: + if obj.settings.get('advertised', False): + public.append(obj) + return public + else: + return objects + + def by_mail_host(self, mail_host, only_public=False): + objects = self.all(only_public) + host_objects = [] + for obj in objects: + if obj.mail_host == mail_host: + host_objects.append(obj) + return host_objects + + class MailmanRestModel(object): """Simple REST Model class to make REST API calls Django style. """ @@ -120,4 +148,6 @@ class List(MailmanRestModel): """List model class. """ - objects = MailmanRestManager('list', 'lists') + objects = MailmanListManager() + + diff --git a/src/mailman_django/static/mailman_django/default/css/style.css b/src/mailman_django/static/mailman_django/default/css/style.css index 418bebf..86ab271 100755 --- a/src/mailman_django/static/mailman_django/default/css/style.css +++ b/src/mailman_django/static/mailman_django/default/css/style.css @@ -76,7 +76,6 @@ /* Add layout tyles here */ body { - background-color: #d4d4d4; font-size: 87.5%; font-family: Verdana, Arial, sans-serif; } @@ -94,9 +93,6 @@ margin: 5px auto; padding: 25px 0 25px 35px; border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - background: #fff repeat top left url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAKCAYAAAD2Fg1xAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9sHFAYzEtopMl4AAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAUklEQVQ4y+2T0QnAQAhDbbkf3X/DW0JDsN2h4IHSN0DgkeRy90eas/eWW4ZQIgJAAPQXISkkj4qsilAzmzGtMR+JCImI/tPKzOONlIio6v+Rr7wQbht30ThlBAAAAABJRU5ErkJggg=='); } .mm_actionButtons { margin: 30px 0 30px 0; diff --git a/src/mailman_django/templates/mailman-django/lists/index.html b/src/mailman_django/templates/mailman-django/lists/index.html index 50e2ec0..a493901 100644 --- a/src/mailman_django/templates/mailman-django/lists/index.html +++ b/src/mailman_django/templates/mailman-django/lists/index.html @@ -17,7 +17,7 @@