diff --git a/Makefile b/Makefile index 495e6bfc..972ab3f6 100644 --- a/Makefile +++ b/Makefile @@ -86,7 +86,7 @@ push_test: (chown -Rf :mam . || true ) && \ (chmod -Rf g+w . || true ) && \ echo 'Reloading apache ... (You may have to start it manually on error!)' && \ - ~/etc/apache2/apache2ctl -k reload && \ + ~/etc/apache2/apache2ctl -k restart && \ echo Done." @echo "Test pushed to ${TEST_SERVER}:${TEST_DIR} successfully." diff --git a/README.md b/README.md index 1cff5cb3..d5373992 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Use git :-) Quickstart ---------- +Install the following packages in Debian/Ubuntu: `libpq-dev python-dev python-setuptools python2.7`. Then run: + make ./manage.py testdata make run diff --git a/mamweb/static/css/mamweb.css b/mamweb/static/css/mamweb.css index 1e6f003b..9c2f0a6a 100644 --- a/mamweb/static/css/mamweb.css +++ b/mamweb/static/css/mamweb.css @@ -1,6 +1,8 @@ -.header { - font-size: 200%; - background: #ea3; +@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,400,300,600&subset=latin,latin-ext); + +body { + font-family: 'Open Sans', sans-serif; + font-weight: 300; } .org-logged-in .mam-text-plugin { @@ -39,4 +41,124 @@ table .border-b { height: 6em; } +/* Headline & Header */ + +#headline { + padding: 6px 10px; + font-size: 150%; + font-weight: 400; + background: #00c322; /* @mamgreen */ +} + +#header { + position: relative; + z-index: -1; +} + +.header-lg { + font-size: 250%; + background-color: rgba(255,195,0,0.8); + height: 220px; + position: relative; +} +.header-md { + font-size: 250%; + background-color: rgba(255,195,0,0.8); + height: 220px; + position: relative; +} + +#header img.logo { + position: absolute; + top: 25px; + left: 25px; + height: 110px; +} +#header h1 { + font-size: 130%; + position: absolute; + top: 125px; + left: 30px; + height: 110px; +} +#header img.header { + margin: -25px 20px 0px 0px; + height: 145px; + float: right; + visibility: hidden; +} + +/* Menu */ +#menu { + background: #00c322; /* @mamgreen */ + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; +} +#menu ul { + padding: 0px; + margin: 0px; +} +#menu li { + display: inline-block; + border-radius: 0px; + + padding: 0px; + width: 16.66%; + min-width: 140px; + text-align: center; + + font-size: 150%; + font-weight: 400; + font-variant: small-caps; + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; +} +#menu a { + display: block; + padding: 8px 10px; + color: black; +} +#menu a:hover { + background: #ffb000; + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + text-decoration: none; +} + +#submenu { + /*border: 1px solid black;*/ +} +#submenu ul { + padding: 0px 0px; + margin: 20px 0px 20px 0px; + background: #00c322; /* @mamgreen */ + border-radius: 8px; + list-style-position: inside; + width: 100%; +} +#submenu li { + border-radius: 0px; + padding: 6px 15px; + margin-right: 0px; + font-size: 120%; +} +#submenu li:hover { + background: #ffb000; +} +#submenu li:first-child { + border-top-left-radius: 7px; + border-top-right-radius: 7px; + padding-top: 8px; +} +#submenu li:last-child { + border-bottom-left-radius: 7px; + border-bottom-right-radius: 7px; + padding-bottom: 8px; +} +#submenu li>a { + color: #000; +} +#submenu li>a:hover { + text-decoration: none; +} diff --git a/mamweb/static/images/logocb.png b/mamweb/static/images/logocb.png new file mode 100644 index 00000000..a35150a5 Binary files /dev/null and b/mamweb/static/images/logocb.png differ diff --git a/mamweb/templates/base.html b/mamweb/templates/base.html index 5812ccfc..e43a837a 100644 --- a/mamweb/templates/base.html +++ b/mamweb/templates/base.html @@ -30,16 +30,46 @@ {% endif %}
-
- Korespondenční seminář M&M +
+
+
+ Studentský korespondenční seminář a časopis MFF UK +
+
+
+
+
+ +
-
- {% include "menu.html" %} - {% block submenu %} - {% endblock %} +
+ +
+
+
+
+
-
+
{% block content %} {% endblock content %}
diff --git a/mamweb/templates/menu.html b/mamweb/templates/menu.html index 6b174589..d0af5551 100644 --- a/mamweb/templates/menu.html +++ b/mamweb/templates/menu.html @@ -1,15 +1,13 @@ {% load i18n cache mam_menu %} {% aktualni_rocniky as rs %} -

