Browse Source

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

export_seznamu_prednasek
parent
commit
81a05c8182
  1. 10
      seminar/templates/seminar/archiv/cislo.html
  2. 9
      seminar/utils.py

10
seminar/templates/seminar/archiv/cislo.html

@ -46,17 +46,17 @@
</div> </div>
{% endif %} {% endif %}
<hr>
<div id="obrazek_cisla_archiv">
{% if cislo.titulka_nahled %} {% if cislo.titulka_nahled %}
<hr>
<div id="obrazek_cisla_archiv">
<a href="{{ cislo.pdf.url }}"><img src="{{ cislo.titulka_nahled.url }}" alt=Titulní strana {{ cislo.poradi }}. čísla></a> <a href="{{ cislo.pdf.url }}"><img src="{{ cislo.titulka_nahled.url }}" alt=Titulní strana {{ cislo.poradi }}. čísla></a>
{% elif cislo.pdf %} {% elif cislo.pdf %}
<a href='{{ cislo.pdf.url }}'>Číslo v pdf</a> <a href='{{ cislo.pdf.url }}'>Číslo v pdf</a>
{% endif %}
</div> </div>
<hr>
{% endif %}
<hr>
{% comment %} {% comment %}
<script id="vuedata" type="application/json">{"treenode":{{cislo.cislonode.id}}}</script> <script id="vuedata" type="application/json">{"treenode":{{cislo.cislonode.id}}}</script>

9
seminar/utils.py

@ -17,10 +17,11 @@ import seminar.treelib as t
org_required = permission_required('auth.org', raise_exception=True) org_required = permission_required('auth.org', raise_exception=True)
resitel_required = permission_required('auth.resitel', raise_exception=True) resitel_required = permission_required('auth.resitel', raise_exception=True)
User = get_user_model() User = get_user_model()
User.je_org = lambda self: self.has_perm('auth.org') # Není to úplně hezké, ale budeme doufat, že to je funkční...
User.je_resitel = lambda self: self.has_perm('auth.resitel') User.je_org = property(lambda self: self.has_perm('auth.org'))
AnonymousUser.je_org = lambda self: False User.je_resitel = property(lambda self: self.has_perm('auth.resitel'))
AnonymousUser.je_resitel = lambda self: False AnonymousUser.je_org = False
AnonymousUser.je_resitel = False
class FirstTagParser(HTMLParser): class FirstTagParser(HTMLParser):

Loading…
Cancel
Save