diff --git a/src/agenda_culturel/static/js/modal.js b/src/agenda_culturel/static/js/modal.js index 1a7f83d..ac82ac9 100644 --- a/src/agenda_culturel/static/js/modal.js +++ b/src/agenda_culturel/static/js/modal.js @@ -1,6 +1,3 @@ -const isOpenClass = "modal-is-open"; -const openingClass = "modal-is-opening"; -const closingClass = "modal-is-closing"; let visibleModal = null; // Toggle modal diff --git a/src/agenda_culturel/static/style.scss b/src/agenda_culturel/static/style.scss index a925b40..f1c2c9c 100644 --- a/src/agenda_culturel/static/style.scss +++ b/src/agenda_culturel/static/style.scss @@ -244,6 +244,7 @@ article#filters { .buttons-filter { float: right; text-align: right; + display: none; } form>label { display: inline-block; @@ -271,4 +272,9 @@ article#filters { margin-left: 0.3em; } } +} + +.disabled { + pointer-events: none; + opacity: 0.4; } \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/filter-inc.html b/src/agenda_culturel/templates/agenda_culturel/filter-inc.html index b934146..ab165cf 100644 --- a/src/agenda_culturel/templates/agenda_culturel/filter-inc.html +++ b/src/agenda_culturel/templates/agenda_culturel/filter-inc.html @@ -18,10 +18,13 @@
- {% csrf_token %}
{{ filter.form }}

+{% if filter.is_active %} +Supprimer le filtre +{% endif %} + diff --git a/src/agenda_culturel/templates/agenda_culturel/forms/category-checkbox.html b/src/agenda_culturel/templates/agenda_culturel/forms/category-checkbox.html index abedf2d..d6140a3 100644 --- a/src/agenda_culturel/templates/agenda_culturel/forms/category-checkbox.html +++ b/src/agenda_culturel/templates/agenda_culturel/forms/category-checkbox.html @@ -1,12 +1,8 @@ {% load cat_extra %} -
- +
{% for group, options, index in widget.optgroups %}{% if group %} diff --git a/src/agenda_culturel/templates/agenda_culturel/forms/tag-checkbox.html b/src/agenda_culturel/templates/agenda_culturel/forms/tag-checkbox.html index 3a72023..636551d 100644 --- a/src/agenda_culturel/templates/agenda_culturel/forms/tag-checkbox.html +++ b/src/agenda_culturel/templates/agenda_culturel/forms/tag-checkbox.html @@ -1,12 +1,8 @@ {% load cat_extra %} -
- +
{% for group, options, index in widget.optgroups %}{% if group %} diff --git a/src/agenda_culturel/templates/agenda_culturel/page-day.html b/src/agenda_culturel/templates/agenda_culturel/page-day.html index 9ced0f1..2b84f88 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-day.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-day.html @@ -12,6 +12,7 @@ {% block entete_header %} {% css_categories %} + {% endblock %} {% block title %} diff --git a/src/agenda_culturel/templates/agenda_culturel/page-month.html b/src/agenda_culturel/templates/agenda_culturel/page-month.html index 96597b8..bc6cc07 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-month.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-month.html @@ -13,6 +13,7 @@ {% block entete_header %} {% css_categories %} + {% endblock %} {% block title %} diff --git a/src/agenda_culturel/templates/agenda_culturel/page-week.html b/src/agenda_culturel/templates/agenda_culturel/page-week.html index 903bc33..7b91a4c 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-week.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-week.html @@ -13,6 +13,7 @@ {% block entete_header %} {% css_categories %} + {% endblock %} {% block title %} diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index f123ec5..a22bb20 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -206,6 +206,9 @@ class EventFilter(django_filters.FilterSet): print(self.form.data) return "" + def get_url_without_filters(self): + return self.request.build_absolute_uri().split("?")[0] + def get_categories(self): return self.form.cleaned_data["category"] @@ -226,7 +229,7 @@ def month_view(request, year = None, month = None): if month is None: month = now.month - filter = EventFilter(request.GET, queryset=Event.objects.all()) + filter = EventFilter(request.GET, queryset=Event.objects.all(), request=request) cmonth = CalendarMonth(year, month, filter) @@ -241,7 +244,7 @@ def week_view(request, year = None, week = None): if week is None: week = now.isocalendar()[1] - filter = EventFilter(request.GET, queryset=Event.objects.all()) + filter = EventFilter(request.GET, queryset=Event.objects.all(), request=request) cweek = CalendarWeek(year, week, filter) context = {"year": year, "week": week, "calendar": cweek, "filter": filter } @@ -259,7 +262,7 @@ def day_view(request, year = None, month = None, day = None): day = date(year, month, day) - filter = EventFilter(request.GET, Event.objects.all()) + filter = EventFilter(request.GET, Event.objects.all(), request=request) events = filter.qs.filter((Q(start_day__lte=day) & (Q(end_day__gte=day)) | Q(start_day=day))).order_by("start_day", F("start_time").desc(nulls_last=True)) context = {"day": day, "events": events, "filter": filter}