DJ1.9 upgrade: Changes icons from gif to svg

This commit is contained in:
Marc Aymerich 2016-05-03 12:14:59 +00:00
parent bee56d833d
commit 5a62b9be85
10 changed files with 22 additions and 12 deletions

View File

@ -454,3 +454,5 @@ mkhomedir_helper or create ssh homes with bash.rc and such
# exclude from change list action, support for multiple exclusion # exclude from change list action, support for multiple exclusion
# breadcrumbs https://orchestra.pangea.org/admin/domains/domain/?account_id=930 # breadcrumbs https://orchestra.pangea.org/admin/domains/domain/?account_id=930
# SHow addresses on mailboxes (+add address)

View File

@ -188,11 +188,11 @@ class AccountAdminMixin(object):
def display_active(self, instance): def display_active(self, instance):
if not instance.is_active: if not instance.is_active:
return '<img src="%s" alt="False">' % static('admin/img/icon-no.gif') return '<img src="%s" alt="False">' % static('admin/img/icon-no.svg')
elif not instance.account.is_active: elif not instance.account.is_active:
msg = _("Account disabled") msg = _("Account disabled")
return '<img src="%s" alt="False" title="%s">' % (static('admin/img/icon-unknown.gif'), msg) return '<img style="width:13px" src="%s" alt="False" title="%s">' % (static('admin/img/inline-delete.svg'), msg)
return '<img src="%s" alt="False">' % static('admin/img/icon-yes.gif') return '<img src="%s" alt="False">' % static('admin/img/icon-yes.svg')
display_active.short_description = _("active") display_active.short_description = _("active")
display_active.allow_tags = True display_active.allow_tags = True
display_active.admin_order_field = 'is_active' display_active.admin_order_field = 'is_active'

View File

@ -12,8 +12,6 @@ class HasMainUserListFilter(SimpleListFilter):
return ( return (
('True', _("Yes")), ('True', _("Yes")),
('False', _("No")), ('False', _("No")),
('account', _("Account disabled")),
('object', _("Object disabled")),
) )
def queryset(self, request, queryset): def queryset(self, request, queryset):
@ -23,10 +21,18 @@ class HasMainUserListFilter(SimpleListFilter):
return queryset.filter(users__isnull=True).distinct() return queryset.filter(users__isnull=True).distinct()
class IsActiveListFilter(HasMainUserListFilter): class IsActiveListFilter(SimpleListFilter):
title = _("is active") title = _("is active")
parameter_name = '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): def queryset(self, request, queryset):
if self.value() == 'True': if self.value() == 'True':
return queryset.filter(is_active=True, account__is_active=True) return queryset.filter(is_active=True, account__is_active=True)

View File

