Amélioration du rendu des catégories

This commit is contained in:
Jean-Marie Favreau 2024-11-01 23:48:30 +01:00
parent 9e7842f198
commit eeae6f11e4
2 changed files with 6 additions and 6 deletions

View File

@ -187,7 +187,7 @@ details[role="list"] summary + ul li.selected>a:hover {
height: 2.6em;
width: 2.6em;
border-radius: 1.3em;
line-height: 2.6em;
line-height: 2.4em;
img {
width: 80%;
margin: .2em 0;

View File

@ -219,20 +219,20 @@ def legend_cat(category, url, selected=True, first=False):
n = category.name
class_reduced = '' if selected else 'reduced'
if first:
prefix = "afficher"
prefix = ""
else:
if selected:
prefix = "retirer"
prefix = "retirer "
else:
prefix = "ajouter"
prefix = "ajouter "
if category.pictogram:
return mark_safe(
'<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>'
'<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:
return mark_safe(
'<a href="' + url + '"><span class="cat ' + class_reduced + ' ' + c + ' circ-cat circ-large" data-tooltip="' + prefix + ' ' + n + '"></span></a>'
'<a href="' + url + '"><span class="cat ' + class_reduced + ' ' + c + ' circ-cat circ-large" data-tooltip="' + prefix + n + '"></span></a>'
)