diff --git a/mamweb/static/css/mamweb.css b/mamweb/static/css/mamweb.css index 386ed6e1..41a63c40 100644 --- a/mamweb/static/css/mamweb.css +++ b/mamweb/static/css/mamweb.css @@ -58,10 +58,17 @@ h2 { #header { position: relative; font-size: 250%; - background: url("../images/header-archiv.png") no-repeat left top; + background: url("../images/header-bg-uvod.png") no-repeat center top; height: 255px; top: -1px; } + +#header.cojemam { background-image: url("../images/header-bg-uvod.png"); } +#header.soustredeni { background-image: url("../images/header-bg-soustredeni.png"); } +#header.zadani { background-image: url("../images/header-bg-zadani.png"); } +#header.clanky { background-image: url("../images/header-bg-clanek.png"); } +#header.archiv { background-image: url("../images/header-bg-archiv.png"); } + #header img.logo { position: absolute; top: 20px; @@ -141,7 +148,7 @@ h2 { font-weight: 400; } #submenu li { - padding: 3px 20px; + padding: 4px 20px; display: inline-block; height: 40px; } @@ -153,9 +160,11 @@ h2 { color: #3c003c; } #submenu li.selected { - background: url("../images/submenu-bg-selected.png") no-repeat center 1px; - background-size: 100% 100%; - /*background-color: #cc8400;*/ + background: url("../images/submenu-bg-selected.png") no-repeat center; + background-size: 150% 150%; +} +#submenu li.selected>a { + color: #3c003c; } /*#submenu li:first-child { border-top-left-radius: 7px; @@ -187,9 +196,15 @@ div.zadani_azad_termin { **********/ #footer { - background: url("../images/footer-bg.png") no-repeat -100px 0px; - padding: 20px 30px; - height: 210px; + background: url("../images/footer-bg-top.png") no-repeat top center; + background-color: #ffd546; + padding: 20px 30px 0px 30px; + min-height: 210px; +} + +#footer-extra { + background: url("../images/footer-bg-bottom.png") no-repeat bottom center; + height: 39px; } #footer p.license { @@ -199,16 +214,63 @@ div.zadani_azad_termin { #footer p.organize { text-align: center; - margin-top: 40px; + margin-top: 60px; margin-left: 90px; } #footer img.logo-left { - padding: 30px 0px; + padding: 50px 0px 0px 0px; float: left; } #footer img.logo-right { + padding: 40px 0px 00px 10px; float: right; } +@media (max-width: 991px) { + #header { + height: 196px; + background-size: 100% 100%; + } + #header img.logo { + top: 15px; + left: 25px; + height: 170px; + } + #menu li { + min-width: 120px; + font-size: 130%; + } + #submenu ul { + font-size: 115%; + } + #submenu li { + padding-top: 5px; + } + #footer { + padding: 20px 40px 0px 40px; + min-height: 270px; + } + #footer-extra { + position: relative; + top: -10px; + height: 39px; + } + + #footer p.organize { + text-align: center; + margin-top: 170px; + margin-left: 0px; + } + + #footer img.logo-left { + padding: 50px 20px 0px 0px; + float: right; + } + + #footer img.logo-right { + padding: 40px 0px 0px 20px; + float: left; + } +} diff --git a/mamweb/static/images/footer-bg-bottom.png b/mamweb/static/images/footer-bg-bottom.png new file mode 100644 index 00000000..95be7d8f Binary files /dev/null and b/mamweb/static/images/footer-bg-bottom.png differ diff --git a/mamweb/static/images/footer-bg-top.png b/mamweb/static/images/footer-bg-top.png new file mode 100644 index 00000000..89ebce5e Binary files /dev/null and b/mamweb/static/images/footer-bg-top.png differ diff --git a/mamweb/static/images/footer-bg.png b/mamweb/static/images/footer-bg.png deleted file mode 100644 index 66c7d03a..00000000 Binary files a/mamweb/static/images/footer-bg.png and /dev/null differ diff --git a/mamweb/static/images/header-archiv.png b/mamweb/static/images/header-bg-archiv.png similarity index 100% rename from mamweb/static/images/header-archiv.png rename to mamweb/static/images/header-bg-archiv.png diff --git a/mamweb/static/images/header-bg-clanek.png b/mamweb/static/images/header-bg-clanek.png new file mode 100644 index 00000000..95576fe6 Binary files /dev/null and b/mamweb/static/images/header-bg-clanek.png differ diff --git a/mamweb/static/images/header-bg-uvod.png b/mamweb/static/images/header-bg-uvod.png new file mode 100644 index 00000000..532d9941 Binary files /dev/null and b/mamweb/static/images/header-bg-uvod.png differ diff --git a/mamweb/static/images/header-bg-zadani.png b/mamweb/static/images/header-bg-zadani.png new file mode 100644 index 00000000..291c46bb Binary files /dev/null and b/mamweb/static/images/header-bg-zadani.png differ diff --git a/mamweb/static/images/logo-mff.png b/mamweb/static/images/logo-mff.png index 4231e9b5..9c9a98e4 100644 Binary files a/mamweb/static/images/logo-mff.png and b/mamweb/static/images/logo-mff.png differ diff --git a/mamweb/static/images/submenu-bg-selected.png b/mamweb/static/images/submenu-bg-selected.png index 6d23a38e..81d1c817 100644 Binary files a/mamweb/static/images/submenu-bg-selected.png and b/mamweb/static/images/submenu-bg-selected.png differ diff --git a/mamweb/templates/base.html b/mamweb/templates/base.html index d5bdcc17..8817ddb7 100644 --- a/mamweb/templates/base.html +++ b/mamweb/templates/base.html @@ -91,7 +91,7 @@

Korespondenční seminář M&M organizují převážně studenti MFF UK. Organizaci semináře a vydávání časopisu podporuje Jednota českých matematiků a fyziků.

- + diff --git a/seminar/models.py b/seminar/models.py index f831b496..0041b8a7 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -579,7 +579,7 @@ class Soustredeni(SeminarModelBase): db_table = 'seminar_soustredeni' verbose_name = u'Soustředění' verbose_name_plural = u'Soustředění' - ordering = ['rocnik__rocnik', 'datum_zacatku'] + ordering = ['-rocnik__rocnik', '-datum_zacatku'] # Interní ID id = models.AutoField(primary_key = True) diff --git a/seminar/templates/seminar/archiv/problem.html b/seminar/templates/seminar/archiv/problem.html index 32f68911..67071dea 100644 --- a/seminar/templates/seminar/archiv/problem.html +++ b/seminar/templates/seminar/archiv/problem.html @@ -4,31 +4,10 @@ {% block content %}
- {% if problem.cislo_zadani %} -

- {% block nadpis1a %}{% block nadpis1b %} - {{ problem.nazev_typu }} {{ problem.kod_v_rocniku }}: {{ problem.nazev }} {{ problem.body_v_zavorce }} - {% endblock %}{% endblock %} -

+ {% block problem %} + {% endblock %} -

Zadáno v čísle {{ problem.cislo_zadani.kod }}. - {% if problem.cislo_reseni %} -

Řešeno v čísle {{ problem.cislo_reseni.kod }}. - {% endif %} - {% else %} -

Problém {{ problem.nazev }}

- {% endif %} - - -

Zadání

- {{ problem.text_zadani |safe }} - {% if problem.text_reseni %} -

Řešení

- {{ problem.text_reseni |safe }} - {% endif %} - - {# TODO Kontrola, zda je uzivatel org #} - {% if user.is_authenticated %} + {% if user.is_staff %}

Text - org

@@ -43,4 +22,3 @@
{% endblock content %} - diff --git a/seminar/templates/seminar/archiv/problem_clanek.html b/seminar/templates/seminar/archiv/problem_clanek.html new file mode 100644 index 00000000..c7beba99 --- /dev/null +++ b/seminar/templates/seminar/archiv/problem_clanek.html @@ -0,0 +1,38 @@ +{% extends "seminar/archiv/problem.html" %} + +{% block problem %} + {% if problem.cislo_zadani %} + +

+ {{ problem.nazev_typu }}: + {% block nadpis1a %}{% block nadpis1b %} + {{ problem.nazev }} + {% endblock %}{% endblock %} +

+ +
+ {% if problem.typ == 'res-clanek' %} + {# pozor na mezery #} + {% for r in reseni %}{% if not forloop.first %}, {% endif %} + {{ r.resitel.jmeno }} {{ r.resitel.prijmeni }}{% if r.body %} ({{ r.body }} b){% endif %}{% endfor %} + {% else %} + {{ problem.autor.first_name }} + {% if problem.autor.organizator.prezdivka %} + „{{ problem.autor.organizator.prezdivka }}“ + {% endif %} + {{ problem.autor.last_name }} + {% endif %} +
+ + {% if problem.cislo_reseni %} +

Vyšlo v čísle {{ problem.cislo_reseni.kod }}. + {% endif %} + + {% else %} + {# TODO ? #} +

Problém {{ problem.nazev }}

+ {% endif %} + + {{ problem.text_zadani |safe }} + +{% endblock %} diff --git a/seminar/templates/seminar/archiv/problem_uloha_tema.html b/seminar/templates/seminar/archiv/problem_uloha_tema.html new file mode 100644 index 00000000..12ee40ac --- /dev/null +++ b/seminar/templates/seminar/archiv/problem_uloha_tema.html @@ -0,0 +1,27 @@ +{% extends "seminar/archiv/problem.html" %} + +{% block problem %} +

+ {% block nadpis1a %}{% block nadpis1b %} + {{ problem.nazev_typu }} {{ problem.kod_v_rocniku }}: {{ problem.nazev }} {{ problem.body_v_zavorce }} + {% endblock %}{% endblock %} +

+ {% if problem.cislo_zadani %} +

Zadáno v čísle {{ problem.cislo_zadani.kod }}. + {% if problem.cislo_reseni %} +

Řešeno v čísle {{ problem.cislo_reseni.kod }}. + {% endif %} + {% else %} + {# TODO ? #} +

Problém {{ problem.nazev }}

+ {% endif %} + + +

Zadání

+ {{ problem.text_zadani |safe }} + {% if problem.text_reseni %} +

Řešení

+ {{ problem.text_reseni |safe }} + {% endif %} + +{% endblock %} diff --git a/seminar/templates/seminar/clanky/organizatorske_clanky.html b/seminar/templates/seminar/clanky/organizatorske_clanky.html new file mode 100644 index 00000000..f2e00104 --- /dev/null +++ b/seminar/templates/seminar/clanky/organizatorske_clanky.html @@ -0,0 +1,5 @@ +{% extends 'seminar/clanky/resitelske_clanky.html' %} + +{% block nadpis1a %}{% block nadpis1b %} +Organizátorské články +{% endblock %}{% endblock %} diff --git a/seminar/templates/seminar/clanky/resitelske_clanky.html b/seminar/templates/seminar/clanky/resitelske_clanky.html new file mode 100644 index 00000000..6f34f3dc --- /dev/null +++ b/seminar/templates/seminar/clanky/resitelske_clanky.html @@ -0,0 +1,24 @@ +{% extends 'base.html' %} + +{% block content %} + +

+{% block nadpis1a %}{% block nadpis1b %} +Řešitelské články +{% endblock %}{% endblock %} +

+ +{% for clanek in object_list %} +{% with clanek.cislo_zadani.rocnik.rocnik as rocnik %} + {% ifchanged rocnik %} + {% if not forloop.first %}{% endif %} +

{{ rocnik }}. ročník

+ + +{% endblock %} diff --git a/seminar/templates/seminar/clanky/submenu.html b/seminar/templates/seminar/clanky/submenu.html index b544520b..5f0d78a2 100644 --- a/seminar/templates/seminar/clanky/submenu.html +++ b/seminar/templates/seminar/clanky/submenu.html @@ -3,8 +3,8 @@ diff --git a/seminar/templates/seminar/soustredeni/seznam_soustredeni.html b/seminar/templates/seminar/soustredeni/seznam_soustredeni.html index 020c78b6..a6672c95 100644 --- a/seminar/templates/seminar/soustredeni/seznam_soustredeni.html +++ b/seminar/templates/seminar/soustredeni/seznam_soustredeni.html @@ -9,13 +9,13 @@ {# zmena fotky #}{% block header %}soustredeni{% endblock %} -{% block content %}{% if user.is_authenticated %}{# PRACUJE SE STRANKA #} +{% block nadpis1a %}{% block nadpis1b %} + Soustředění +{% endblock %}{% endblock %} + +{% block content %} +{#% if user.is_authenticated %#}{# PRACUJE SE STRANKA #} -

- {% block nadpis1a %}{% block nadpis1b %} - Soustředění - {% endblock %}{% endblock %} -

{# Projdi vsechna soustredeni #} {% for soustredeni in object_list %} @@ -29,30 +29,36 @@ že jste přihlášení.
{% endif %} {# misto soustredeni TODO upravit#} - {% if soustredeni.misto %}

- Soustředění v {{soustredeni.misto}} - od {{soustredeni.datum_zacatku}} do {{soustredeni.datum_konce}} - při {{soustredeni.rocnik.rocnik}}. ročníku M&M + {{soustredeni.get_typ_display}} + {{soustredeni.misto}}

+ + {% if user.is_authenticated %} + {# popis soustredeni #} + {% if soustredeni.text %} + {% autoescape off %}{{soustredeni.text}}{% endautoescape %} + {% endif %} + {# Účastníci #} +

Soustředění se zúčastnili tito účastníci:

+ {% endif %} - {# popis soustredeni #} - {% if soustredeni.text %} - {% autoescape off %}{{soustredeni.text}}{% endautoescape %} - {% endif %} - {# Účastníci #} -

Soustředění se zúčastnili tito účastníci:

- {% endif %} {% empty %} Žádná soustředění zatím neproběhla! {% endfor %} -{% else %}{% include 'seminar/pracuje_se.html' %}{% endif %}{% endblock %} +{#% else %}{% include 'seminar/pracuje_se.html' %}{% endif %#} + +{% endblock %} diff --git a/seminar/urls.py b/seminar/urls.py index ff322241..1af3d42a 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -22,6 +22,10 @@ urlpatterns = patterns('', url(r'^$', views.TitulniStranaView.as_view(), name='titulni_strana'), url(r'^stare-novinky/$', views.StareNovinkyView.as_view(), name='stare_novinky'), + url(r'^clanky/resitel/$', views.ClankyResitelView.as_view(), name='clanky_resitel'), + url(r'^clanky/org/$', views.ClankyOrganizatorView.as_view(), name='clanky_organizator'), + + url(r'^stav$', views.StavDatabazeView, name='stav_databaze'), url(r'^aesop-export/mam-rocnik-(?P\d+)\.csv$', export.ExportRocnikView.as_view(), name='seminar_export_rocnik'), diff --git a/seminar/views.py b/seminar/views.py index 320ec359..5d29dfe2 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -168,9 +168,23 @@ class RocnikView(generic.DetailView): context['temata_v_rocniku'] = temata_v_rocniku return context + class ProblemView(generic.DetailView): model = Problem - template_name = 'seminar/archiv/problem.html' + + def _je_clanek(self, problem): + return problem.typ in [Problem.TYP_ORG_CLANEK, Problem.TYP_RES_CLANEK] + + def get_template_names(self, **kwargs): + context = super(ProblemView, self).get_context_data(**kwargs) + return ['seminar/archiv/problem_' + ('clanek.html' if self._je_clanek(context['problem']) else 'uloha_tema.html')] + + def get_context_data(self, **kwargs): + context = super(ProblemView, self).get_context_data(**kwargs) + if context['problem'].typ == Problem.TYP_RES_CLANEK: + context['reseni'] = Reseni.objects.filter(problem=context['problem']).select_related('resitel').order_by('resitel__prijmeni') + return context + class RadekVysledkovky(object): pass @@ -280,6 +294,19 @@ class SoustredeniView(generic.DetailView): model = Soustredeni template_name = 'seminar/archiv/soustredeni.html' +### Články + +class ClankyResitelView(generic.ListView): + model = Problem + template_name = 'seminar/clanky/resitelske_clanky.html' + queryset = Problem.objects.filter(typ=Problem.TYP_RES_CLANEK, stav=Problem.STAV_ZADANY).select_related('cislo_zadani__rocnik__rocnik').order_by('-cislo_zadani__rocnik__rocnik', 'kod') + +class ClankyOrganizatorView(generic.ListView): + model = Problem + template_name = 'seminar/clanky/organizatorske_clanky.html' + queryset = Problem.objects.filter(typ=Problem.TYP_ORG_CLANEK, stav=Problem.STAV_ZADANY).select_related('cislo_zadani__rocnik__rocnik').order_by('-cislo_zadani__rocnik__rocnik', 'kod') + + ### Status def StavDatabazeView(request):