@ -74,7 +74,7 @@ class BillLineInline(admin.TabularInline):
url = change_url(line) url = change_url(line)
if sublines: if sublines:
content = '\n'.join(['%s: %s' % (sub.description, sub.total) for sub in 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 '<a href="%s" title="%s">%s <img src="%s"></img></a>' % (url, content, total, img) return '<a href="%s" title="%s">%s <img src="%s"></img></a>' % (url, content, total, img)
return '<a href="%s">%s</a>' % (url, total) return '<a href="%s">%s</a>' % (url, total)
display_total.short_description = _("Total") display_total.short_description = _("Total")

View File

@ -289,6 +289,7 @@ class Record(models.Model):
SRV = 'SRV' SRV = 'SRV'
TXT = 'TXT' TXT = 'TXT'
SPF = 'SPF' SPF = 'SPF'
SOA = 'SOA'
TYPE_CHOICES = ( TYPE_CHOICES = (
(MX, "MX"), (MX, "MX"),
@ -310,6 +311,7 @@ class Record(models.Model):
TXT: (validate_ascii, validators.validate_quoted_record), TXT: (validate_ascii, validators.validate_quoted_record),
SPF: (validate_ascii, validators.validate_quoted_record), SPF: (validate_ascii, validators.validate_quoted_record),
SRV: (validators.validate_srv_record,), SRV: (validators.validate_srv_record,),
SOA: (validators.validate_soa_record,),
} }
domain = models.ForeignKey(Domain, verbose_name=_("domain"), related_name='records') domain = models.ForeignKey(Domain, verbose_name=_("domain"), related_name='records')

View File

@ -36,7 +36,7 @@ class LogEntryAdmin(admin.ModelAdmin):
def display_message(self, log): def display_message(self, log):
edit = '<a href="%(url)s"><img src="%(img)s"></img></a>' % { edit = '<a href="%(url)s"><img src="%(img)s"></img></a>' % {
'url': reverse('admin:admin_logentry_change', args=(log.pk,)), '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(): if log.is_addition():
return _('Added "%(link)s". %(edit)s') % { return _('Added "%(link)s". %(edit)s') % {

View File

@ -29,7 +29,7 @@
<tr> <tr>
<th scope="row">{{ action.action_time|date:"DATETIME_FORMAT" }}</th> <th scope="row">{{ action.action_time|date:"DATETIME_FORMAT" }}</th>
<td>{{ action.user.get_username }}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}</td> <td>{{ action.user.get_username }}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}</td>
<td>{% if action.is_addition and not action.change_message %}{% trans 'Added' %}{% else %}{{ action.change_message }}{% endif %} <a href="{% url 'admin:admin_logentry_change' action.pk %}?edit=True" style="float:right"><img src="{% static 'orchestra/images/icon_changelink.gif' %}"></img></a></td> <td>{% if action.is_addition and not action.change_message %}{% trans 'Added' %}{% else %}{{ action.change_message }}{% endif %} <a href="{% url 'admin:admin_logentry_change' action.pk %}?edit=True" style="float:right"><img src="{% static 'admin/img/icon-changelink.svg' %}"></img></a></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

View File

@ -28,7 +28,8 @@ class Mailbox(models.Model):
choices=[(k, v[0]) for k,v in sorted(settings.MAILBOXES_MAILBOX_FILTERINGS.items())]) choices=[(k, v[0]) for k,v in sorted(settings.MAILBOXES_MAILBOX_FILTERINGS.items())])
custom_filtering = models.TextField(_("filtering"), blank=True, custom_filtering = models.TextField(_("filtering"), blank=True,
validators=[validators.validate_sieve], validators=[validators.validate_sieve],
help_text=_("Arbitrary email filtering in sieve language. " help_text=_("Arbitrary email filtering in "
"<a href='https://tty1.net/blog/2011/sieve-tutorial_en.html'>sieve language</a>. "
"This overrides any automatic junk email filtering")) "This overrides any automatic junk email filtering"))
is_active = models.BooleanField(_("active"), default=True) is_active = models.BooleanField(_("active"), default=True)

View File

@ -24,7 +24,7 @@ class SpanWidget(forms.Widget):
display = original if self.display is None else self.display display = original if self.display is None else self.display
# Display icon # Display icon
if isinstance(original, bool): 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('<img src="%s" alt="%s">' % (icon, display)) return mark_safe('<img src="%s" alt="%s">' % (icon, display))
tag = self.tag[:-1] tag = self.tag[:-1]
endtag = '/'.join((self.tag[0], self.tag[1:])) endtag = '/'.join((self.tag[0], self.tag[1:]))

View File

@ -61,7 +61,6 @@
</form> </form>
</div> </div>
</li> </li>
<li class="menu-item"></li>
<span style="float:right;color:grey;margin:15px;font-size:13px;position:relative;white-space:nowrap;"> <span style="float:right;color:grey;margin:15px;font-size:13px;position:relative;white-space:nowrap;">
{% url 'admin:accounts_account_change' user.pk as user_change_url %} {% url 'admin:accounts_account_change' user.pk as user_change_url %}
<a href="{{ user_change_url }}" style="color:#555;"><strong>{% filter force_escape %}{% firstof user.get_short_name user.username %}{% endfilter %}</strong></a> <a href="{{ user_change_url }}" style="color:#555;"><strong>{% filter force_escape %}{% firstof user.get_short_name user.username %}{% endfilter %}</strong></a>