Merge remote-tracking branch 'origin/master' into Petr
|  | @ -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; | ||||
| 	} | ||||
| } | ||||
|  |  | |||
							
								
								
									
										
											BIN
										
									
								
								mamweb/static/images/footer-bg-bottom.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 13 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mamweb/static/images/footer-bg-top.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 15 KiB | 
| Before Width: | Height: | Size: 38 KiB | 
| Before Width: | Height: | Size: 400 KiB After Width: | Height: | Size: 400 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mamweb/static/images/header-bg-clanek.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 519 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mamweb/static/images/header-bg-uvod.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 512 KiB | 
							
								
								
									
										
											BIN
										
									
								
								mamweb/static/images/header-bg-zadani.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 456 KiB | 
| Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 15 KiB | 
| Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.4 KiB | 
|  | @ -91,7 +91,7 @@ | |||
| 		    <a href="http://jcmf.cz/"><img class="logo-left" src="{% static 'images/logo-jcmf.png' %}" /></a> | ||||
| 		    <a href="http://mff.cuni.cz"><img class="logo-right" src="{% static 'images/logo-mff.png' %}" /></a> | ||||
| 			<p class="organize"><a href="/kontakt">Korespondenční seminář M&M</a> organizují převážně studenti MFF UK. Organizaci semináře a vydávání časopisu podporuje <a href="http://jcmf.cz">Jednota českých matematiků a fyziků</a>.</p> | ||||
| 		</div> | ||||
| 		</div><div id="footer-extra"></div> | ||||
| 	  </div> | ||||
| 	</div> | ||||
|     </div> | ||||
|  |  | |||
|  | @ -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) | ||||
|  |  | |||
|  | @ -4,31 +4,10 @@ | |||
| 
 | ||||
| {% block content %} | ||||
| <div> | ||||
|   {% if problem.cislo_zadani %} | ||||
|     <h2> | ||||
|       {% block nadpis1a %}{% block nadpis1b %} | ||||
|         {{ problem.nazev_typu }} {{ problem.kod_v_rocniku }}: {{ problem.nazev }} {{ problem.body_v_zavorce }} | ||||
|       {% endblock %}{% endblock %} | ||||
|     </h2> | ||||
|   {% block problem %} | ||||
|   {% endblock %} | ||||
| 
 | ||||
|     <p>Zadáno v čísle <a href='{{ problem.cislo_zadani.verejne_url }}'>{{ problem.cislo_zadani.kod }}</a>. | ||||
|     {% if problem.cislo_reseni %} | ||||
|       <p>Řešeno v čísle <a href='{{ problem.cislo_reseni.verejne_url }}'>{{ problem.cislo_reseni.kod }}</a>. | ||||
|     {% endif %} | ||||
|   {% else %} | ||||
|     <h2>Problém {{ problem.nazev }}</h2> | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
|   <h3>Zadání</h3> | ||||
|   {{ problem.text_zadani |safe }} | ||||
|   {% if problem.text_reseni %} | ||||
|     <h3>Řešení</h3> | ||||
|     {{ problem.text_reseni |safe }} | ||||
|   {% endif %} | ||||
| 
 | ||||
