diff --git a/.gitignore b/.gitignore index 36b0b565..05e728bd 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,9 @@ TODO # .htpasswd kvůli přihlášení .htpasswd + +# reversion kvůli historii objektů v reversion +**/reversion + +# pro lidi, co programují v nástrojích od JetBrains +.idea \ No newline at end of file diff --git a/MIGRATIONS b/MIGRATIONS new file mode 100644 index 00000000..3cf73ac4 --- /dev/null +++ b/MIGRATIONS @@ -0,0 +1,187 @@ +Jak zvládnout migrace na nový model: + +- V mojí verzi databáze mají úlohy-Problémy typ "b'uloha'" + + +Log migrace na nový model: + +Operations to perform: + Apply all migrations: admin, auth, contenttypes, django_comments, flatpages, fluent_comments, galerie, korektury, prednasky, reversion, seminar, sessions, sites, sitetree, taggit, threadedcomments +Running migrations: + Applying admin.0003_logentry_add_action_flag_choices... OK + Applying auth.0009_alter_user_last_name_max_length... OK + Applying auth.0010_alter_group_name_max_length... OK + Applying auth.0011_update_proxy_permissions... OK + Applying galerie.0008_auto_20190430_2340... OK + Applying galerie.0009_auto_20190610_2358... OK + Applying galerie.0010_auto_20200819_0947... OK + Applying korektury.0016_auto_20190430_2340... OK + Applying korektury.0017_auto_20190610_2358... OK + Applying prednasky.0011_auto_20190430_2340... OK + Applying prednasky.0012_auto_20190610_2358... OK + Applying seminar.0049_auto_20190430_2354... OK + Applying seminar.0050_auto_20190510_2228... OK + Applying seminar.0051_resitel_to_osoba... OK + Applying seminar.0052_user_to_organizator... OK +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2004-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1998-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2017-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2017-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2014-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2011-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2013-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2004-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2013-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2012-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2007-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2011-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2009-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2009-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2008-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2005-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2015-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2001-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2010-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2008-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2006-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2002-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2005-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1999-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2003-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2000-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2002-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2001-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1996-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2000-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (1999-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (1996-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1994-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2012-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2016-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2018-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2014-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2019-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2006-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1995-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2007-12-31 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2015-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2016-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2018-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2019-01-01 00:00:00) while time zone support is active. + RuntimeWarning) +/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2020-01-01 00:00:00) while time zone support is active. + RuntimeWarning) + Applying seminar.0053_organizator_organizuje_od_do... OK + Applying seminar.0055_smazat_nemigrovane_zastarale_veci... OK + Applying seminar.0056_vrcholy_pro_rocniky_a_cisla... OK + Applying seminar.0057_reseni_to_reseni_hodnoceni...!!!!!!!!!!!!!!! +31397 Reseni object (31397) +!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!! +31396 Reseni object (31396) +!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!! +31395 Reseni object (31395) +!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!! +31394 Reseni object (31394) +!!!!!!!!!!!!!!! +!!!!!!!!!!!!!!! +31393 Reseni object (31393) +!!!!!!!!!!!!!!! + OK + Applying seminar.0058_problem_to_uloha_tema_clanek... OK + Applying seminar.fix_0058... OK + Applying seminar.0059_vytvorit_pohadkanode... OK + Applying seminar.0060_spoj_stromy... OK + Applying seminar.0061_kill_frankenstein... OK + Applying seminar.0062_redukce_modelu_pohadky... OK + Applying seminar.0063_procisteni_migraci... OK + Applying seminar.0064_auto_20190610_2358... OK + Applying seminar.0065_treenode_polymorphic_ctype... OK + Applying seminar.0066_problem_polymorphic_ctype... OK + Applying seminar.0067_auto_20190814_0805... OK + Applying seminar.0068_treenode_nazev... OK + Applying seminar.0069_auto_20191120_2115... OK + Applying seminar.0070_auto_20191120_2357... OK + Applying seminar.0071_remove_nastaveni_aktualni_rocnik... OK + Applying seminar.0072_auto_20191204_2257... OK + Applying seminar.0073_copy_osoba_email_to_user_email... OK + Applying seminar.0074_auto_20200228_1401... OK + Applying seminar.0075_auto_20200228_2010... OK + Applying seminar.0076_auto_20200228_2013... OK + Applying seminar.0077_auto_20200318_2146... OK + Applying seminar.0078_otistenereseninode... OK + Applying seminar.0079_clanek_resitelsky... OK + Applying seminar.0080_zruseni_claneknode_a_konferanode... OK + Applying seminar.0081_auto_20200408_2221... OK + Applying seminar.0082_auto_20200506_1951... OK + Applying seminar.0083_auto_20200506_1952... OK +WARNING 2020-08-20 00:49:07,941 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2215) +WARNING 2020-08-20 00:49:07,953 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2221) +WARNING 2020-08-20 00:49:07,959 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2212) +WARNING 2020-08-20 00:49:07,965 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1955) +WARNING 2020-08-20 00:49:07,968 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2027) +WARNING 2020-08-20 00:49:07,971 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1981) +WARNING 2020-08-20 00:49:07,974 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1970) +WARNING 2020-08-20 00:49:07,978 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2001) +WARNING 2020-08-20 00:49:07,981 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2004) +WARNING 2020-08-20 00:49:07,984 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1941) +WARNING 2020-08-20 00:49:07,990 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2024) +WARNING 2020-08-20 00:49:07,993 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2031) +WARNING 2020-08-20 00:49:07,997 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2211) +WARNING 2020-08-20 00:49:08,005 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2073) +WARNING 2020-08-20 00:49:08,017 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2018) +WARNING 2020-08-20 00:49:08,022 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2222) +WARNING 2020-08-20 00:49:08,028 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1953) +WARNING 2020-08-20 00:49:08,034 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2026) + Applying seminar.0084_clanek_cislo... OK + Applying seminar.0085_nepovinna_prezdivka... OK + Applying seminar.0086_auto_20200819_0959... OK + Applying sitetree.0001_initial... OK + Applying taggit.0003_taggeditem_add_unique_index... OK + diff --git a/Makefile b/Makefile index 1ace9e01..a9d2e082 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ schema_all.pdf: venv_check # Deploy to current *mamweb-test* directory deploy_test: venv_check @if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi - @if [ `pwd` != "/akce/mam/www/mamweb-test" ]; then echo "Only possible in /akce/mam/www/mamweb-test"; exit 1; fi + @if [ `readlink -f .` != "/aux/akce/mam/www/mamweb-test" ]; then echo "Only possible in directory mamweb-test"; exit 1; fi @echo "Installing version from origin/test ..." git pull origin test git clean -f @@ -81,9 +81,9 @@ deploy_test: venv_check # Deploy to current *mamweb-prod* directory deploy_prod: venv_check @if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi - @if [ `pwd` != "/akce/mam/www/mamweb-prod" ]; then echo "Only possible in /akce/mam/www/mamweb-prod"; exit 1; fi + @if [ `readlink -f .` != "/aux/akce/mam/www/mamweb-prod" ]; then echo "Only possible in directory mamweb-prod"; exit 1; fi @echo "Backing up production DB ..." - ( cd .. && ./backup_prod_db.sh ) + ( cd -P .. && ./backup_prod_db.sh ) @echo "Installing version from origin/master ..." git pull origin master git clean -f @@ -109,7 +109,7 @@ sync_prod_flatpages: venv_check # Sync test media directory with production sync_test_media: @if [ ${USER} != "mam-web" ]; then echo "Only possible by user mam-web"; exit 1; fi - @if [ `pwd` != "/akce/mam/www/mamweb-test" ]; then echo "Only possible in /akce/mam/www/mamweb-test"; exit 1; fi + @if [ `readlink -f .` != "/aux/akce/mam/www/mamweb-test" ]; then echo "Only possible in /akce/mam/www/mamweb-test"; exit 1; fi rsync -av --delete /akce/mam/www/mamweb-prod/media/ ./media # Sync test database with production database diff --git a/flat.json b/flat.json index db13ba78..8adde103 100644 --- a/flat.json +++ b/flat.json @@ -125,7 +125,7 @@ "fields": { "url": "/soustredeni/", "title": "Informace", - "content": "

Pro na\u0161e nejlep\u0161\u00ed \u0159e\u0161itele po\u0159\u00e1d\u00e1me dvakr\u00e1t do roka t\u00fddenn\u00ed soust\u0159ed\u011bn\u00ed pln\u00e9 odborn\u00e9ho programu i nejr\u016fzn\u011bj\u0161\u00ed z\u00e1bavy.

\r\n\r\n\r\n

Pro\u010d jet na soust\u0159ed\u011bn\u00ed?

\r\n\r\n

P\u0159edn\u00e1\u0161ky

\r\n\r\n

V\u011bt\u0161inou t\u011b ka\u017ed\u00fd den \u010dekaj\u00ed dv\u011b devades\u00e1timinutov\u00e9 p\u0159edn\u00e1\u0161ky. Vybrat si obvykle m\u016f\u017ee\u0161 mezi matematikou, fyzikou a informatikou, proto\u017ee se konaj\u00ed t\u0159i p\u0159edn\u00e1\u0161ky z\u00e1rove\u0148. N\u011bkter\u00e9 p\u0159edn\u00e1\u0161ky jsou leh\u010d\u00ed, jin\u00e9 t\u011b\u017e\u0161\u00ed, obecn\u011b je ale jejich \u00farove\u0148 vhodn\u00e1 pr\u00e1v\u011b pro zv\u00eddav\u00e9 st\u0159edo\u0161kol\u00e1ky. P\u0159edn\u00e1\u0161\u00edme jak klasick\u00e1 t\u00e9mata, tak t\u00e9mata nev\u0161edn\u00ed, z\u00e1kulisn\u00ed \u010di dokonce obskurn\u00ed. Kdy\u017e bude\u0161 organiz\u00e1tory hodn\u011b prosit, mo\u017en\u00e1 se dostane i na n\u011bjakou \u010dernou magii!

\r\n\r\n