MENU

- + Toto soustředění není veřejné, vidíte ho jen proto, + že jste přihlášení.
+ {% endif %} + {# misto soustredeni TODO upravit#} {% if soustredeni.misto %}

Soustředění v {{soustredeni.misto}} @@ -29,9 +36,6 @@
  • Nic! {% endfor %} - {# Kdyz neni verejne, tak TODO zobraz jen pro prihlasene orgy #} - {% else %} - {# TODO if org je prihlaseny, predelat na (verejne OR jsem_org) #} {% endif %} {% empty %} Žádná soustředění zatím neproběhla! diff --git a/seminar/templates/seminar/zadani/submenu.html b/seminar/templates/seminar/zadani/submenu.html index fa2761a3..8c67e9bf 100644 --- a/seminar/templates/seminar/zadani/submenu.html +++ b/seminar/templates/seminar/zadani/submenu.html @@ -4,7 +4,7 @@
  • Aktuální zadání
  • Úlohy
  • Témata -
  • Aktuální Číslo +
  • Aktuální číslo
  • Výsledkové listiny diff --git a/seminar/urls.py b/seminar/urls.py index 94e7b992..f066a0b3 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -8,7 +8,7 @@ urlpatterns = patterns('', url(r'^archiv/cisla/$', views.CislaView.as_view()), url(r'^rocnik/(?P\d+)/$', views.RocnikView.as_view(), name='seminar_rocnik'), - url(r'^cislo/(?P\d+).(?P\d+)/$', views.CisloView.as_view(), name='seminar_cislo'), + url(r'^cislo/(?P\d+)\.(?P\d+)/$', views.CisloView.as_view(), name='seminar_cislo'), url(r'^problem/(?P\d+)/$', views.ProblemView.as_view(), name='seminar_problem'), url(r'^soustredeni/$', views.SoustredeniListView.as_view(), diff --git a/seminar/views.py b/seminar/views.py index 7e75ac7e..23bc2b99 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -74,20 +74,26 @@ class CisloView(generic.DetailView): def get_context_data(self, **kwargs): context = super(CisloView, self).get_context_data(**kwargs) + # Vysledky k cislu: seznam objektu typu (cislo, resitel, body [v tom cisle], body_celkem [od zac. rocniku]) vysledky = VysledkyKCislu.objects.filter(cislo = context['cislo']).order_by('-body_celkem').select_related("resitel") + reseni = Reseni.objects.filter(cislo_body = context['cislo']).select_related("resitel") + # seznam problemu s nejakymi body v tomto cisle problemy = sorted(list(set([r.problem for r in reseni])), key=lambda x:(0 if x.typ==Problem.TYP_ULOHA else 1,x.kod)) - #setridi problemy podle typu a poradi zadani + # cislo sloupecku pro problem (inverzni funkce) problem_index = {} for i in range(len(problemy)): problem_index[problemy[i].id] = i #umoznuje zjistit index podle id problemu + # pomocna mapa Resitel: RadekVysledkovky vysledky_resitele = {} stejne_body = {} konec_rozmezi = {} + # radky vysledkovky, seznam objektu RadekVysledkovky vysledkovka = [] + # posledni pocet bodu, pro detekci stejnych mist posledni_body = 100000 predchozi_poradi = None @@ -96,8 +102,7 @@ class CisloView(generic.DetailView): tv = RadekVysledkovky() tv.resitel = v.resitel tv.vysledek = v - tv.body = ['']*len(problemy) - #defaultni hodnota poctu bodu je prazdny retezec + tv.body = ['']*len(problemy) # misto pro body za jednotlive uloy tv.poradi = '' #defaultni poradi je prazdne - kvuli sdilenym mistum if posledni_body > v.body_celkem: @@ -123,6 +128,7 @@ class CisloView(generic.DetailView): vysledky_resitele[v.resitel.id] = tv vysledkovka.append(tv) + # doplneni bodu za jednotliva reseni lidi do RadekVysledkovky.body for r in reseni: vysledky_resitele[r.resitel.id].body[problem_index[r.problem.id]] = r.body