correction urls

This commit is contained in:
SebF 2024-05-08 11:41:43 +02:00
parent bd310c7b44
commit fc3b0f8320
3 changed files with 5 additions and 3 deletions

View File

@ -95,7 +95,7 @@
<h2>Voir aussi</h2>
</header>
<div class="buttons">
<a role="button" href="{% url 'day_view' day.year day.month day.day%}" >Exporter ical {% picto_from_name "calendar" %}</a>
<a role="button" href="{% url 'day_view_ical' day.year day.month day.day%}" >Exporter ical {% picto_from_name "calendar" %}</a>
<a role="button" href="{% url 'week_view' day.year day|week %}?{{ filter.get_url }}">Toute la semaine</a>
</div>
</article>

View File

@ -13,7 +13,7 @@ urlpatterns = [
path("semaine/<int:year>/<int:week>/", week_view, name="week_view"),
path("mois/<int:year>/<int:month>/", month_view, name="month_view"),
path("jour/<int:year>/<int:month>/<int:day>/", day_view, name="day_view"),
path("jour/<int:year>/<int:month>/<int:day>?feed=ical", day_view, name="day_view"),
path("jour/<int:year>/<int:month>/<int:day>?feed=ical", day_view_ical, name="day_view_ical"),
path("aujourdhui/", day_view, name="aujourdhui"),
path("cette-semaine/", week_view, name="cette_semaine"),
path("ce-mois-ci", month_view, name="ce_mois_ci"),

View File

@ -301,8 +301,10 @@ def week_view(request, year=None, week=None, home=False):
context["home"] = 1
return render(request, "agenda_culturel/page-week.html", context)
def day_view_ical(request, year=None, month=None, day=None):
return day_view(request, year, month, day, ical=True)
def day_view(request, year=None, month=None, day=None):
def day_view(request, year=None, month=None, day=None, ical=False):
now = date.today()
if year is None:
year = now.year