13 export mois
This commit is contained in:
parent
6795a221da
commit
8bd4fafb17
@ -58,10 +58,13 @@
|
||||
|
||||
|
||||
<footer>
|
||||
{% if calendar.today_in_calendar %}
|
||||
<a role="button" href="{% url 'aujourdhui' %}?{{ filter.get_url }}">Aujourd'hui</a>
|
||||
<a role="button" href="{% url 'cette_semaine' %}?{{ filter.get_url }}">Cette semaine</a>
|
||||
{% endif %}
|
||||
<div class="buttons">
|
||||
<a role="button" href="{% url 'month_view_ical' calendar.firstdate.year calendar.firstdate.month %}" >Exporter ical {% picto_from_name "calendar" %}</a>
|
||||
{% if calendar.today_in_calendar %}
|
||||
<a role="button" href="{% url 'aujourdhui' %}?{{ filter.get_url }}">Aujourd'hui</a>
|
||||
<a role="button" href="{% url 'cette_semaine' %}?{{ filter.get_url }}">Cette semaine</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
|
@ -13,6 +13,7 @@ urlpatterns = [
|
||||
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("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("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("aujourdhui/", day_view, name="aujourdhui"),
|
||||
|
@ -267,7 +267,10 @@ def home(request):
|
||||
return week_view(request, home=True)
|
||||
|
||||
|
||||
def month_view(request, year=None, month=None):
|
||||
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:
|
||||
year = now.year
|
||||
@ -277,6 +280,11 @@ def month_view(request, year=None, month=None):
|
||||
filter = EventFilter(request.GET, queryset=get_event_qs(request), request=request)
|
||||
cmonth = CalendarMonth(year, month, filter)
|
||||
|
||||
if ical:
|
||||
logger.warning("export ical mois")
|
||||
response = Event.export_to_ics("testmois", cmonth.get_events())
|
||||
return response
|
||||
|
||||
context = {
|
||||
"year": year,
|
||||
"month": cmonth.get_month_name(),
|
||||
@ -301,7 +309,6 @@ def week_view(request, year=None, week=None, home=False, ical=False):
|
||||
cweek = CalendarWeek(year, week, filter)
|
||||
|
||||
if ical:
|
||||
logger.warning("export ical semaine")
|
||||
response = Event.export_to_ics("testsemaine", cweek.get_events())
|
||||
return response
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user