Browse Source

Merge branch 'data_migrations' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into data_migrations

export_seznamu_prednasek
Kateřina Čížková 5 years ago
parent
commit
7086309bc1
  1. 4
      mamweb/templates/base.html
  2. 8
      seminar/models.py
  3. 12
      seminar/templates/seminar/archiv/obalky.tex
  4. 2
      seminar/templates/seminar/soustredeni/seznam_soustredeni.html
  5. 2
      seminar/templates/seminar/soustredeni/seznam_ucastniku.html
  6. 2
      seminar/views.py

4
mamweb/templates/base.html

@ -13,8 +13,8 @@
<script src="{% static 'js/jquery-1.11.1.js' %}"></script> <script src="{% static 'js/jquery-1.11.1.js' %}"></script>
{% include 'autocomplete_light/static.html' %} {% include 'autocomplete_light/static.html' %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}fluent_comments/css/ajaxcomments.css" /> <link rel="stylesheet" type="text/css" href="{% static 'fluent_comments/css/ajaxcomments.css' %}" />
<script type="text/javascript" src="{{ STATIC_URL }}fluent_comments/js/ajaxcomments.js"></script> <script type="text/javascript" src="{% static 'fluent_comments/js/ajaxcomments.js' %}"></script>
{# nastavení MathJaxu, aby nahrazoval i matiku obalenou jednoduchými $ #} {# nastavení MathJaxu, aby nahrazoval i matiku obalenou jednoduchými $ #}
<script type="text/x-mathjax-config"> <script type="text/x-mathjax-config">

8
seminar/models.py

@ -1152,6 +1152,14 @@ class TreeNode(models.Model):
blank = True, blank = True,
on_delete=models.SET_NULL, on_delete=models.SET_NULL,
verbose_name="další element na stejné úrovni") verbose_name="další element na stejné úrovni")
def print_tree(self,indent=0):
print("{}TreeNode({})".format(" "*indent,self.id))
if self.first_child:
self.first_child.print_tree(indent=indent+2)
if self.succ:
self.succ.print_tree(indent=indent)
class RocnikNode(TreeNode): class RocnikNode(TreeNode):
class Meta: class Meta:

12
seminar/templates/seminar/archiv/obalky.tex

@ -96,25 +96,29 @@
{% for r in resitele %} {% for r in resitele %}
{% with o=r.osoba %}
{% with s=r.osoba.skola %}
{% spaceless %} {% spaceless %}
{% if r.zasilat == "do_skoly" %} {% if r.zasilat == "do_skoly" %}
{% if r.stat == "CZ" %} {% if r.stat == "CZ" %}
\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{r.skola.nazev|sloz}}{{r.skola.ulice|sloz}}{{r.skola.psc|sloz}}{{r.skola.mesto|sloz}}{{''|sloz}} \obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{s.nazev|sloz}}{{s.ulice|sloz}}{{s.psc|sloz}}{{s.mesto|sloz}}{{''|sloz}}
{% else %} {% else %}
\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{r.skola.nazev|sloz}}{{r.skola.ulice|sloz}}{{r.skola.psc|sloz}}{{r.skola.mesto|sloz}}{{r.stat.name|sloz}} \obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{s.nazev|sloz}}{{s.ulice|sloz}}{{s.psc|sloz}}{{s.mesto|sloz}}{{o.stat.name|sloz}}
{% endif %} {% endif %}
{% elif r.zasilat == "domu" %} {% elif r.zasilat == "domu" %}
{% if r.stat == "CZ" %} {% if r.stat == "CZ" %}
\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{''|sloz}}{{r.ulice|sloz}}{{r.psc|sloz}}{{r.mesto|sloz}}{{''|sloz}} \obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{''|sloz}}{{o.ulice|sloz}}{{o.psc|sloz}}{{o.mesto|sloz}}{{''|sloz}}
{% else %} {% else %}
\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{''|sloz}}{{r.ulice|sloz}}{{r.psc|sloz}}{{r.mesto|sloz}}{{r.stat.name|sloz}} \obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{''|sloz}}{{o.ulice|sloz}}{{o.psc|sloz}}{{o.mesto|sloz}}{{o.stat.name|sloz}}
{% endif %} {% endif %}
{% else %} {% else %}
% zasilat: {{r.zasilat}} % zasilat: {{r.zasilat}}
%\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{''|sloz}}{{r.ulice|sloz}}{{r.psc|sloz}}{{r.mesto|sloz}}{{r.stat.name|sloz}} %\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{''|sloz}}{{r.ulice|sloz}}{{r.psc|sloz}}{{r.mesto|sloz}}{{r.stat.name|sloz}}
{% endif %} {% endif %}
{% endspaceless %} {% endspaceless %}
{% endwith %}
{% endwith %}
{% endfor %} {% endfor %}
\end{document} \end{document}

2
seminar/templates/seminar/soustredeni/seznam_soustredeni.html

@ -51,7 +51,7 @@
<a href="../{{soustredeni.pk}}/seznam_ucastniku">HTML tabulka pro tisk</a>, <a href="../{{soustredeni.pk}}/seznam_ucastniku">HTML tabulka pro tisk</a>,
<a href="../{{soustredeni.pk}}/export_ucastniku">CSV</a>, <a href="../{{soustredeni.pk}}/export_ucastniku">CSV</a>,
<a href="../{{soustredeni.pk}}/maily_ucastniku">E-maily</a><br> <a href="../{{soustredeni.pk}}/maily_ucastniku">E-maily</a><br>
<a href="../{{soustredeni.pk}}/stvrzenky/42">Stvrzenky <i>(42 v URL nahraďte prvním číslem z rozsahu)</i></a> <!--a href="../{{soustredeni.pk}}/stvrzenky/42">Stvrzenky <i>(42 v URL nahraďte prvním číslem z rozsahu)</i></a!-->
</div> </div>
{% endif %} {% endif %}

2
seminar/templates/seminar/soustredeni/seznam_ucastniku.html

@ -25,7 +25,7 @@
<tr> <tr>
<td nowrap>{{sous_ucast.resitel}}</td> <td nowrap>{{sous_ucast.resitel}}</td>
<td nowrap>{{sous_ucast.resitel.rok_maturity}}</td> <td nowrap>{{sous_ucast.resitel.rok_maturity}}</td>
<td nowrap>{{sous_ucast.resitel.telefon}}</td> <td nowrap>{{sous_ucast.resitel.osoba.telefon}}</td>
<td nowrap>{{sous_ucast.poznamka}}</td> <td nowrap>{{sous_ucast.poznamka}}</td>
<td class="fill"></td> <td class="fill"></td>

2
seminar/views.py

@ -524,7 +524,7 @@ def obalkyView(request,resitele):
tex = render(request,'seminar/archiv/obalky.tex', {'resitele': resitele}).content tex = render(request,'seminar/archiv/obalky.tex', {'resitele': resitele}).content
tempdir = tempfile.mkdtemp() tempdir = tempfile.mkdtemp()
with open(tempdir+"/obalky.tex","w") as texfile: with open(tempdir+"/obalky.tex","wb") as texfile:
texfile.write(tex) texfile.write(tex)
shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/lisak.eps'),tempdir) shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/lisak.eps'),tempdir)
subprocess.call(["pdflatex","obalky.tex"],cwd = tempdir) subprocess.call(["pdflatex","obalky.tex"],cwd = tempdir)

Loading…
Cancel
Save