parent
d9e06aa776
commit
b9ecde46e5
@ -171,7 +171,7 @@ footer {
|
||||
overflow: auto;
|
||||
.grid {
|
||||
grid-template-columns: repeat(auto-fit, minmax(0%, 1fr));
|
||||
min-width: 1200px;
|
||||
min-width: 1500px;
|
||||
}
|
||||
.grid.week-in-month {
|
||||
grid-template-columns: 2.5em repeat(auto-fit, minmax(0%, 1fr));
|
||||
@ -212,6 +212,7 @@ footer {
|
||||
article.day {
|
||||
margin: 0;
|
||||
padding: 0 0 0.3em 0;
|
||||
min-height: 12em;
|
||||
}
|
||||
|
||||
article.day>header {
|
||||
|
@ -5,7 +5,7 @@
|
||||
<details>
|
||||
<summary role="button" class="contrast outline">
|
||||
{% if filter.is_active %}
|
||||
Filtres :
|
||||
Filtre :
|
||||
{% for c in filter.get_categories %}
|
||||
{{ c | small_cat }}
|
||||
{% endfor %}
|
||||
|
@ -1,14 +0,0 @@
|
||||
{% extends "agenda_culturel/page_event.html" %}
|
||||
|
||||
{% block title %}Accueil{% endblock %}
|
||||
|
||||
{% block events %}
|
||||
<h1>Événements</h1>
|
||||
<ul>
|
||||
{% for event in object_list %}
|
||||
<li><a href="{{ BASE_URL }}{{ event.get_absolute_url }}">{{ event.start_day|date }} : {{ event.title }}</a></li>
|
||||
{% empty %}
|
||||
<li>Il n'y a pas d'événement.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
@ -52,6 +52,10 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Légende : {% show_legend filter=filter %}
|
||||
</div>
|
||||
|
||||
|
||||
<footer>
|
||||
{% if calendar.today_in_calendar %}
|
||||
|
@ -51,9 +51,13 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Légende : {% show_legend filter=filter %}
|
||||
</div>
|
||||
|
||||
|
||||
<footer>
|
||||
|
||||
{% if calendar.today_in_calendar %}
|
||||
<a role="button" href="{% url 'aujourdhui' %}?{{ filter.get_url }}">Aujourd'hui</a>
|
||||
{% endif %}
|
||||
|
@ -89,7 +89,7 @@ def css_categories():
|
||||
return mark_safe(result)
|
||||
|
||||
@register.filter
|
||||
def small_cat(category, url=None, contrast=True, close_url=None):
|
||||
def small_cat(category, url=None, contrast=True):
|
||||
|
||||
name = Category.default_name if category is None else category.name
|
||||
css_class = Category.default_css_class if category is None else category.css_class()
|
||||
@ -107,6 +107,12 @@ def circle_cat(category):
|
||||
else:
|
||||
return mark_safe('<span class="cat ' + category.css_class() + ' circ-cat" data-tooltip="' + category.name + '"></span>')
|
||||
|
||||
@register.filter
|
||||
def small_cat_close(category, close_url=None, contrast=True):
|
||||
return small_cat(category, close_url=close_url, contrast=contrast)
|
||||
|
||||
@register.simple_tag
|
||||
def show_legend(filter):
|
||||
current_url = filter.get_url_without_filters()
|
||||
cats = Category.objects.all()
|
||||
if filter.is_active(only_categories=True):
|
||||
return mark_safe(" ".join([small_cat(c, current_url + "?category=" + str(c.pk) if not filter.is_selected(c) else None, contrast=filter.is_selected(c)) for c in cats]))
|
||||
else:
|
||||
return mark_safe(" ".join([small_cat(c, current_url + "?category=" + str(c.pk)) for c in cats]))
|
@ -43,3 +43,4 @@ def show_badges_events():
|
||||
return mark_safe('<a href="' + reverse_lazy("moderation") + '?status=draft" class="badge" data-tooltip="' + str(nb_drafts) + ' brouillon' + pluralize(nb_drafts) + ' à valider">' + picto_from_name("calendar") + " " + str(nb_drafts) + '</a>')
|
||||
else:
|
||||
return ""
|
||||
|
@ -88,9 +88,15 @@ class EventFilter(django_filters.FilterSet):
|
||||
def get_tags(self):
|
||||
return self.form.cleaned_data["tags"]
|
||||
|
||||
def is_active(self):
|
||||
def is_active(self, only_categories=False):
|
||||
if only_categories:
|
||||
return len(self.form.cleaned_data["category"]) != 0
|
||||
else:
|
||||
return len(self.form.cleaned_data["category"]) != 0 or len(self.form.cleaned_data["tags"]) != 0
|
||||
|
||||
def is_selected(self, cat):
|
||||
return cat in self.form.cleaned_data["category"]
|
||||
|
||||
|
||||
def mentions_legales(request):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user