make format

This commit is contained in:
SebF 2024-05-19 17:11:00 +02:00
parent 018b7a052f
commit ce5ff2df63
2 changed files with 26 additions and 7 deletions

View File

@ -12,13 +12,21 @@ urlpatterns = [
path("", home, name="home"),
path("aujourdhui/", day_view, name="aujourdhui"),
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_ical, name="day_view_ical"),
path(
"jour/<int:year>/<int:month>/<int:day>?feed=ical",
day_view_ical,
name="day_view_ical",
),
path("cette-semaine/", week_view, name="cette_semaine"),
path("semaine/<int:year>/<int:week>/", week_view, name="week_view"),
path("semaine/<int:year>/<int:week>?feed=ical", week_view_ical, name="week_view_ical"),
path(
"semaine/<int:year>/<int:week>?feed=ical", week_view_ical, name="week_view_ical"
),
path("ce-mois-ci", month_view, name="ce_mois_ci"),
path("mois/<int:year>/<int:month>/", month_view, name="month_view"),
path("mois/<int:year>/<int:month>?feed=ical", month_view_ical, name="month_view_ical"),
path(
"mois/<int:year>/<int:month>?feed=ical", month_view_ical, name="month_view_ical"
),
path("tag/<t>/", view_tag, name="view_tag"),
path("tags/", tag_list, name="view_all_tags"),
path("moderation/", moderation, name="moderation"),

View File

@ -270,6 +270,7 @@ def home(request):
def month_view_ical(request, year=None, month=None):
return month_view(request, year, month, True)
def month_view(request, year=None, month=None, ical=False):
now = date.today()
if year is None:
@ -281,7 +282,9 @@ def month_view(request, year=None, month=None, ical=False):
cmonth = CalendarMonth(year, month, filter)
if ical:
response = Event.export_to_ics(f"Événements {cmonth.get_month_name()} {year}", cmonth.get_events())
response = Event.export_to_ics(
f"Événements {cmonth.get_month_name()} {year}", cmonth.get_events()
)
return response
context = {
@ -308,10 +311,18 @@ def week_view(request, year=None, week=None, home=False, ical=False):
cweek = CalendarWeek(year, week, filter)
if ical:
response = Event.export_to_ics(f"Événements semaine {week} {year}", cweek.get_events())
response = Event.export_to_ics(
f"Événements semaine {week} {year}", cweek.get_events()
)
return response
context = {"year": year, "week": week, "calendar": cweek, "filter": filter, "ical": True}
context = {
"year": year,
"week": week,
"calendar": cweek,
"filter": filter,
"ical": True,
}
if home:
context["home"] = 1
return render(request, "agenda_culturel/page-week.html", context)