Add tag container and CSS for extra spacing.

This commit is contained in:
Roberto Rosario
2016-12-21 01:58:57 -04:00
parent a0bcbdbce9
commit c262ccabbd
2 changed files with 9 additions and 3 deletions

View File

@@ -163,3 +163,7 @@ a i {
.select2-container--default .select2-selection--multiple .select2-selection__choice {
padding-bottom: 1px;
}
.tag-container .label {
margin-right: 2px;
}

View File

@@ -43,16 +43,18 @@ def widget_document_tags(document, user):
app_label='acls', model_name='AccessControlList'
)
tags_template = []
result = ['<div class="tag-container">']
tags = AccessControlList.objects.filter_by_access(
permission_tag_view, user, queryset=document.attached_tags().all()
)
for tag in tags:
tags_template.append(widget_single_tag(tag))
result.append(widget_single_tag(tag))
return mark_safe(''.join(tags_template))
result.append('</div>')
return mark_safe(''.join(result))
def widget_single_tag(tag):