Amélioration de la navigation par tags:
- Fix #375: liens cliquables sur les modaux - quand on est sur une page tag, les liens "quand" renvoient à l'agenda filtré par le tag de la pag
This commit is contained in:
parent
d3bcfc0cbf
commit
85d7c64875
@ -191,7 +191,11 @@
|
||||
</header>
|
||||
<div class="body-fixed">{{ event.description |linebreaks }}</div>
|
||||
<p>
|
||||
{% for tag in event.sorted_tags %}{{ tag | tag_button }}{% endfor %}
|
||||
{% for tag in event.sorted_tags %}
|
||||
<a href="{% url 'view_tag' tag|prepare_tag %}"
|
||||
role="button"
|
||||
class="small-cat">{{ tag|tw_highlight }}</a>
|
||||
{% endfor %}
|
||||
</p>
|
||||
<footer class="infos-and-buttons">
|
||||
<div class="buttons">
|
||||
|
@ -9,6 +9,10 @@
|
||||
{% block entete_header %}
|
||||
{% css_categories %}
|
||||
{% endblock %}
|
||||
{% block when_parameters %}tags={{ tag|prepare_tag }}{% endblock %}
|
||||
{% block navigation-menu %}
|
||||
{% navigation_links_tag tag %}
|
||||
{% endblock %}
|
||||
{% block body-class %}tag{% endblock %}
|
||||
{% block content %}
|
||||
<article>
|
||||
|
@ -188,6 +188,26 @@ def no_emoji(text):
|
||||
return emoji.replace_emoji(text, replace="")
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def navigation_links_tag(tag):
|
||||
from .tag_extra import prepare_tag
|
||||
|
||||
result = ""
|
||||
|
||||
extra = "?tags=" + prepare_tag(tag)
|
||||
for t in [
|
||||
("aujourdhui", "aujourd'hui"),
|
||||
("a_venir", "ces jours-ci"),
|
||||
("cette_semaine", "cette semaine"),
|
||||
("ce_mois_ci", "ce mois-ci"),
|
||||
]:
|
||||
result += (
|
||||
'<li><a href="' + reverse_lazy(t[0]) + extra + '">' + t[1] + "</a></li>"
|
||||
)
|
||||
|
||||
return mark_safe(result)
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def navigation_links(filter, category, calendar, current_view):
|
||||
extra = "?" + filter.get_url()
|
||||
|
Loading…
x
Reference in New Issue
Block a user