Amélioration rendu catégories
This commit is contained in:
parent
57344ff5b9
commit
d685f7e63a
@ -124,11 +124,28 @@ details[role="list"] summary + ul li.selected>a:hover {
|
|||||||
|
|
||||||
#filters {
|
#filters {
|
||||||
.categories {
|
.categories {
|
||||||
text-align: center;
|
|
||||||
line-height: 2.8em;
|
|
||||||
[data-tooltip]::before, [data-tooltip]::after {
|
[data-tooltip]::before, [data-tooltip]::after {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.developpe, .non-developpe {
|
||||||
|
background: var(--primary-focus);
|
||||||
|
color: var(--contrast);
|
||||||
|
border-radius: 1.3em;
|
||||||
|
height: 2.4em;
|
||||||
|
padding: 0.1em .2em;
|
||||||
|
.titre {
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-right: .4em;
|
||||||
|
}
|
||||||
|
display: inline-block;
|
||||||
|
margin: .1em 0;
|
||||||
|
}
|
||||||
|
.non-developpe {
|
||||||
|
background: none;
|
||||||
|
padding: 0.1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.suggested-tags {
|
.suggested-tags {
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
@ -188,12 +205,11 @@ details[role="list"] summary + ul li.selected>a:hover {
|
|||||||
height: 2.6em;
|
height: 2.6em;
|
||||||
width: 2.6em;
|
width: 2.6em;
|
||||||
border-radius: 1.3em;
|
border-radius: 1.3em;
|
||||||
line-height: 2.4em;
|
line-height: 2.2em;
|
||||||
img {
|
img {
|
||||||
width: 80%;
|
width: 70%;
|
||||||
margin: .2em 0;
|
margin: .4em 0;
|
||||||
}
|
}
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.reduced {
|
.reduced {
|
||||||
|
@ -214,7 +214,7 @@ def circle_cat(category, recurrence=False):
|
|||||||
'<span class="cat ' + c + ' circ-cat" data-tooltip="' + n + '"></span>'
|
'<span class="cat ' + c + ' circ-cat" data-tooltip="' + n + '"></span>'
|
||||||
)
|
)
|
||||||
|
|
||||||
def legend_cat(category, url, selected=True, first=False):
|
def legend_cat(category, url, selected=True, first=False, with_title=False):
|
||||||
c = category.css_class()
|
c = category.css_class()
|
||||||
n = category.name
|
n = category.name
|
||||||
class_reduced = '' if selected else 'reduced'
|
class_reduced = '' if selected else 'reduced'
|
||||||
@ -227,13 +227,18 @@ def legend_cat(category, url, selected=True, first=False):
|
|||||||
prefix = "ajouter "
|
prefix = "ajouter "
|
||||||
|
|
||||||
if category.pictogram:
|
if category.pictogram:
|
||||||
return mark_safe(
|
result = '<span class="cat ' + class_reduced + ' ' + c + ' circ-cat circ-large" data-tooltip="' + prefix + n + '">' + '<img src="' + category.pictogram.url + '" alt="' + category.name + '" /></span>'
|
||||||
'<a href="' + url + '"><span class="cat ' + class_reduced + ' ' + c + ' circ-cat circ-large" data-tooltip="' + prefix + n + '">' + '<img src="' + category.pictogram.url + '" alt="' + category.name + '" /></span></a>'
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
return mark_safe(
|
result = '<span class="cat ' + class_reduced + ' ' + c + ' circ-cat circ-large" data-tooltip="' + prefix + n + '"></span>'
|
||||||
'<a href="' + url + '"><span class="cat ' + class_reduced + ' ' + c + ' circ-cat circ-large" data-tooltip="' + prefix + n + '"></span></a>'
|
|
||||||
)
|
if with_title and selected:
|
||||||
|
result = '<div class="developpe">' + result + ' <span class="titre">' + n + '</span></div>'
|
||||||
|
else:
|
||||||
|
result = '<div class="non-developpe">' + result + '</div>'
|
||||||
|
|
||||||
|
result = '<a href="' + url + '">' + result + '</a>'
|
||||||
|
|
||||||
|
return mark_safe(result)
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
@ -250,6 +255,7 @@ def show_legend(filter):
|
|||||||
if not filter.is_selected(c)
|
if not filter.is_selected(c)
|
||||||
else filter.get_url_remove_categories([c.pk]),
|
else filter.get_url_remove_categories([c.pk]),
|
||||||
selected=filter.is_selected(c),
|
selected=filter.is_selected(c),
|
||||||
|
with_title=True
|
||||||
)
|
)
|
||||||
for c in cats
|
for c in cats
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user