Browse Source

Galerie: přepínání fotek klávesnicí

remotes/origin/imagekit
Matěj Kocián 9 years ago
parent
commit
03c8c1c8dd
  1. 29
      galerie/templates/galerie/Galerie.html
  2. 3
      mamweb/templates/base.html

29
galerie/templates/galerie/Galerie.html

@ -1,10 +1,39 @@
{% extends "galerie/Base.html" %} {% extends "galerie/Base.html" %}
{% block nadpis1a %} {% block nadpis1a %}
{{galerie.nazev}}: {{ obrazek.popis | default:"Fotka" }} {{galerie.nazev}}: {{ obrazek.popis | default:"Fotka" }}
{% endblock %} {% endblock %}
{% block script %}
{% with obrazky_predchozi|last as predchozi_obrazek %}
{% with obrazky_dalsi|first as dalsi_obrazek %}
<script type="text/javascript">
$(document).keydown(function(e) {
{% if predchozi_obrazek %}
// doleva
if (e.which == 37) {
window.location.assign("../{{ predchozi_obrazek.pk }}#nahoru");
}
{% endif %}
{% if dalsi_obrazek %}
// doprava
if (e.which == 39) {
window.location.assign("../{{ dalsi_obrazek.pk }}#nahoru");
}
{% endif %}
if (e.which == 27) {
window.location.assign("../#obsah")
}
})
</script>
{% endwith %}
{% endwith %}
{% endblock %}
{% block content %} {% block content %}
<h2> <h2>
{% for g in cesta %} {% for g in cesta %}
<a href="../../{{ g.pk }}">{{ g.nazev }}</a> > <a href="../../{{ g.pk }}">{{ g.nazev }}</a> >

3
mamweb/templates/base.html

@ -29,6 +29,9 @@
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script> </script>
{# script specifický pro stránku #}
{% block script %}{% endblock %}
</head> </head>
<body class='{% if user.is_staff %}org-logged-in{% endif %}'> <body class='{% if user.is_staff %}org-logged-in{% endif %}'>
{% if user.is_staff %} {% if user.is_staff %}

Loading…
Cancel
Save