mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Change the way to create labels as label-info
This commit is contained in:
@@ -167,9 +167,9 @@ class User(PermissionsMixin):
|
||||
|
||||
@property
|
||||
def tags(self):
|
||||
return [{"name": "account", "label": _("account"), "type": "idt"},
|
||||
return [{"name": "account", "label": _("account"), "type": "label label-default idt"},
|
||||
{"name": self.group, "label": self.group,
|
||||
"type": "grp", "color": "info"}]
|
||||
"type": "grp label label-info"}]
|
||||
|
||||
@property
|
||||
def fullname(self):
|
||||
|
||||
@@ -83,7 +83,7 @@ class Alias(AdminObject):
|
||||
"alias": _("alias")
|
||||
}
|
||||
altype = self.type
|
||||
return [{"name": altype, "label": labels[altype], "type": "idt"}]
|
||||
return [{"name": altype, "label": labels[altype], "type": "idt label label-default"}]
|
||||
|
||||
def post_create(self, creator):
|
||||
from modoboa.lib.permissions import grant_access_to_object
|
||||
|
||||
@@ -58,7 +58,7 @@ class Domain(AdminObject):
|
||||
|
||||
@property
|
||||
def tags(self):
|
||||
return [{"name": "domain", "label": _("Domain"), "type": "dom"}]
|
||||
return [{"name": "domain", "label": _("Domain"), "type": "label label-default dom"}]
|
||||
|
||||
@property
|
||||
def admins(self):
|
||||
|
||||
@@ -151,9 +151,7 @@ def fromunix(value):
|
||||
@register.simple_tag
|
||||
def render_tags(tags):
|
||||
t = Template("""{% for tag in tags %}
|
||||
<span class="label{% if tag.color %} label-{{ tag.color }}{% endif %}">
|
||||
<a href="#" class="filter {{ tag.type }}" name="{{ tag.name }}">{{ tag.label }}</a>
|
||||
</span>
|
||||
{% endfor %}
|
||||
""")
|
||||
return t.render(Context({"tags": tags}))
|
||||
|
||||
Reference in New Issue
Block a user