From 5a62b9be85af354dc8194764a6dd821ba9c67eae Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Tue, 3 May 2016 12:14:59 +0000 Subject: [PATCH] DJ1.9 upgrade: Changes icons from gif to svg --- TODO.md | 2 ++ orchestra/contrib/accounts/admin.py | 6 +++--- orchestra/contrib/accounts/filters.py | 12 +++++++++--- orchestra/contrib/bills/admin.py | 2 +- orchestra/contrib/domains/models.py | 2 ++ orchestra/contrib/history/admin.py | 2 +- .../history/templates/admin/object_history.html | 2 +- orchestra/contrib/mailboxes/models.py | 3 ++- orchestra/forms/widgets.py | 2 +- orchestra/templates/admin/orchestra/menu.html | 1 - 10 files changed, 22 insertions(+), 12 deletions(-) diff --git a/TODO.md b/TODO.md index 9a2bd186..da754e1e 100644 --- a/TODO.md +++ b/TODO.md @@ -454,3 +454,5 @@ mkhomedir_helper or create ssh homes with bash.rc and such # exclude from change list action, support for multiple exclusion # breadcrumbs https://orchestra.pangea.org/admin/domains/domain/?account_id=930 + +# SHow addresses on mailboxes (+add address) diff --git a/orchestra/contrib/accounts/admin.py b/orchestra/contrib/accounts/admin.py index f9f039e1..1918a8ff 100644 --- a/orchestra/contrib/accounts/admin.py +++ b/orchestra/contrib/accounts/admin.py @@ -188,11 +188,11 @@ class AccountAdminMixin(object): def display_active(self, instance): if not instance.is_active: - return 'False' % static('admin/img/icon-no.gif') + return 'False' % static('admin/img/icon-no.svg') elif not instance.account.is_active: msg = _("Account disabled") - return 'False' % (static('admin/img/icon-unknown.gif'), msg) - return 'False' % static('admin/img/icon-yes.gif') + return 'False' % (static('admin/img/inline-delete.svg'), msg) + return 'False' % static('admin/img/icon-yes.svg') display_active.short_description = _("active") display_active.allow_tags = True display_active.admin_order_field = 'is_active' diff --git a/orchestra/contrib/accounts/filters.py b/orchestra/contrib/accounts/filters.py index 91a10708..e1ccfa85 100644 --- a/orchestra/contrib/accounts/filters.py +++ b/orchestra/contrib/accounts/filters.py @@ -12,8 +12,6 @@ class HasMainUserListFilter(SimpleListFilter): return ( ('True', _("Yes")), ('False', _("No")), - ('account', _("Account disabled")), - ('object', _("Object disabled")), ) def queryset(self, request, queryset): @@ -23,10 +21,18 @@ class HasMainUserListFilter(SimpleListFilter): return queryset.filter(users__isnull=True).distinct() -class IsActiveListFilter(HasMainUserListFilter): +class IsActiveListFilter(SimpleListFilter): title = _("is active") parameter_name = 'active' + def lookups(self, request, model_admin): + return ( + ('True', _("Yes")), + ('False', _("No")), + ('account', _("Account disabled")), + ('object', _("Object disabled")), + ) + def queryset(self, request, queryset): if self.value() == 'True': return queryset.filter(is_active=True, account__is_active=True) diff --git a/orchestra/contrib/bills/admin.py b/orchestra/contrib/bills/admin.py index 28cc7bfd..d4604b39 100644 --- a/orchestra/contrib/bills/admin.py +++ b/orchestra/contrib/bills/admin.py @@ -74,7 +74,7 @@ class BillLineInline(admin.TabularInline): url = change_url(line) if sublines: content = '\n'.join(['%s: %s' % (sub.description, sub.total) for sub in sublines]) - img = static('admin/img/icon_alert.gif') + img = static('admin/img/icon-alert.svg') return '%s ' % (url, content, total, img) return '%s' % (url, total) display_total.short_description = _("Total") diff --git a/orchestra/contrib/domains/models.py b/orchestra/contrib/domains/models.py index ea123f48..8290b780 100644 --- a/orchestra/contrib/domains/models.py +++ b/orchestra/contrib/domains/models.py @@ -289,6 +289,7 @@ class Record(models.Model): SRV = 'SRV' TXT = 'TXT' SPF = 'SPF' + SOA = 'SOA' TYPE_CHOICES = ( (MX, "MX"), @@ -310,6 +311,7 @@ class Record(models.Model): TXT: (validate_ascii, validators.validate_quoted_record), SPF: (validate_ascii, validators.validate_quoted_record), SRV: (validators.validate_srv_record,), + SOA: (validators.validate_soa_record,), } domain = models.ForeignKey(Domain, verbose_name=_("domain"), related_name='records') diff --git a/orchestra/contrib/history/admin.py b/orchestra/contrib/history/admin.py index 073f38cd..430eb9aa 100644 --- a/orchestra/contrib/history/admin.py +++ b/orchestra/contrib/history/admin.py @@ -36,7 +36,7 @@ class LogEntryAdmin(admin.ModelAdmin): def display_message(self, log): edit = '' % { 'url': reverse('admin:admin_logentry_change', args=(log.pk,)), - 'img': static('orchestra/images/icon_changelink.gif'), + 'img': static('admin/img/icon-changelink.svg'), } if log.is_addition(): return _('Added "%(link)s". %(edit)s') % { diff --git a/orchestra/contrib/history/templates/admin/object_history.html b/orchestra/contrib/history/templates/admin/object_history.html index 379c27e9..9441b522 100644 --- a/orchestra/contrib/history/templates/admin/object_history.html +++ b/orchestra/contrib/history/templates/admin/object_history.html @@ -29,7 +29,7 @@ {{ action.action_time|date:"DATETIME_FORMAT" }} {{ action.user.get_username }}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %} - {% if action.is_addition and not action.change_message %}{% trans 'Added' %}{% else %}{{ action.change_message }}{% endif %} + {% if action.is_addition and not action.change_message %}{% trans 'Added' %}{% else %}{{ action.change_message }}{% endif %} {% endfor %} diff --git a/orchestra/contrib/mailboxes/models.py b/orchestra/contrib/mailboxes/models.py index fd11e01e..ce6e5edc 100644 --- a/orchestra/contrib/mailboxes/models.py +++ b/orchestra/contrib/mailboxes/models.py @@ -28,7 +28,8 @@ class Mailbox(models.Model): choices=[(k, v[0]) for k,v in sorted(settings.MAILBOXES_MAILBOX_FILTERINGS.items())]) custom_filtering = models.TextField(_("filtering"), blank=True, validators=[validators.validate_sieve], - help_text=_("Arbitrary email filtering in sieve language. " + help_text=_("Arbitrary email filtering in " + "sieve language. " "This overrides any automatic junk email filtering")) is_active = models.BooleanField(_("active"), default=True) diff --git a/orchestra/forms/widgets.py b/orchestra/forms/widgets.py index 88ccdc93..a3a686df 100644 --- a/orchestra/forms/widgets.py +++ b/orchestra/forms/widgets.py @@ -24,7 +24,7 @@ class SpanWidget(forms.Widget): display = original if self.display is None else self.display # Display icon if isinstance(original, bool): - icon = static('admin/img/icon-%s.gif' % ('yes' if original else 'no',)) + icon = static('admin/img/icon-%s.svg' % ('yes' if original else 'no',)) return mark_safe('%s' % (icon, display)) tag = self.tag[:-1] endtag = '/'.join((self.tag[0], self.tag[1:])) diff --git a/orchestra/templates/admin/orchestra/menu.html b/orchestra/templates/admin/orchestra/menu.html index 7ae238d2..8cf8effa 100644 --- a/orchestra/templates/admin/orchestra/menu.html +++ b/orchestra/templates/admin/orchestra/menu.html @@ -61,7 +61,6 @@ - {% url 'admin:accounts_account_change' user.pk as user_change_url %} {% filter force_escape %}{% firstof user.get_short_name user.username %}{% endfilter %}