Krom toho p\u0159edn\u00e1\u0161\u00edme i na po\u017e\u00e1d\u00e1n\u00ed \u2013 sta\u010d\u00ed, kdy\u017e si vybere\u0161 t\u00e9ma, kter\u00e9 t\u011b zaj\u00edm\u00e1, a oslov\u00ed\u0161 toho spr\u00e1vn\u00e9ho organiz\u00e1tora.

\r\n\r\n

Lid\u00e9

\r\n\r\n

Pozn\u00e1\u0161 lidi, pro kter\u00e9 je p\u0159em\u00fd\u0161len\u00ed obl\u00edbenou \u010dinnost\u00ed a pro kter\u00e9 matematika nen\u00ed sprost\u00e9 slovo. P\u0159edev\u0161\u00edm to jsou ale lidi, kte\u0159\u00ed se r\u00e1di bav\u00ed a se kter\u00fdmi si u\u017eije\u0161 mnoho legrace u j\u00eddla, b\u011bhem her, na v\u00fdlet\u011b, jen tak, p\u0159i hran\u00ed na kytaru nebo p\u0159i \u0161ar\u00e1d\u011bn\u00ed (pokud nev\u00ed\u0161, co tohle slovo znamen\u00e1, je na \u010dase to zjistit!).

\r\n\r\n

Konfery

\r\n\r\n

Konfery jsou na\u0161\u00ed specialitou. Ve skupin\u011b \u00fa\u010dastn\u00edk\u016f a pod veden\u00edm zku\u0161en\u00e9ho organiz\u00e1tora m\u016f\u017ee\u0161 zkusit pracovat na zadan\u00e9m probl\u00e9mu a v\u00fdsledky pak ostatn\u00edm prezentovat na mal\u00e9 v\u011bdeck\u00e9 konferenci. Pr\u00e1ce na konfe\u0159e je velmi podobn\u00e1 skute\u010dn\u00e9 v\u011bdeck\u00e9 pr\u00e1ci. M\u00e1me za sebou nap\u0159\u00edklad stavbu katapultu, po\u010d\u00edta\u010dovou synt\u00e9zu zvuku \u010di tropickou geometrii.

\r\n\r\n

Hry

\r\n\r\n

M\u00e1me pro tebe p\u0159ipravenou celou \u0159adu denn\u00edch i no\u010dn\u00edch her, uvnit\u0159 i venku, strategick\u00fdch i ak\u010dn\u00edch. A n\u011bkdy tohle v\u0161echno dohromady. Chceme, aby sis mohl/a zkusit \u010dinnosti, ke kter\u00fdm se b\u011b\u017en\u011b nedostane\u0161. St\u0159elba z luku, lezen\u00ed po skal\u00e1ch, slackline \u010di celono\u010dn\u00ed \u0161ifrova\u010dka? Nen\u00ed probl\u00e9m!

\r\n\r\n

Legenda

\r\n\r\n

Ka\u017ed\u00e9 soust\u0159ed\u011bn\u00ed m\u00e1 sv\u00e9 vlastn\u00ed prost\u0159ed\u00ed \u010di p\u0159\u00edb\u011bh, kter\u00fd j\u00edm prov\u00e1z\u00ed. U\u017e jsme byli ve starov\u011bk\u00e9m \u0158ecku \u010di pod podlahou obcho\u010f\u00e1ku, cestovali jsme \u010dasem a tak\u00e9 jsme bojovali s krvela\u010dn\u00fdmi zmutovan\u00fdmi tule\u0148\u00e1tky, kter\u00e1 se nakonec uk\u00e1zala b\u00fdt filma\u0159sk\u00fdm trikem. Co n\u00e1s \u010dek\u00e1 p\u0159\u00ed\u0161t\u011b?

\r\n\r\n

Absence ve \u0161kole

\r\n\r\n

Ne\u017e pojede\u0161 na soust\u0159ed\u011bn\u00ed, po\u0161leme ti ofici\u00e1ln\u00ed omluvenku od MFF UK. Jeliko\u017e je soust\u0159ed\u011bn\u00ed pln\u00e9 odborn\u00e9ho programu, v\u011bt\u0161ina \u0161kol na\u0161e \u0159e\u0161itele bez probl\u00e9mu uvol\u0148uje. N\u011bkter\u00e9 \u0161koly dokonce \u00fa\u010dast na soust\u0159ed\u011bn\u00ed nezapo\u010d\u00edt\u00e1vaj\u00ed do absence. V\u017edy je ale dobr\u00e9 se informovat, jak \u00fa\u010dast na podobn\u00fdch akc\u00edch \u0159e\u0161\u00ed tvoje \u0161kola, a p\u0159\u00edpadn\u011b se osobn\u011b domluvit s \u0159editelem \u010di \u0159editelkou.

\r\n\r\n

Kapacita soust\u0159ed\u011bn\u00ed

\r\n\r\n

Proto\u017ee chceme zachovat p\u0159\u00e1telskou a komorn\u00ed atmosf\u00e9ru soust\u0159ed\u011bn\u00ed, zveme na soust\u0159ed\u011bn\u00ed zhruba dvacet nej\u00fasp\u011b\u0161n\u011bj\u0161\u00edch \u0159e\u0161itel\u016f koresponden\u010dn\u00edho semin\u00e1\u0159e. N\u011bkolik dal\u0161\u00edch \u0159e\u0161itel\u016f zveme jako n\u00e1hradn\u00edky pro p\u0159\u00edpad, \u017ee by n\u011bkte\u0159\u00ed pozvan\u00ed nemohli. Pokud t\u011b na soust\u0159ed\u011bn\u00ed nepozveme, nezoufej a zkus v p\u0159\u00ed\u0161t\u00edm p\u016flroce v\u00edc \u0159e\u0161it t\u00e9mata. Dostat se mezi nejlep\u0161\u00edch dvacet \u0159e\u0161itel\u016f je s trochou p\u00edle hra\u010dka.

\r\n\r\n

 

\r\n", + "content": "

Pro na\u0161e nejlep\u0161\u00ed \u0159e\u0161itele po\u0159\u00e1d\u00e1me dvakr\u00e1t do roka t\u00fddenn\u00ed soust\u0159ed\u011bn\u00ed pln\u00e9 odborn\u00e9ho programu i nejr\u016fzn\u011bj\u0161\u00ed z\u00e1bavy.

\r\n\r\n\r\n

Pro\u010d jet na soust\u0159ed\u011bn\u00ed?

\r\n\r\n

P\u0159edn\u00e1\u0161ky

\r\n\r\n

V\u011bt\u0161inou t\u011b ka\u017ed\u00fd den \u010dekaj\u00ed dv\u011b devades\u00e1timinutov\u00e9 p\u0159edn\u00e1\u0161ky. Vybrat si obvykle m\u016f\u017ee\u0161 mezi matematikou, fyzikou a informatikou, proto\u017ee se konaj\u00ed t\u0159i p\u0159edn\u00e1\u0161ky z\u00e1rove\u0148. N\u011bkter\u00e9 p\u0159edn\u00e1\u0161ky jsou leh\u010d\u00ed, jin\u00e9 t\u011b\u017e\u0161\u00ed, obecn\u011b je ale jejich \u00farove\u0148 vhodn\u00e1 pr\u00e1v\u011b pro zv\u00eddav\u00e9 st\u0159edo\u0161kol\u00e1ky. P\u0159edn\u00e1\u0161\u00edme jak klasick\u00e1 t\u00e9mata, tak t\u00e9mata nev\u0161edn\u00ed, z\u00e1kulisn\u00ed \u010di dokonce obskurn\u00ed. Kdy\u017e bude\u0161 organiz\u00e1tory hodn\u011b prosit, mo\u017en\u00e1 se dostane i na n\u011bjakou \u010dernou magii!

\r\n\r\n

Krom toho p\u0159edn\u00e1\u0161\u00edme i na po\u017e\u00e1d\u00e1n\u00ed \u2013 sta\u010d\u00ed, kdy\u017e si vybere\u0161 t\u00e9ma, kter\u00e9 t\u011b zaj\u00edm\u00e1, a oslov\u00ed\u0161 toho spr\u00e1vn\u00e9ho organiz\u00e1tora.

\r\n\r\n

Lid\u00e9

\r\n\r\n

Pozn\u00e1\u0161 lidi, pro kter\u00e9 je p\u0159em\u00fd\u0161len\u00ed obl\u00edbenou \u010dinnost\u00ed a pro kter\u00e9 matematika nen\u00ed sprost\u00e9 slovo. P\u0159edev\u0161\u00edm to jsou ale lidi, kte\u0159\u00ed se r\u00e1di bav\u00ed a se kter\u00fdmi si u\u017eije\u0161 mnoho legrace u j\u00eddla, b\u011bhem her, na v\u00fdlet\u011b, jen tak, p\u0159i hran\u00ed na kytaru nebo p\u0159i \u0161ar\u00e1d\u011bn\u00ed (pokud nev\u00ed\u0161, co tohle slovo znamen\u00e1, je na \u010dase to zjistit!).

\r\n\r\n

Konfery

\r\n\r\n

Konfery jsou na\u0161\u00ed specialitou. Ve skupin\u011b \u00fa\u010dastn\u00edk\u016f a pod veden\u00edm zku\u0161en\u00e9ho organiz\u00e1tora m\u016f\u017ee\u0161 zkusit pracovat na zadan\u00e9m probl\u00e9mu a v\u00fdsledky pak ostatn\u00edm prezentovat na mal\u00e9 v\u011bdeck\u00e9 konferenci. Pr\u00e1ce na konfe\u0159e je velmi podobn\u00e1 skute\u010dn\u00e9 v\u011bdeck\u00e9 pr\u00e1ci. M\u00e1me za sebou nap\u0159\u00edklad stavbu katapultu, po\u010d\u00edta\u010dovou synt\u00e9zu zvuku \u010di tropickou geometrii.

\r\n\r\n

Hry

\r\n\r\n