|   {# TODO Kontrola, zda je uzivatel org #}  | ||||
|   {% if user.is_authenticated %} | ||||
|   {% if user.is_staff %} | ||||
|   <div class='mam-org-only'> | ||||
| 
 | ||||
|     <h3>Text - org</h3> | ||||
|  | @ -43,4 +22,3 @@ | |||
| 
 | ||||
| </div> | ||||
| {% endblock content %} | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										38
									
								
								seminar/templates/seminar/archiv/problem_clanek.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						|  | @ -0,0 +1,38 @@ | |||
| {% extends "seminar/archiv/problem.html" %} | ||||
| 
 | ||||
| {% block problem %} | ||||
|   {% if problem.cislo_zadani %} | ||||
| 
 | ||||
|     <h2> | ||||
|       {{ problem.nazev_typu }}: | ||||
|       {% block nadpis1a %}{% block nadpis1b %} | ||||
|         {{ problem.nazev }} | ||||
|       {% endblock %}{% endblock %} | ||||
|     </h2> | ||||
| 
 | ||||
|     <div class='problem-autori'> | ||||
|     {% 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 %} | ||||
|     </div> | ||||
| 
 | ||||
|     {% if problem.cislo_reseni %} | ||||
|       <p>Vyšlo v čísle <a href='{{ problem.cislo_reseni.verejne_url }}'>{{ problem.cislo_reseni.kod }}</a>. | ||||
|     {% endif %} | ||||
| 
 | ||||
|   {% else %} | ||||
|     {# TODO ? #} | ||||
|     <h2>Problém {{ problem.nazev }}</h2> | ||||
|   {% endif %} | ||||
| 
 | ||||
|   {{ problem.text_zadani |safe }} | ||||
| 
 | ||||
| {% endblock %} | ||||
							
								
								
									
										27
									
								
								seminar/templates/seminar/archiv/problem_uloha_tema.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						|  | @ -0,0 +1,27 @@ | |||
| {% extends "seminar/archiv/problem.html" %} | ||||
| 
 | ||||
| {% block problem %} | ||||
|     <h2> | ||||
|       {% block nadpis1a %}{% block nadpis1b %} | ||||
|         {{ problem.nazev_typu }} {{ problem.kod_v_rocniku }}: {{ problem.nazev }} {{ problem.body_v_zavorce }} | ||||
|       {% endblock %}{% endblock %} | ||||
|     </h2> | ||||
|   {% if problem.cislo_zadani %} | ||||
|     <p>Zadáno v čísle <a href='{{ problem.cislo_zadani.verejne_url }}'>{{ problem.cislo_zadani.kod }}</a>. | ||||
|     {% if problem.cislo_reseni %} | ||||
|       <p>Řešeno v čísle <a href='{{ problem.cislo_reseni.verejne_url }}'>{{ problem.cislo_reseni.kod }}</a>. | ||||
|     {% endif %} | ||||
|   {% else %} | ||||
|     {# TODO ? #} | ||||
|     <h2>Problém {{ problem.nazev }}</h2> | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
|   <h3>Zadání</h3> | ||||
|   {{ problem.text_zadani |safe }} | ||||
|   {% if problem.text_reseni %} | ||||
|     <h3>Řešení</h3> | ||||
|     {{ problem.text_reseni |safe }} | ||||
|   {% endif %} | ||||
| 
 | ||||
| {% endblock %} | ||||
|  | @ -0,0 +1,5 @@ | |||
| {% extends 'seminar/clanky/resitelske_clanky.html' %} | ||||
| 
 | ||||
| {% block nadpis1a %}{% block nadpis1b %} | ||||
| Organizátorské články | ||||
| {% endblock %}{% endblock %} | ||||
							
								
								
									
										24
									
								
								seminar/templates/seminar/clanky/resitelske_clanky.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						|  | @ -0,0 +1,24 @@ | |||
| {% extends 'base.html' %} | ||||
| 
 | ||||
| {% block content %} | ||||
| 
 | ||||
| <h2> | ||||
| {% block nadpis1a %}{% block nadpis1b %} | ||||
| Řešitelské články | ||||
| {% endblock %}{% endblock %} | ||||
| </h2> | ||||
| 
 | ||||
| {% for clanek in object_list %} | ||||
| {% with clanek.cislo_zadani.rocnik.rocnik as rocnik %} | ||||
|   {% ifchanged rocnik %} | ||||
|     {% if not forloop.first %}</ul>{% endif %} | ||||
|     <h3>{{ rocnik }}. ročník</h3> | ||||
|     <ul> | ||||
|   {% endifchanged %} | ||||
|       <li> | ||||
|         <a href="{{ clanek.verejne_url }}">{{ clanek.nazev }}</a> | ||||
| {% endwith %} | ||||
| {% endfor %} | ||||
| </ul> | ||||
| 
 | ||||
| {% endblock %} | ||||
|  | @ -3,8 +3,8 @@ | |||
| <div id='submenu'> | ||||
| <ul> | ||||
|   <li class="{% if selected == "uvod" %}selected{% endif %}"><a href="{{cesta}}/uvod/">Úvod</a> | ||||
|   {# TODO až budou <li class="{% if selected == "org" %}selected{% endif %}"><a href="{{cesta}}/org/">Organizátorské články</a> #} | ||||
|   {# TODO až budou <li class="{% if selected == "resitel" %}selected{% endif %}"><a href="{{cesta}}/resitel/">Řešitelské články</a> #} | ||||
|   <li class="{% if selected == "org" %}selected{% endif %}"><a href="{{cesta}}/org/">Organizátorské články</a> | ||||
|   <li class="{% if selected == "resitel" %}selected{% endif %}"><a href="{{cesta}}/resitel/">Řešitelské články</a> | ||||
|   <li class="{% if selected == "jak-psat-vedecky-clanek" %}selected{% endif %}"><a href="{{cesta}}/jak-psat-vedecky-clanek/">Jak napsat článek</a> | ||||
| </ul> | ||||
| </div> | ||||
|  |  | |||
|  | @ -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 #} | ||||
| 
 | ||||
|   <h2> | ||||
|     {% block nadpis1a %}{% block nadpis1b %} | ||||
|       Soustředění | ||||
|     {% endblock %}{% endblock %} | ||||
|   </h2> | ||||
| 
 | ||||
|   {# Projdi vsechna soustredeni #} | ||||
|   {% for soustredeni in object_list %} | ||||
|  | @ -29,30 +29,36 @@ | |||
|         že jste přihlášení. <br> | ||||
|       {% endif %} | ||||
|       {# misto soustredeni TODO upravit#} | ||||
|       {% if soustredeni.misto %} | ||||
|         <h2> | ||||
|           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}} | ||||
|         </h2> | ||||
| 	<ul> | ||||
| 	<li> | ||||
| 		{{soustredeni.datum_zacatku}} – {{soustredeni.datum_konce}} | ||||
| 	</li> | ||||
| 	</ul> | ||||
|       {% if user.is_authenticated %} | ||||
|         {# popis soustredeni #} | ||||
|         {% if soustredeni.text %} | ||||
|           {% autoescape off %}{{soustredeni.text}}{% endautoescape %} | ||||
|         {% endif %} | ||||
|         {# Účastníci #} | ||||
|         <h3>Soustředění se zúčastnili tito účastníci:</h3> | ||||
|         <ul> | ||||
|         {% for i in soustredeni.soustredeni_ucastnici_set.all %} | ||||
|           <li>{{i.resitel}} | ||||
|         {% empty %} | ||||
|           <li>Nic! | ||||
|         {% endfor %} | ||||
|         </ul> | ||||
|       {% endif %} | ||||
|       {# popis soustredeni #} | ||||
|       {% if soustredeni.text %} | ||||
|         {% autoescape off %}{{soustredeni.text}}{% endautoescape %} | ||||
|       {% endif %} | ||||
|       {# Účastníci #} | ||||
|       <h3>Soustředění se zúčastnili tito účastníci:</h3> | ||||
|       <ul> | ||||
|       {% for i in soustredeni.soustredeni_ucastnici_set.all %} | ||||
|         <li>{{i.resitel}} | ||||
|       {% empty %} | ||||
|         <li>Nic! | ||||
|       {% endfor %} | ||||
|       </ul> | ||||
|     {% 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 %} | ||||
| 
 | ||||
|  |  | |||
|  | @ -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<prvni_rok>\d+)\.csv$', export.ExportRocnikView.as_view(), name='seminar_export_rocnik'), | ||||
|  |  | |||
|  | @ -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): | ||||
|  |  | |||
 Bc. Petr Pecha
						Bc. Petr Pecha