Browse Source

Stranky pouze pro orgy vyzaduji prihlaseni.

remotes/origin/opraf
parent
commit
3e46b3bec3
  1. 22
      seminar/urls.py
  2. 4
      seminar/utils.py

22
seminar/urls.py

@ -1,6 +1,7 @@
from django.conf.urls import * # NOQA
from django.conf.urls import patterns, url
from . import views, export
from utils import staff_member_required
urlpatterns = patterns('',
@ -18,7 +19,6 @@ urlpatterns = patterns('',
name = 'seminar_seznam_soustredeni'),
url(r'^soustredeni/probehlo/(?P<soustredeni>\d+)/$', views.SoustredeniView.as_view(), name='seminar_soustredeni'),
url(r'^soustredeni/(?P<soustredeni>\d+)/fotogalerie/', include('galerie.urls')),
url(r'^soustredeni/(?P<soustredeni>\d+)/obalky.pdf', views.soustredeniObalkyView,name='seminar_soustredeni_obalky'),
url(r'^zadani/aktualni/$', views.AktualniZadaniView, name='seminar_aktualni_zadani'),
url(r'^zadani/temata/$', views.ZadaniTemataView, name='seminar_temata'),
@ -29,15 +29,21 @@ urlpatterns = patterns('',
url(r'^clanky/resitel/$', views.ClankyResitelView.as_view(), name='clanky_resitel'),
url(r'^clanky/org/$', views.ClankyOrganizatorView.as_view(), name='clanky_organizator'),
url(r'^stav$', views.StavDatabazeView, name='stav_databaze'),
url(r'^aesop-export/mam-rocnik-(?P<prvni_rok>\d+)\.csv$', export.ExportRocnikView.as_view(), name='seminar_export_rocnik'),
url(r'^aesop-export/mam-sous-(?P<datum_zacatku>[\d-]+)\.csv$', export.ExportSousView.as_view(), name='seminar_export_sous'),
url(r'^aesop-export/index.csv$', export.ExportIndexView.as_view(), name='seminar_export_index'),
url(r'^cislo/(?P<rocnik>\d+).(?P<cislo>\d+)/vysledkovka.tex$', views.CisloVysledkovkaView.as_view(), name='seminar_cislo_vysledkovka'),
url(r'^cislo/(?P<rocnik>\d+).(?P<cislo>\d+)/obalky.pdf$',views.cisloObalkyView, name='seminar_cislo_obalky'),
url(r'^cislo/(?P<rocnik>\d+).(?P<cislo>\d+)/tituly.tex$', views.TitulyView,
name='seminar_cislo_titul'),
#### Stranky viditelne pouze pro orgy:
url(r'^cislo/(?P<rocnik>\d+).(?P<cislo>\d+)/vysledkovka.tex$',
staff_member_required(views.CisloVysledkovkaView.as_view()), name='seminar_cislo_vysledkovka'),
url(r'^cislo/(?P<rocnik>\d+).(?P<cislo>\d+)/obalky.pdf$',
staff_member_required(views.cisloObalkyView), name='seminar_cislo_obalky'),
url(r'^cislo/(?P<rocnik>\d+).(?P<cislo>\d+)/tituly.tex$',
staff_member_required(views.TitulyView), name='seminar_cislo_titul'),
url(r'^stav$',
staff_member_required(views.StavDatabazeView), name='stav_databaze'),
url(r'^soustredeni/(?P<soustredeni>\d+)/obalky.pdf',
staff_member_required(views.soustredeniObalkyView),name='seminar_soustredeni_obalky'),
)

4
seminar/utils.py

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
import datetime
from django.contrib.auth.decorators import user_passes_test
staff_member_required = user_passes_test(lambda u: u.is_staff)
def histogram(seznam):
d = {}
@ -76,3 +78,5 @@ def seznam_problemu():
return problemy

Loading…
Cancel
Save