M\u00e1me pro tebe p\u0159ipravenou celou \u0159adu denn\u00edch i no\u010dn\u00edch her, uvnit\u0159 i venku, strategick\u00fdch i ak\u010dn\u00edch. A n\u011bkdy tohle v\u0161echno dohromady. Chceme, aby sis mohl/a zkusit \u010dinnosti, ke kter\u00fdm se b\u011b\u017en\u011b nedostane\u0161. St\u0159elba z luku, lezen\u00ed po skal\u00e1ch, slackline \u010di celono\u010dn\u00ed \u0161ifrova\u010dka? Nen\u00ed probl\u00e9m!

\r\n\r\n

Legenda

\r\n\r\n

Ka\u017ed\u00e9 soust\u0159ed\u011bn\u00ed m\u00e1 sv\u00e9 vlastn\u00ed prost\u0159ed\u00ed \u010di p\u0159\u00edb\u011bh, kter\u00fd j\u00edm prov\u00e1z\u00ed. U\u017e jsme byli ve starov\u011bk\u00e9m \u0158ecku \u010di pod podlahou obcho\u010f\u00e1ku, cestovali jsme \u010dasem a tak\u00e9 jsme bojovali s krvela\u010dn\u00fdmi zmutovan\u00fdmi tule\u0148\u00e1tky, kter\u00e1 se nakonec uk\u00e1zala b\u00fdt filma\u0159sk\u00fdm trikem. Co n\u00e1s \u010dek\u00e1 p\u0159\u00ed\u0161t\u011b?

\r\n\r\n

Absence ve \u0161kole

\r\n\r\n

Ne\u017e pojede\u0161 na soust\u0159ed\u011bn\u00ed, po\u0161leme ti ofici\u00e1ln\u00ed omluvenku od MFF UK. Jeliko\u017e je soust\u0159ed\u011bn\u00ed pln\u00e9 odborn\u00e9ho programu, v\u011bt\u0161ina \u0161kol na\u0161e \u0159e\u0161itele bez probl\u00e9mu uvol\u0148uje. N\u011bkter\u00e9 \u0161koly dokonce \u00fa\u010dast na soust\u0159ed\u011bn\u00ed nezapo\u010d\u00edt\u00e1vaj\u00ed do absence. V\u017edy je ale dobr\u00e9 se informovat, jak \u00fa\u010dast na podobn\u00fdch akc\u00edch \u0159e\u0161\u00ed tvoje \u0161kola, a p\u0159\u00edpadn\u011b se osobn\u011b domluvit s \u0159editelem \u010di \u0159editelkou.

\r\n\r\n

Kapacita soust\u0159ed\u011bn\u00ed

\r\n\r\n

Proto\u017ee chceme zachovat p\u0159\u00e1telskou a komorn\u00ed atmosf\u00e9ru soust\u0159ed\u011bn\u00ed, zveme na soust\u0159ed\u011bn\u00ed zhruba dvacet nej\u00fasp\u011b\u0161n\u011bj\u0161\u00edch \u0159e\u0161itel\u016f koresponden\u010dn\u00edho semin\u00e1\u0159e. N\u011bkolik dal\u0161\u00edch \u0159e\u0161itel\u016f zveme jako n\u00e1hradn\u00edky pro p\u0159\u00edpad, \u017ee by n\u011bkte\u0159\u00ed pozvan\u00ed nemohli. Pokud t\u011b na soust\u0159ed\u011bn\u00ed nepozveme, nezoufej a zkus v p\u0159\u00ed\u0161t\u00edm p\u016flroce v\u00edc \u0159e\u0161it t\u00e9mata. Dostat se mezi nejlep\u0161\u00edch dvacet \u0159e\u0161itel\u016f je s trochou p\u00edle hra\u010dka.

\r\n\r\n

 

