Compare commits
1 commit
master
...
upgrade_do
Author | SHA1 | Date | |
---|---|---|---|
79aef3557f |
12
.gitignore
vendored
|
@ -31,15 +31,9 @@ TODO
|
||||||
# reversion kvůli historii objektů v reversion
|
# reversion kvůli historii objektů v reversion
|
||||||
**/reversion
|
**/reversion
|
||||||
|
|
||||||
# dokumentace
|
|
||||||
docs/_build
|
|
||||||
docs/modules
|
|
||||||
|
|
||||||
# logy týracího skriptu (./checklinks.sh)
|
|
||||||
/wget.log.*
|
|
||||||
|
|
||||||
# pro lidi, co programují v nástrojích od JetBrains
|
# pro lidi, co programují v nástrojích od JetBrains
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
# Mac users
|
# dokumentace
|
||||||
.DS_Store
|
docs/_build
|
||||||
|
docs/modules
|
16
_git_hooks/README.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
git hooks
|
||||||
|
=========
|
||||||
|
|
||||||
|
Kontrola stylu pythoních zdrojáků pomocí flake8. Kontrolujeme jen změny,
|
||||||
|
abychom nenutili lidi dělat nesouvisející úpravy, které by rozbíjely historii
|
||||||
|
(git blame).
|
||||||
|
|
||||||
|
pre-commit
|
||||||
|
----------
|
||||||
|
* kontrola změn před commitnutím
|
||||||
|
* instalace: lokálně zkopírovat do .git/hooks (musí být spustitelný)
|
||||||
|
|
||||||
|
update
|
||||||
|
------
|
||||||
|
* kontrola změn přicházejících s pushem
|
||||||
|
* instalace: na atreyi zkopírovat do /akce/MaM/MaMweb/mamweb.git/hooks
|
30
_git_hooks/pre-commit
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Git hook script to verify what is about to be committed.
|
||||||
|
# Checks that the changes don't introduce new flake8 errors.
|
||||||
|
|
||||||
|
TMPDIFF=`tempfile`
|
||||||
|
FLAKE8="`git rev-parse --show-toplevel`/bin/flake8"
|
||||||
|
|
||||||
|
status=0
|
||||||
|
|
||||||
|
# select only changed python files which are not migrations
|
||||||
|
changed=`git diff --cached --name-only | grep 'py$' | grep -v 'migrations/[0-9]'`
|
||||||
|
if [ -z $changed ] ; then
|
||||||
|
# Nothing to check. Note the exit is necessary -- we would not pass any
|
||||||
|
# paths to git diff below and it would output the diff unfiltered.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git diff --unified=1 --cached HEAD -- $changed > $TMPDIFF
|
||||||
|
|
||||||
|
# only do the check when there are some changes to be commited
|
||||||
|
# otherwise flake8 would hang waiting for input
|
||||||
|
if [ -s $TMPDIFF ] ; then
|
||||||
|
cat $TMPDIFF | $FLAKE8 --diff
|
||||||
|
status=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f $TMPDIFF
|
||||||
|
|
||||||
|
exit $status
|
61
_git_hooks/update
Executable file
|
@ -0,0 +1,61 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# git update hook to check that pushed changes don't introduce new flake8
|
||||||
|
# errors
|
||||||
|
|
||||||
|
# --- Command line
|
||||||
|
refname="$1"
|
||||||
|
oldrev="$2"
|
||||||
|
newrev="$3"
|
||||||
|
|
||||||
|
# --- Safety check
|
||||||
|
if [ -z "$GIT_DIR" ]; then
|
||||||
|
echo "Don't run this script from the command line." >&2
|
||||||
|
echo " (if you want, you could supply GIT_DIR then run" >&2
|
||||||
|
echo " $0 <ref> <oldrev> <newrev>)" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
|
||||||
|
echo "usage: $0 <ref> <oldrev> <newrev>" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
TMPDIR=`mktemp -d`
|
||||||
|
TMPDIFF=`tempfile`
|
||||||
|
|
||||||
|
[ $refname != "refs/heads/master" -a $refname != "refs/heads/stable" ] && exit 0
|
||||||
|
|
||||||
|
# select only changed python files which are not migrations
|
||||||
|
changed=`git diff --name-only $oldrev $newrev | grep 'py$' | grep -v 'migrations/[0-9]'`
|
||||||
|
if [ -z $changed ] ; then
|
||||||
|
# Nothing to check. Note the exit is necessary -- we would not pass any
|
||||||
|
# paths to git diff below and it would output the diff unfiltered.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git diff --unified=1 $oldrev $newrev -- $changed >${TMPDIFF}
|
||||||
|
|
||||||
|
# there is no working tree in bare git repository, so we recreate it for flake8
|
||||||
|
git archive $newrev | tar -x -C ${TMPDIR}
|
||||||
|
|
||||||
|
cd ${TMPDIR}
|
||||||
|
# report only errors on lines in diff
|
||||||
|
# (if threre was flake8 installed on atrey, we could just call flake8)
|
||||||
|
/akce/MaM/WWW/mamweb-test/bin/flake8 --diff <${TMPDIFF}
|
||||||
|
status=$?
|
||||||
|
if [ $status != 0 ] ; then
|
||||||
|
echo
|
||||||
|
echo -n "Změny, které se snažíte pushnout, obsahují kód v pythonu "
|
||||||
|
echo -n "nevyhovující flake8 (viz výše). Opravte je a zkuste to znovu. "
|
||||||
|
echo -n "Nezapomeňte, že můžete editovat historii (git commit --amend, "
|
||||||
|
echo -n "git rebase -i). Pokud byste chybu příště raději odhalili už při "
|
||||||
|
echo "commitu, zkopírujte si pre-commit hook z _git_hooks do .git/hooks."
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf ${TMPDIR}
|
||||||
|
rm -f ${TMPDIFF}
|
||||||
|
|
||||||
|
exit $status
|
|
@ -1,5 +1,8 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace.
|
||||||
|
"""
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class AesopConfig(AppConfig):
|
class AesopConfig(AppConfig):
|
||||||
name = 'aesop'
|
name = 'aesop'
|
||||||
verbose_name = 'Export do AESOPa'
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.utils.encoding import force_str
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
|
|
||||||
class OvvpFile:
|
class OvvpFile:
|
||||||
|
@ -20,7 +20,7 @@ class OvvpFile:
|
||||||
yield '\t'.join(self.columns) + '\n'
|
yield '\t'.join(self.columns) + '\n'
|
||||||
# rows
|
# rows
|
||||||
for r in self.rows:
|
for r in self.rows:
|
||||||
yield '\t'.join([force_str(r[c]) for c in self.columns]) + '\n'
|
yield '\t'.join([force_text(r[c]) for c in self.columns]) + '\n'
|
||||||
|
|
||||||
def to_string(self):
|
def to_string(self):
|
||||||
return ''.join(self.to_lines())
|
return ''.join(self.to_lines())
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují:
|
||||||
|
|
||||||
|
- ``aesop-export/mam-rocnik-<int:prvni_rok>.csv`` (seminar_export_rocnik) :class:`~aesop.views.ExportRocnikView`
|
||||||
|
- ``aesop-export/mam-sous-<str:datum_zacatku>.csv`` (seminar_export_sous) :class:`~aesop.views.ExportSousView`
|
||||||
|
- ``aesop-export/index.csv`` (seminar_export_index) :class:`~aesop.views.ExportIndexView`
|
||||||
|
"""
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
from aesop import views
|
from aesop import views
|
||||||
|
|
||||||
|
@ -5,16 +12,16 @@ urlpatterns = [
|
||||||
path(
|
path(
|
||||||
'aesop-export/mam-rocnik-<int:prvni_rok>.csv',
|
'aesop-export/mam-rocnik-<int:prvni_rok>.csv',
|
||||||
views.ExportRocnikView.as_view(),
|
views.ExportRocnikView.as_view(),
|
||||||
name='aesop_export_rocnik'
|
name='seminar_export_rocnik'
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
'aesop-export/mam-sous-<str:datum_zacatku>.csv',
|
'aesop-export/mam-sous-<str:datum_zacatku>.csv',
|
||||||
views.ExportSousView.as_view(),
|
views.ExportSousView.as_view(),
|
||||||
name='aesop_export_sous'
|
name='seminar_export_sous'
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
'aesop-export/index.csv',
|
'aesop-export/index.csv',
|
||||||
views.ExportIndexView.as_view(),
|
views.ExportIndexView.as_view(),
|
||||||
name='aesop_export_index'
|
name='seminar_export_index'
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from django.utils.encoding import force_str
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
from aesop.ovvpfile import OvvpFile
|
from aesop.ovvpfile import OvvpFile
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ def default_ovvpfile(event, rocnik):
|
||||||
of = OvvpFile()
|
of = OvvpFile()
|
||||||
of.headers['version'] = '1'
|
of.headers['version'] = '1'
|
||||||
of.headers['event'] = event
|
of.headers['event'] = event
|
||||||
of.headers['year'] = force_str(rocnik.prvni_rok)
|
of.headers['year'] = force_text(rocnik.prvni_rok)
|
||||||
of.headers['date'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
of.headers['date'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
of.headers['id-scope'] = 'mam'
|
of.headers['id-scope'] = 'mam'
|
||||||
of.headers['id-generation'] = '1'
|
of.headers['id-generation'] = '1'
|
||||||
|
|
|
@ -1,24 +1,28 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící k deklaraci jednotlivých „views“ (nejčastěji funkce beroucí request
|
||||||
|
a vracející :func:`django.shortcuts.render` respektive nějakou response, nebo
|
||||||
|
třídy většinou rozšiřující nějakou třídu z :mod:`django.views.generic`)
|
||||||
|
"""
|
||||||
import django
|
import django
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.views import generic
|
from django.views import generic
|
||||||
from django.utils.encoding import force_str
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
from .utils import default_ovvpfile
|
from .utils import default_ovvpfile
|
||||||
from soustredeni.models import Soustredeni
|
from seminar.models import Rocnik, Soustredeni
|
||||||
from tvorba.models import Rocnik
|
|
||||||
from vysledkovky import utils
|
from vysledkovky import utils
|
||||||
from tvorba.utils import aktivniResitele
|
from seminar.utils import aktivniResitele
|
||||||
|
|
||||||
class ExportIndexView(generic.View):
|
class ExportIndexView(generic.View):
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
ls = []
|
ls = []
|
||||||
for r in Rocnik.objects.filter(exportovat = True):
|
for r in Rocnik.objects.filter(exportovat = True):
|
||||||
url = reverse('aesop_export_rocnik', kwargs={'prvni_rok': r.prvni_rok})
|
url = reverse('seminar_export_rocnik', kwargs={'prvni_rok': r.prvni_rok})
|
||||||
ls.append(url.split('/')[-1])
|
ls.append(url.split('/')[-1])
|
||||||
for s in Soustredeni.objects.filter(exportovat = True):
|
for s in Soustredeni.objects.filter(exportovat = True):
|
||||||
url = reverse('aesop_export_sous', kwargs={'datum_zacatku': s.datum_zacatku.isoformat()})
|
url = reverse('seminar_export_sous', kwargs={'datum_zacatku': s.datum_zacatku.isoformat()})
|
||||||
ls.append(url.split('/')[-1])
|
ls.append(url.split('/')[-1])
|
||||||
|
|
||||||
return HttpResponse('\n'.join(ls) + '\n', content_type='text/plain; charset=utf-8')
|
return HttpResponse('\n'.join(ls) + '\n', content_type='text/plain; charset=utf-8')
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace.
|
||||||
|
"""
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class ApiConfig(AppConfig):
|
class ApiConfig(AppConfig):
|
||||||
name = 'api'
|
name = 'api'
|
||||||
verbose_name = 'Různá webová API'
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
from django.test import TestCase, tag
|
from django.test import TestCase
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from personalni.models import Skola
|
import seminar.models as m
|
||||||
from personalni.utils import sync_skoly
|
import seminar.views as v
|
||||||
|
from seminar.utils import sync_skoly
|
||||||
|
|
||||||
@tag('stejny-model-na-produkci')
|
|
||||||
class OrgSkolyAutocompleteTestCase(TestCase):
|
class OrgSkolyAutocompleteTestCase(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
@ -48,7 +48,7 @@ class OrgSkolyAutocompleteTestCase(TestCase):
|
||||||
"""Testuje, že pro každého orga je jeho škola ve výsledném QuerySetu"""
|
"""Testuje, že pro každého orga je jeho škola ve výsledném QuerySetu"""
|
||||||
for pfx, id in self.spravna_data:
|
for pfx, id in self.spravna_data:
|
||||||
with self.subTest(prefix=pfx, spravne_id=id):
|
with self.subTest(prefix=pfx, spravne_id=id):
|
||||||
spravna_skola = Skola.objects.get(id=id)
|
spravna_skola = m.Skola.objects.get(id=id)
|
||||||
# Zeptáme se view, co si myslí
|
# Zeptáme se view, co si myslí
|
||||||
resp = self.client.get(reverse('autocomplete_skola')+'?q='+pfx).json()
|
resp = self.client.get(reverse('autocomplete_skola')+'?q='+pfx).json()
|
||||||
ids = [int(x['id']) for x in resp['results']]
|
ids = [int(x['id']) for x in resp['results']]
|
||||||
|
|
16
api/urls.py
|
@ -1,6 +1,18 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují:
|
||||||
|
|
||||||
|
- ``api/expor/skoly/`` (export_skoly) :func:`~api.views.exports.exportSkolView`
|
||||||
|
- ``api/autocomplete/skola/`` (autocomplete_skola) :class:`~api.views.autocomplete.SkolaAutocomplete`
|
||||||
|
- ``api/autocomplete/resitel/`` (autocomplete_resitel) :class:`~api.views.autocomplete.ResitelAutocomplete`
|
||||||
|
- ``api/autocomplete/problem/odevzdatelny`` (autocomplete_problem_odevzdatelny) :class:`~api.views.autocomplete.OdevzdatelnyProblemAutocomplete`
|
||||||
|
|
||||||
|
Na autocomplete v3 čeká:
|
||||||
|
|
||||||
|
- ``autocomplete/organizatori/`` (seminar_autocomplete_organizator) :class:`~api.views.autocomplete.OrganizatorAutocomplete`
|
||||||
|
"""
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
from . import views
|
from . import views
|
||||||
from personalni.utils import org_required
|
from seminar.utils import org_required
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# Export škol
|
# Export škol
|
||||||
|
@ -17,5 +29,5 @@ urlpatterns = [
|
||||||
# Ceka na autocomplete v3
|
# Ceka na autocomplete v3
|
||||||
# path('autocomplete/organizatori/',
|
# path('autocomplete/organizatori/',
|
||||||
# org_member_required(views.OrganizatorAutocomplete.as_view()),
|
# org_member_required(views.OrganizatorAutocomplete.as_view()),
|
||||||
# name='autocomplete_organizator')
|
# name='seminar_autocomplete_organizator')
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,2 +1,7 @@
|
||||||
|
"""
|
||||||
|
Soubory sloužící k deklaraci jednotlivých „views“ (nejčastěji funkce beroucí request
|
||||||
|
a vracející :func:`django.shortcuts.render` respektive nějakou response, nebo
|
||||||
|
třídy většinou rozšiřující nějakou třídu z :mod:`django.views.generic`)
|
||||||
|
"""
|
||||||
from .autocomplete import *
|
from .autocomplete import *
|
||||||
from .exports import *
|
from .exports import *
|
||||||
|
|
|
@ -5,9 +5,7 @@ from dal import autocomplete
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
from personalni.models import Skola, Resitel
|
import seminar.models as m
|
||||||
from tvorba.models import Problem
|
|
||||||
from various.models import Nastaveni
|
|
||||||
from .helpers import LoginRequiredAjaxMixin
|
from .helpers import LoginRequiredAjaxMixin
|
||||||
|
|
||||||
# TODO filosofie - zkratky, jak v databázi, tak ve vyhledávání (SPŠE, GASOŠ, Kpt., soukr)
|
# TODO filosofie - zkratky, jak v databázi, tak ve vyhledávání (SPŠE, GASOŠ, Kpt., soukr)
|
||||||
|
@ -15,7 +13,7 @@ class SkolaAutocomplete(autocomplete.Select2QuerySetView):
|
||||||
""" View k :mod:`dal.autocomplete` pro vyhledávání škol hlavně při registraci. """
|
""" View k :mod:`dal.autocomplete` pro vyhledávání škol hlavně při registraci. """
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
# Don't forget to filter out results depending on the visitor !
|
# Don't forget to filter out results depending on the visitor !
|
||||||
qs = Skola.objects.all()
|
qs = m.Skola.objects.all()
|
||||||
if self.q:
|
if self.q:
|
||||||
words = self.q.split(' ') #TODO re split podle bileho znaku
|
words = self.q.split(' ') #TODO re split podle bileho znaku
|
||||||
partq = Q()
|
partq = Q()
|
||||||
|
@ -33,7 +31,7 @@ class SkolaAutocomplete(autocomplete.Select2QuerySetView):
|
||||||
class ResitelAutocomplete(LoginRequiredAjaxMixin,autocomplete.Select2QuerySetView):
|
class ResitelAutocomplete(LoginRequiredAjaxMixin,autocomplete.Select2QuerySetView):
|
||||||
""" View k :mod:`dal.autocomplete` pro vyhledávání řešitelů především v odevzdávátku. """
|
""" View k :mod:`dal.autocomplete` pro vyhledávání řešitelů především v odevzdávátku. """
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
qs = Resitel.objects.all()
|
qs = m.Resitel.objects.all()
|
||||||
if self.q:
|
if self.q:
|
||||||
parts = self.q.split()
|
parts = self.q.split()
|
||||||
query = Q()
|
query = Q()
|
||||||
|
@ -53,8 +51,8 @@ class PublicResitelAutocomplete(LoginRequiredAjaxMixin, autocomplete.Select2Quer
|
||||||
především v odevzdávátku.
|
především v odevzdávátku.
|
||||||
"""
|
"""
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
letos = Nastaveni.get_solo().aktualni_rocnik
|
letos = m.Nastaveni.get_solo().aktualni_rocnik
|
||||||
qs = Resitel.objects.filter(
|
qs = m.Resitel.objects.filter(
|
||||||
rok_maturity__gte=letos.druhy_rok()
|
rok_maturity__gte=letos.druhy_rok()
|
||||||
).filter(
|
).filter(
|
||||||
prezdivka_resitele__isnull=False
|
prezdivka_resitele__isnull=False
|
||||||
|
@ -72,7 +70,7 @@ class PublicResitelAutocomplete(LoginRequiredAjaxMixin, autocomplete.Select2Quer
|
||||||
class OdevzdatelnyProblemAutocomplete(autocomplete.Select2QuerySetView):
|
class OdevzdatelnyProblemAutocomplete(autocomplete.Select2QuerySetView):
|
||||||
""" View k :mod:`dal.autocomplete` pro vyhledávání problémů především v odevzdávátku. """
|
""" View k :mod:`dal.autocomplete` pro vyhledávání problémů především v odevzdávátku. """
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
qs = Problem.objects.filter(stav=Problem.STAV_ZADANY)
|
qs = m.Problem.objects.filter(stav=m.Problem.STAV_ZADANY)
|
||||||
if self.q:
|
if self.q:
|
||||||
qs = qs.filter(
|
qs = qs.filter(
|
||||||
Q(nazev__icontains=self.q))
|
Q(nazev__icontains=self.q))
|
||||||
|
@ -89,12 +87,12 @@ class ProblemAutocomplete(autocomplete.Select2QuerySetView):
|
||||||
""" View k :mod:`dal.autocomplete` pro vyhledávání problémů především v odevzdávátku. """
|
""" View k :mod:`dal.autocomplete` pro vyhledávání problémů především v odevzdávátku. """
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
# FIXME i starší úlohy
|
# FIXME i starší úlohy
|
||||||
nastaveni = get_object_or_404(Nastaveni)
|
nastaveni = get_object_or_404(m.Nastaveni)
|
||||||
rocnik = nastaveni.aktualni_rocnik
|
rocnik = nastaveni.aktualni_rocnik
|
||||||
temaQ = Q(Tema___rocnik = rocnik)
|
temaQ = Q(Tema___rocnik = rocnik)
|
||||||
ulohaQ = Q(Uloha___cislo_zadani__rocnik=rocnik)
|
ulohaQ = Q(Uloha___cislo_zadani__rocnik=rocnik)
|
||||||
clanekQ = Q(Clanek___cislo__rocnik=rocnik)
|
clanekQ = Q(Clanek___cislo__rocnik=rocnik)
|
||||||
qs = Problem.objects.filter(temaQ | ulohaQ | clanekQ).order_by("-stav", "nazev")
|
qs = m.Problem.objects.filter(temaQ | ulohaQ | clanekQ).order_by("-stav", "nazev")
|
||||||
if self.q:
|
if self.q:
|
||||||
qs = qs.filter(
|
qs = qs.filter(
|
||||||
Q(nazev__icontains=self.q))
|
Q(nazev__icontains=self.q))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import personalni.models as m
|
import seminar.models as m
|
||||||
from django.core import serializers as ser
|
from django.core import serializers as ser
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
def exportSkolView(request):
|
def exportSkolView(request):
|
||||||
|
|
645
data/groups.json
|
@ -1,645 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"fields": {
|
|
||||||
"name": "org",
|
|
||||||
"permissions": [
|
|
||||||
[
|
|
||||||
"org",
|
|
||||||
"auth",
|
|
||||||
"user"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_flatpage",
|
|
||||||
"flatpages",
|
|
||||||
"flatpage"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_flatpage",
|
|
||||||
"flatpages",
|
|
||||||
"flatpage"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_flatpage",
|
|
||||||
"flatpages",
|
|
||||||
"flatpage"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_flatpage",
|
|
||||||
"flatpages",
|
|
||||||
"flatpage"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_galerie",
|
|
||||||
"galerie",
|
|
||||||
"galerie"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_galerie",
|
|
||||||
"galerie",
|
|
||||||
"galerie"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_galerie",
|
|
||||||
"galerie",
|
|
||||||
"galerie"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_galerie",
|
|
||||||
"galerie",
|
|
||||||
"galerie"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_obrazek",
|
|
||||||
"galerie",
|
|
||||||
"obrazek"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_obrazek",
|
|
||||||
"galerie",
|
|
||||||
"obrazek"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_obrazek",
|
|
||||||
"galerie",
|
|
||||||
"obrazek"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_obrazek",
|
|
||||||
"galerie",
|
|
||||||
"obrazek"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_fotkaheader",
|
|
||||||
"header_fotky",
|
|
||||||
"fotkaheader"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_fotkaheader",
|
|
||||||
"header_fotky",
|
|
||||||
"fotkaheader"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_fotkaheader",
|
|
||||||
"header_fotky",
|
|
||||||
"fotkaheader"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_fotkaurlvazba",
|
|
||||||
"header_fotky",
|
|
||||||
"fotkaurlvazba"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_fotkaurlvazba",
|
|
||||||
"header_fotky",
|
|
||||||
"fotkaurlvazba"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_fotkaurlvazba",
|
|
||||||
"header_fotky",
|
|
||||||
"fotkaurlvazba"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_komentar",
|
|
||||||
"korektury",
|
|
||||||
"komentar"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_komentar",
|
|
||||||
"korektury",
|
|
||||||
"komentar"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_komentar",
|
|
||||||
"korektury",
|
|
||||||
"komentar"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_komentar",
|
|
||||||
"korektury",
|
|
||||||
"komentar"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_korekturovanepdf",
|
|
||||||
"korektury",
|
|
||||||
"korekturovanepdf"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_korekturovanepdf",
|
|
||||||
"korektury",
|
|
||||||
"korekturovanepdf"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_korekturovanepdf",
|
|
||||||
"korektury",
|
|
||||||
"korekturovanepdf"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_korekturovanepdf",
|
|
||||||
"korektury",
|
|
||||||
"korekturovanepdf"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_oprava",
|
|
||||||
"korektury",
|
|
||||||
"oprava"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_oprava",
|
|
||||||
"korektury",
|
|
||||||
"oprava"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_oprava",
|
|
||||||
"korektury",
|
|
||||||
"oprava"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_oprava",
|
|
||||||
"korektury",
|
|
||||||
"oprava"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_novinky",
|
|
||||||
"novinky",
|
|
||||||
"novinky"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_novinky",
|
|
||||||
"novinky",
|
|
||||||
"novinky"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_novinky",
|
|
||||||
"novinky",
|
|
||||||
"novinky"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_novinky",
|
|
||||||
"novinky",
|
|
||||||
"novinky"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_organizator",
|
|
||||||
"personalni",
|
|
||||||
"organizator"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_organizator",
|
|
||||||
"personalni",
|
|
||||||
"organizator"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_osoba",
|
|
||||||
"personalni",
|
|
||||||
"osoba"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_osoba",
|
|
||||||
"personalni",
|
|
||||||
"osoba"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_prijemce",
|
|
||||||
"personalni",
|
|
||||||
"prijemce"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_prijemce",
|
|
||||||
"personalni",
|
|
||||||
"prijemce"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_prijemce",
|
|
||||||
"personalni",
|
|
||||||
"prijemce"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_prijemce",
|
|
||||||
"personalni",
|
|
||||||
"prijemce"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_resitel",
|
|
||||||
"personalni",
|
|
||||||
"resitel"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_resitel",
|
|
||||||
"personalni",
|
|
||||||
"resitel"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_skola",
|
|
||||||
"personalni",
|
|
||||||
"skola"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_skola",
|
|
||||||
"personalni",
|
|
||||||
"skola"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_skola",
|
|
||||||
"personalni",
|
|
||||||
"skola"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_skola",
|
|
||||||
"personalni",
|
|
||||||
"skola"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_hlasovani",
|
|
||||||
"prednasky",
|
|
||||||
"hlasovani"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_hlasovani",
|
|
||||||
"prednasky",
|
|
||||||
"hlasovani"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_hlasovani",
|
|
||||||
"prednasky",
|
|
||||||
"hlasovani"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_hlasovani",
|
|
||||||
"prednasky",
|
|
||||||
"hlasovani"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_prednaska",
|
|
||||||
"prednasky",
|
|
||||||
"prednaska"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_prednaska",
|
|
||||||
"prednasky",
|
|
||||||
"prednaska"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_prednaska",
|
|
||||||
"prednasky",
|
|
||||||
"prednaska"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_prednaska",
|
|
||||||
"prednasky",
|
|
||||||
"prednaska"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_seznam",
|
|
||||||
"prednasky",
|
|
||||||
"seznam"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_seznam",
|
|
||||||
"prednasky",
|
|
||||||
"seznam"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_seznam",
|
|
||||||
"prednasky",
|
|
||||||
"seznam"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_seznam",
|
|
||||||
"prednasky",
|
|
||||||
"seznam"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_konfera",
|
|
||||||
"soustredeni",
|
|
||||||
"konfera"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_konfera",
|
|
||||||
"soustredeni",
|
|
||||||
"konfera"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_konfera",
|
|
||||||
"soustredeni",
|
|
||||||
"konfera"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_konfera",
|
|
||||||
"soustredeni",
|
|
||||||
"konfera"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_konfery_ucastnici",
|
|
||||||
"soustredeni",
|
|
||||||
"konfery_ucastnici"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_konfery_ucastnici",
|
|
||||||
"soustredeni",
|
|
||||||
"konfery_ucastnici"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_konfery_ucastnici",
|
|
||||||
"soustredeni",
|
|
||||||
"konfery_ucastnici"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_konfery_ucastnici",
|
|
||||||
"soustredeni",
|
|
||||||
"konfery_ucastnici"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_soustredeni",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_soustredeni",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_soustredeni",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_soustredeni",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_soustredeni_organizatori",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni_organizatori"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_soustredeni_organizatori",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni_organizatori"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_soustredeni_organizatori",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni_organizatori"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_soustredeni_organizatori",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni_organizatori"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_soustredeni_ucastnici",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni_ucastnici"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_soustredeni_ucastnici",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni_ucastnici"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_soustredeni_ucastnici",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni_ucastnici"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_soustredeni_ucastnici",
|
|
||||||
"soustredeni",
|
|
||||||
"soustredeni_ucastnici"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_tag",
|
|
||||||
"taggit",
|
|
||||||
"tag"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_tag",
|
|
||||||
"taggit",
|
|
||||||
"tag"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_tag",
|
|
||||||
"taggit",
|
|
||||||
"tag"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_tag",
|
|
||||||
"taggit",
|
|
||||||
"tag"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_taggeditem",
|
|
||||||
"taggit",
|
|
||||||
"taggeditem"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_taggeditem",
|
|
||||||
"taggit",
|
|
||||||
"taggeditem"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_taggeditem",
|
|
||||||
"taggit",
|
|
||||||
"taggeditem"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_taggeditem",
|
|
||||||
"taggit",
|
|
||||||
"taggeditem"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_cislo",
|
|
||||||
"tvorba",
|
|
||||||
"cislo"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_cislo",
|
|
||||||
"tvorba",
|
|
||||||
"cislo"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_cislo",
|
|
||||||
"tvorba",
|
|
||||||
"cislo"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_cislo",
|
|
||||||
"tvorba",
|
|
||||||
"cislo"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_clanek",
|
|
||||||
"tvorba",
|
|
||||||
"clanek"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_clanek",
|
|
||||||
"tvorba",
|
|
||||||
"clanek"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_clanek",
|
|
||||||
"tvorba",
|
|
||||||
"clanek"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_clanek",
|
|
||||||
"tvorba",
|
|
||||||
"clanek"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_deadline",
|
|
||||||
"tvorba",
|
|
||||||
"deadline"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_deadline",
|
|
||||||
"tvorba",
|
|
||||||
"deadline"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_deadline",
|
|
||||||
"tvorba",
|
|
||||||
"deadline"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_pohadka",
|
|
||||||
"tvorba",
|
|
||||||
"pohadka"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_pohadka",
|
|
||||||
"tvorba",
|
|
||||||
"pohadka"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_pohadka",
|
|
||||||
"tvorba",
|
|
||||||
"pohadka"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_pohadka",
|
|
||||||
"tvorba",
|
|
||||||
"pohadka"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_problem",
|
|
||||||
"tvorba",
|
|
||||||
"problem"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_problem",
|
|
||||||
"tvorba",
|
|
||||||
"problem"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_problem",
|
|
||||||
"tvorba",
|
|
||||||
"problem"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_problem",
|
|
||||||
"tvorba",
|
|
||||||
"problem"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_rocnik",
|
|
||||||
"tvorba",
|
|
||||||
"rocnik"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_rocnik",
|
|
||||||
"tvorba",
|
|
||||||
"rocnik"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_rocnik",
|
|
||||||
"tvorba",
|
|
||||||
"rocnik"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_rocnik",
|
|
||||||
"tvorba",
|
|
||||||
"rocnik"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_tema",
|
|
||||||
"tvorba",
|
|
||||||
"tema"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_tema",
|
|
||||||
"tvorba",
|
|
||||||
"tema"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_tema",
|
|
||||||
"tvorba",
|
|
||||||
"tema"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_tema",
|
|
||||||
"tvorba",
|
|
||||||
"tema"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_uloha",
|
|
||||||
"tvorba",
|
|
||||||
"uloha"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_uloha",
|
|
||||||
"tvorba",
|
|
||||||
"uloha"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_uloha",
|
|
||||||
"tvorba",
|
|
||||||
"uloha"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_uloha",
|
|
||||||
"tvorba",
|
|
||||||
"uloha"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"add_nastaveni",
|
|
||||||
"various",
|
|
||||||
"nastaveni"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"delete_nastaveni",
|
|
||||||
"various",
|
|
||||||
"nastaveni"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"change_nastaveni",
|
|
||||||
"various",
|
|
||||||
"nastaveni"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"view_nastaveni",
|
|
||||||
"various",
|
|
||||||
"nastaveni"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"model": "auth.group",
|
|
||||||
"pk": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fields": {
|
|
||||||
"name": "resitel",
|
|
||||||
"permissions": [
|
|
||||||
[
|
|
||||||
"resitel",
|
|
||||||
"auth",
|
|
||||||
"user"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"model": "auth.group",
|
|
||||||
"pk": 2
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -73,7 +73,7 @@
|
||||||
"sort_order": 3,
|
"sort_order": 3,
|
||||||
"title": "Aktuální<br/> ročník",
|
"title": "Aktuální<br/> ročník",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "tvorba_aktualni_zadani",
|
"url": "seminar_aktualni_zadani",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
"sort_order": 5,
|
"sort_order": 5,
|
||||||
"title": "Archiv",
|
"title": "Archiv",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "tvorba_archiv_rocniky",
|
"url": "seminar_archiv_rocniky",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -289,7 +289,7 @@
|
||||||
"sort_order": 43,
|
"sort_order": 43,
|
||||||
"title": "Výsledková listina",
|
"title": "Výsledková listina",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "tvorba_aktualni_vysledky",
|
"url": "seminar_aktualni_vysledky",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -361,7 +361,7 @@
|
||||||
"sort_order": 20,
|
"sort_order": 20,
|
||||||
"title": "Proběhlo",
|
"title": "Proběhlo",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "soustredeni_seznam",
|
"url": "seminar_seznam_soustredeni",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -409,7 +409,7 @@
|
||||||
"sort_order": 23,
|
"sort_order": 23,
|
||||||
"title": "Osobní údaje",
|
"title": "Osobní údaje",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "personalni_resitel_edit",
|
"url": "seminar_resitel_edit",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -439,7 +439,7 @@
|
||||||
"sort_order": 36,
|
"sort_order": 36,
|
||||||
"title": "Nahrát řešení",
|
"title": "Nahrát řešení",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "odevzdavatko_nahraj_reseni",
|
"url": "seminar_nahraj_reseni",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -463,7 +463,7 @@
|
||||||
"sort_order": 35,
|
"sort_order": 35,
|
||||||
"title": "Témata",
|
"title": "Témata",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "tvorba_archiv_temata",
|
"url": "seminar_archiv_temata",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -589,7 +589,7 @@
|
||||||
"sort_order": 15,
|
"sort_order": 15,
|
||||||
"title": "Aktuální číslo",
|
"title": "Aktuální číslo",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "tvorba_aktualni_zadani",
|
"url": "seminar_aktualni_zadani",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -613,7 +613,7 @@
|
||||||
"sort_order": 24,
|
"sort_order": 24,
|
||||||
"title": "Čísla",
|
"title": "Čísla",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "tvorba_archiv_rocniky",
|
"url": "seminar_archiv_rocniky",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -721,7 +721,7 @@
|
||||||
"sort_order": 36,
|
"sort_order": 36,
|
||||||
"title": "Vložit řešení",
|
"title": "Vložit řešení",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "odevzdavatko_vloz_reseni",
|
"url": "seminar_vloz_reseni",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -804,7 +804,7 @@
|
||||||
"sort_order": 37,
|
"sort_order": 37,
|
||||||
"title": "Moje řešení",
|
"title": "Moje řešení",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "odevzdavatko_resitel_odevzdana_reseni",
|
"url": "seminar_resitel_odevzdana_reseni",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -828,7 +828,7 @@
|
||||||
"sort_order": 33,
|
"sort_order": 33,
|
||||||
"title": "Aktuální ročník",
|
"title": "Aktuální ročník",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "tvorba_aktualni_rocnik",
|
"url": "seminar_aktualni_rocnik",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -900,7 +900,7 @@
|
||||||
"sort_order": 46,
|
"sort_order": 46,
|
||||||
"title": "Ročník {{rocnik.rocnik}}",
|
"title": "Ročník {{rocnik.rocnik}}",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "tvorba_rocnik rocnik.rocnik",
|
"url": "seminar_rocnik rocnik.rocnik",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -924,7 +924,7 @@
|
||||||
"sort_order": 47,
|
"sort_order": 47,
|
||||||
"title": "Číslo {{ cislo.rocnik.rocnik }}.{{ cislo.poradi }}",
|
"title": "Číslo {{ cislo.rocnik.rocnik }}.{{ cislo.poradi }}",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "tvorba_cislo cislo.rocnik.rocnik cislo.poradi",
|
"url": "seminar_cislo cislo.rocnik.rocnik cislo.poradi",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -1007,18 +1007,7 @@
|
||||||
"access_guest": false,
|
"access_guest": false,
|
||||||
"access_loggedin": false,
|
"access_loggedin": false,
|
||||||
"access_perm_type": 1,
|
"access_perm_type": 1,
|
||||||
"access_permissions": [
|
"access_permissions": [],
|
||||||
[
|
|
||||||
"org",
|
|
||||||
"auth",
|
|
||||||
"user"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"resitel",
|
|
||||||
"auth",
|
|
||||||
"user"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"access_restricted": true,
|
"access_restricted": true,
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"description": "",
|
"description": "",
|
||||||
|
@ -1061,7 +1050,7 @@
|
||||||
"sort_order": 52,
|
"sort_order": 52,
|
||||||
"title": "Nahrát řešení k nadproblému {{nadproblem_id}}",
|
"title": "Nahrát řešení k nadproblému {{nadproblem_id}}",
|
||||||
"tree": 1,
|
"tree": 1,
|
||||||
"url": "odevzdavatko_nahraj_reseni nadproblem_id",
|
"url": "seminar_nahraj_reseni nadproblem_id",
|
||||||
"urlaspattern": true
|
"urlaspattern": true
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
|
@ -1090,29 +1079,5 @@
|
||||||
},
|
},
|
||||||
"model": "sitetree.treeitem",
|
"model": "sitetree.treeitem",
|
||||||
"pk": 53
|
"pk": 53
|
||||||
},
|
|
||||||
{
|
|
||||||
"fields": {
|
|
||||||
"access_guest": false,
|
|
||||||
"access_loggedin": false,
|
|
||||||
"access_perm_type": 1,
|
|
||||||
"access_permissions": [],
|
|
||||||
"access_restricted": false,
|
|
||||||
"alias": null,
|
|
||||||
"description": "",
|
|
||||||
"hidden": false,
|
|
||||||
"hint": "",
|
|
||||||
"inbreadcrumbs": true,
|
|
||||||
"inmenu": true,
|
|
||||||
"insitetree": true,
|
|
||||||
"parent": 20,
|
|
||||||
"sort_order": 54,
|
|
||||||
"title": "Export do abstraktů sousu {{ soustredeni.id }}",
|
|
||||||
"tree": 1,
|
|
||||||
"url": "soustredeni_abstrakty soustredeni.id",
|
|
||||||
"urlaspattern": true
|
|
||||||
},
|
|
||||||
"model": "sitetree.treeitem",
|
|
||||||
"pk": 54
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
652
deploy_v2/admin_org_prava.json
Normal file
|
@ -0,0 +1,652 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"codename": "org",
|
||||||
|
"ct_app_label": "auth",
|
||||||
|
"ct_model": "user"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_flatpage",
|
||||||
|
"ct_app_label": "flatpages",
|
||||||
|
"ct_model": "flatpage"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_flatpage",
|
||||||
|
"ct_app_label": "flatpages",
|
||||||
|
"ct_model": "flatpage"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_flatpage",
|
||||||
|
"ct_app_label": "flatpages",
|
||||||
|
"ct_model": "flatpage"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_flatpage",
|
||||||
|
"ct_app_label": "flatpages",
|
||||||
|
"ct_model": "flatpage"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_galerie",
|
||||||
|
"ct_app_label": "galerie",
|
||||||
|
"ct_model": "galerie"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_galerie",
|
||||||
|
"ct_app_label": "galerie",
|
||||||
|
"ct_model": "galerie"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_galerie",
|
||||||
|
"ct_app_label": "galerie",
|
||||||
|
"ct_model": "galerie"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_galerie",
|
||||||
|
"ct_app_label": "galerie",
|
||||||
|
"ct_model": "galerie"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_obrazek",
|
||||||
|
"ct_app_label": "galerie",
|
||||||
|
"ct_model": "obrazek"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_obrazek",
|
||||||
|
"ct_app_label": "galerie",
|
||||||
|
"ct_model": "obrazek"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_obrazek",
|
||||||
|
"ct_app_label": "galerie",
|
||||||
|
"ct_model": "obrazek"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_obrazek",
|
||||||
|
"ct_app_label": "galerie",
|
||||||
|
"ct_model": "obrazek"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_komentar",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "komentar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_komentar",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "komentar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_komentar",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "komentar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_komentar",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "komentar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_korekturovanepdf",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "korekturovanepdf"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_korekturovanepdf",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "korekturovanepdf"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_korekturovanepdf",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "korekturovanepdf"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_korekturovanepdf",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "korekturovanepdf"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_oprava",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "oprava"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_oprava",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "oprava"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_oprava",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "oprava"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_oprava",
|
||||||
|
"ct_app_label": "korektury",
|
||||||
|
"ct_model": "oprava"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_hlasovani",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "hlasovani"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_hlasovani",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "hlasovani"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_hlasovani",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "hlasovani"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_hlasovani",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "hlasovani"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_prednaska",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "prednaska"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_prednaska",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "prednaska"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_prednaska",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "prednaska"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_prednaska",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "prednaska"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_seznam",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "seznam"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_seznam",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "seznam"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_seznam",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "seznam"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_seznam",
|
||||||
|
"ct_app_label": "prednasky",
|
||||||
|
"ct_model": "seznam"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_cislo",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "cislo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_cislo",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "cislo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_cislo",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "cislo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_cislo",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "cislo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_clanek",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "clanek"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_clanek",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "clanek"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_clanek",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "clanek"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_clanek",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "clanek"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_konfera",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "konfera"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_konfera",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "konfera"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_konfera",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "konfera"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_konfera",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "konfera"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_konfery_ucastnici",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "konfery_ucastnici"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_konfery_ucastnici",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "konfery_ucastnici"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_konfery_ucastnici",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "konfery_ucastnici"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_konfery_ucastnici",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "konfery_ucastnici"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_nastaveni",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "nastaveni"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_nastaveni",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "nastaveni"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_nastaveni",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "nastaveni"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_nastaveni",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "nastaveni"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_novinky",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "novinky"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_novinky",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "novinky"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_novinky",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "novinky"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_novinky",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "novinky"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_organizator",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "organizator"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_organizator",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "organizator"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_organizator",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "organizator"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_organizator",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "organizator"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_osoba",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "osoba"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_osoba",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "osoba"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_osoba",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "osoba"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_osoba",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "osoba"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_pohadka",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "pohadka"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_pohadka",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "pohadka"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_pohadka",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "pohadka"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_pohadka",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "pohadka"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_prijemce",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "prijemce"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_prijemce",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "prijemce"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_prijemce",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "prijemce"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_prijemce",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "prijemce"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_problem",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "problem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_problem",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "problem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_problem",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "problem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_problem",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "problem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_resitel",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "resitel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_resitel",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "resitel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_resitel",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "resitel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_resitel",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "resitel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_rocnik",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "rocnik"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_rocnik",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "rocnik"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_rocnik",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "rocnik"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_rocnik",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "rocnik"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_skola",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "skola"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_skola",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "skola"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_skola",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "skola"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_skola",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "skola"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_soustredeni",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_soustredeni",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_soustredeni",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_soustredeni",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_soustredeni_organizatori",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni_organizatori"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_soustredeni_organizatori",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni_organizatori"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_soustredeni_organizatori",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni_organizatori"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_soustredeni_organizatori",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni_organizatori"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_soustredeni_ucastnici",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni_ucastnici"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_soustredeni_ucastnici",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni_ucastnici"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_soustredeni_ucastnici",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni_ucastnici"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_soustredeni_ucastnici",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "soustredeni_ucastnici"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_tema",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "tema"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_tema",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "tema"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_tema",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "tema"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_tema",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "tema"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_uloha",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "uloha"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_uloha",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "uloha"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_uloha",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "uloha"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_uloha",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "uloha"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_tag",
|
||||||
|
"ct_app_label": "taggit",
|
||||||
|
"ct_model": "tag"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_tag",
|
||||||
|
"ct_app_label": "taggit",
|
||||||
|
"ct_model": "tag"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_tag",
|
||||||
|
"ct_app_label": "taggit",
|
||||||
|
"ct_model": "tag"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_tag",
|
||||||
|
"ct_app_label": "taggit",
|
||||||
|
"ct_model": "tag"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_taggeditem",
|
||||||
|
"ct_app_label": "taggit",
|
||||||
|
"ct_model": "taggeditem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_taggeditem",
|
||||||
|
"ct_app_label": "taggit",
|
||||||
|
"ct_model": "taggeditem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "delete_taggeditem",
|
||||||
|
"ct_app_label": "taggit",
|
||||||
|
"ct_model": "taggeditem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_taggeditem",
|
||||||
|
"ct_app_label": "taggit",
|
||||||
|
"ct_model": "taggeditem"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_fotkaheader",
|
||||||
|
"ct_app_label": "header_fotky",
|
||||||
|
"ct_model": "fotkaheader"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_fotkaheader",
|
||||||
|
"ct_app_label": "header_fotky",
|
||||||
|
"ct_model": "fotkaheader"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_fotkaheader",
|
||||||
|
"ct_app_label": "header_fotky",
|
||||||
|
"ct_model": "fotkaheader"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_fotkaurlvazba",
|
||||||
|
"ct_app_label": "header_fotky",
|
||||||
|
"ct_model": "fotkaurlvazba"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_fotkaurlvazba",
|
||||||
|
"ct_app_label": "header_fotky",
|
||||||
|
"ct_model": "fotkaurlvazba"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_fotkaurlvazba",
|
||||||
|
"ct_app_label": "header_fotky",
|
||||||
|
"ct_model": "fotkaurlvazba"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "add_deadline",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "deadline"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "change_deadline",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "deadline"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"codename": "view_deadline",
|
||||||
|
"ct_app_label": "seminar",
|
||||||
|
"ct_model": "deadline"
|
||||||
|
}
|
||||||
|
]
|
|
@ -13,6 +13,7 @@ make install_venv
|
||||||
make install
|
make install
|
||||||
deploy_v2/pre_migration.py
|
deploy_v2/pre_migration.py
|
||||||
make deploy_test
|
make deploy_test
|
||||||
|
./manage.py load_org_permissions admin_org_prava.json
|
||||||
./manage.py loaddata data/*
|
./manage.py loaddata data/*
|
||||||
systemctl --user start mamweb-test.service
|
systemctl --user start mamweb-test.service
|
||||||
./manage.py generate_thumbnails
|
./manage.py generate_thumbnails
|
||||||
|
|
29
docs/conf.py
|
@ -12,6 +12,8 @@
|
||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import types
|
||||||
|
|
||||||
import django
|
import django
|
||||||
sys.path.insert(0, os.path.abspath('..'))
|
sys.path.insert(0, os.path.abspath('..'))
|
||||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'mamweb.settings'
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'mamweb.settings'
|
||||||
|
@ -97,5 +99,32 @@ def ignorovat(app, what, name, obj, skip, options):
|
||||||
ignore = (what, name) in blacklist
|
ignore = (what, name) in blacklist
|
||||||
return True if ignore else None
|
return True if ignore else None
|
||||||
|
|
||||||
|
|
||||||
|
def see(app, what: str, name: str, obj, options, lines: list[str]):
|
||||||
|
from django.urls.resolvers import URLPattern
|
||||||
|
if what == "module" and name.endswith("urls") and hasattr(obj, "urlpatterns"):
|
||||||
|
for url_pattern in obj.urlpatterns:
|
||||||
|
text = f"- ``{url_pattern.pattern}`` "
|
||||||
|
if isinstance(url_pattern, URLPattern):
|
||||||
|
if url_pattern.name is not None:
|
||||||
|
text += f"({url_pattern.name}) "
|
||||||
|
|
||||||
|
if hasattr(url_pattern.callback, "view_class"):
|
||||||
|
text += f":class:`~{url_pattern.callback.view_class.__module__}.{url_pattern.callback.view_class.__name__}`"
|
||||||
|
else:
|
||||||
|
text += f":func:`~{url_pattern.callback.__module__}.{url_pattern.callback.__name__}`"
|
||||||
|
|
||||||
|
else:
|
||||||
|
if isinstance(url_pattern.urlconf_name, types.ModuleType):
|
||||||
|
text += f":mod:`~{url_pattern.urlconf_name.__name__}`"
|
||||||
|
else:
|
||||||
|
# FIXME nějak lépe ošetřit. Ale `admin/` je zatím jediný případ
|
||||||
|
pass
|
||||||
|
|
||||||
|
lines.append(text)
|
||||||
|
return lines
|
||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
app.connect('autodoc-skip-member', ignorovat)
|
app.connect('autodoc-skip-member', ignorovat)
|
||||||
|
app.connect('autodoc-process-docstring', see)
|
||||||
|
|
27
docs/css.rst
|
@ -1,27 +0,0 @@
|
||||||
CSS (a další styly na webu)
|
|
||||||
===========================
|
|
||||||
|
|
||||||
Inspirován `css-trick článkem <https://css-tricks.com/methods-organize-css/>`_ jsem se rozhodl rozdělit
|
|
||||||
CSSka do
|
|
||||||
|
|
||||||
- Konstant (``constants.css``), které jsou využívány na mnoha místech CSSek
|
|
||||||
- Nastylování html tagů (``base.css``)
|
|
||||||
- Layoutu (``layout.css``), což je to, co určuje celkové rozložení stránky
|
|
||||||
- Jednotlivých prvků (``modules.css``)
|
|
||||||
|
|
||||||
Dále jsem separoval CSSka pro **galerii** (potřebuje hodně specifických stylů). Stejně tak **korekturovátko** má styly separátně.
|
|
||||||
|
|
||||||
Dále web (asi) používá externí frameworky (v separátních složkách – mají k sobě i JS a podobné věci):
|
|
||||||
|
|
||||||
- bootstrap: dělá nějaké basic stylování, *web je na něm hodně závislý* (například jsem zjistil, že bootstrap kdysi přidával ``font-size:14px``, bez čehož se web úplně rozpadnul) (také na něm běží mobilní meníčko, které navíc vyžaduje Popper, tedy bootstrap.bundle.js místo bootstrap.js)
|
|
||||||
|
|
||||||
Pak jsou tu ``mamweb-dev.css`` a ``printtable.css``, co jsem si ještě nerozmyslel, co s tím.
|
|
||||||
|
|
||||||
Pár myšlenek
|
|
||||||
------------
|
|
||||||
|
|
||||||
- Až na pár výjimek (galerii a korekturovátko) bych styly držel v jedné složce a málo souborech,
|
|
||||||
protože CSS šíleně dědí všechno možné
|
|
||||||
- Chce to dobře pojmenovávat třídy (speciálně aby bylo vidět, co ta třída dělá nebo kde se používá)
|
|
||||||
- Chce to hodně komentovat kód (speciálně tam, kde není splněn předchozí bod)
|
|
||||||
|
|
|
@ -9,6 +9,12 @@ static
|
||||||
------
|
------
|
||||||
Složka, kam django nakopíruje všechno ze složek static a pak na to z templatů / kódu jde ukazovat pomocí ``static``.
|
Složka, kam django nakopíruje všechno ze složek static a pak na to z templatů / kódu jde ukazovat pomocí ``static``.
|
||||||
|
|
||||||
|
_git_hooks
|
||||||
|
----------
|
||||||
|
Hooky do gitu pro kontrolu Pythoního stylu. Především ``flake8``.
|
||||||
|
|
||||||
|
Zbylo tu z minulosti mamwebu.
|
||||||
|
|
||||||
data
|
data
|
||||||
----
|
----
|
||||||
Obsahuje data, která patří do databáze, ale jsou přímo součástí webu jako
|
Obsahuje data, která patří do databáze, ale jsou přímo součástí webu jako
|
||||||
|
|
|
@ -27,10 +27,8 @@ Dokumentace (jak v ``docs/``, tak přímo v kódu) je psaná ve
|
||||||
:titlesonly:
|
:titlesonly:
|
||||||
|
|
||||||
vyvoj
|
vyvoj
|
||||||
zavislosti
|
|
||||||
sphinx
|
sphinx
|
||||||
skripty
|
skripty
|
||||||
zkratky
|
|
||||||
modules/modules
|
modules/modules
|
||||||
dalsi_soubory
|
dalsi_soubory
|
||||||
zapisy/zapisy
|
zapisy/zapisy
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
Sphinx na našem webu
|
Sphinx na našem webu
|
||||||
====================
|
====================
|
||||||
|
|
||||||
Dokumentace se zkompiluje příkazem ``make html`` ve složce ``docs``. (Musíte mít zapnutý virtualenv)
|
Dokumentace se zkompiluje příkazem ``make html`` ve složce ``doc``.
|
||||||
|
|
||||||
Složka ``modules`` je automaticiky generována a přegenerovávána. (**Nic v ní neupravovat!**)
|
Složka ``modules`` je automaticiky generována a přegenerovávána. (**Nic v ní neupravovat!**)
|
||||||
Jinak všechny rst, co jsou ve složce ``docs`` a jejích podsložkách nezačínajících podtržítkem, budou v dokumentaci a to je přesně to, co editovat pro změnu dokumentace (kromě dokumentace přímo v Pythonu).
|
Jinak všechny rst, co jsou ve složce ``doc`` a jejích podsložkách nezačínajících podtržítkem, budou v dokumentaci a to je přesně to, co editovat pro změnu dokumentace (kromě dokumentace přímo v Pythonu).
|
||||||
|
|
||||||
Sphinx se píše v rst: `Návod na syntaxi rst`_ `Cheat sheet`_
|
Sphinx se píše v rst: `Návod na syntaxi rst`_ `Cheat sheet`_
|
||||||
|
|
||||||
Pokud něco chcete protlačit do bočního meníčka, je potřeba to připsat do souboru ``docs/index.rst`` (Zatím není úplně konsensus nad tím, co tam má a nemá být, takže pokud si nejste jistí, cpěte tam *všechno* ☺)
|
|
||||||
|
|
||||||
To je snad vše, co je potřeba vědět k dokumentaci mamwebu. Následující sekce jsou o tom, co jsem provedl Sphinxu, aby to fungovalo:
|
To je snad vše, co je potřeba vědět k dokumentaci mamwebu. Následující sekce jsou o tom, co jsem provedl Sphinxu, aby to fungovalo:
|
||||||
|
|
||||||
.. _Návod na syntaxi rst: https://sphinx-tutorial.readthedocs.io/step-1/#sections
|
.. _Návod na syntaxi rst: https://sphinx-tutorial.readthedocs.io/step-1/#sections
|
||||||
|
|
|
@ -10,9 +10,11 @@ věci jako chybové hlášky a vzhled M&M stránek (menu, patička, atd.). Aktu
|
||||||
i veškeré csv.
|
i veškeré csv.
|
||||||
|
|
||||||
Další jsou pak jednotlivé aplikace (pokud něco hledáte, tak zřejmě chcete najít
|
Další jsou pak jednotlivé aplikace (pokud něco hledáte, tak zřejmě chcete najít
|
||||||
tu aplikaci, která tomu odpovídá, respektive se k ní dostat přes url).
|
tu aplikaci, která tomu odpovídá, respektive se k ní dostat přes url), za
|
||||||
|
zmínku stojí seminar, kde jsou takové ty věci, co zbyly. Plus jsou tam aktuálně
|
||||||
|
téměř všechny modely, protože je těžké je přesunout jinam.
|
||||||
|
|
||||||
**TLDR: Nevšímejte si složek data/ seminar/ a souborů přímo v kořenové složce.**
|
**TLDR: Nevšímejte si složky data/ a souborů přímo v kořenové složce.**
|
||||||
Kromě věcí potřebných ke gitu, :doc:`ke spuštění <vyvoj>` a fukci djanga,
|
Kromě věcí potřebných ke gitu, :doc:`ke spuštění <vyvoj>` a fukci djanga,
|
||||||
dalších drobností, lokální databáze a již zmíněných aplikací jsou tu ``data``,
|
dalších drobností, lokální databáze a již zmíněných aplikací jsou tu ``data``,
|
||||||
kde je takový ten obsah webu, co by se měl dát snadno měnit (tudíž musí být v
|
kde je takový ten obsah webu, co by se měl dát snadno měnit (tudíž musí být v
|
||||||
|
@ -20,9 +22,6 @@ databázi), tj. statické stránky, menu a obrázky v pozadí menu. Ten je třeb
|
||||||
měnit hlavně na produkci a sekundárně tady (může to dělat i newebař a nechcete
|
měnit hlavně na produkci a sekundárně tady (může to dělat i newebař a nechcete
|
||||||
přepsat jeho práci). Vše, co nejsou aplikace je popsáno :doc:`tady <dalsi_soubory>`.
|
přepsat jeho práci). Vše, co nejsou aplikace je popsáno :doc:`tady <dalsi_soubory>`.
|
||||||
|
|
||||||
Ještě je tu aplikace ``seminar/``, kde bylo původně skoro všechno, a tak nám
|
|
||||||
tam zbývá spoustu historických migrací (čehož se jen tak nezbavíme).
|
|
||||||
|
|
||||||
Základy djanga
|
Základy djanga
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
|
25
docs/tabulka_prerekvizit.rst
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
.. Není odkázaná z menu, je to záměr
|
||||||
|
|
||||||
|
Tabulka prerekvizit v různých distribucích
|
||||||
|
=========
|
||||||
|
|
||||||
|
.. admonition:: Metodika
|
||||||
|
|
||||||
|
Na čistém repozitáři (``git clean -fxd``) a čistém systému spouštíme
|
||||||
|
``make/init_local``. Když to spadne, tak do tabulky zapíšeme, co jsme
|
||||||
|
přiinstalovali. Protože větev ``makefiles`` aktuálně není mergenutá do
|
||||||
|
masteru, nefunguje synchronizace flatpages (a stejně nemáme SSH klíč), takže
|
||||||
|
tam ``make/init_local`` sestřelíme a vyzkoušíme, že ``make/test`` spustí
|
||||||
|
testy.
|
||||||
|
|
||||||
|
.. Grafické tabulky (grid-tables, simple-tables) jsou strašný porod vyrábět, dlabu na to a cpu to do CSV…
|
||||||
|
|
||||||
|
.. csv-table:: Prerekvizity v jednotlivých distribucích
|
||||||
|
:header: Distribuce / OS, Repozitář s Py3.9, venv, py knihovny, PostgreSQL knihovna, poznámky
|
||||||
|
|
||||||
|
Ubuntu 22.10, ??, ``python3-venv``, ``python3-dev``, ``libpq-dev``, "Je potřeba zapnout zdroj ``universe`` a nainstalovat kompilátor C (``gcc``)?"
|
||||||
|
Linux Mint 21, ??, ``python3-venv``, ``python3-dev``, ``libpq-dev``, ""
|
||||||
|
Archlinux 2022.11.01, AUR, vestavěný, vestavěné, ``postgresql-libs``, "Je potřeba céčkový kompilátor (``gcc``)"
|
||||||
|
openSUSE Leap 15.4, oficiální (``python39``), předinstalovaný?, ``python39-devel``, ??FIXME!!, "Výchozí verze pythonu je 3.6 a ta je moc stará, potřeba instalovat ``gcc``. Nevím jak sehnat pg_config."
|
||||||
|
Debian 11, "oficiální, výchozí", ??, ??, ??, "Určitě to tam rozběhat jde, protože Gimli. Nejspíš bude relativně podobné Ubuntu."
|
||||||
|
|
|
@ -37,7 +37,7 @@ Kromě toho je potřeba mít účet na `Gitee <https://gitea.ks.matfyz.cz>`_, kd
|
||||||
bydlí gitový repozitář s kódem.
|
bydlí gitový repozitář s kódem.
|
||||||
|
|
||||||
.. tip:: Potřebné balíčky v různých distribucích jsou sepsané v :ref:`tabulce
|
.. tip:: Potřebné balíčky v různých distribucích jsou sepsané v :ref:`tabulce
|
||||||
prerekvizit <Alternativní jména balíčků>`.
|
prerekvizit <Tabulka prerekvizit v různých distribucích>`.
|
||||||
|
|
||||||
Doporučené
|
Doporučené
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
|
|
@ -116,7 +116,7 @@ Aktuálně: Jakýsi coding style zhruba existuje, není popsaný, šíří se li
|
||||||
- Nesmí být striktně vynucovaný
|
- Nesmí být striktně vynucovaný
|
||||||
- Musel by být hodně nastavitelný
|
- Musel by být hodně nastavitelný
|
||||||
- Nechceme mít kód plný `#NOQA: WTF42`
|
- Nechceme mít kód plný `#NOQA: WTF42`
|
||||||
- Nejspíš vždycky bude mít false positives (`tvorba.utils.roman_numerals`) i false negatives (`tvorba.models.Cislo.posli_cislo_mailem`)
|
- Nejspíš vždycky bude mít false positives (`seminar.utils.roman_numerals`) i false negatives (`seminar.models.tvorba.Cislo.posli_cislo_mailem`)
|
||||||
- Možná dobrý sluha, ale určitě špatný pán (also: špatná zkušenost ☺)
|
- Možná dobrý sluha, ale určitě špatný pán (also: špatná zkušenost ☺)
|
||||||
- __Důsledek:__ Hrozí, že těch falešných varování bude moc, čímž to ztratí smysl úplně
|
- __Důsledek:__ Hrozí, že těch falešných varování bude moc, čímž to ztratí smysl úplně
|
||||||
- Potenciálně by šlo aplikovat jen lokálně na změny?
|
- Potenciálně by šlo aplikovat jen lokálně na změny?
|
||||||
|
|
|
@ -1,97 +0,0 @@
|
||||||
Závislosti webu
|
|
||||||
@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
Web ke svému běhu potřebuje různé další programy. Tahle stránka se snaží je pokrýt.
|
|
||||||
|
|
||||||
Stránka je koncipována jako odrážkový seznam balíčků pro Ubuntu s případnými
|
|
||||||
komentáři, na konci stránky jsou uvedena :ref:`jména balíčků <Alternativní jména
|
|
||||||
balíčků>` v různých dalších distribucích. (Seznam mj. cílí na lokální
|
|
||||||
rozchození, proto popisuji Ubuntu a ne Debian. I tak se ale snažíme popsat web
|
|
||||||
v úplnosti.)
|
|
||||||
|
|
||||||
.. I use Arch, btw.
|
|
||||||
|
|
||||||
|
|
||||||
Základ webu
|
|
||||||
===========
|
|
||||||
|
|
||||||
- ``python3`` – Ideálně Python 3.9, jenž je na Gimlim
|
|
||||||
- ``python3-pip`` pro instalaci dalších Pythoních balíčků podle ``requirements.txt``
|
|
||||||
- ``python3-venv``
|
|
||||||
- ``gcc`` – kompilace Pythoních knihoven ze zdrojových distribucí (sdist), možná (neotestováno) jde jako alternativu použít ``python3-wheel`` a stahovat bdists
|
|
||||||
- ``python3-dev`` – taktéž
|
|
||||||
- ``libpq-dev`` do třetice…
|
|
||||||
- ``ghostscript`` TODO konverze PDF v korekturovátku
|
|
||||||
- ``pdflatex`` FIXME! generování obálek a stvrzenek
|
|
||||||
- ``git`` – používán :ref:`Make skripty`
|
|
||||||
- ``locales`` pro české formáty
|
|
||||||
|
|
||||||
Nasazení na produkci / testweb
|
|
||||||
==============================
|
|
||||||
|
|
||||||
(nejsou nutně potřeba k provozu lokální instance)
|
|
||||||
|
|
||||||
- ``rsync``
|
|
||||||
- ``pg_utils`` FIXME
|
|
||||||
- ``htpasswd`` FIXME – aby testweb nepoužívali náhodní kolemjdoucí
|
|
||||||
- ``postgresql-server`` TODO
|
|
||||||
- ``acl`` pro nastavování práv přes ``setfacl``
|
|
||||||
|
|
||||||
Pro testweb je potřeba i všechno pro :ref:`dokumentaci <Dokumentace>`, vizte níž.
|
|
||||||
|
|
||||||
Předpokládá se nasazení v uWSGI pod Nginxem a služba běžící pod systemd, nicméně to už je spíš záležitost infrastruktury a ne specifikum mamwebu.
|
|
||||||
|
|
||||||
Dokumentace
|
|
||||||
===========
|
|
||||||
|
|
||||||
- ``make`` pro zbuildění
|
|
||||||
- Pythoní balíčky podle příslušné části ``requirements.txt``
|
|
||||||
|
|
||||||
Vývojové nástroje
|
|
||||||
=================
|
|
||||||
|
|
||||||
(Nejsou nezbytně nutné, ale předpokládáme jejich užitečnost. Mohou se hodit i na produkci.)
|
|
||||||
|
|
||||||
- ``psql`` TODO pro manuální dotazy do PostgreSQL
|
|
||||||
- ``sqlite3`` TODO totéž pro SQLite3
|
|
||||||
- ``ssh``
|
|
||||||
- ``graphviz`` pro vygenerování schématu
|
|
||||||
- ``rsync``
|
|
||||||
- ``ipython3`` – hezčí interaktivní shell (stačí z ``requirements.txt``)
|
|
||||||
|
|
||||||
Potenciální usnadnění života
|
|
||||||
============================
|
|
||||||
|
|
||||||
(Úplně zbytečné, ale sdílíme pozitivní zkušenosti :-))
|
|
||||||
|
|
||||||
- ``tea`` – CLI klient pro Giteu, aby člověk nepotřeboval otevírat web pro založení PR
|
|
||||||
|
|
||||||
|
|
||||||
Alternativní jména balíčků
|
|
||||||
==========================
|
|
||||||
|
|
||||||
Různé distribuce balí SW různě, takže to, co je v jedné distribuci jeden
|
|
||||||
balíček může být v jiné rozděleno do víc. Pro usnadnění nasazení je tady
|
|
||||||
přehled známých alternativních jmen.
|
|
||||||
|
|
||||||
TODO: tabulka není úplná. Pokud na něco narazíte, tak ji prosím doplňte.
|
|
||||||
|
|
||||||
.. admonition:: Jak se pozná, že web funguje, pro účely tabulky?
|
|
||||||
|
|
||||||
Na čistém repozitáři (``git clean -fxd``) a čistém systému spouštíme
|
|
||||||
``make/init_local``. Když to spadne, tak do tabulky zapíšeme, co jsme
|
|
||||||
přiinstalovali. Protože nefunguje synchronizace flatpages (nemáme SSH klíč),
|
|
||||||
``make/init_local`` sestřelíme při pokusu o synchronizaci a vyzkoušíme, že
|
|
||||||
``make/test`` spustí testy.
|
|
||||||
|
|
||||||
.. Grafické tabulky (grid-tables, simple-tables) jsou strašný porod vyrábět, dlabu na to a cpu to do CSV…
|
|
||||||
|
|
||||||
.. csv-table:: Prerekvizity v jednotlivých distribucích
|
|
||||||
:header: Distribuce / OS, Repozitář s Py3.9, venv, py knihovny, PostgreSQL knihovna, poznámky
|
|
||||||
|
|
||||||
Ubuntu 22.10, ??, ``python3-venv``, ``python3-dev``, ``libpq-dev``, "Je potřeba zapnout zdroj ``universe`` a nainstalovat kompilátor C (``gcc``)?"
|
|
||||||
Linux Mint 21, ??, ``python3-venv``, ``python3-dev``, ``libpq-dev``, ""
|
|
||||||
Archlinux 2022.11.01, AUR, vestavěný, vestavěné, ``postgresql-libs``, "Je potřeba céčkový kompilátor (``gcc``)"
|
|
||||||
openSUSE Leap 15.4, oficiální (``python39``), předinstalovaný?, ``python39-devel``, ??FIXME!!, "Výchozí verze pythonu je 3.6 a ta je moc stará, potřeba instalovat ``gcc``. Nevím jak sehnat pg_config."
|
|
||||||
Debian 11, "oficiální, výchozí", ??, ??, ??, "Určitě to tam rozběhat jde, protože Gimli. Nejspíš bude relativně podobné Ubuntu."
|
|
||||||
|
|
|
@ -1,86 +0,0 @@
|
||||||
Zkratky aplikací ve zdrojácích
|
|
||||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
||||||
|
|
||||||
Ve zdrojácích (zejména různé ``models.py``, ``views.py`` ap.) používáme spoustu
|
|
||||||
modelů. Někdy je praktičtější / někdo preferuje importovat celou aplikaci jako
|
|
||||||
jedno jméno a používat modely bez explicitních importů, tj::
|
|
||||||
|
|
||||||
# „hromadné“ importy:
|
|
||||||
import personalni.models as p
|
|
||||||
...
|
|
||||||
p.Organizator.objects.all()
|
|
||||||
|
|
||||||
# „explicitní“ importy:
|
|
||||||
from personalni.models import Organizator
|
|
||||||
...
|
|
||||||
Organizator.objects.all()
|
|
||||||
|
|
||||||
Na webschůzce 2024-11-05 jsme na toto téma otevřeli diskusi, tady je její závěr.
|
|
||||||
|
|
||||||
.. admonition:: Historické okénko
|
|
||||||
:class: note
|
|
||||||
|
|
||||||
Kdysi jsme měli (prakticky) všechny modely v jedné aplikaci, ``seminar``. Na
|
|
||||||
různých místech se pak ``seminar.models`` importovalo typicky jako ``s``
|
|
||||||
nebo jako ``m``.
|
|
||||||
|
|
||||||
Přirozeně, toto už nejde tak snadno, protože už neexistuje jedno místo, ze
|
|
||||||
kterého chceme tahat modely v kódu.
|
|
||||||
|
|
||||||
Konvence
|
|
||||||
========
|
|
||||||
|
|
||||||
Shodli jsme se, že nám rozhodně nevadí explicitní importy a z pohledu
|
|
||||||
čitelnosti je preferujeme. Nicméně při psaní kódu to některým webařům přijde
|
|
||||||
nepohodlné, takže očekáváme, že bude existovat spousta kódu, která bude chtít
|
|
||||||
importovat hromadně. Usnesli jsme se proto na následujících kanonických
|
|
||||||
zkratkách, aby se aplikace alespoň zkracovaly konzistentně.
|
|
||||||
|
|
||||||
V závorkách je uvedené případné jméno, ale nepředpokládáme, že někdo bude danou
|
|
||||||
aplikaci chtít importovat hromadně. Některé aplikace zkratku nemají, ty se
|
|
||||||
importují vždy pod plným jménem nebo explicitně.
|
|
||||||
|
|
||||||
.. list-table::
|
|
||||||
:header-rows: 1
|
|
||||||
|
|
||||||
* - Model
|
|
||||||
- Zkratka
|
|
||||||
* - ``aesop``
|
|
||||||
- ---
|
|
||||||
* - ``api``
|
|
||||||
- --- (``api``)
|
|
||||||
* - ``galerie``
|
|
||||||
- ``g``
|
|
||||||
* - ``header_fotky``
|
|
||||||
- --- (``hdr``)
|
|
||||||
* - ``korektury``
|
|
||||||
- ``kor``
|
|
||||||
* - ``novinky``
|
|
||||||
- ``nov``
|
|
||||||
* - ``odevzdavatko``
|
|
||||||
- ``odev``
|
|
||||||
* - ``personální``
|
|
||||||
- ``pers``/``p``
|
|
||||||
* - ``sifrovacka``
|
|
||||||
- (``sifr``)
|
|
||||||
* - ``soustredeni``
|
|
||||||
- ``sou``
|
|
||||||
* - ``treenode``
|
|
||||||
- ``tn``
|
|
||||||
* - ``tvorba``
|
|
||||||
- ``tv``
|
|
||||||
* - ``various``
|
|
||||||
- ``v``/``var``
|
|
||||||
* - ``vyroci``
|
|
||||||
- ---
|
|
||||||
* - ``vysledkovky``
|
|
||||||
- ``vysl``
|
|
||||||
|
|
||||||
|
|
||||||
.. admonition:: O všech modelech pod jedním jménem
|
|
||||||
:class: warning
|
|
||||||
|
|
||||||
Historické okénko výš zatajuje jeden detail: Při práci v shellu se hodí mít
|
|
||||||
modely k dispozici a nemuset přemýšlet nad dělením do aplikací, takže ve
|
|
||||||
skutečnosti existuje ``mamweb.vsechno``, jenž všechny modely obsahuje.
|
|
||||||
Z čitelnostních důvodů je ale *zakázáno* tento modul používat v kódu.
|
|
25
galerie/TODO
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
========
|
||||||
|
| TODO |
|
||||||
|
|======|
|
||||||
|
|
||||||
|
Aktualni
|
||||||
|
* co s titulni fotkou
|
||||||
|
* do CSS
|
||||||
|
* nahledy
|
||||||
|
* nastylovat tabulku s nahledy
|
||||||
|
* komentare uz na nahledy?
|
||||||
|
* detail
|
||||||
|
* nahledy pred a po
|
||||||
|
* opravit prechodove sipky
|
||||||
|
* vyrobit prechodove sipky ve M&M-stylu
|
||||||
|
|
||||||
|
Dlouhodobe
|
||||||
|
* sipky na prechazeni mezi fotkami
|
||||||
|
* hromadne PRIDANI fotek do jiz existujici galerie
|
||||||
|
|
||||||
|
Fylozoficke
|
||||||
|
* zvolit velikosti velke a male fotky
|
||||||
|
* je potreba i jine razeni nez automaticky podle casu nebo staci podgalerie?
|
||||||
|
* napr. dve hry na dvou ruznych mistech ve stejny cas
|
||||||
|
* fotky od ucastniku ze hry (skupinky se pohybuji ve stejny cas, ale maji sled fotek) -- nestaci to pripadne vrazit do podgalerii?
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#coding: utf-8
|
||||||
|
|
||||||
from galerie.models import Obrazek, Galerie
|
from galerie.models import Obrazek, Galerie
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
|
|
47
galerie/autocomplete_light_registry.py.old
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from autocomplete_light import shortcuts as autocomplete_light
|
||||||
|
|
||||||
|
from .models import Obrazek, Galerie
|
||||||
|
from .views import cesta_od_korene
|
||||||
|
|
||||||
|
|
||||||
|
class ObrazekAutocomplete(autocomplete_light.AutocompleteModelBase):
|
||||||
|
|
||||||
|
model = Obrazek
|
||||||
|
search_fields = ['nazev', 'popis']
|
||||||
|
split_words = True
|
||||||
|
limit_choices = 15
|
||||||
|
attrs = {
|
||||||
|
# This will set the input placeholder attribute:
|
||||||
|
'placeholder': u'Obrázek',
|
||||||
|
# This will set the yourlabs.Autocomplete.minimumCharacters
|
||||||
|
# options, the naming conversion is handled by jQuery
|
||||||
|
'data-autocomplete-minimum-characters': 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
choice_html_format = '''
|
||||||
|
<span class="block" data-value="{}">
|
||||||
|
<span class="block">
|
||||||
|
{}
|
||||||
|
<span class="block">{}</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
'''
|
||||||
|
|
||||||
|
def choice_label(self, obrazek):
|
||||||
|
cesta = "/".join(g.nazev for g in cesta_od_korene(obrazek.galerie))
|
||||||
|
popis = "{}<br>".format(obrazek.popis) if obrazek.popis else ""
|
||||||
|
return '{}<br>{}{}'.format(obrazek.nazev, popis, cesta)
|
||||||
|
|
||||||
|
def choice_html(self, obrazek):
|
||||||
|
"""Vrátí kus html i s obrázkem, které se pak ukazuje v nabídce"""
|
||||||
|
return self.choice_html_format.format(self.choice_value(obrazek),
|
||||||
|
obrazek.obrazek_maly_tag(), self.choice_label(obrazek))
|
||||||
|
|
||||||
|
widget_attrs={
|
||||||
|
'data-widget-maximum-values': 15,
|
||||||
|
'class': 'modern-style',
|
||||||
|
}
|
||||||
|
|
||||||
|
autocomplete_light.register(ObrazekAutocomplete)
|
|
@ -1,4 +1,7 @@
|
||||||
|
#coding: utf-8
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
|
from seminar.models import Soustredeni
|
||||||
|
|
||||||
class KomentarForm(forms.Form):
|
class KomentarForm(forms.Form):
|
||||||
komentar = forms.CharField(label = "Komentář:", max_length = 300, required=False)
|
komentar = forms.CharField(label = "Komentář:", max_length = 300, required=False)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by Django 1.11.20 on 2019-04-30 21:40
|
# Generated by Django 1.11.20 on 2019-04-30 21:40
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by Django 1.11.21 on 2019-06-10 21:58
|
# Generated by Django 1.11.21 on 2019-06-10 21:58
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
# Generated by Django 4.2.11 on 2024-04-30 21:53
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('galerie', '0010_auto_20200819_0947'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
]
|
|
|
@ -1,20 +0,0 @@
|
||||||
# Generated by Django 4.2.11 on 2024-05-01 13:07
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('soustredeni', '0001_split_from_seminar'),
|
|
||||||
('galerie', '0011_pre_split_soustredeni'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='galerie',
|
|
||||||
name='soustredeni',
|
|
||||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='soustredeni.soustredeni'),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,14 +0,0 @@
|
||||||
# Generated by Django 4.2.11 on 2024-05-01 13:35
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('galerie', '0012_soustredeni_relink'),
|
|
||||||
('soustredeni', '0003_post_split_soustredeni'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
]
|
|
|
@ -1,11 +1,14 @@
|
||||||
|
# coding: utf-8
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
#from django.db.models import Q
|
#from django.db.models import Q
|
||||||
|
from django.utils.encoding import force_text
|
||||||
from imagekit.models import ImageSpecField
|
from imagekit.models import ImageSpecField
|
||||||
from imagekit.processors import ResizeToFit, Transpose
|
from imagekit.processors import ResizeToFit, Transpose
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from soustredeni.models import Soustredeni
|
from seminar.models import Soustredeni
|
||||||
|
|
||||||
VZDY=0
|
VZDY=0
|
||||||
ORG=1
|
ORG=1
|
||||||
|
|
|
@ -1,186 +0,0 @@
|
||||||
@charset "utf-8"; /* vynuť utf-8 */
|
|
||||||
|
|
||||||
/* Galerie */
|
|
||||||
|
|
||||||
|
|
||||||
/* velká fotka */
|
|
||||||
/* zmenšování spolu s oknem prohlížeče */
|
|
||||||
.galerie .obrazek, .titulni_obrazek {
|
|
||||||
max-width: 100%;
|
|
||||||
height: auto;
|
|
||||||
width: auto\9; /* ie8 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.predchozi_obrazek{
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1;
|
|
||||||
width: 33%;
|
|
||||||
height: 100%;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
.predchozi_obrazek:hover{
|
|
||||||
background-image: url("/static/galerie/prvky/predchozi.svg");
|
|
||||||
filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.4));
|
|
||||||
background-position: left center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
.dalsi_obrazek{
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1;
|
|
||||||
width: 33%;
|
|
||||||
height: 100%;
|
|
||||||
left: 67%;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
.dalsi_obrazek:hover{
|
|
||||||
background-image: url("/static/galerie/prvky/dalsi.svg");
|
|
||||||
filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.4));
|
|
||||||
background-position: right center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie {
|
|
||||||
position: relative;
|
|
||||||
text-align: center;
|
|
||||||
margin: 20px auto 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie h1 {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie_hlavicka {
|
|
||||||
margin: 30px auto 30px auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popis {
|
|
||||||
margin: 10px 10px 30px 0px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nahoru {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* titulní obrázek hlavní galerie soustředění */
|
|
||||||
|
|
||||||
.galerie_nahledy{
|
|
||||||
/*margin: 1em 0;*/
|
|
||||||
margin: auto;
|
|
||||||
padding: 10px;
|
|
||||||
text-align: center;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie_nahledy img {
|
|
||||||
margin: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie_nahledy div.navigace {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie_nahled, .podgalerie_nahled { /* frame */
|
|
||||||
display: block;
|
|
||||||
position: relative;
|
|
||||||
float: left;
|
|
||||||
width: 200px;
|
|
||||||
height: 200px;
|
|
||||||
text-align: center;
|
|
||||||
border: solid;
|
|
||||||
border-width: 1px;
|
|
||||||
border-radius: 4px;
|
|
||||||
border-color: var(--svetla-oranzova);
|
|
||||||
background-color: var(--barva-pozadi);
|
|
||||||
white-space: nowrap;
|
|
||||||
margin: 10px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie_nahled:hover, .podgalerie_nahled:hover {
|
|
||||||
background-color: var(--svetla-oranzova);
|
|
||||||
filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.4));
|
|
||||||
color: var(--tmava-oranzova);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vystredeno{ /* helper */
|
|
||||||
display: inline-block;
|
|
||||||
height: 100%;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie_nahled img {
|
|
||||||
vertical-align: middle;
|
|
||||||
max-height: 180px;
|
|
||||||
max-width: 180px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie_nahled div {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0px;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.podgalerie_nahled img {
|
|
||||||
margin-top: 20px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
max-height: 125px;
|
|
||||||
max-width: 167px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.podgalerie_nahled .nazev_galerie {
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
top: 160px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Odkazy na předchozí a následující podgalerii */
|
|
||||||
.galerie_predchozi_nasledujici {
|
|
||||||
overflow: auto;
|
|
||||||
margin: 10px auto 10px auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie_predchozi_nasledujici .predchozi {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.galerie_predchozi_nasledujici .nasledujici {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* posune kotvu obrázku v galerii o oranžový pruh dolu, aby se pod ním obrázek neschovával */
|
|
||||||
/* https://stackoverflow.com/questions/10732690/offsetting-an-html-anchor-to-adjust-for-fixed-header */
|
|
||||||
.kotva_obrazku {
|
|
||||||
position: absolute;
|
|
||||||
width: 0;
|
|
||||||
height: 55px; /* viz #title */
|
|
||||||
margin-top: -55px; /* viz #title */
|
|
||||||
}
|
|
||||||
@media(max-width: 860px) {
|
|
||||||
.kotva_obrazku {
|
|
||||||
height: 3em; /* #FIXME nemám páru, jak zjistit výšku toho elementu */
|
|
||||||
margin-top: -3em; /* #FIXME */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* plus a minus tlacitka */
|
|
||||||
.mam-org-only-galerie {
|
|
||||||
background: var(--orgovska-svetla-fialova);
|
|
||||||
padding: 10px;
|
|
||||||
margin: 10px 10px 10px -20px;
|
|
||||||
border: #333 2px dashed;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mam-org-only-galerie a{
|
|
||||||
padding: 3px 5px;
|
|
||||||
margin: 5px;
|
|
||||||
border-radius: 20px;
|
|
||||||
background-color: var(--tmava-oranzova);;
|
|
||||||
color: var(--barva-pozadi);
|
|
||||||
float: left;
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "galerie/base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
|
||||||
{% block nadpis1a %}
|
{% block nadpis1a %}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "galerie/base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block nadpis1a %}
|
{% block nadpis1a %}
|
||||||
Galerie {{galerie.nazev}}
|
Galerie {{galerie.nazev}}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "galerie/base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{% extends "base.html" %}
|
|
||||||
{% load static %}
|
|
||||||
|
|
||||||
{% block custom_css %}
|
|
||||||
<link href="{% static 'css/galerie.css' %}?version=1" rel="stylesheet">
|
|
||||||
{% endblock %}
|
|
|
@ -1,5 +1,14 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují:
|
||||||
|
|
||||||
|
- ``<int:pk>/`` :func:`~galerie.views.nahled`
|
||||||
|
- ``<int:pk>/<int:fotka>/`` :func:`~galerie.views.detail`
|
||||||
|
- ``<int:galerie>/new/`` :func:`~galerie.views.new_galerie`
|
||||||
|
- ``<int:galerie>/plus/<int:subgalerie>/`` :func:`~galerie.views.plus_galerie`
|
||||||
|
- ``<int:galerie>/minus/<int:subgalerie>/`` :func:`~galerie.views.minus_galerie`
|
||||||
|
"""
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
from personalni.utils import org_required
|
from seminar.utils import org_required
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# coding: utf-8
|
||||||
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from django.http import HttpResponse, Http404
|
from django.http import HttpResponse, Http404
|
||||||
|
@ -6,7 +8,7 @@ from django.template import RequestContext
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from galerie.models import Obrazek, Galerie
|
from galerie.models import Obrazek, Galerie
|
||||||
from soustredeni.models import Soustredeni
|
from seminar.models import Soustredeni
|
||||||
from galerie.forms import KomentarForm, NewGalerieForm
|
from galerie.forms import KomentarForm, NewGalerieForm
|
||||||
|
|
||||||
def zobrazit(galerie, request):
|
def zobrazit(galerie, request):
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící k definici toho, co bude v adminu. Většinou pouhým zavoláním
|
||||||
|
funkce :func:`django.contrib.admin.site.register`, v případě, že chceme něco
|
||||||
|
upravit, tak jako třída rozšiřující :class:`django.contrib.admin.ModelAdmin`
|
||||||
|
s dekorátorem :func:`django.contrib.admin.register`.
|
||||||
|
|
||||||
|
Zde se definuje admin pro:
|
||||||
|
|
||||||
|
- :class:`~header_fotky.models.FotkaHeader`
|
||||||
|
- :class:`~header_fotky.models.FotkaUrlVazba`
|
||||||
|
"""
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.contrib.admin import ModelAdmin
|
from django.contrib.admin import ModelAdmin
|
||||||
import header_fotky.models as m
|
import header_fotky.models as m
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace.
|
||||||
|
"""
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class HeaderFotkyConfig(AppConfig):
|
class HeaderFotkyConfig(AppConfig):
|
||||||
name = 'header_fotky'
|
name = 'header_fotky'
|
||||||
verbose_name = 'Fotky v záhlaví'
|
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
"""
|
||||||
|
Tento soubor slouží k definici databázového modelu.
|
||||||
|
|
||||||
|
Třídy rozšiřují většinou :class:`django.db.models.Model` a jejich atributy jsou
|
||||||
|
většinou sloupce v databázi (tj. nastaví se na hodnotu něčeho z :mod:`django.db.models`).
|
||||||
|
Na výběr jsou:
|
||||||
|
|
||||||
|
- :class:`django.db.models.TextField`
|
||||||
|
- :class:`django.db.models.ForeignKey`
|
||||||
|
- :class:`django.db.models.DateField`
|
||||||
|
- :class:`django.db.models.DateTimeField`
|
||||||
|
- :class:`django.db.models.ImageField`
|
||||||
|
- :class:`django.db.models.CharField`
|
||||||
|
"""
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
FIXME přepsat do rst, přidat i další věci a případně přesunout na wiki
|
|
||||||
Přidání obrázků do odměn:
|
Přidání obrázků do odměn:
|
||||||
admin -> flatpage odměn -> ikona přidat obrázek
|
admin -> flatpage odměn -> ikona přidat obrázek
|
||||||
záložka odeslat, vybrat obrázek, odeslat
|
záložka odeslat, vybrat obrázek, odeslat
|
11
korektury/TODO
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
- korektura potrebuje reakci
|
||||||
|
+ komentáře fixně na username
|
||||||
|
- používat skutečné jméno?
|
||||||
|
- vyžádat pozornost autora obsahu
|
||||||
|
- zvednout upload limit na 5MB
|
||||||
|
- sbalit a rozbalit korekturu
|
||||||
|
- nahrávání jiných věcí než PDF - kontrolovat?
|
||||||
|
- stylování
|
||||||
|
- seznam PDF - co zobrazovat?
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící k definici toho, co bude v adminu. Většinou pouhým zavoláním
|
||||||
|
funkce :func:`django.contrib.admin.site.register`, v případě, že chceme něco
|
||||||
|
upravit, tak jako třída rozšiřující :class:`django.contrib.admin.ModelAdmin`
|
||||||
|
s dekorátorem :func:`django.contrib.admin.register`.
|
||||||
|
|
||||||
|
Zde se definuje admin pro:
|
||||||
|
|
||||||
|
- :class:`korektury.models.KorekturovanePDF`
|
||||||
|
"""
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from reversion.admin import VersionAdmin
|
from reversion.admin import VersionAdmin
|
||||||
from korektury.models import KorekturovanePDF
|
from korektury.models import KorekturovanePDF
|
||||||
|
@ -5,6 +15,7 @@ from korektury.models import KorekturovanePDF
|
||||||
from django.core.mail import EmailMessage
|
from django.core.mail import EmailMessage
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
class KorekturovanePDFAdmin(VersionAdmin):
|
class KorekturovanePDFAdmin(VersionAdmin):
|
||||||
"""
|
"""
|
||||||
nastaví čas vložení (:attr:`~koretkury.models.KorekturovanePDF.cas`) a počet
|
nastaví čas vložení (:attr:`~koretkury.models.KorekturovanePDF.cas`) a počet
|
||||||
|
@ -25,13 +36,12 @@ class KorekturovanePDFAdmin(VersionAdmin):
|
||||||
fieldsets = [
|
fieldsets = [
|
||||||
(None,
|
(None,
|
||||||
{'fields':
|
{'fields':
|
||||||
['pdf', 'cas', 'stran', 'nazev', 'orgove', 'komentar', 'poslat_mail']}),
|
['pdf', 'cas', 'org', 'stran', 'nazev', 'komentar', 'poslat_mail']}),
|
||||||
# (u'PDF', {'fields': ['pdf']}),
|
# (u'PDF', {'fields': ['pdf']}),
|
||||||
]
|
]
|
||||||
list_display = ['nazev', 'cas', 'stran']
|
list_display = ['nazev', 'cas', 'stran', 'org']
|
||||||
list_filter = []
|
list_filter = []
|
||||||
search_fields = []
|
search_fields = []
|
||||||
autocomplete_fields = ['orgove']
|
|
||||||
|
|
||||||
def save_model(self, request, obj, form, change):
|
def save_model(self, request, obj, form, change):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
"""
|
||||||
|
Formuláře (:class:`django.forms.Form`) umožňují jednoduchou tvorbu formulářů,
|
||||||
|
které lze pak jednoduše dát do frontendu i zpracovat na backendu.
|
||||||
|
|
||||||
|
Pro přidání políčka do formuláře je potřeba
|
||||||
|
- mít v modelu tu položku, kterou chci upravovat
|
||||||
|
- přidat do views (prihlaskaView, resitelEditView)
|
||||||
|
- přidat do forms
|
||||||
|
- includovat do html
|
||||||
|
"""
|
||||||
from django import forms
|
from django import forms
|
||||||
|
|
||||||
class OpravaForm(forms.Form):
|
class OpravaForm(forms.Form):
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by Django 1.11.20 on 2019-04-30 21:40
|
# Generated by Django 1.11.20 on 2019-04-30 21:40
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by Django 1.11.21 on 2019-06-10 21:58
|
# Generated by Django 1.11.21 on 2019-06-10 21:58
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
# Generated by Django 4.2.8 on 2024-03-12 20:24
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('korektury', '0020_lepsi_popis_nazvu_PDF_v_adminu'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
]
|
|
|
@ -1,30 +0,0 @@
|
||||||
# Generated by Django 4.2.11 on 2024-03-19 21:35
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('personalni', '0003_initial'),
|
|
||||||
('korektury', '0021_auto_20240312_2124'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='komentar',
|
|
||||||
name='autor',
|
|
||||||
field=models.ForeignKey(blank=True, help_text='Autor komentáře', null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.organizator'),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='korekturovanepdf',
|
|
||||||
name='org',
|
|
||||||
field=models.ForeignKey(blank=True, default=None, help_text='Zodpovědný organizátor za obsah', null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.organizator'),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='oprava',
|
|
||||||
name='autor',
|
|
||||||
field=models.ForeignKey(blank=True, help_text='Autor opravy', null=True, on_delete=django.db.models.deletion.SET_NULL, to='personalni.organizator'),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,14 +0,0 @@
|
||||||
# Generated by Django 4.2.11 on 2024-03-26 21:25
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('korektury', '0022_alter_komentar_autor_alter_korekturovanepdf_org_and_more'),
|
|
||||||
('personalni', '0005_personalni_post_migrate'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
]
|
|
|
@ -1,41 +0,0 @@
|
||||||
# Generated by Django 4.2.13 on 2024-06-11 23:53
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
def pridej_orgy(apps, schema_editor):
|
|
||||||
PDF = apps.get_model('korektury', 'KorekturovanePDF')
|
|
||||||
for pdf in PDF.objects.all(): # Tohle by asi mělo jít udělat pomocí update, ale moc práce a rychlé hledání taky nepomohlo.
|
|
||||||
if pdf.org is not None: pdf.orgove.add(pdf.org)
|
|
||||||
pdf.save() # ig?
|
|
||||||
|
|
||||||
def vyber_orga(apps, schema_editor):
|
|
||||||
PDF = apps.get_model('korektury', 'KorekturovanePDF')
|
|
||||||
for pdf in PDF.objects.all():
|
|
||||||
orgove = pdf.orgove.all()
|
|
||||||
if len(orgove) > 1:
|
|
||||||
raise migrations.exceptions.IrreversibleError(f'PDF {pdf.id} má víc než jednoho zodpovědného orga, nejde odmigrovat na verzi, která umí jen jednoho.')
|
|
||||||
if len(orgove) == 0:
|
|
||||||
pdf.org = None
|
|
||||||
else:
|
|
||||||
pdf.org = orgove[0]
|
|
||||||
pdf.save()
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('personalni', '0011_osloveni_vsechny_choices'),
|
|
||||||
('korektury', '0023_personalni_post_migrate'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='korekturovanepdf',
|
|
||||||
name='orgove',
|
|
||||||
field=models.ManyToManyField(blank=True, default=None, help_text='Zodpovědní organizátoři za obsah (chodí jim maily o nových korekturách)', to='personalni.organizator'),
|
|
||||||
),
|
|
||||||
migrations.RunPython(pridej_orgy, vyber_orga),
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name='korekturovanepdf',
|
|
||||||
name='org',
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,13 +1,27 @@
|
||||||
|
"""
|
||||||
|
Tento soubor slouží k definici databázového modelu.
|
||||||
|
|
||||||
|
Třídy rozšiřují většinou :class:`django.db.models.Model` a jejich atributy jsou
|
||||||
|
většinou sloupce v databázi (tj. nastaví se na hodnotu něčeho z :mod:`django.db.models`).
|
||||||
|
Na výběr jsou:
|
||||||
|
|
||||||
|
- :class:`django.db.models.TextField`
|
||||||
|
- :class:`django.db.models.ForeignKey`
|
||||||
|
- :class:`django.db.models.DateField`
|
||||||
|
- :class:`django.db.models.DateTimeField`
|
||||||
|
- :class:`django.db.models.ImageField`
|
||||||
|
- :class:`django.db.models.CharField`
|
||||||
|
"""
|
||||||
import os
|
import os
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.urls import reverse
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.utils.encoding import force_text
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
from django.utils.text import get_valid_filename
|
from django.utils.text import get_valid_filename
|
||||||
|
|
||||||
from personalni.models import Organizator
|
from seminar.models import Organizator
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
from reversion import revisions as reversion
|
from reversion import revisions as reversion
|
||||||
|
@ -27,6 +41,7 @@ def generate_filename(self, filename):
|
||||||
clean)
|
clean)
|
||||||
return os.path.join(settings.KOREKTURY_PDF_DIR, fname)
|
return os.path.join(settings.KOREKTURY_PDF_DIR, fname)
|
||||||
|
|
||||||
|
|
||||||
#@reversion.register(ignore_duplicates=True)
|
#@reversion.register(ignore_duplicates=True)
|
||||||
class KorekturovanePDF(models.Model):
|
class KorekturovanePDF(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -46,9 +61,9 @@ class KorekturovanePDF(models.Model):
|
||||||
|
|
||||||
pdf = models.FileField(u'PDF', upload_to = generate_filename)
|
pdf = models.FileField(u'PDF', upload_to = generate_filename)
|
||||||
|
|
||||||
orgove = models.ManyToManyField(Organizator, blank=True,
|
org = models.ForeignKey(Organizator, blank=True,
|
||||||
help_text='Zodpovědní organizátoři za obsah (chodí jim maily o nových korekturách)',
|
help_text='Zodpovědný organizátor za obsah',
|
||||||
default=None)
|
null=True, default=None, on_delete=models.SET_NULL)
|
||||||
|
|
||||||
stran = models.IntegerField(u'počet stran', help_text='Počet stran PDF',
|
stran = models.IntegerField(u'počet stran', help_text='Počet stran PDF',
|
||||||
default=0)
|
default=0)
|
||||||
|
@ -130,9 +145,6 @@ class KorekturovanePDF(models.Model):
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return self.nazev
|
return self.nazev
|
||||||
|
|
||||||
def get_absolute_url(self):
|
|
||||||
return reverse('korektury', kwargs={'pdf': self.id})
|
|
||||||
|
|
||||||
|
|
||||||
@reversion.register(ignore_duplicates=True)
|
@reversion.register(ignore_duplicates=True)
|
||||||
class Oprava(models.Model):
|
class Oprava(models.Model):
|
||||||
|
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 697 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 702 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 617 B |
3
korektury/tests.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
|
@ -35,27 +35,24 @@ def create_test_pdf(rnd, organizatori):
|
||||||
|
|
||||||
# TODO silent ghostscript (vypisuje odstavec za každou stránku…)
|
# TODO silent ghostscript (vypisuje odstavec za každou stránku…)
|
||||||
|
|
||||||
korekturovane_pdf = KorekturovanePDF.objects.create(
|
KorekturovanePDF.objects.create(
|
||||||
nazev='B', komentar='Neuronové sítě', pdf=gen_filename(filename='B.pdf')
|
nazev='B', komentar='Neuronové sítě', org=rnd.choice(organizatori), pdf=gen_filename(filename='B.pdf')
|
||||||
)
|
)
|
||||||
korekturovane_pdf.orgove.set((rnd.choice(organizatori),))
|
|
||||||
|
|
||||||
korekturovane_pdf = KorekturovanePDF.objects.create(
|
|
||||||
nazev='A', komentar='M&M: Jak řešit?', pdf=gen_filename(filename='A.pdf')
|
|
||||||
)
|
|
||||||
korekturovane_pdf.orgove.set(rnd.sample(organizatori, 2))
|
|
||||||
|
|
||||||
KorekturovanePDF.objects.create(
|
KorekturovanePDF.objects.create(
|
||||||
nazev='A', komentar='M&M: Jak řešit?', pdf=gen_filename(filename='A.pdf'),
|
nazev='A', komentar='M&M: Jak řešit?', org=rnd.choice(organizatori), pdf=gen_filename(filename='A.pdf')
|
||||||
|
)
|
||||||
|
|
||||||
|
korekturovane_pdf = KorekturovanePDF.objects.create(
|
||||||
|
nazev='A', komentar='M&M: Jak řešit?', org=rnd.choice(organizatori), pdf=gen_filename(filename='A.pdf'),
|
||||||
status='zanaseni'
|
status='zanaseni'
|
||||||
)
|
)
|
||||||
|
|
||||||
korekturovane_pdf = KorekturovanePDF.objects.create(
|
KorekturovanePDF.objects.create(
|
||||||
nazev='A', komentar='M&M: Jak řešit?', pdf=gen_filename(filename='A.pdf'),
|
nazev='A', komentar='M&M: Jak řešit?', org=rnd.choice(organizatori), pdf=gen_filename(filename='A.pdf'),
|
||||||
status='zastarale'
|
status='zastarale'
|
||||||
)
|
)
|
||||||
korekturovane_pdf.orgove.set((rnd.choice(organizatori),))
|
except (FileNotFoundError, Exception) as e:
|
||||||
except OSError as e:
|
|
||||||
# TODO najít správné chyby, které vyhazují různé systémy při neexistenci ImageMagick, nebo knihoven
|
# TODO najít správné chyby, které vyhazují různé systémy při neexistenci ImageMagick, nebo knihoven
|
||||||
logger.error(str(e))
|
logger.error(str(e))
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují:
|
||||||
|
|
||||||
|
- ``korektury/`` (korektury_list) :class:`~korektury.views.KorekturySeskupeneListView`
|
||||||
|
- ``korektury/neseskupene/`` (korektury_neseskupene_list) :class:`~korektury.views.KorekturyAktualniListView`
|
||||||
|
- ``korektury/zastarale/`` (korektury_stare_list) :class:`~korektury.views.KorekturyZastaraleListView`
|
||||||
|
- ``korektury/<int:pdf>/`` (korektury) :class:`~korektury.views.KorekturyView`
|
||||||
|
"""
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
from personalni.utils import org_required
|
from seminar.utils import org_required
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
|
"""
|
||||||
|
Soubor sloužící k deklaraci jednotlivých „views“ (nejčastěji funkce beroucí request
|
||||||
|
a vracející :func:`django.shortcuts.render` respektive nějakou response, nebo
|
||||||
|
třídy většinou rozšiřující nějakou třídu z :mod:`django.views.generic`)
|
||||||
|
"""
|
||||||
from django.shortcuts import get_object_or_404, render
|
from django.shortcuts import get_object_or_404, render
|
||||||
from django.views import generic
|
from django.views import generic
|
||||||
|
from django.utils.translation import ugettext as _
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.http import HttpResponseForbidden
|
from django.http import HttpResponseForbidden
|
||||||
from django.core.mail import EmailMessage
|
from django.core.mail import EmailMessage
|
||||||
|
@ -183,9 +189,9 @@ class KorekturyView(generic.TemplateView):
|
||||||
if email_komentujiciho:
|
if email_komentujiciho:
|
||||||
emails.add(email_komentujiciho)
|
emails.add(email_komentujiciho)
|
||||||
|
|
||||||
# zodpovedni orgove
|
# zodpovedny org
|
||||||
for org in oprava.pdf.orgove.all():
|
if oprava.pdf.org:
|
||||||
email_zobpovedny = org.osoba.email
|
email_zobpovedny = oprava.pdf.org.osoba.email
|
||||||
if email_zobpovedny:
|
if email_zobpovedny:
|
||||||
emails.add(email_zobpovedny)
|
emails.add(email_zobpovedny)
|
||||||
|
|
||||||
|
@ -194,6 +200,13 @@ class KorekturyView(generic.TemplateView):
|
||||||
if email:
|
if email:
|
||||||
emails.discard(email)
|
emails.discard(email)
|
||||||
|
|
||||||
|
if not settings.POSLI_MAILOVOU_NOTIFIKACI:
|
||||||
|
print("Poslal bych upozornění na tyto adresy: ", " ".join(emails))
|
||||||
|
print("---- Upozornění:")
|
||||||
|
print(text)
|
||||||
|
print("---- Konec upozornění")
|
||||||
|
return
|
||||||
|
|
||||||
EmailMessage(
|
EmailMessage(
|
||||||
subject=subject,
|
subject=subject,
|
||||||
body=text,
|
body=text,
|
||||||
|
|
|
@ -7,4 +7,5 @@ make/install_web
|
||||||
ensure_venv
|
ensure_venv
|
||||||
./manage.py testdata
|
./manage.py testdata
|
||||||
./manage.py loaddata data/*
|
./manage.py loaddata data/*
|
||||||
#make/sync_prod_flatpages
|
make/sync_prod_flatpages
|
||||||
|
./manage.py load_org_permissions deploy_v2/admin_org_prava.json
|
||||||
|
|
|
@ -95,7 +95,7 @@ function safe_checkout_branch {
|
||||||
echo >&2 "Změna v $SCRIPT, prosím pullni manuálně"
|
echo >&2 "Změna v $SCRIPT, prosím pullni manuálně"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
git checkout "$BRANCH" --
|
git checkout "$BRANCH"
|
||||||
git pull
|
git pull
|
||||||
git clean -f
|
git clean -f
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ set -exuo pipefail
|
||||||
. make/lib.sh
|
. make/lib.sh
|
||||||
|
|
||||||
scp vue_frontend/webpack-stats.json "$GIMLI_LOGIN:$TESTWEB/vue_frontend/"
|
scp vue_frontend/webpack-stats.json "$GIMLI_LOGIN:$TESTWEB/vue_frontend/"
|
||||||
rsync -ave ssh treenode/static/treenode/vue "$GIMLI_LOGIN:$TESTWEB/treenode/static/treenode/"
|
rsync -ave ssh seminar/static/seminar/vue "$GIMLI_LOGIN:$TESTWEB/seminar/static/seminar/"
|
||||||
ssh "$GIMLI_LOGIN" "
|
ssh "$GIMLI_LOGIN" "
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
cd $TESTWEB
|
cd $TESTWEB
|
||||||
|
|
|
@ -5,4 +5,5 @@ set -exuo pipefail
|
||||||
|
|
||||||
ensure_web_installed
|
ensure_web_installed
|
||||||
|
|
||||||
|
./manage.py graph_models seminar | dot -Tpdf > schema_seminar.pdf
|
||||||
./manage.py graph_models -a -g | dot -Tpdf > schema_all.pdf
|
./manage.py graph_models -a -g | dot -Tpdf > schema_all.pdf
|
||||||
|
|
|
@ -7,18 +7,17 @@ import locale
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.contrib.admin import AdminSite
|
from django.contrib.admin import AdminSite
|
||||||
from django.contrib.flatpages.models import FlatPage
|
from django.contrib.flatpages.models import FlatPage
|
||||||
import logging
|
|
||||||
|
|
||||||
# Note: we are renaming the original Admin and Form as we import them!
|
# Note: we are renaming the original Admin and Form as we import them!
|
||||||
from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld
|
from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld
|
||||||
from django.contrib.flatpages.admin import FlatpageForm as FlatpageFormOld
|
from django.contrib.flatpages.admin import FlatpageForm as FlatpageFormOld
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django_ckeditor_5.widgets import CKEditor5Widget
|
from ckeditor_uploader.widgets import CKEditorUploadingWidget
|
||||||
|
|
||||||
|
|
||||||
class FlatpageForm(FlatpageFormOld):
|
class FlatpageForm(FlatpageFormOld):
|
||||||
content = forms.CharField(widget=CKEditor5Widget())
|
content = forms.CharField(widget=CKEditorUploadingWidget())
|
||||||
class Meta:
|
class Meta:
|
||||||
model = FlatPage # this is not automatically inherited from FlatpageFormOld
|
model = FlatPage # this is not automatically inherited from FlatpageFormOld
|
||||||
exclude = []
|
exclude = []
|
||||||
|
@ -36,34 +35,19 @@ locale.setlocale(locale.LC_COLLATE, 'cs_CZ.UTF-8')
|
||||||
|
|
||||||
# https://books.agiliq.com/projects/django-admin-cookbook/en/latest/set_ordering.html
|
# https://books.agiliq.com/projects/django-admin-cookbook/en/latest/set_ordering.html
|
||||||
# FIXME zpraseno pomocí toho, že Python umí bez problému přepisovat funkce
|
# FIXME zpraseno pomocí toho, že Python umí bez problému přepisovat funkce
|
||||||
def get_app_list(self, request, app_label=None):
|
def get_app_list(self, request):
|
||||||
"""
|
"""
|
||||||
Return a sorted list of all the installed apps that have been
|
Return a sorted list of all the installed apps that have been
|
||||||
registered in this site.
|
registered in this site.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
app_dict = self._build_app_dict(request, label=app_label)
|
app_dict = self._build_app_dict(request)
|
||||||
aplikace_nahore = [
|
# Sort the apps alphabetically.
|
||||||
'tvorba',
|
app_list = sorted(app_dict.values(), key=lambda x: locale.strxfrm('!') if (x['name'] == "Seminar") else locale.strxfrm(x['name'].lower()))
|
||||||
'personalni',
|
|
||||||
'novinky',
|
|
||||||
'korektury',
|
|
||||||
'various',
|
|
||||||
'prednasky',
|
|
||||||
'soustredeni',
|
|
||||||
]
|
|
||||||
# Odhlášený admin má prázdný app_dict :-/
|
|
||||||
app_list = [app_dict[label] for label in aplikace_nahore if label in app_dict] + [app_dict[label] for label in app_dict if label not in aplikace_nahore]
|
|
||||||
|
|
||||||
|
|
||||||
# Sort the models alphabetically within each app.
|
# Sort the models alphabetically within each app.
|
||||||
try: # na macu nefunguje locale.strxfrm :-/ proto je tu try except block
|
|
||||||
for app in app_list:
|
for app in app_list:
|
||||||
app['models'].sort(key=lambda x: locale.strxfrm(x['name'].lower()))
|
app['models'].sort(key=lambda x: locale.strxfrm('žž' + x['name'].lower()) if (x['name'].endswith("(Node)")) else locale.strxfrm(x['name'].lower()))
|
||||||
except OSError as e:
|
|
||||||
# locale.strxfrm nefunguje na macu... :-/ -> neprovede se řazení
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
logger.error(e)
|
|
||||||
|
|
||||||
return app_list
|
return app_list
|
||||||
|
|
||||||
|
|
88
mamweb/middleware.py
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
from datetime import datetime, date
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.http import HttpResponse, HttpResponseRedirect
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class LoggedInHintCookieMiddleware(object):
|
||||||
|
"""Middleware to securely help with 'logged-in' detection for dual HTTP/HTTPS sites.
|
||||||
|
|
||||||
|
On insecure requests: Checks for a (non-secure) cookie settings.LOGGED_IN_HINT_COOKIE_NAME
|
||||||
|
and if present, redirects to HTTPS (same adress).
|
||||||
|
Note this usually breaks non-GET (POST) requests.
|
||||||
|
|
||||||
|
On secure requests: Updates cookie settings.LOGGED_IN_HINT_COOKIE_NAME to reflect
|
||||||
|
whether an user is logged in in the current session (cookie set to 'True' or cleared).
|
||||||
|
The cookie is set to expire at the same time as the sessionid cookie.
|
||||||
|
|
||||||
|
By default, LOGGED_IN_HINT_COOKIE_NAME = 'logged_in_hint'.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
if hasattr(settings, 'LOGGED_IN_HINT_COOKIE_NAME'):
|
||||||
|
self.cookie_name = settings.LOGGED_IN_HINT_COOKIE_NAME
|
||||||
|
else: self.cookie_name = 'logged_in_hint'
|
||||||
|
self.cookie_value = 'True'
|
||||||
|
|
||||||
|
def cookie_correct(self, request):
|
||||||
|
return self.cookie_name in request.COOKIES and request.COOKIES[self.cookie_name] == self.cookie_value
|
||||||
|
|
||||||
|
def process_request(self, request):
|
||||||
|
if not request.is_secure():
|
||||||
|
if self.cookie_correct(request):
|
||||||
|
# redirect insecure (assuming http) requests with hint cookie to https
|
||||||
|
url = request.build_absolute_uri()
|
||||||
|
assert url[:5] == 'http:'
|
||||||
|
return HttpResponseRedirect('https:' + url[5:])
|
||||||
|
return None
|
||||||
|
|
||||||
|
def process_response(self, request, response):
|
||||||
|
if request.is_secure():
|
||||||
|
# assuming full session info (as the conn. is secure)
|
||||||
|
try:
|
||||||
|
user = request.user
|
||||||
|
except AttributeError: # no user - ajax or other special request
|
||||||
|
return response
|
||||||
|
if user.is_authenticated():
|
||||||
|
if not self.cookie_correct(request):
|
||||||
|
expiry = None if request.session.get_expire_at_browser_close() else request.session.get_expiry_date()
|
||||||
|
response.set_cookie(self.cookie_name, value=self.cookie_value, expires=expiry, secure=False)
|
||||||
|
else:
|
||||||
|
if self.cookie_name in request.COOKIES:
|
||||||
|
response.delete_cookie(self.cookie_name)
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
class vzhled:
|
||||||
|
|
||||||
|
def process_request(self, request):
|
||||||
|
return None
|
||||||
|
|
||||||
|
def process_view(self, request, view_func, view_args, view_kwargs):
|
||||||
|
#print "====== process_request ======"
|
||||||
|
#print view_func
|
||||||
|
#print view_args
|
||||||
|
#print view_kwargs
|
||||||
|
#print "============================="
|
||||||
|
return None
|
||||||
|
|
||||||
|
def process_template_response(self, request, response):
|
||||||
|
hodin = datetime.now().hour
|
||||||
|
if (hodin <= 6) or (hodin >= 14): # TODO 20
|
||||||
|
response.context_data['noc'] = True
|
||||||
|
else:
|
||||||
|
response.context_data['noc'] = False
|
||||||
|
return response
|
||||||
|
|
||||||
|
def process_response(self, request, response):
|
||||||
|
#hodin = datetime.now().hour
|
||||||
|
#if (hodin <= 6) or (hodin >= 14): # TODO 20
|
||||||
|
#response.context_data['noc'] = True
|
||||||
|
#else:
|
||||||
|
#response.context_data['noc'] = False
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
##def process_exception(request, exception):
|
||||||
|
#pass
|
|
@ -28,6 +28,7 @@ APPEND_SLASH = True
|
||||||
LANGUAGE_CODE = 'cs'
|
LANGUAGE_CODE = 'cs'
|
||||||
TIME_ZONE = 'Europe/Prague'
|
TIME_ZONE = 'Europe/Prague'
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
USE_L10N = True
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
|
@ -53,9 +54,6 @@ LOGIN_REDIRECT_URL = 'profil'
|
||||||
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
||||||
DOBA_ODHLASENI_PRI_ZASKRTNUTI_NEODHLASOVAT = 365 * 24 * 3600 # rok
|
DOBA_ODHLASENI_PRI_ZASKRTNUTI_NEODHLASOVAT = 365 * 24 * 3600 # rok
|
||||||
|
|
||||||
# View pro chybu s CSRF tokenem (např. se sušenkami)
|
|
||||||
CSRF_FAILURE_VIEW = 'various.views.csrf.csrf_error'
|
|
||||||
|
|
||||||
# Modules configuration
|
# Modules configuration
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = (
|
AUTHENTICATION_BACKENDS = (
|
||||||
|
@ -68,6 +66,9 @@ MIDDLEWARE = (
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
|
# FIXME: rozbilo se při přechodu na Django 2.0, nevím, jestli
|
||||||
|
# se to dá zahodit bez náhrady
|
||||||
|
# 'mamweb.middleware.LoggedInHintCookieMiddleware',
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
@ -84,10 +85,10 @@ TEMPLATES = [
|
||||||
'django.contrib.auth.context_processors.auth',
|
'django.contrib.auth.context_processors.auth',
|
||||||
'django.template.context_processors.request',
|
'django.template.context_processors.request',
|
||||||
'django.contrib.messages.context_processors.messages',
|
'django.contrib.messages.context_processors.messages',
|
||||||
|
'sekizai.context_processors.sekizai',
|
||||||
'header_fotky.context_processors.vzhled',
|
'header_fotky.context_processors.vzhled',
|
||||||
'various.context_processors.rozliseni',
|
'various.context_processors.rozliseni',
|
||||||
'various.context_processors.april',
|
'various.context_processors.april',
|
||||||
'various.context_processors.halloween',
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -107,14 +108,19 @@ INSTALLED_APPS = (
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
|
|
||||||
# Utilities
|
# Utilities
|
||||||
|
'sekizai',
|
||||||
'reversion',
|
'reversion',
|
||||||
'django_countries',
|
'django_countries',
|
||||||
'solo',
|
'solo',
|
||||||
'django_ckeditor_5',
|
'ckeditor',
|
||||||
|
'ckeditor_uploader',
|
||||||
'taggit',
|
'taggit',
|
||||||
'dal',
|
'dal',
|
||||||
'dal_select2',
|
'dal_select2',
|
||||||
|
|
||||||
|
'crispy_forms',
|
||||||
|
'django_comments',
|
||||||
|
|
||||||
'django.contrib.flatpages',
|
'django.contrib.flatpages',
|
||||||
'django.contrib.humanize',
|
'django.contrib.humanize',
|
||||||
|
|
||||||
|
@ -131,7 +137,6 @@ INSTALLED_APPS = (
|
||||||
# MaMweb
|
# MaMweb
|
||||||
'mamweb',
|
'mamweb',
|
||||||
'seminar',
|
'seminar',
|
||||||
'tvorba',
|
|
||||||
'galerie',
|
'galerie',
|
||||||
'korektury',
|
'korektury',
|
||||||
'prednasky',
|
'prednasky',
|
||||||
|
@ -146,8 +151,6 @@ INSTALLED_APPS = (
|
||||||
'soustredeni',
|
'soustredeni',
|
||||||
'treenode',
|
'treenode',
|
||||||
'vyroci',
|
'vyroci',
|
||||||
'sifrovacka',
|
|
||||||
'novinky',
|
|
||||||
|
|
||||||
# Admin upravy:
|
# Admin upravy:
|
||||||
|
|
||||||
|
@ -185,98 +188,26 @@ SUMMERNOTE_CONFIG = {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
CKEDITOR_5_CUSTOM_CSS = "css/ckeditor5_fix.css"
|
CKEDITOR_UPLOAD_PATH = "uploads/"
|
||||||
# customColorPalette = [
|
CKEDITOR_IMAGE_BACKEND = 'pillow'
|
||||||
# {
|
#CKEDITOR_JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'
|
||||||
# 'color': 'hsl(4, 90%, 58%)',
|
CKEDITOR_CONFIGS = {
|
||||||
# 'label': 'Red',
|
|
||||||
# },
|
|
||||||
# {
|
|
||||||
# 'color': 'hsl(340, 82%, 52%)',
|
|
||||||
# 'label': 'Pink',
|
|
||||||
# },
|
|
||||||
# {
|
|
||||||
# 'color': 'hsl(291, 64%, 42%)',
|
|
||||||
# 'label': 'Purple',
|
|
||||||
# },
|
|
||||||
# {
|
|
||||||
# 'color': 'hsl(262, 52%, 47%)',
|
|
||||||
# 'label': 'Deep Purple',
|
|
||||||
# },
|
|
||||||
# {
|
|
||||||
# 'color': 'hsl(231, 48%, 48%)',
|
|
||||||
# 'label': 'Indigo',
|
|
||||||
# },
|
|
||||||
# {
|
|
||||||
# 'color': 'hsl(207, 90%, 54%)',
|
|
||||||
# 'label': 'Blue',
|
|
||||||
# },
|
|
||||||
# ]
|
|
||||||
CKEDITOR_5_FILE_STORAGE = "various.storage.UploadStorage"
|
|
||||||
CKEDITOR_5_CONFIGS = {
|
|
||||||
'default': {
|
'default': {
|
||||||
'language': 'cs',
|
'entities': False,
|
||||||
'blockToolbar': [
|
'toolbar': [
|
||||||
'paragraph', 'heading1', 'heading2', 'heading3',
|
['Source', 'ShowBlocks', '-', 'Maximize'],
|
||||||
'|',
|
['Bold', 'Italic', 'Subscript', 'Superscript', '-', 'RemoveFormat'],
|
||||||
'bulletedList', 'numberedList',
|
['NumberedList','BulletedList','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
|
||||||
'|',
|
['Link', 'Unlink', 'Anchor', '-', 'Image', 'Table', 'HorizontalRule'],
|
||||||
'blockQuote',
|
['Format'],
|
||||||
],
|
|
||||||
'toolbar': ['sourceEditing', '|', 'heading', '|',
|
|
||||||
# 'outdent', 'indent', '|',
|
|
||||||
'bold', 'italic', 'link', 'underline', 'strikethrough',
|
|
||||||
'code',
|
|
||||||
# 'subscript', 'superscript',
|
|
||||||
# 'highlight',
|
|
||||||
'|', 'codeBlock', 'insertImage',
|
|
||||||
'bulletedList', 'numberedList', 'todoList', '|',
|
|
||||||
# 'blockQuote', '|',
|
|
||||||
# 'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor',
|
|
||||||
# 'mediaEmbed',
|
|
||||||
'removeFormat',
|
|
||||||
# 'insertTable',
|
|
||||||
],
|
|
||||||
'image': {
|
|
||||||
'toolbar': ['imageTextAlternative', '|', 'imageStyle:alignLeft',
|
|
||||||
'imageStyle:alignRight', 'imageStyle:alignCenter', 'imageStyle:side', '|'],
|
|
||||||
'styles': [
|
|
||||||
'full',
|
|
||||||
'side',
|
|
||||||
'alignLeft',
|
|
||||||
'alignRight',
|
|
||||||
'alignCenter',
|
|
||||||
]
|
|
||||||
|
|
||||||
|
],
|
||||||
|
# 'toolbar': 'full',
|
||||||
|
'height': '40em',
|
||||||
|
'width': '100%',
|
||||||
|
'toolbarStartupExpanded': False,
|
||||||
|
'allowedContent' : True,
|
||||||
},
|
},
|
||||||
# 'table': {
|
|
||||||
# 'contentToolbar': [ 'tableColumn', 'tableRow', 'mergeTableCells',
|
|
||||||
# 'tableProperties', 'tableCellProperties' ],
|
|
||||||
# 'tableProperties': {
|
|
||||||
# 'borderColors': customColorPalette,
|
|
||||||
# 'backgroundColors': customColorPalette,
|
|
||||||
# },
|
|
||||||
# 'tableCellProperties': {
|
|
||||||
# 'borderColors': customColorPalette,
|
|
||||||
# 'backgroundColors': customColorPalette,
|
|
||||||
# }
|
|
||||||
# },
|
|
||||||
'heading' : {
|
|
||||||
'options': [
|
|
||||||
{ 'model': 'paragraph', 'title': 'Paragraph', 'class': 'ck-heading_paragraph' },
|
|
||||||
{ 'model': 'heading1', 'view': 'h1', 'title': 'Heading 1', 'class': 'ck-heading_heading1' },
|
|
||||||
{ 'model': 'heading2', 'view': 'h2', 'title': 'Heading 2', 'class': 'ck-heading_heading2' },
|
|
||||||
{ 'model': 'heading3', 'view': 'h3', 'title': 'Heading 3', 'class': 'ck-heading_heading3' },
|
|
||||||
]
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'list': {
|
|
||||||
'properties': {
|
|
||||||
'styles': 'true',
|
|
||||||
'startIndex': 'true',
|
|
||||||
'reversed': 'true',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Webpack loader
|
# Webpack loader
|
||||||
|
@ -350,11 +281,11 @@ LOGGING = {
|
||||||
'filters': ['Http404AsInfo'],
|
'filters': ['Http404AsInfo'],
|
||||||
},
|
},
|
||||||
|
|
||||||
'personalni.prihlaska.form':{
|
'seminar.prihlaska.form':{
|
||||||
'handlers': ['console','registration_logfile'],
|
'handlers': ['console','registration_logfile'],
|
||||||
'level': 'INFO'
|
'level': 'INFO'
|
||||||
},
|
},
|
||||||
'personalni.prihlaska.problem':{
|
'seminar.prihlaska.problem':{
|
||||||
'handlers': ['console','mail_registration','registration_error_log'],
|
'handlers': ['console','mail_registration','registration_error_log'],
|
||||||
'level': 'INFO'
|
'level': 'INFO'
|
||||||
},
|
},
|
||||||
|
@ -413,7 +344,10 @@ SEMINAR_KONFERY_DIR = os.path.join('konfery')
|
||||||
KOREKTURY_PDF_DIR = os.path.join('korektury', 'pdf')
|
KOREKTURY_PDF_DIR = os.path.join('korektury', 'pdf')
|
||||||
KOREKTURY_IMG_DIR = os.path.join('korektury', 'img')
|
KOREKTURY_IMG_DIR = os.path.join('korektury', 'img')
|
||||||
CISLO_IMG_DIR = os.path.join('cislo', 'img')
|
CISLO_IMG_DIR = os.path.join('cislo', 'img')
|
||||||
SOUSTREDENI_KONTAKTNICKY_DIR = os.path.join('soustredeni', 'kontaktnicky')
|
|
||||||
|
|
||||||
|
# E-MAIL NOTIFICATIONS
|
||||||
|
POSLI_MAILOVOU_NOTIFIKACI = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -18,18 +20,15 @@ INSTALLED_APPS += (
|
||||||
)
|
)
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
# `'DOCUTILSCONFIG' in os.environ` kvůli sphinxu
|
assert not SECRET_KEY.startswith('12345')
|
||||||
# FIXME zjistit, zda je bezpečné a zda se to nedá udělat lépe
|
|
||||||
assert 'DOCUTILSCONFIG' in os.environ or not SECRET_KEY.startswith('12345')
|
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
||||||
TEMPLATE_DEBUG = False
|
TEMPLATE_DEBUG = False
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['mam.mff.cuni.cz', # Hlavní a asi jediná funkční adresa
|
ALLOWED_HOSTS = ['mam.mff.cuni.cz', 'www.mam.mff.cuni.cz', 'atrey.karlin.mff.cuni.cz',
|
||||||
'mam.matfyz.cz', # Ne že by se tohle použilo, ale pro potenciální případ změny…
|
'mamweb.bezva.org','gimli.ms.mff.cuni.cz']
|
||||||
]
|
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
|
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
|
||||||
|
@ -68,4 +67,5 @@ LOGGING['handlers']['registration_error_log']['filename'] = '/home/mam-web/logs/
|
||||||
|
|
||||||
|
|
||||||
# E-MAIL NOTIFICATIONS
|
# E-MAIL NOTIFICATIONS
|
||||||
|
POSLI_MAILOVOU_NOTIFIKACI = True
|
||||||
LOCAL_TEST_PROD = "prod"
|
LOCAL_TEST_PROD = "prod"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -30,10 +32,7 @@ DEBUG = True
|
||||||
|
|
||||||
TEMPLATES[0]['OPTIONS']['debug'] = True
|
TEMPLATES[0]['OPTIONS']['debug'] = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = [
|
ALLOWED_HOSTS = ['*.mam.mff.cuni.cz', 'atrey.karlin.mff.cuni.cz', 'mam.mff.cuni.cz', 'mam-test.kam.mff.cuni.cz', 'gimli.ms.mff.cuni.cz', 'mam-test.ks.matfyz.cz']
|
||||||
'mam-test.ks.matfyz.cz',
|
|
||||||
'*.mam.mff.cuni.cz', # Asi se nikdy nepoužije…
|
|
||||||
]
|
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
|
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
|
||||||
|
@ -72,6 +71,7 @@ LOGGING['handlers']['registration_error_log']['filename'] = '/home/mam-web/logs/
|
||||||
FILE_UPLOAD_PERMISSIONS = 0o440
|
FILE_UPLOAD_PERMISSIONS = 0o440
|
||||||
|
|
||||||
# Testování e-mailů
|
# Testování e-mailů
|
||||||
|
POSLI_MAILOVOU_NOTIFIKACI = True
|
||||||
EMAIL_BACKEND = 'various.mail_prefixer.PrefixingMailBackend'
|
EMAIL_BACKEND = 'various.mail_prefixer.PrefixingMailBackend'
|
||||||
# TODO Pouze na otestování testu… Zvolit konferu!
|
# TODO Pouze na otestování testu… Zvolit konferu!
|
||||||
# XXX: Je to pole, protože implementační detail backendu.
|
# XXX: Je to pole, protože implementační detail backendu.
|
||||||
|
|