Change the way to create labels as label-info

This commit is contained in:
Maël Solard
2014-08-12 16:08:15 +02:00
parent e262c3ea87
commit ec9aadea5a
4 changed files with 4 additions and 6 deletions
+2 -2
View File
@@ -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):
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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):
-2
View File
@@ -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}))