\r\n", "enable_comments": false, "template_name": "", "registration_required": false, diff --git a/galerie/admin.py b/galerie/admin.py index f0ac6e28..54b0751e 100644 --- a/galerie/admin.py +++ b/galerie/admin.py @@ -30,14 +30,14 @@ def prepnout_fotogalerii_do_org_rezimu(modeladmin, request, queryset): class GalerieInline(admin.TabularInline): model = Obrazek - fields = ['obrazek_velky', 'nazev', 'popis', 'obrazek_maly_tag'] + fields = ['obrazek_velky', 'nazev', 'popis', 'obrazek_maly_tag', 'poradi'] readonly_fields = ['nazev', 'obrazek_maly_tag'] formfield_overrides = { models.TextField: {'widget': forms.TextInput}, } class ObrazekAdmin(admin.ModelAdmin): - list_display = ('obrazek_velky', 'nazev', 'popis', 'obrazek_maly_tag') + list_display = ('obrazek_velky', 'nazev', 'popis', 'obrazek_maly_tag', 'poradi') search_fields = ['nazev','popis'] class GalerieAdmin(admin.ModelAdmin): diff --git a/galerie/migrations/0010_auto_20200819_0947.py b/galerie/migrations/0010_auto_20200819_0947.py new file mode 100644 index 00000000..b7678ac1 --- /dev/null +++ b/galerie/migrations/0010_auto_20200819_0947.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.15 on 2020-08-19 07:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('galerie', '0009_auto_20190610_2358'), + ] + + operations = [ + migrations.AlterField( + model_name='galerie', + name='poradi', + field=models.IntegerField(blank=True, default=0, verbose_name='Pořadí'), + ), + ] diff --git a/galerie/models.py b/galerie/models.py index c48d3a95..8e6efdc7 100644 --- a/galerie/models.py +++ b/galerie/models.py @@ -94,7 +94,7 @@ class Galerie(models.Model): on_delete=models.SET_NULL) soustredeni = models.ForeignKey(Soustredeni, blank = True, null = True, on_delete=models.PROTECT) - poradi = models.IntegerField('Pořadí', blank = True, null = True) + poradi = models.IntegerField('Pořadí', blank = True, null = False, default = 0) def __str__(self): return self.nazev diff --git a/galerie/templates/galerie/GalerieNahled.html b/galerie/templates/galerie/GalerieNahled.html index 7d9313fc..d1c6873e 100644 --- a/galerie/templates/galerie/GalerieNahled.html +++ b/galerie/templates/galerie/GalerieNahled.html @@ -61,7 +61,7 @@ Galerie {{galerie.nazev}} {{ galerie|truncatechars:max_delka_nazvu }} - {% if user.is_staff and galerie.zobrazit > 0 %} + {% if user.je_org and galerie.zobrazit > 0 %}
({{galerie.poradi}}) + @@ -73,7 +73,7 @@ Galerie {{galerie.nazev}} {% endwith %} {% endif %} {% endif %} - {% if user.is_staff and galerie.zobrazit > 0 %} + {% if user.je_org and galerie.zobrazit > 0 %}
Vytvořit novou podgalerii
diff --git a/galerie/urls.py b/galerie/urls.py index 4d1e8f24..d299165f 100644 --- a/galerie/urls.py +++ b/galerie/urls.py @@ -1,13 +1,14 @@ # coding: utf-8 from django.urls import path +from seminar.utils import org_required from . import views urlpatterns = [ path('/', views.nahled), path('//', views.detail), - path('/new/', views.new_galerie), - path('/plus//', views.plus_galerie), - path('/minus//', views.minus_galerie), + path('/new/', org_required(views.new_galerie)), + path('/plus//', org_required(views.plus_galerie)), + path('/minus//', org_required(views.minus_galerie)), ] diff --git a/galerie/views.py b/galerie/views.py index 729ac3b8..4570b8fb 100644 --- a/galerie/views.py +++ b/galerie/views.py @@ -14,7 +14,7 @@ from galerie.forms import KomentarForm, NewGalerieForm def zobrazit(galerie, request): preview = False if galerie.zobrazit >= 1: - if request.user.is_staff: + if request.user.je_org: preview = True; else: raise Http404 @@ -35,16 +35,16 @@ def nahled(request, pk, soustredeni): galerie = get_object_or_404(Galerie, pk=pk) podgalerie = Galerie.objects.filter(galerie_up = galerie).order_by('poradi') - if not request.user.is_staff: + if not request.user.je_org: podgalerie = podgalerie.filter(zobrazit__lt=1) - obrazky = Obrazek.objects.filter(galerie = galerie) + obrazky = Obrazek.objects.filter(galerie = galerie).order_by('poradi', 'nazev') preview = zobrazit(galerie, request) sourozenci = [] if galerie.galerie_up: sourozenci = galerie.galerie_up.galerie_set.all().order_by('poradi') - if not request.user.is_staff: + if not request.user.je_org: sourozenci = sourozenci.filter(zobrazit__lt=1) predchozi = None @@ -82,7 +82,7 @@ def detail(request, pk, fotka, soustredeni): galerie = get_object_or_404(Galerie, pk=pk) preview = zobrazit(galerie, request) obrazek = get_object_or_404(Obrazek, pk=fotka) - obrazky = galerie.obrazek_set.all() + obrazky = galerie.obrazek_set.all().order_by('poradi', 'nazev') # vytvoreni a obslouzeni formulare if request.method == 'POST': @@ -96,22 +96,23 @@ def detail(request, pk, fotka, soustredeni): # Poradi aktualniho obrazku v galerii/stitku. for i in range(len(obrazky)): if obrazky[i] == obrazek: - znacka = i + poradi = i break else: # Obrazek neni v galerii/stitku. raise Http404 + # Nacteni okolnich obrazku a galerii # TODO vyjmout zjisteni predchozich a nasledujicich galerii # a udelat z toho funkci, ktera se pouzije u nahledu predchozi_galerie = None nasledujici_galerie = None - obrazky_dalsi = obrazky[znacka+1:znacka+NAHLEDU+1] - if (znacka+1) > NAHLEDU: - obrazky_predchozi = obrazky[znacka-NAHLEDU:znacka] + obrazky_dalsi = obrazky[poradi+1:poradi+NAHLEDU+1] + if (poradi+1) > NAHLEDU: + obrazky_predchozi = obrazky[poradi-NAHLEDU:poradi] else: - obrazky_predchozi = obrazky[0:znacka] + obrazky_predchozi = obrazky[0:poradi] if galerie.poradi > 1: predchozi_galerie = Galerie.objects.\ filter(galerie_up=galerie.galerie_up).\ @@ -120,41 +121,44 @@ def detail(request, pk, fotka, soustredeni): predchozi_galerie = predchozi_galerie[0] else: predchozi_galerie = None - if (znacka+1) == len(obrazky): - nasledujici_galerie = Galerie.objects.\ - filter(galerie_up=galerie.galerie_up).\ - filter(poradi=(galerie.poradi+1)) + if (poradi+1) == len(obrazky): # Tohle je poslední obrázek + if (galerie.poradi is not None + and galerie.galerie_up is not None): + nasledujici_galerie = Galerie.objects.\ + filter(galerie_up=galerie.galerie_up).\ + filter(poradi=(galerie.poradi+1)) + else: + nasledujici_galerie = None if nasledujici_galerie: nasledujici_galerie = nasledujici_galerie[0] else: nasledujici_galerie = None - + # Preskalovani obrazku do vybraneho prostoru. vyska = obrazek.obrazek_stredni.height sirka = obrazek.obrazek_stredni.width if vyska > MAX_VYSKA: - sirka = sirka * MAX_VYSKA / vyska + sirka = sirka * MAX_VYSKA / vyska vyska = MAX_VYSKA if sirka > MAX_SIRKA: vyska = vyska * MAX_SIRKA / sirka sirka = MAX_SIRKA return render(request, 'galerie/Galerie.html', - {'galerie' : galerie, - 'predchozi_galerie' : predchozi_galerie, - 'nasledujici_galerie' : nasledujici_galerie, - 'obrazek' : obrazek, - 'vyska' : vyska, - 'sirka' : sirka, - 'obrazky_predchozi' : obrazky_predchozi, - 'obrazky_dalsi' : obrazky_dalsi, - 'preview' : preview, - 'form' : form, - 'cesta': cesta_od_korene(galerie), - }) - + {'galerie' : galerie, + 'predchozi_galerie' : predchozi_galerie, + 'nasledujici_galerie' : nasledujici_galerie, + 'obrazek' : obrazek, + 'vyska' : vyska, + 'sirka' : sirka, + 'obrazky_predchozi' : obrazky_predchozi, + 'obrazky_dalsi' : obrazky_dalsi, + 'preview' : preview, + 'form' : form, + 'cesta': cesta_od_korene(galerie), + }) def new_galerie(request, galerie, soustredeni): diff --git a/korektury/models.py b/korektury/models.py index 6e5fed8a..37213172 100644 --- a/korektury/models.py +++ b/korektury/models.py @@ -79,22 +79,31 @@ class KorekturovanePDF(models.Model): self.stran = 0 while True: res = subprocess.call([ - "convert", - "-density", "180x180", - "-geometry", " 1024x1448", - "%s[%d]" % (self.pdf.path, self.stran), - os.path.join( + #Parametry inspirovány chybovou hláškou imagemagicku + "gs", + "-sstdout=%stderr", + "-dSAFER", + "-dNOPAUSE", + "-dBATCH", + "-dNOPROMPT", + "-sDEVICE=pngalpha", + "-r180x180", + "-dFirstPage=%d" % (self.stran+1), + "-dLastPage=%d" % (self.stran+1), + "-sOutputFile="+os.path.join( dirname, - "%s-%d.png" % (self.get_prefix(), self.stran) - ) + "%s-%d.png" % (self.get_prefix(), self.stran)), + "-f%s" % (self.pdf.path) ]) - if res == 1: + if not os.path.exists(os.path.join( + dirname, + "%s-%d.png" % (self.get_prefix(), self.stran))): break self.stran += 1 # Změnil se počet stran, ukládáme super(KorekturovanePDF, self).save() - def save(self): + def save(self, **kwargs): # Pokud se nezmenilo PDF, tak nepregenerovavej nahledy try: original = KorekturovanePDF.objects.get(pk=self.pk) @@ -104,7 +113,7 @@ class KorekturovanePDF(models.Model): except ObjectDoesNotExist: pass # uložíme nahrávané pdf - super(KorekturovanePDF, self).save() + super(KorekturovanePDF, self).save(kwargs) # uložíme png a změněný počet stran self.convert() diff --git a/korektury/templates/korektury/base.html b/korektury/templates/korektury/base.html index b31d5d47..886a15e1 100644 --- a/korektury/templates/korektury/base.html +++ b/korektury/templates/korektury/base.html @@ -1,5 +1,9 @@ {% extends "base.html" %} +{% block submenu %} + {% include "korektury/submenu.html" %} +{% endblock %} + {% block content %} {# blok do kterého se nacita text, v pripade jinyhc templatu obalit vlastnim blokem #} {% endblock %} diff --git a/korektury/templates/korektury/help.html b/korektury/templates/korektury/help.html index 0024848e..f2ddafb9 100644 --- a/korektury/templates/korektury/help.html +++ b/korektury/templates/korektury/help.html @@ -1,4 +1,11 @@ {% extends "korektury/base.html" %} + +{% block submenu %} + {% with "help" as selected %} + {% include "korektury/submenu.html" %} + {% endwith %} +{% endblock %} + {% load staticfiles %} {% block title %} Nápověda ke korigovátku {% endblock title %} diff --git a/korektury/templates/korektury/opraf.html b/korektury/templates/korektury/opraf.html index ba8898a6..00c81c2d 100644 --- a/korektury/templates/korektury/opraf.html +++ b/korektury/templates/korektury/opraf.html @@ -36,12 +36,12 @@ id="neni_chyba_checkbox" name="neni_chyba_checkbox" onchange="toggle_corrections('neni_chyba')" checked> -
diff --git a/mamweb/templates/logo.html b/mamweb/templates/logo.html new file mode 100644 index 00000000..c5113d0c --- /dev/null +++ b/mamweb/templates/logo.html @@ -0,0 +1,26 @@ +{% load staticfiles %} + \ No newline at end of file diff --git a/mamweb/templates/menu.html b/mamweb/templates/menu.html index c7c0e8f5..e948785a 100644 --- a/mamweb/templates/menu.html +++ b/mamweb/templates/menu.html @@ -3,7 +3,9 @@ {% autoescape off %} diff --git a/seminar/templates/seminar/titulnistrana.html b/seminar/templates/seminar/titulnistrana.html index 2e4fa6a0..3880489e 100644 --- a/seminar/templates/seminar/titulnistrana.html +++ b/seminar/templates/seminar/titulnistrana.html @@ -10,7 +10,7 @@ {% if dead %}
-

Do konce odeslání řešení {% if deadline_soustredeni %}(pro účast na soustředění) {% endif %}zbývá:
+

Do konce odeslání řešení {% if deadline_soustredeni %}(pro účast na soustředění) {% endif %}zbývá:
{{ted|timesince:dead}}

{% endif %} diff --git a/seminar/templates/seminar/treenode.html b/seminar/templates/seminar/treenode.html index 0fd734ef..ca4df002 100644 --- a/seminar/templates/seminar/treenode.html +++ b/seminar/templates/seminar/treenode.html @@ -1,4 +1,4 @@ -{% extends "seminar/archiv/base_ulohy.html" %} +{% extends "seminar/archiv/base.html" %} {% load comments %} diff --git a/seminar/templates/seminar/zadani/AktualniVysledkovka.html b/seminar/templates/seminar/zadani/AktualniVysledkovka.html index 00ace94c..0f2ad4f4 100644 --- a/seminar/templates/seminar/zadani/AktualniVysledkovka.html +++ b/seminar/templates/seminar/zadani/AktualniVysledkovka.html @@ -27,7 +27,7 @@ v archivu.

- {% if user.is_staff and vysledkovka_s_neverejnymi %} + {% if user.je_org and vysledkovka_s_neverejnymi %}

Výsledky včetně neveřejných

