Browse Source

Merge branch 'master' of atrey.karlin.mff.cuni.cz:/akce/MaM/MaMweb/mamweb

remotes/origin/noc
Honza "Stínovlas" Musílek 9 years ago
parent
commit
9ce86a1a2c
  1. 2
      mamweb/templates/base.html
  2. 11
      mamweb/templates/flatpages/default.html
  3. 10
      seminar/templates/seminar/archiv/problem.html
  4. 5
      seminar/templates/seminar/cojemam/organizatori.html
  5. 2
      seminar/templates/seminar/zadani/AktualniZadani.html
  6. 2
      seminar/templates/seminar/zadani/submenu.html
  7. 6
      seminar/views.py

2
mamweb/templates/base.html

@ -2,7 +2,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang='cs'> <html lang='cs'>
<head> <head>
<title>{% block title %}Seminář M&amp;M{% endblock title %}</title> <title>{% block title %}{% block nadpis1a %}{% endblock %} – Korespondenční seminář M&amp;M{% endblock title %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="{% static 'favicon.ico' %}" type="image/x-icon"> <link rel="shortcut icon" href="{% static 'favicon.ico' %}" type="image/x-icon">
{% render_block "css" %} {% render_block "css" %}

11
mamweb/templates/flatpages/default.html

@ -1,7 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}{{ flatpage.title }}{% endblock title %}
{% block nadpis1a %}{% block nadpis1b%} {% block nadpis1a %}{% block nadpis1b%}
{{ flatpage.title }} {{ flatpage.title }}
{% endblock %}{% endblock %} {% endblock %}{% endblock %}
@ -29,6 +27,7 @@
{% with "FAQ" as selected %} {% with "FAQ" as selected %}
{% include "seminar/cojemam/submenu.html" %} {% include "seminar/cojemam/submenu.html" %}
{% endwith %} {% endwith %}
{% elif "kontakt" in flatpage.url %}
{% else %} {% else %}
{% include "seminar/cojemam/submenu.html" %} {% include "seminar/cojemam/submenu.html" %}
{% endif %} {% endif %}
@ -73,6 +72,10 @@
{% with "resitel" as selected %} {% with "resitel" as selected %}
{% include "seminar/clanky/submenu.html" %} {% include "seminar/clanky/submenu.html" %}
{% endwith %} {% endwith %}
{% elif "/jak-psat-vedecky-clanek/" in flatpage.url %}
{% with "jak-psat-vedecky-clanek" as selected %}
{% include "seminar/clanky/submenu.html" %}
{% endwith %}
{% else %} {% else %}
{% include "seminar/clanky/submenu.html" %} {% include "seminar/clanky/submenu.html" %}
{% endif %} {% endif %}
@ -94,12 +97,12 @@
{% endblock %} {% endblock %}
{# zvirazneni menu #} {# zvirazneni menu #}
{% block menu_uvod %}{% if "/co-je-MaM/" in flatpage.url %}selected{% endif %}{% endblock %} {% block menu_uvod %}{% if not "/kontakt/" in flatpage.url %}{% if "/co-je-MaM/" in flatpage.url %}selected{% endif %}{% endif %}{% endblock %}
{% block menu_soustredeni %}{% if "/soustredeni/" in flatpage.url %}selected{% endif %}{% endblock %} {% block menu_soustredeni %}{% if "/soustredeni/" in flatpage.url %}selected{% endif %}{% endblock %}
{% block menu_zadani %}{% if "/zadani/" in flatpage.url %}selected{% endif %}{% endblock %} {% block menu_zadani %}{% if "/zadani/" in flatpage.url %}selected{% endif %}{% endblock %}
{% block menu_clanky %}{% if "/clanky/" in flatpage.url %}selected{% endif %}{% endblock %} {% block menu_clanky %}{% if "/clanky/" in flatpage.url %}selected{% endif %}{% endblock %}
{% block menu_archiv %}{% if "/archiv/" in flatpage.url %}selected{% endif %}{% endblock %} {% block menu_archiv %}{% if "/archiv/" in flatpage.url %}selected{% endif %}{% endblock %}
{% block menu_odevzdat %}{% if "/odevzdat-reseni/" in flatpage.url %}selected{% endif %}{% endblock %} {% block menu_odevzdat %}{% if "/kontakt/" in flatpage.url %}selected{% endif %}{% endblock %}
{# zmena titulniho obrazku #} {# zmena titulniho obrazku #}
{% block header %}{% if "/co-je-MaM/" in flatpage.url %}cojemam{% elif "/soustredeni/" in flatpage.url %}soustredeni{% elif "/zadani/" in flatpage.url %}zadani{% elif "/clanky/" in flatpage.url %}clanky{% elif "/archiv/" in flatpage.url %}archiv{% else %}odeslat{% endif %}{% endblock header %} {% block header %}{% if "/co-je-MaM/" in flatpage.url %}cojemam{% elif "/soustredeni/" in flatpage.url %}soustredeni{% elif "/zadani/" in flatpage.url %}zadani{% elif "/clanky/" in flatpage.url %}clanky{% elif "/archiv/" in flatpage.url %}archiv{% else %}odeslat{% endif %}{% endblock header %}

10
seminar/templates/seminar/archiv/problem.html

@ -22,11 +22,13 @@
<h3>Zadání</h3> <h3>Zadání</h3>
{{ problem.text_zadani |safe }} {{ problem.text_zadani |safe }}
{% if problem.text_reseni %}
<h3>Řešení</h3>
{{ problem.text_reseni |safe }}
{% endif %}
<h3>Řešení</h3> {# TODO Kontrola, zda je uzivatel org #}
{{ problem.text_reseni |safe }} {% if user.is_authenticated %}
{% if True %}
<div class='mam-org-only'> <div class='mam-org-only'>
<h3>Text - org</h3> <h3>Text - org</h3>

5
seminar/templates/seminar/cojemam/organizatori.html

@ -20,7 +20,8 @@
{% block content %} {% block content %}
<div> <div>
{% if not aktivni %} {% if not aktivni %}
<a href="/co-je-MaM/organizatori/">Aktivní organizátoři</a> <a href="/co-je-MaM/organizatori/">Aktivní organizátoři</a><br>
<br>
{% endif %} {% endif %}
{% for org in object_list %} {% for org in object_list %}
<h2> <h2>
@ -58,7 +59,7 @@
{% for znak in org.user.email %}{% if znak == '@' %} &#60;zavináč&#62; {% elif znak == '.' %} &#60;tečka&#62; {% else %}{{znak}}{% endif %}{% endfor %} {% for znak in org.user.email %}{% if znak == '@' %} &#60;zavináč&#62; {% elif znak == '.' %} &#60;tečka&#62; {% else %}{{znak}}{% endif %}{% endfor %}
{% endif %} {% endif %}
</ul> </ul>
{{org.strucny_popis_organizatora}} {# {{org.strucny_popis_organizatora}} #}
</td> </td>
</tr> </tr>
</table> </table>

2
seminar/templates/seminar/zadani/AktualniZadani.html

@ -22,7 +22,7 @@
{% endif %} {% endif %}
{#TODO a co speciální deadline pro účast na soustředění? #} {#TODO a co speciální deadline pro účast na soustředění? #}
<p><a href="/zadani/aktualni-cislo/">Celé aktuální číslo naleznete zde.</a></p> <p><a href="{{ac.pdf.url}}">Celé aktuální číslo v PDF</a></p>
{% for sada in jednorazove_problemy %} {% for sada in jednorazove_problemy %}
{# podnadpisy, kdyz neni zakomentuje se nadpis #} {# podnadpisy, kdyz neni zakomentuje se nadpis #}
{% if not sada %}<!--{% endif %} {% if not sada %}<!--{% endif %}

2
seminar/templates/seminar/zadani/submenu.html

@ -3,7 +3,7 @@
<ul> <ul>
<li class="{% if selected == "aktualni" %}selected{% endif %}"><a href="{{cesta}}/aktualni/">Aktuální zadání</a> <li class="{% if selected == "aktualni" %}selected{% endif %}"><a href="{{cesta}}/aktualni/">Aktuální zadání</a>
<li class="{% if selected == "temata" %}selected{% endif %}"><a href="{{cesta}}/temata/">Témata</a> <li class="{% if selected == "temata" %}selected{% endif %}"><a href="{{cesta}}/temata/">Témata</a>
<li class="{% if selected == "aktualni-cislo" %}selected{% endif %}"><a href="{{cesta}}/aktualni-cislo/">Aktuální číslo</a> {# <li class="{% if selected == "aktualni-cislo" %}selected{% endif %}"><a href="{{cesta}}/aktualni-cislo/">Aktuální číslo</a> #}
<li class="{% if selected == "vysledkova-listina" %}selected{% endif %}"><a href="{{cesta}}/vysledkova-listina/">Výsledková listina</a> <li class="{% if selected == "vysledkova-listina" %}selected{% endif %}"><a href="{{cesta}}/vysledkova-listina/">Výsledková listina</a>
</ul> </ul>

6
seminar/views.py

@ -153,7 +153,7 @@ class RocnikView(generic.DetailView):
vysledkovka.append(v) vysledkovka.append(v)
temata_v_rocniku = Problem.objects.filter(typ=Problem.TYP_TEMA, cislo_zadani__rocnik=context['rocnik']) temata_v_rocniku = Problem.objects.filter(typ=Problem.TYP_TEMA, cislo_zadani__rocnik=context['rocnik']).order_by('kod')
context['vysledkovka'] = vysledkovka context['vysledkovka'] = vysledkovka
context['temata_v_rocniku'] = temata_v_rocniku context['temata_v_rocniku'] = temata_v_rocniku
@ -194,9 +194,9 @@ class CisloView(generic.DetailView):
# typy úloh, které se mají zobrazovat u čísla, tj. těch, které byly v čísle skutečně zadány # typy úloh, které se mají zobrazovat u čísla, tj. těch, které byly v čísle skutečně zadány
typy_skutecne_zadanych = [Problem.TYP_ULOHA, Problem.TYP_SERIAL, Problem.TYP_ORG_CLANEK] typy_skutecne_zadanych = [Problem.TYP_ULOHA, Problem.TYP_SERIAL, Problem.TYP_ORG_CLANEK]
v_cisle_zadane = Problem.objects.filter(cislo_zadani=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('cislo_reseni__cislo', 'kod') v_cisle_zadane = Problem.objects.filter(cislo_zadani=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('kod')
resene_problemy = Problem.objects.filter(cislo_reseni=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('cislo_reseni__cislo', 'kod') resene_problemy = Problem.objects.filter(cislo_reseni=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('cislo_zadani__cislo', 'kod')
problemy = sorted(list(set([r.problem for r in reseni])), key=lambda x:(0 if x.typ==Problem.TYP_ULOHA else 1, x.kod_v_rocniku)) problemy = sorted(list(set([r.problem for r in reseni])), key=lambda x:(0 if x.typ==Problem.TYP_ULOHA else 1, x.kod_v_rocniku))
#setridi problemy podle typu a poradi zadani #setridi problemy podle typu a poradi zadani

Loading…
Cancel
Save