Bc. Petr Pecha
8 years ago
21 changed files with 401 additions and 19 deletions
@ -0,0 +1,19 @@ |
|||||
|
table { |
||||
|
border-collapse: collapse; |
||||
|
width: 100% |
||||
|
} |
||||
|
|
||||
|
table, th, td { |
||||
|
border: 1px solid black; |
||||
|
} |
||||
|
|
||||
|
td { |
||||
|
width: 1%; |
||||
|
height: 1cm; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.fill { |
||||
|
width: 100%; |
||||
|
max-width: 100% |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
{% extends "prednasky/Base.html" %} |
||||
|
|
||||
|
|
||||
|
{% block header %}hlasovani{% endblock %} |
||||
|
|
||||
|
{% block nadpis1a %}{% block nadpis1b %} |
||||
|
Hlasování o přednáškách |
||||
|
{% endblock %}{% endblock %} |
||||
|
|
||||
|
{% block content %} |
||||
|
{# Projdi vsechny seznamy #} |
||||
|
<div class="mam-org-only"> |
||||
|
<ul> |
||||
|
{% for seznam in object_list %} |
||||
|
<li> |
||||
|
{% if seznam.stav == 1 %} {# STAV_NAHRH = 1 #} |
||||
|
<a href="/prednasky/seznam_prednasek/{{seznam.id}}">Návrh přednášek na soustředění {{seznam.soustredeni.misto}} </a> |
||||
|
{% else %} |
||||
|
<a href="/prednasky/seznam_prednasek/{{seznam.id}}">Seznam přednášek na soustředění {{seznam.soustredeni.misto}} </a> |
||||
|
{% endif %} |
||||
|
<a href="/prednasky/seznam_prednasek/{{seznam.id}}/export">Export</a> |
||||
|
</li> |
||||
|
{% endfor %} |
||||
|
|
||||
|
{% endblock %} |
||||
|
|
@ -0,0 +1,21 @@ |
|||||
|
{% extends "prednasky/Base.html" %} |
||||
|
|
||||
|
|
||||
|
{% block header %}seznam_prednasek{% endblock %} |
||||
|
|
||||
|
{% block nadpis1a %}{% block nadpis1b %} |
||||
|
Seznam přednášek |
||||
|
{% endblock %}{% endblock %} |
||||
|
|
||||
|
{% block content %} |
||||
|
<div class="mam-org-only"> |
||||
|
<ul> |
||||
|
{# Projdi vsechny prednasky #} |
||||
|
{% for prednaska in object_list %} |
||||
|
<li> |
||||
|
<strong>{{prednaska.nazev}}</strong> (<i>{{prednaska.obor}},{{prednaska.obtiznost}}</i>) - {{prednaska.org}} |
||||
|
</li> |
||||
|
{% endfor %} |
||||
|
|
||||
|
{% endblock %} |
||||
|
|
@ -0,0 +1,21 @@ |
|||||
|
{% block content %} |
||||
|
{% spaceless %} |
||||
|
{% for hlas in hlasovani %} |
||||
|
hlas({{hlas.ucastnik}},{{hlas.prednaska.id}},{{hlas.body}}) |
||||
|
{% endfor %} |
||||
|
{% for prednaska in prednasky %} |
||||
|
prednaska({{prednaska.id}},{{prednaska.org.id}},{{prednaska.obtiznost}},{{prednaska.obor}}) |
||||
|
{% endfor %} |
||||
|
{% for org in orgove %} |
||||
|
org({{org.id}},4,0,15) |
||||
|
{% endfor %} |
||||
|
{% for org in orgove %} |
||||
|
{{org.id}};{{org}} |
||||
|
{% endfor %} |
||||
|
{% for prednaska in prednasky %} |
||||
|
{{prednaska.id}};{{prednaska.nazev}};{{prednaska.org.id}} |
||||
|
{{prednaska.body}} |
||||
|
{% endfor %} |
||||
|
{% endspaceless %} |
||||
|
{% endblock %} |
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
from django.conf.urls import * # NOQA |
||||
|
from django.conf.urls import patterns, url |
||||
|
from django.contrib.auth.decorators import user_passes_test |
||||
|
from . import views |
||||
|
|
||||
|
staff_member_required = user_passes_test(lambda u: u.is_staff) |
||||
|
|
||||
|
urlpatterns = [ |
||||
|
url(r'^prednasky/$', views.newPrednaska), |
||||
|
url(r'^prednasky/hotovo$', views.Prednaska_hotovo), |
||||
|
url(r'^prednasky/metaseznam_prednasek$', staff_member_required(views.MetaSeznamListView.as_view()), name='metaseznam-list'), |
||||
|
url(r'^prednasky/seznam_prednasek/(?P<seznam>\d+)/$', staff_member_required(views.SeznamListView.as_view()), name='seznam-list'), |
||||
|
url(r'^prednasky/seznam_prednasek/(?P<seznam>\d+)/export$', staff_member_required(views.SeznamExportView), name='seznam-export'), |
||||
|
# url(r'^korektury/help/', staff_member_required(views.KorekturyHelpView.as_view()), name='korektury-help'), |
||||
|
] |
@ -0,0 +1,31 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
import seminar.models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0041_konfery'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='konfera', |
||||
|
name='materialy', |
||||
|
field=models.FileField(help_text='Dal\u0161\xed materi\xe1ly ke konfe\u0159e zabalen\xe9 do jednoho souboru', upload_to=seminar.models.generate_filename_konfera, verbose_name='materialy', blank=True), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='konfera', |
||||
|
name='prezentace', |
||||
|
field=models.FileField(help_text='Prezentace nebo fotka posteru', upload_to=seminar.models.generate_filename_konfera, verbose_name='prezentace', blank=True), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='konfera', |
||||
|
name='prispevek', |
||||
|
field=models.ForeignKey(related_name='konfery', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='seminar.Problem', help_text='\xda\u010dastnick\xfd p\u0159\xedp\u011bvek o konfe\u0159e', null=True, verbose_name='p\u0159\xedsp\u011bvek do \u010d\xedsla'), |
||||
|
), |
||||
|
] |
@ -0,0 +1,24 @@ |
|||||
|
\newcommand{\stvrzenka}[6]{ |
||||
|
\removelastskip\bigskip |
||||
|
\newpage |
||||
|
|
||||
|
\noindent\textbf{Dodavatel:}\hfill\textbf{Stvrzenka č. {\Large #1}} |
||||
|
|
||||
|
{Univerzita Karlova \\ |
||||
|
\indent Matematicko-fyzikální fakulta \\ |
||||
|
\indent OVVP, M\&M \\ |
||||
|
\indent Ke Karlovu 3, 120 00 Praha 2 \\ |
||||
|
\indent IČ: 00216208 DIČ: CZ00216208} |
||||
|
|
||||
|
\parindent=0pt |
||||
|
\parskip=0.2in |
||||
|
|
||||
|
\textbf{Celkem Kč:} 700,- \\ |
||||
|
\textbf{Slovy:} sedmset korun českých |
||||
|
|
||||
|
\textbf{Přijato od (firma, jméno, adresa):} #2 #3, #4, #5 #6 |
||||
|
|
||||
|
\textbf{Účel platby:} příspěvek na stravování |
||||
|
|
||||
|
ze dne \datum \hfill Přijal:\hspace{3cm} |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
\documentclass[12pt,a4paper]{article} |
||||
|
\usepackage[czech]{babel} |
||||
|
\usepackage[utf8]{inputenc} |
||||
|
\usepackage[margin=1in]{geometry} |
||||
|
|
||||
|
\usepackage{stvrzenka} |
||||
|
|
||||
|
\pagestyle{empty} |
||||
|
\begin{document} |
||||
|
|
||||
|
\input{ucastnici} |
||||
|
|
||||
|
\end{document} |
@ -0,0 +1,39 @@ |
|||||
|
{% load static %} |
||||
|
<html lang='cs'> |
||||
|
<head> |
||||
|
<title>Seznam účastníků</title> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
|
<link rel="stylesheet" type="text/css" href="{% static 'css/printtable.css' %}" /> |
||||
|
</head> |
||||
|
<body> |
||||
|
|
||||
|
<h1> |
||||
|
{% with object_list|first as afirst %} |
||||
|
{{afirst.soustredeni.misto}} |
||||
|
{% endwith %} |
||||
|
- účastníci |
||||
|
</h1> |
||||
|
<table> |
||||
|
<tr> |
||||
|
<th nowrap>Jméno</th> |
||||
|
<th nowrap>Maturita</th> |
||||
|
<th nowrap>Mobil</th> |
||||
|
<th class="fill"></th> |
||||
|
</tr> |
||||
|
{% for sous_ucast in object_list %} |
||||
|
<tr> |
||||
|
<td nowrap>{{sous_ucast.resitel}}</td> |
||||
|
<td nowrap>{{sous_ucast.resitel.rok_maturity}}</td> |
||||
|
<td nowrap>{{sous_ucast.resitel.telefon}}</td> |
||||
|
<td class="fill"></td> |
||||
|
|
||||
|
</tr> |
||||
|
|
||||
|
{% empty %} |
||||
|
Žádní účastníci nebyli... |
||||
|
{% endfor %} |
||||
|
</table> |
||||
|
</ul> |
||||
|
</body> |
||||
|
</html> |
||||
|
|
@ -0,0 +1,5 @@ |
|||||
|
{% load tex %} |
||||
|
\newcommand{\datum}{{datum|date:"j. n. Y"|sloz}} |
||||
|
{% for u in ucastnici %} |
||||
|
\stvrzenka{{u.cislo_stvrzenky|sloz}}{{u.jmeno|sloz}}{{u.prijmeni|sloz}}{{u.ulice|sloz}}{{u.psc|sloz}}{{u.mesto|sloz}} |
||||
|
{% endfor %} |
@ -0,0 +1,61 @@ |
|||||
|
import csv, codecs, cStringIO |
||||
|
|
||||
|
class UTF8Recoder: |
||||
|
""" |
||||
|
Iterator that reads an encoded stream and reencodes the input to UTF-8 |
||||
|
""" |
||||
|
def __init__(self, f, encoding): |
||||
|
self.reader = codecs.getreader(encoding)(f) |
||||
|
|
||||
|
def __iter__(self): |
||||
|
return self |
||||
|
|
||||
|
def next(self): |
||||
|
return self.reader.next().encode("utf-8") |
||||
|
|
||||
|
class UnicodeReader: |
||||
|
""" |
||||
|
A CSV reader which will iterate over lines in the CSV file "f", |
||||
|
which is encoded in the given encoding. |
||||
|
""" |
||||
|
|
||||
|
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds): |
||||
|
f = UTF8Recoder(f, encoding) |
||||
|
self.reader = csv.reader(f, dialect=dialect, **kwds) |
||||
|
|
||||
|
def next(self): |
||||
|
row = self.reader.next() |
||||
|
return [unicode(s, "utf-8") for s in row] |
||||
|
|
||||
|
def __iter__(self): |
||||
|
return self |
||||
|
|
||||
|
class UnicodeWriter: |
||||
|
""" |
||||
|
A CSV writer which will write rows to CSV file "f", |
||||
|
which is encoded in the given encoding. |
||||
|
""" |
||||
|
|
||||
|
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds): |
||||
|
# Redirect output to a queue |
||||
|
self.queue = cStringIO.StringIO() |
||||
|
self.writer = csv.writer(self.queue, dialect=dialect, **kwds) |
||||
|
self.stream = f |
||||
|
self.encoder = codecs.getincrementalencoder(encoding)() |
||||
|
|
||||
|
def writerow(self, row): |
||||
|
self.writer.writerow([s.encode("utf-8") for s in row]) |
||||
|
# Fetch UTF-8 output from the queue ... |
||||
|
data = self.queue.getvalue() |
||||
|
data = data.decode("utf-8") |
||||
|
# ... and reencode it into the target encoding |
||||
|
data = self.encoder.encode(data) |
||||
|
# write to the target stream |
||||
|
self.stream.write(data) |
||||
|
# empty queue |
||||
|
self.queue.truncate(0) |
||||
|
|
||||
|
def writerows(self, rows): |
||||
|
for row in rows: |
||||
|
self.writerow(row) |
||||
|
|
Loading…
Reference in new issue