{% with vysledkovka_s_neverejnymi as vysledkovka %} diff --git a/seminar/templates/seminar/zadani/AktualniZadani.html b/seminar/templates/seminar/zadani/AktualniZadani.html index b611eee9..31e2ca89 100644 --- a/seminar/templates/seminar/zadani/AktualniZadani.html +++ b/seminar/templates/seminar/zadani/AktualniZadani.html @@ -16,8 +16,8 @@ {% with nastaveni.aktualni_cislo as ac %} {# Zobrazovani neverejnych zadani jen organizatorum #} -{% if user.is_staff or verejne %} -{% if user.is_staff and not verejne %}
{% endif %} +{% if user.je_org or verejne %} +{% if user.je_org and not verejne %}
{% endif %} {% if ac.zadane_problemy.all %} {% if ac.datum_deadline_soustredeni %} @@ -35,34 +35,38 @@ {% if ac.pdf %} -

Aktuální číslo v PDF

+

Aktuální témata najdete v aktuálním čísle v PDF.

{% endif %} - {% for sada in jednorazove_problemy %} - {# podnadpisy, kdyz neni zakomentuje se nadpis #} - {% if not sada %}{% endif %} - {# publikace jednotlivych zadani #} - {% for problem in sada %} - {% for tag in problem.zamereni.names %} - - {% endfor %} + + {% if False %} + {% for sada in jednorazove_problemy %} + {# podnadpisy, kdyz neni zakomentuje se nadpis #} + {% if not sada %}{% endif %} + {# publikace jednotlivych zadani #} + {% for problem in sada %} + {% for tag in problem.zamereni.names %} + + {% endfor %} - {# TODO použít {{problem.kod_v_rocniku}} ? vrací 4.u1 místo 4.1 #} -

{{problem.cislo_zadani.cislo}}.{{problem.kod}} {{problem.nazev}} {{ problem.body_v_zavorce }}

- {% autoescape off %}{{problem.text_zadani}}{% endautoescape %} -
- {% endfor %} - {% empty %} - Aktuálně nejsou zadané žádné úlohy k řešení. - {% endfor %} + {# TODO použít {{problem.kod_v_rocniku}} ? vrací 4.u1 místo 4.1 #} +

{{problem.cislo_zadani.cislo}}.{{problem.kod}} {{problem.nazev}} {{ problem.body_v_zavorce }}

+ {% autoescape off %}{{problem.text_zadani}}{% endautoescape %} +
+ {% endfor %} + {% empty %} + Aktuálně nejsou zadané žádné úlohy k řešení. + {% endfor %} + {% endif %} -{% if user.is_staff and not verejne%}
{% endif %} +{% if user.je_org and not verejne%}
{% endif %} {% else %}

Aktuálně nejsou zveřejněny žádné úlohy

{% endif %} + {% if False %}

Témata

+ {% endif %} {% endwith %} diff --git a/seminar/templates/seminar/zadani/Temata.html b/seminar/templates/seminar/zadani/Temata.html index ec700a1f..9b4e0156 100644 --- a/seminar/templates/seminar/zadani/Temata.html +++ b/seminar/templates/seminar/zadani/Temata.html @@ -16,15 +16,20 @@ {% endblock %}{% endblock %} + +

+ Pozor, tato stránka není aktuální! Aktualizovaný seznam všech čísel v PDF najdete zde. Za problémy se omlouváme. +

- Témata jsou hlavním obsahem časopisu M&M. Obvykle představují - složitější a obecnější problémy než samostatné úlohy. Navíc je v jejich - zadání vždy prostor pro tvůrčí rozšíření. Za pěkný článek k tématu lze - získat třeba i 20 bodů, určitě se tedy vyplatí se tématy zabývat. + Témata jsou texty nejen z oblasti matematiky, fyziky a informatiky, které + popisují nějaký problém a jsou doprovázeny návodnými úlohami. Vaším úkolem + je zamyslet se nad daným problémem a sepsat vaše úvahy ve formě krátkého + textu.

Jak řešit téma?

+
{% endwith %} diff --git a/seminar/testutils.py b/seminar/testutils.py index c7ed79c7..7189dfcf 100644 --- a/seminar/testutils.py +++ b/seminar/testutils.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- import datetime + +from django.contrib.auth.models import Permission from pytz import timezone import random import lorem @@ -9,6 +11,7 @@ from django.db import transaction import unidecode import logging +from korektury.testutils import create_test_pdf from seminar.models import Skola, Resitel, Rocnik, Cislo, Problem, Reseni, PrilohaReseni, Nastaveni, Soustredeni, Soustredeni_Ucastnici, Soustredeni_Organizatori, Osoba, Organizator, Prijemce, Tema, Uloha, Konfera, TextNode, UlohaVzorakNode, RocnikNode, CisloNode, TemaVCisleNode, Text, Hodnoceni, UlohaZadaniNode, Novinky, TreeNode import seminar.models as m @@ -70,7 +73,7 @@ def gen_osoby(rnd, size): if pokusy >= max_pokusy: print("Chyba, na danou velikost testovacích dat příliš málo možných" " jmen a příjmení") - exit + exit() prezdivka = rnd.choice(prezdivky) email = "@".join([unidecode.unidecode(jmeno), rnd.choice(domain)]) telefon = "".join([str(rnd.choice([k for k in range(10)])) for i in range(9)]) @@ -124,9 +127,20 @@ def gen_resitele(rnd, osoby, skoly): logger.info('Generuji řešitele...') resitele = [] + x = 0 + resitel_perm = Permission.objects.filter(codename__exact='resitel').first() for os in osoby: rand = rnd.randint(0, 8) if not (rand % 8 == 0): + if not os.user: + if x: + user = User.objects.create_user(username='r'+str(x), email=os.email, password='r') + else: + user = User.objects.create_user(username='r', email=os.email, password='r') + x += 1 + os.user = user + os.save() + os.user.user_permissions.add(resitel_perm) resitele.append(Resitel.objects.create(osoba=os, skola=rnd.choice(skoly), rok_maturity=rnd.randint(2019, 2029), zasilat=rnd.choice(Resitel.ZASILAT_CHOICES)[0])) @@ -139,7 +153,7 @@ def gen_prijemci(rnd, osoby, kolik=10): prijemci.append(Prijemce.objects.create(osoba=i)) return prijemci -def gen_organizatori(rnd, osoby, last_rocnik, users): +def gen_organizatori(rnd, osoby, last_rocnik): logger.info('Generuji organizátory...') organizatori = [] @@ -149,6 +163,8 @@ def gen_organizatori(rnd, osoby, last_rocnik, users): seznam_oboru = ["matematiku", "matematiku", "matematiku", "fyziku", "literaturu", "informatiku", "informatiku", "běhání dokolečka"] + x = 0 + org_perm = Permission.objects.filter(codename__exact='org').first() for os in osoby: rand = rnd.randint(0, 8) if (rand % 8 == 0): @@ -175,6 +191,15 @@ def gen_organizatori(rnd, osoby, last_rocnik, users): if do.year > datetime.datetime.now().year: do = None + if not os.user: + if x: + user = User.objects.create_user(username='o'+str(x), email=os.email, password='o') + else: + user = User.objects.create_user(username='o', email=os.email, password='o') + x += 1 + os.user = user + os.save() + os.user.user_permissions.add(org_perm) organizatori.append(Organizator.objects.create(osoba=os, organizuje_od=od, organizuje_do=do, strucny_popis_organizatora = popis_orga)) return organizatori @@ -681,14 +706,14 @@ def otec_syn(otec, syn): syn.save() otec.save() -def gen_clanek(rnd): +def gen_clanek(rnd, organizatori, resitele): logger.info("Generuji článek do čísla 22.2") clanek = m.Clanek.objects.create( nazev="Článek o Lorem ipsum", nadproblem=None, stav='vyreseny', zamereni=['I'], - garant=rnd.choice(m.Organizator.objects.all()), + garant=rnd.choice(organizatori), kod='cl', ) clanek.save() @@ -696,7 +721,7 @@ def gen_clanek(rnd): reseni = m.Reseni.objects.create( zverejneno=True, ) - reseni.resitele.add(rnd.choice(m.Resitel.objects.all())) + reseni.resitele.add(rnd.choice(resitele)) reseni.save() cislo = m.Cislo.objects.get(rocnik__rocnik=22, poradi=2) @@ -771,11 +796,22 @@ def create_test_data(size = 6, rnd = None): # users admin = User.objects.create_superuser(username='admin', email='', password='admin') + os_admin = Osoba.objects.create( + user=admin, jmeno='admin', prijmeni='admin', + prezdivka='admin', pohlavi_muz=1, email='admin@admin.admin', + telefon='123 456 789', datum_narozeni=datetime.date(2000, 1, 1), + ulice='admin', mesto='admin', psc='100 00', + datum_registrace=datetime.date(2020, 9, 6) + ) + or_admin = Organizator.objects.create( + osoba=os_admin, organizuje_od=None, organizuje_do=None, + strucny_popis_organizatora="Organizátor k uživateli Admin" + ) usernames = ['anet', 'bara', 'cyril', 'david', 'eva', 'filip'] users = [] for usr in usernames[:size]: - u = User.objects.create(username=usr, password=usr) + u = User.objects.create_user(username=usr, password=usr) u.first_name = usr.capitalize() u.save() users.append(u) @@ -789,8 +825,8 @@ def create_test_data(size = 6, rnd = None): # resitele a organizatori last_rocnik = 25 + organizatori = gen_organizatori(rnd, osoby, last_rocnik) resitele = gen_resitele(rnd, osoby, skoly) - organizatori = gen_organizatori(rnd, osoby, last_rocnik, users) #generování novinek novinky = gen_novinky(rnd, organizatori) @@ -830,6 +866,9 @@ def create_test_data(size = 6, rnd = None): #generování konfer konfery = gen_konfery(size, rnd, organizatori, resitele, soustredeni) + # vytvoreni pdf ke korekturam + create_test_pdf(rnd, organizatori) + # TODO: nastavi správně, kolik se čeho generuje, aby rozsahy přibližně odpovídaly # FIXME: misto typu ruzne typy objektu a vnoreni do sebe (Tom nechápe, co je tímto fixme míněno) # TODO: vytvorit temata s ruznymi vlakny @@ -840,7 +879,7 @@ def create_test_data(size = 6, rnd = None): # TODO: přidat ke konferám řešení a dát je do čísel # Dohackované vytvoření jednoho článku - gen_clanek(rnd) + gen_clanek(rnd, organizatori, resitele) # obecné nastavení semináře, musí být už přidané ročníky a čísla, jinak se nastaví divně diff --git a/seminar/urls.py b/seminar/urls.py index 7481b66d..f98e1502 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -1,11 +1,8 @@ from django.urls import path, include -from django.contrib.auth.decorators import user_passes_test +from django.contrib.auth.decorators import login_required from . import views, export -from .utils import staff_member_required +from .utils import org_required, resitel_required from django.views.generic.base import RedirectView -from django.contrib.auth import views as auth_views - -staff_member_required = user_passes_test(lambda u: u.is_staff) urlpatterns = [ # path('aktualni/temata/', views.TemataRozcestnikView), @@ -33,17 +30,17 @@ urlpatterns = [ ), path( 'soustredeni//seznam_ucastniku', - staff_member_required(views.SoustredeniUcastniciView.as_view()), + org_required(views.SoustredeniUcastniciView.as_view()), name='soustredeni_ucastnici' ), path( 'soustredeni//maily_ucastniku', - staff_member_required(views.SoustredeniMailyUcastnikuView.as_view()), + org_required(views.SoustredeniMailyUcastnikuView.as_view()), name='maily_ucastniku' ), path( 'soustredeni//export_ucastniku', - staff_member_required(views.soustredeniUcastniciExportView), + org_required(views.soustredeniUcastniciExportView), name='soustredeni_ucastnici_export' ), path( @@ -62,58 +59,101 @@ urlpatterns = [ #path('clanky/org/', views.ClankyOrganizatorView.as_view(), name='clanky_organizator'), # Aesop - path('aesop-export/mam-rocnik-.csv', export.ExportRocnikView.as_view(), name='seminar_export_rocnik'), - path('aesop-export/mam-sous-.csv', export.ExportSousView.as_view(), name='seminar_export_sous'), - path('aesop-export/index.csv', export.ExportIndexView.as_view(), name='seminar_export_index'), + path( + 'aesop-export/mam-rocnik-.csv', + org_required(export.ExportRocnikView.as_view()), + name='seminar_export_rocnik' + ), + path( + 'aesop-export/mam-sous-.csv', + org_required(export.ExportSousView.as_view()), + name='seminar_export_sous' + ), + path( + 'aesop-export/index.csv', + org_required(export.ExportIndexView.as_view()), + name='seminar_export_index' + ), # Stranky viditelne pouze pro orgy: path( - 'rocnik//vysledkovka.tex', - staff_member_required(views.RocnikVysledkovkaView.as_view()), - name='seminar_rocnik_vysledkovka' + 'rocnik//vysledkovka.tex', + org_required(views.RocnikVysledkovkaView.as_view()), + name='seminar_rocnik_vysledkovka' ), - path('cislo/./vysledkovka.tex', - staff_member_required(views.CisloVysledkovkaView.as_view()), - name='seminar_cislo_vysledkovka' + path( + 'cislo/./vysledkovka.tex', + org_required(views.CisloVysledkovkaView.as_view()), + name='seminar_cislo_vysledkovka' + ), + path( + 'cislo/./obalky.pdf', + org_required(views.cisloObalkyView), + name='seminar_cislo_obalky' + ), + path( + 'cislo/./tituly.tex', + org_required(views.TitulyView), + name='seminar_cislo_titul' + ), + path( + 'stav', + org_required(views.StavDatabazeView), + name='stav_databaze' + ), + path( + 'cislo/./obalkovani', + org_required(views.ObalkovaniView.as_view()), + name='seminar_cislo_resitel_obalkovani' + ), + path( + 'soustredeni//obalky.pdf', + org_required(views.soustredeniObalkyView), + name='seminar_soustredeni_obalky' + ), + path( + 'org/vloz_body//', + org_required(views.VlozBodyView.as_view()), + name='seminar_org_vlozbody' + ), + # příprava na nestatický orgorozcestník + path( + 'org/rozcestnik/', + org_required(views.OrgoRozcestnikView.as_view()), + name='seminar_org_rozcestnik' ), - path('cislo/./obalky.pdf', - staff_member_required(views.cisloObalkyView), name='seminar_cislo_obalky'), - - path('cislo/./tituly.tex', - staff_member_required(views.TitulyView), name='seminar_cislo_titul'), - path('stav', - staff_member_required(views.StavDatabazeView), name='stav_databaze'), - path('cislo/./obalkovani', - staff_member_required(views.ObalkovaniView.as_view()), name='seminar_cislo_resitel_obalkovani'), - path('soustredeni//obalky.pdf', - staff_member_required(views.soustredeniObalkyView), name='seminar_soustredeni_obalky'), - path('org/vloz_body//', - staff_member_required(views.VlozBodyView.as_view()),name='seminar_org_vlozbody'), path('prihlaska/',views.prihlaskaView, name='seminar_prihlaska'), path('login/', views.LoginView.as_view(), name='login'), path('logout/', views.LogoutView.as_view(), name='logout'), - path('resitel/', views.ResitelView.as_view(), name='seminar_resitel'), + path('resitel/', resitel_required(views.ResitelView.as_view()), name='seminar_resitel'), path('reset_password/', views.PasswordResetView.as_view(), name='reset_password'), path('change_password/', views.PasswordChangeView.as_view(), name='change_password'), path('reset_password_done/', views.PasswordResetDoneView.as_view(), name='reset_password_done'), path('reset_password_confirm///', views.PasswordResetConfirmView.as_view(), name='password_reset_confirm'), path('reset_password_complete/', views.PasswordResetCompleteView.as_view(), name='reset_password_complete'), - path('resitel_edit', views.resitelEditView, name='seminar_resitel_edit'), + path( + 'resitel_edit', + login_required(views.resitelEditView, login_url='/login/'), + name='seminar_resitel_edit' + ), + + # Obecný view na profil -- orgům dá rozcestník, řešitelům jejich stránku + path('profil/', views.profilView, name='profil'), # Autocomplete path('autocomplete/skola/',views.SkolaAutocomplete.as_view(), name='autocomplete_skola'), - path('autocomplete/resitel/',views.ResitelAutocomplete.as_view(), name='autocomplete_resitel'), + path('autocomplete/resitel/', org_required(views.ResitelAutocomplete.as_view()), name='autocomplete_resitel'), path('autocomplete/problem/odevzdatelny',views.OdevzdatelnyProblemAutocomplete.as_view(), name='autocomplete_problem_odevzdatelny'), - path('temp/add_solution', views.AddSolutionView.as_view(),name='seminar_vloz_reseni'), - path('temp/nahraj_reseni', views.NahrajReseniView.as_view(),name='seminar_nahraj_reseni'), + path('temp/add_solution', org_required(views.AddSolutionView.as_view()), name='seminar_vloz_reseni'), + path('temp/nahraj_reseni', resitel_required(views.NahrajReseniView.as_view()), name='seminar_nahraj_reseni'), path('', views.TitulniStranaView.as_view(), name='titulni_strana'), # Ceka na autocomplete v3 # path('autocomplete/organizatori/', - # staff_member_required(views.OrganizatorAutocomplete.as_view()), + # org_member_required(views.OrganizatorAutocomplete.as_view()), # name='seminar_autocomplete_organizator') diff --git a/seminar/utils.py b/seminar/utils.py index 9a442127..ad9be95e 100644 --- a/seminar/utils.py +++ b/seminar/utils.py @@ -1,15 +1,25 @@ # -*- coding: utf-8 -*- import datetime -from django.contrib.auth.decorators import user_passes_test + +from django.contrib.auth import get_user_model +from django.contrib.auth.decorators import permission_required from html.parser import HTMLParser + +from django.contrib.auth.models import AnonymousUser from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist import seminar.models as m import seminar.treelib as t -staff_member_required = user_passes_test(lambda u: u.is_staff) +org_required = permission_required('auth.org', raise_exception=True) +resitel_required = permission_required('auth.resitel', raise_exception=True) +User = get_user_model() +User.je_org = lambda self: self.has_perm('auth.org') +User.je_resitel = lambda self: self.has_perm('auth.resitel') +AnonymousUser.je_org = lambda self: False +AnonymousUser.je_resitel = lambda self: False class FirstTagParser(HTMLParser): diff --git a/seminar/views/utils.py b/seminar/views/utils.py index 3869ffd4..1fa28827 100644 --- a/seminar/views/utils.py +++ b/seminar/views/utils.py @@ -6,8 +6,6 @@ from html.parser import HTMLParser import seminar.models as m -staff_member_required = user_passes_test(lambda u: u.is_staff) - class FirstTagParser(HTMLParser): def __init__(self, *args, **kwargs): self.firstTag = None diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index fd9badf0..2d93a2bf 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -1,6 +1,6 @@ # coding:utf-8 -from django.shortcuts import get_object_or_404, render +from django.shortcuts import get_object_or_404, render, redirect from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, JsonResponse from django.urls import reverse,reverse_lazy from django.core.exceptions import PermissionDenied, ObjectDoesNotExist @@ -10,9 +10,10 @@ from django.http import Http404,HttpResponseBadRequest,HttpResponseRedirect from django.db.models import Q, Sum, Count from django.views.decorators.csrf import ensure_csrf_cookie from django.views.generic.edit import FormView, CreateView +from django.views.generic.base import TemplateView from django.contrib.auth import authenticate, login, get_user_model, logout from django.contrib.auth import views as auth_views -from django.contrib.auth.models import User +from django.contrib.auth.models import User, Permission from django.contrib.auth.mixins import LoginRequiredMixin from django.db import transaction @@ -201,7 +202,7 @@ class AktualniZadaniView(TreeNodeView): # "cisla" : cisla # }) # return render(request, 'seminar/tematka/rozcestnik.html', {"tematka": tematka, "rocnik" : nastaveni.aktualni_rocnik().rocnik}) -# +# #def ZadaniAktualniVysledkovkaView(request): # nastaveni = get_object_or_404(Nastaveni) @@ -238,8 +239,7 @@ def spravne_novinky(request): user = request.user # Využíváme líné vyhodnocování QuerySetů qs = Novinky.objects.all() - # TODO: Tohle by mělo spíš kontrolovat, že je/není někdo org, než že může do Adminu. - if not user.is_staff: + if not user.je_org: qs = qs.filter(zverejneno=True) return qs.order_by('-datum') @@ -644,7 +644,7 @@ class ProblemView(generic.DetailView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) # Musí se používat context['object'], protože nevíme, jestli dostaneme úložku, téma, článek, .... a tyhle věci vyrábějí různé klíče. - if not context['object'].verejne() and not self.request.user.is_staff: + if not context['object'].verejne() and not self.request.user.je_org: raise PermissionDenied() if isinstance(context['object'], Clanek): context['reseni'] = Reseni.objects.filter(problem=context['object']).select_related('resitel').order_by('resitel__prijmeni') @@ -896,6 +896,43 @@ def oldObalkovaniView(request, rocnik, cislo): {'cislo': cislo, 'problemy': problemy, 'reseni': reseni} ) +### Orgostránky + +class OrgoRozcestnikView(TemplateView): + ''' Zobrazí organizátorský rozcestník.''' + + template_name = 'seminar/orgorozcestnik.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['posledni_soustredeni'] = Soustredeni.objects.order_by('-datum_konce').first() + nastaveni = Nastaveni.objects.first() + aktualni_rocnik = nastaveni.aktualni_rocnik + context['posledni_cislo_url'] = nastaveni.aktualni_cislo.verejne_url() + # TODO možná chceme odkazovat na právě rozpracované číslo, a ne to poslední vydané + # pokud nechceme haluzit kód (= poradi) dalšího čísla, bude asi potřeba jít + # přes treenody (a dát si přitom pozor na MezicisloNode) + + u = self.request.user + os = s.Osoba.objects.get(user=u) + organizator = s.Organizator.objects.get(osoba=os) + temata_garant = s.Tema.objects.filter(garant=organizator, + rocnik=aktualni_rocnik) + #FIXME: přidat opravovatel, stav='STAV_ZADANY' + ulohy_garant = s.Uloha.objects.filter(garant=organizator, + cislo_zadani__rocnik=aktualni_rocnik) + clanky_garant = s.Clanek.objects.filter(garant=organizator, + cislo__rocnik=aktualni_rocnik) + + context['temata'] = temata_garant + context['ulohy'] = ulohy_garant + context['clanky'] = clanky_garant + context['organizator'] = organizator + return context + + #content_type = 'text/plain; charset=UTF8' + #XXX + ### Tituly def TitulyView(request, rocnik, cislo): @@ -974,12 +1011,44 @@ def soustredeniUcastniciExportView(request,soustredeni): ### Články +def group_by_rocnik(clanky): + ''' Vezme zadaný seznam článků a seskupí je podle ročníku. + Vrátí seznam seznamů článků ze stejného ročníku.''' + if len(clanky) == 0: + return clanky + clanky.order_by('cislo__rocnik__rocnik') + skupiny_clanku = [] + skupina = [] + + rocnik = clanky.first().cislo.rocnik.rocnik # první ročník + for clanek in clanky: + if clanek.cislo.rocnik.rocnik == rocnik: + skupina.append(clanek) + else: + skupiny_clanku.append(skupina) + skupina = [] + skupina.append(clanek) + rocnik = clanek.cislo.rocnik.rocnik + skupiny_clanku.append(skupina) + return skupiny_clanku + # FIXME: clanky jsou vsechny, pokud budou i neresitelske, tak se take zobrazi +# FIXME: Původně tu byl kód přímo v těle třídy, což rozbíjelo migrace. Opravil jsem, ale vůbec nevím, jestli to funguje. class ClankyResitelView(generic.ListView): model = Problem template_name = 'seminar/clanky/resitelske_clanky.html' - queryset = Clanek.objects.filter(stav=Problem.STAV_ZADANY).select_related('cislo_zadani__rocnik').order_by('-cislo_zadani__rocnik__rocnik', 'kod') + + # FIXME: QuerySet není pole! + def get_queryset(self): + clanky = Clanek.objects.filter(stav=Problem.STAV_ZADANY).select_related('cislo__rocnik').order_by('-cislo__rocnik__rocnik') + queryset = [] + skupiny_clanku = group_by_rocnik(clanky) + for skupina in skupiny_clanku: + skupina.sort(key=lambda clanek: clanek.kod_v_rocniku()) + for clanek in skupina: + queryset.append(clanek) + return queryset # FIXME: pokud chceme orgoclanky, tak nejak zavest do modelu a podle toho odkomentovat a upravit #class ClankyOrganizatorView(generic.ListView): @@ -1088,63 +1157,63 @@ def logoutView(request): def prihlaska_log_gdpr_safe(logger, gdpr_logger, msg, form_data): - msg = "{}, form_hash:{}".format(msg,hash(form_data)) + msg = "{}, form_hash:{}".format(msg,hash(frozenset(form_data.items))) logger.warn(msg) gdpr_logger.warn(msg+", form:{}".format(form_data)) from django.forms.models import model_to_dict def resitelEditView(request): - err_logger = logging.getLogger('seminar.prihlaska.problem') - ## Načtení objektu Osoba a Resitel, patrici k aktuálně přihlášenému uživately - u = request.user - osoba_edit = Osoba.objects.get(user=u) - resitel_edit = osoba_edit.resitel - user_edit = osoba_edit.user - ## Vytvoření slovníku, kterým předvyplním formulář - prefill_1=model_to_dict(user_edit) - prefill_2=model_to_dict(resitel_edit) - prefill_3=model_to_dict(osoba_edit) - prefill_1.update(prefill_2) - prefill_1.update(prefill_3) - form = ProfileEditForm(initial=prefill_1) - ## Změna údajů a jejich uložení - if request.method == 'POST': - form = ProfileEditForm(request.POST) - if form.is_valid(): - ## Změny v osobě - fcd = form.cleaned_data - osoba_edit.jmeno = fcd['jmeno'] - osoba_edit.prijmeni = fcd['prijmeni'] - osoba_edit.pohlavi_muz = fcd['pohlavi_muz'] - osoba_edit.email = fcd['email'] - osoba_edit.telefon = fcd['telefon'] - osoba_edit.ulice = fcd['ulice'] - osoba_edit.mesto = fcd['mesto'] - osoba_edit.psc = fcd['psc'] - ## Změny v osobě s podmínkami - if fcd.get('spam',False): - osoba_edit.datum_souhlasu_zasilani = date.today() - if fcd.get('stat','') in ('CZ','SK'): - osoba_edit.stat = fcd['stat'] - else: - ## Neznámá země - msg = "Unknown country {}".format(fcd['stat_text']) - - ## Změny v řešiteli - resitel_edit.skola = fcd['skola'] - resitel_edit.rok_maturity = fcd['rok_maturity'] - resitel_edit.zasilat = fcd['zasilat'] - if fcd.get('skola'): - resitel_edit.skola = fcd['skola'] - else: - # Unknown school - log it - msg = "Unknown school {}, {}".format(fcd['skola_nazev'],fcd['skola_adresa']) - resitel_edit.save() - osoba_edit.save() - return HttpResponseRedirect('/thanks/') - else: - ## Stránka před odeslaním formuláře = předvyplněný formulář - return render(request, 'seminar/profil/edit.html', {'form': form}) + err_logger = logging.getLogger('seminar.prihlaska.problem') + ## Načtení objektu Osoba a Resitel, patrici k aktuálně přihlášenému uživately + u = request.user + osoba_edit = Osoba.objects.get(user=u) + resitel_edit = osoba_edit.resitel + user_edit = osoba_edit.user + ## Vytvoření slovníku, kterým předvyplním formulář + prefill_1=model_to_dict(user_edit) + prefill_2=model_to_dict(resitel_edit) + prefill_3=model_to_dict(osoba_edit) + prefill_1.update(prefill_2) + prefill_1.update(prefill_3) + form = ProfileEditForm(initial=prefill_1) + ## Změna údajů a jejich uložení + if request.method == 'POST': + form = ProfileEditForm(request.POST) + if form.is_valid(): + ## Změny v osobě + fcd = form.cleaned_data + osoba_edit.jmeno = fcd['jmeno'] + osoba_edit.prijmeni = fcd['prijmeni'] + osoba_edit.pohlavi_muz = fcd['pohlavi_muz'] + osoba_edit.email = fcd['email'] + osoba_edit.telefon = fcd['telefon'] + osoba_edit.ulice = fcd['ulice'] + osoba_edit.mesto = fcd['mesto'] + osoba_edit.psc = fcd['psc'] + ## Změny v osobě s podmínkami + if fcd.get('spam',False): + osoba_edit.datum_souhlasu_zasilani = date.today() + if fcd.get('stat','') in ('CZ','SK'): + osoba_edit.stat = fcd['stat'] + else: + ## Neznámá země + msg = "Unknown country {}".format(fcd['stat_text']) + + ## Změny v řešiteli + resitel_edit.skola = fcd['skola'] + resitel_edit.rok_maturity = fcd['rok_maturity'] + resitel_edit.zasilat = fcd['zasilat'] + if fcd.get('skola'): + resitel_edit.skola = fcd['skola'] + else: + # Unknown school - log it + msg = "Unknown school {}, {}".format(fcd['skola_nazev'],fcd['skola_adresa']) + resitel_edit.save() + osoba_edit.save() + return formularOKView(request) + else: + ## Stránka před odeslaním formuláře = předvyplněný formulář + return render(request, 'seminar/profil/edit.html', {'form': form}) def prihlaskaView(request): generic_logger = logging.getLogger('seminar.prihlaska') @@ -1156,8 +1225,8 @@ def prihlaskaView(request): if form.is_valid(): generic_logger.info("Form valid") fcd = form.cleaned_data - form_hash = hash(fcd) - form_logger.info(fcd,form_hash=form_hash) + form_hash = hash(frozenset(fcd.items())) + form_logger.info(str(fcd) + str(form_hash)) # TODO možná logovat jinak with transaction.atomic(): u = User.objects.create_user( @@ -1165,6 +1234,8 @@ def prihlaskaView(request): password=fcd['password'], email = fcd['email']) u.save() + resitel_perm = Permission.objects.filter(codename__exact='resitel').first() + u.user_permissions.add(resitel_perm) o = Osoba( jmeno = fcd['jmeno'], @@ -1187,7 +1258,7 @@ def prihlaskaView(request): else: # Unknown country - log it msg = "Unknown country {}".format(fcd['stat_text']) - err_logger.warn(msg,form_hash=form_hash) + err_logger.warn(msg + str(form_hash)) o.save() o.user = u @@ -1205,11 +1276,11 @@ def prihlaskaView(request): else: # Unknown school - log it msg = "Unknown school {}, {}".format(fcd['skola_nazev'],fcd['skola_adresa']) - err_logger.warn(msg,form_hash=form_hash) + err_logger.warn(msg + str(form_hash)) r.save() - return HttpResponseRedirect('/thanks/') + return formularOKView(request) # if a GET (or any other method) we'll create a blank form else: @@ -1259,3 +1330,28 @@ class PasswordResetCompleteView(auth_views.PasswordResetCompleteView): class PasswordChangeView(auth_views.PasswordChangeView): #template_name = 'seminar/password_change.html' success_url = reverse_lazy('titulni_strana') + + +# Jen hloupé rozhazovátko +def profilView(request): + user = request.user + if user.has_perm('auth.org'): + return OrgoRozcestnikView.as_view()(request) + if user.has_perm('auth.resitel'): + return ResitelView.as_view()(request) + else: + return LoginView.as_view()(request) + +# Interní, nemá se nikdy objevit v urls (jinak to účastníci vytrolí) +def formularOKView(request): + template_name = 'seminar/formular_ok.html' + odkazy = [ + # (Text, odkaz) + ('Vrátit se na titulní stránku', reverse('titulni_strana')), + ('Zobrazit aktuální zadání', reverse('seminar_aktualni_zadani')), + ] + context = { + 'odkazy': odkazy, + } + return render(request, template_name, context) + diff --git a/sitetree_new.json b/sitetree_new.json index 468d8bcb..195723cd 100644 --- a/sitetree_new.json +++ b/sitetree_new.json @@ -1 +1,660 @@ -[{"model": "sitetree.tree", "pk": 1, "fields": {"title": "Hlavn\u00ed menu", "alias": "main_menu"}}, {"model": "sitetree.treeitem", "pk": 1, "fields": {"title": "Co je M&M", "hint": "", "url": "/co-je-MaM/uvod/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": null, "sort_order": 1, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 2, "fields": {"title": "Jak \u0159e\u0161it", "hint": "", "url": "/jak-resit/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": null, "sort_order": 2, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 3, "fields": {"title": "Aktu\u00e1ln\u00ed
ro\u010dn\u00edk", "hint": "", "url": "/zadani/aktualni/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": null, "sort_order": 3, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 4, "fields": {"title": "Soust\u0159ed\u011bn\u00ed", "hint": "", "url": "/soustredeni/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": null, "sort_order": 4, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 5, "fields": {"title": "Archiv", "hint": "", "url": "/archiv/rocniky/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": null, "sort_order": 5, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 6, "fields": {"title": "P\u0159ihl\u00e1sit", "hint": "", "url": "/login/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": true, "access_restricted": false, "access_perm_type": 1, "parent": null, "sort_order": 6, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 7, "fields": {"title": "\u00davod", "hint": "", "url": "/co-je-MaM/uvod/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 1, "sort_order": 7, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 8, "fields": {"title": "Organiz\u00e1to\u0159i", "hint": "", "url": "/co-je-MaM/organizatori/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 1, "sort_order": 8, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 9, "fields": {"title": "FAQ", "hint": "", "url": "/co-je-MaM/FAQ/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 1, "sort_order": 9, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 10, "fields": {"title": "Kontakt", "hint": "", "url": "/co-je-MaM/kontakt/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 1, "sort_order": 10, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 11, "fields": {"title": "T\u00e9mata", "hint": "", "url": "/jak-resit/temata/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 2, "sort_order": 11, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 12, "fields": {"title": "Jak ps\u00e1t p\u0159\u00edsp\u011bvek", "hint": "", "url": "/jak-resit/jak-psat-prispevek/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 2, "sort_order": 12, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 13, "fields": {"title": "Odm\u011bny", "hint": "", "url": "/co-je-MaM/odmeny/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 2, "sort_order": 13, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 15, "fields": {"title": "Aktu\u00e1ln\u00ed t\u00e9mata", "hint": "", "url": "/zadani/temata/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 3, "sort_order": 15, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 16, "fields": {"title": "V\u00fdsledkov\u00e1 listina", "hint": "", "url": "zadani/vysledkova-listina/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 3, "sort_order": 16, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 17, "fields": {"title": "\u010cl\u00e1nky", "hint": "", "url": "/clanky/resitel/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 3, "sort_order": 17, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 18, "fields": {"title": "\u00davod", "hint": "", "url": "/soustredeni/uvod/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 4, "sort_order": 18, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 19, "fields": {"title": "P\u0159ipravujeme", "hint": "", "url": "/soustredeni/pripravujeme/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 4, "sort_order": 19, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 20, "fields": {"title": "Prob\u011bhlo", "hint": "", "url": "/soustredeni/probehlo/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 4, "sort_order": 20, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 21, "fields": {"title": "Profil", "hint": "", "url": "/profil/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": true, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": null, "sort_order": 21, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 22, "fields": {"title": "Osobn\u00ed \u00fadaje", "hint": "", "url": "/profil/osobni-udaje", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 21, "sort_order": 22, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 23, "fields": {"title": "Poslat \u0159e\u0161en\u00ed", "hint": "", "url": "/odeslat-reseni/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 21, "sort_order": 23, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 24, "fields": {"title": "T\u00e9mata", "hint": "", "url": "/archiv/temata/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 5, "sort_order": 25, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 25, "fields": {"title": "\u010cl\u00e1nky", "hint": "", "url": "/clanky/resitel/", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 5, "sort_order": 26, "access_permissions": []}}, {"model": "sitetree.treeitem", "pk": 26, "fields": {"title": "\u010c\u00edsla", "hint": "", "url": "/archiv/rocniky", "urlaspattern": false, "tree": 1, "hidden": false, "alias": null, "description": "", "inmenu": true, "inbreadcrumbs": true, "insitetree": true, "access_loggedin": false, "access_guest": false, "access_restricted": false, "access_perm_type": 1, "parent": 5, "sort_order": 24, "access_permissions": []}}] \ No newline at end of file +[ +{ + "model": "sitetree.tree", + "pk": 1, + "fields": { + "title": "Hlavn\u00ed menu", + "alias": "main_menu" + } +}, +{ + "model": "sitetree.treeitem", + "pk": 1, + "fields": { + "title": "Co je M&M", + "hint": "", + "url": "/co-je-MaM/uvod/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": null, + "sort_order": 1, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 2, + "fields": { + "title": "Jak \u0159e\u0161it", + "hint": "", + "url": "/jak-resit/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": null, + "sort_order": 2, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 3, + "fields": { + "title": "Aktu\u00e1ln\u00ed
ro\u010dn\u00edk", + "hint": "", + "url": "/zadani/aktualni/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": null, + "sort_order": 3, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 4, + "fields": { + "title": "Soust\u0159ed\u011bn\u00ed", + "hint": "", + "url": "/soustredeni/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": null, + "sort_order": 4, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 5, + "fields": { + "title": "Archiv", + "hint": "", + "url": "/archiv/rocniky/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": null, + "sort_order": 5, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 6, + "fields": { + "title": "P\u0159ihl\u00e1sit", + "hint": "", + "url": "/login/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": true, + "access_restricted": false, + "access_perm_type": 1, + "parent": null, + "sort_order": 6, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 7, + "fields": { + "title": "\u00davod", + "hint": "", + "url": "/co-je-MaM/uvod/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 1, + "sort_order": 7, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 8, + "fields": { + "title": "Organiz\u00e1to\u0159i", + "hint": "", + "url": "/co-je-MaM/organizatori/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 1, + "sort_order": 8, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 9, + "fields": { + "title": "FAQ", + "hint": "", + "url": "/co-je-MaM/FAQ/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 1, + "sort_order": 9, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 10, + "fields": { + "title": "Kontakt", + "hint": "", + "url": "/co-je-MaM/kontakt/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 1, + "sort_order": 10, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 11, + "fields": { + "title": "T\u00e9mata", + "hint": "", + "url": "/jak-resit/temata/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 2, + "sort_order": 11, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 12, + "fields": { + "title": "Jak ps\u00e1t p\u0159\u00edsp\u011bvek", + "hint": "", + "url": "/jak-resit/jak-psat-prispevek/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 2, + "sort_order": 12, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 13, + "fields": { + "title": "Odm\u011bny", + "hint": "", + "url": "/co-je-MaM/odmeny/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 2, + "sort_order": 13, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 15, + "fields": { + "title": "Aktu\u00e1ln\u00ed t\u00e9mata", + "hint": "", + "url": "/zadani/temata/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 3, + "sort_order": 15, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 16, + "fields": { + "title": "V\u00fdsledkov\u00e1 listina", + "hint": "", + "url": "zadani/vysledkova-listina/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 3, + "sort_order": 16, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 17, + "fields": { + "title": "\u010cl\u00e1nky", + "hint": "", + "url": "/clanky/resitel/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 3, + "sort_order": 17, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 18, + "fields": { + "title": "\u00davod", + "hint": "", + "url": "/soustredeni/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 4, + "sort_order": 18, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 19, + "fields": { + "title": "P\u0159ipravujeme", + "hint": "", + "url": "/soustredeni/pripravujeme/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 4, + "sort_order": 19, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 20, + "fields": { + "title": "Prob\u011bhlo", + "hint": "", + "url": "/soustredeni/probehlo/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 4, + "sort_order": 20, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 21, + "fields": { + "title": "Profil", + "hint": "", + "url": "/profil/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": true, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": null, + "sort_order": 21, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 22, + "fields": { + "title": "Osobn\u00ed \u00fadaje", + "hint": "", + "url": "/profil/osobni-udaje", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 21, + "sort_order": 22, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 23, + "fields": { + "title": "Poslat \u0159e\u0161en\u00ed", + "hint": "", + "url": "/odeslat-reseni/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 21, + "sort_order": 23, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 24, + "fields": { + "title": "T\u00e9mata", + "hint": "", + "url": "/archiv/temata/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 5, + "sort_order": 24, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 28, + "fields": { + "title": "HIDDEN", + "hint": "", + "url": "/korektury/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": true, + "access_perm_type": 1, + "parent": null, + "sort_order": 28, + "access_permissions": [ + 1 + ] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 30, + "fields": { + "title": "Aktu\u00e1ln\u00ed", + "hint": "", + "url": "/korektury/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 28, + "sort_order": 30, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 31, + "fields": { + "title": "Zastaral\u00e9", + "hint": "", + "url": "/korektury/zastarale/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 28, + "sort_order": 31, + "access_permissions": [] + } +}, +{ + "model": "sitetree.treeitem", + "pk": 32, + "fields": { + "title": "N\u00e1pov\u011bda", + "hint": "", + "url": "/korektury/help/", + "urlaspattern": false, + "tree": 1, + "hidden": false, + "alias": null, + "description": "", + "inmenu": true, + "inbreadcrumbs": true, + "insitetree": true, + "access_loggedin": false, + "access_guest": false, + "access_restricted": false, + "access_perm_type": 1, + "parent": 28, + "sort_order": 32, + "access_permissions": [] + } +} +]