parent
32785b0459
commit
b2a4df5be7
@ -27,7 +27,7 @@
|
||||
<ul>
|
||||
{% for category, events in day.events_by_category.items %}
|
||||
<li>{{ events.0.category | circle_cat }}
|
||||
<a href="{{ daytag }}" data-target="{{ daytag }}-category-{{ events.0.category.pk }}" onClick="toggleModal(event)">{{ events | length }} {{ category }}</a></li>
|
||||
<a href="{{ day.date | url_day }}?{{ filter.get_url|add_url_category:events.0.category }}" data-target="{{ daytag }}-category-{{ events.0.category.pk }}" onClick="toggleModal(event)">{{ events | length }} {{ category }}</a></li>
|
||||
<dialog id="{{ daytag }}-category-{{ events.0.category.pk }}">
|
||||
<article>
|
||||
<header>
|
||||
@ -66,7 +66,7 @@
|
||||
{% if event.start_day == day.date and event.start_time %}
|
||||
{{ event.start_time }}
|
||||
{% endif %}
|
||||
{{ event|picto_status }} <a href="{{ daytag }}" data-target="event-{{ event.id }}" onClick="toggleModal(event)">{{ event.title }}</a>
|
||||
{{ event|picto_status }} <a href="{{ event.get_absolute_url }}" data-target="event-{{ event.id }}" onClick="toggleModal(event)">{{ event.title }}</a>
|
||||
<dialog id="event-{{ event.id }}">
|
||||
{% include "agenda_culturel/single-event/event-modal-inc.html" with event=event filter=filter %}
|
||||
</dialog>
|
||||
|
@ -4,7 +4,7 @@ from django.urls import reverse_lazy
|
||||
from django.template.defaultfilters import pluralize, linebreaks, urlize
|
||||
|
||||
|
||||
from agenda_culturel.models import Event
|
||||
from agenda_culturel.models import Event, Category
|
||||
from django.db.models import Q
|
||||
|
||||
from .utils_extra import picto_from_name
|
||||
@ -125,3 +125,12 @@ def field_to_html(field, key):
|
||||
return "-"
|
||||
else:
|
||||
return field
|
||||
|
||||
@register.filter
|
||||
def add_url_category(url, c):
|
||||
if c is None:
|
||||
return url
|
||||
if url == "":
|
||||
return "category=" + str(c.pk)
|
||||
else:
|
||||
return url + "&category=" + str(c.pk)
|
Loading…
Reference in New Issue
Block a user