Add tag container and CSS for extra spacing.
This commit is contained in:
@@ -163,3 +163,7 @@ a i {
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
.tag-container .label {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user