aboutsummaryrefslogtreecommitdiff
path: root/urls.py
blob: a5f6b9b8a11a818b73355daa25cb11a6e02f86ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#    Copyright (C) 2017-2019  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 <http://www.gnu.org/licenses/>.

from django.conf import settings
from django.urls import include, path

from . import feeds, views

urlpatterns = [
    path("", views.index, name="index")
]

if getattr(settings, "CS_ENABLE_API", False):
    from .api.urls import router

    urlpatterns += [
        path("api/", include(router.urls)),
    ]

urlpatterns += [
    path("pages/", include("django.contrib.flatpages.urls")),
    path("salles/", views.rooms, name="rooms"),
    path("salles/qsjps", views.qsjps, name="qsjps"),
    path("salles/<slug:room_slug>/", views.room_timetable, name="room-timetable"),
    path("salles/<slug:room_slug>/semaines", views.room_weeks, name="room-weeks"),
    path("salles/<slug:room_slug>/<int:year>/<int:week>", views.room_timetable, name="room-timetable"),
    path("<slug:year_slug>/", views.mention_list, name="mentions"),
    path("<slug:year_slug>/<slug:timetable_slug>/", views.group_list, name="groups"),
    path("<slug:year_slug>/<slug:timetable_slug>/tous", views.groups_all, name="groups-all"),
    path("<slug:year_slug>/<slug:timetable_slug>/<slug:group_slug>/", views.timetable, name="timetable"),
    path("<slug:year_slug>/<slug:timetable_slug>/<slug:group_slug>/calendars", views.calendars, name="calendars"),
    path("<slug:year_slug>/<slug:timetable_slug>/<slug:group_slug>/calendar.ics", feeds.IcalFeed(), name="ics"),
    path("<slug:year_slug>/<slug:timetable_slug>/<slug:group_slug>/calendar-group.ics", feeds.IcalOnlyOneFeed(), name="ics-group"),
    path("<slug:year_slug>/<slug:timetable_slug>/<slug:group_slug>/feed.atom", feeds.AtomFeed(), name="atom"),
    path("<slug:year_slug>/<slug:timetable_slug>/<slug:group_slug>/feed.rss", feeds.RSSFeed(), name="rss"),
    path("<slug:year_slug>/<slug:timetable_slug>/<slug:group_slug>/semaines", views.group_weeks, name="group-weeks"),
    path("<slug:year_slug>/<slug:timetable_slug>/<slug:group_slug>/<int:year>/<int:week>/", views.timetable, name="timetable"),
]