DJ1.9 upgrade: Changes icons from gif to svg
This commit is contained in:
parent
bee56d833d
commit
5a62b9be85
2
TODO.md
2
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)
|
||||
|
|
|
@ -188,11 +188,11 @@ class AccountAdminMixin(object):
|
|||
|
||||
def display_active(self, instance):
|
||||
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:
|
||||
msg = _("Account disabled")
|
||||
return '<img src="%s" alt="False" title="%s">' % (static('admin/img/icon-unknown.gif'), msg)
|
||||
return '<img src="%s" alt="False">' % static('admin/img/icon-yes.gif')
|
||||
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.svg')
|
||||
display_active.short_description = _("active")
|
||||
display_active.allow_tags = True
|
||||
display_active.admin_order_field = 'is_active'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 '<a href="%s" title="%s">%s <img src="%s"></img></a>' % (url, content, total, img)
|
||||
return '<a href="%s">%s</a>' % (url, total)
|
||||
display_total.short_description = _("Total")
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -36,7 +36,7 @@ class LogEntryAdmin(admin.ModelAdmin):
|
|||
def display_message(self, log):
|
||||
edit = '<a href="%(url)s"><img src="%(img)s"></img></a>' % {
|
||||
'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') % {
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<tr>
|
||||
<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>{% 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>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
@ -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 "
|
||||
"<a href='https://tty1.net/blog/2011/sieve-tutorial_en.html'>sieve language</a>. "
|
||||
"This overrides any automatic junk email filtering"))
|
||||
is_active = models.BooleanField(_("active"), default=True)
|
||||
|
||||
|
|
|
@ -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('<img src="%s" alt="%s">' % (icon, display))
|
||||
tag = self.tag[:-1]
|
||||
endtag = '/'.join((self.tag[0], self.tag[1:]))
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
</form>
|
||||
</div>
|
||||
</li>
|
||||
<li class="menu-item"></li>
|
||||
<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 %}
|
||||
<a href="{{ user_change_url }}" style="color:#555;"><strong>{% filter force_escape %}{% firstof user.get_short_name user.username %}{% endfilter %}</strong></a>
|
||||
|
|
Loading…
Reference in a new issue