# Copyright (C) 2017 Alban Gruin
#
# celcatsanitizer is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# celcatsanitizer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with celcatsanitizer. If not, see .
from django.conf.urls import include, url
from . import feeds, views
urlpatterns = [
url(r"^$", views.index, name="index"),
url(r"^pages/", include("django.contrib.flatpages.urls")),
url(r"^salles/$", views.rooms, name="rooms"),
url(r"^salles/(?P[-\w]+)$", views.room_timetable, name="room-timetable"),
url(r"^salles/(?P[-\w]+)/(?P[0-9]{4})/(?P[0-4]?[0-9]|5[0-3])/$", views.room_timetable, name="room-timetable"),
url(r"^(?P[-\w]+)/$", views.mention_list, name="mentions"),
url(r"^(?P[-\w]+)/(?P[-\w]+)/$", views.group_list, name="groups"),
url(r"^(?P[-\w]+)/(?P[-\w]+)/(?P[-\w]+)/$", views.timetable, name="timetable"),
url(r"^(?P[-\w]+)/(?P[-\w]+)/(?P[-\w]+)/calendars", views.calendars, name="calendars"),
url(r"^(?P[-\w]+)/(?P[-\w]+)/(?P[-\w]+)/calendar.ics$", feeds.IcalFeed(), name="ics"),
url(r"^(?P[-\w]+)/(?P[-\w]+)/(?P[-\w]+)/calendar-group.ics$", feeds.IcalOnlyOneFeed(), name="ics-group"),
url(r"^(?P[-\w]+)/(?P[-\w]+)/(?P[-\w]+)/feed.atom$", feeds.AtomFeed(), name="atom"),
url(r"^(?P[-\w]+)/(?P[-\w]+)/(?P[-\w]+)/feed.rss$", feeds.RSSFeed(), name="rss"),
url(r"^(?P[-\w]+)/(?P[-\w]+)/(?P[-\w]+)/(?P[0-9]{4})/(?P[0-4]?[0-9]|5[0-3])/$", views.timetable, name="timetable"),
]