link to gallery, show related content for single photo page
This commit is contained in:
parent
01afa5aa3f
commit
f4f6b440b8
|
@ -59,9 +59,16 @@
|
||||||
document.querySelectorAll('.select-image').forEach(function(a) {
|
document.querySelectorAll('.select-image').forEach(function(a) {
|
||||||
a.onclick = function(event) {
|
a.onclick = function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
slider.goToSlide(this.dataset.id)
|
slider.goToSlide(parseInt(this.dataset.id) - 1)
|
||||||
|
document.location.hash = '#' + this.dataset.id;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
if (document.querySelectorAll('.select-image').length && document.location.hash.length) {
|
||||||
|
var slide = parseInt(document.location.hash.slice(1))
|
||||||
|
if (slide) {
|
||||||
|
slider.goToSlide(slide - 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(document).keydown(function(e){
|
$(document).keydown(function(e){
|
||||||
if (e.keyCode == 39) // Right arrow
|
if (e.keyCode == 39) // Right arrow
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<h6><strong>Gallery: {{gallery.title}}</strong></h6>
|
<h6><strong>Gallery: {{gallery.title}}</strong></h6>
|
||||||
<ul class="clearing-thumbs" data-clearing>
|
<ul class="clearing-thumbs" data-clearing>
|
||||||
{% for photo in gallery.public %}
|
{% for photo in gallery.public %}
|
||||||
<li><a href="{{ photo.get_absolute_url }}"><img src="{{ photo.get_thumbnail_url }}"></a></li>
|
<li><a href="{{ gallery.get_absolute_url }}#{{forloop.counter}}"><img src="{{ photo.get_thumbnail_url }}"></a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -4,15 +4,39 @@
|
||||||
{% block title %}{{ gallery.title }}{% endblock %}
|
{% block title %}{{ gallery.title }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row col-lg-12">
|
<div class="row">
|
||||||
<h1 class="page-header">{{ gallery.title }}</h1>
|
<div class="medium-9 columns">
|
||||||
<p class="muted"><small>{% trans "Published" %} {{ gallery.date_added }}</small></p>
|
{% if gallery.content.exists %}
|
||||||
{% if gallery.description %}{{ gallery.description|safe }}{% endif %}
|
<h6 class="page-header"><a href="{{ gallery.content.all.0.get_absolute_url }}">Back to {{ gallery.content.all.0.title }}</a></h6>
|
||||||
|
{% endif %}
|
||||||
|
<h5>{{ gallery.title }}</h5>
|
||||||
|
<ul class="slider1">
|
||||||
{% for photo in gallery.public %}
|
{% for photo in gallery.public %}
|
||||||
<a href="{{ photo.get_absolute_url }}">
|
<li id="slide-{{photo.slug}}">
|
||||||
|
<img src="{{ photo.get_display_url }}" alt="{{ photo.title }}">
|
||||||
|
<p>
|
||||||
|
{{ photo.caption|safe }}
|
||||||
|
{% if photo.caption %}<br>{%endif%}
|
||||||
|
<a href="{{ photo.image.url }}" target="_blank" >Link to original file</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="medium-3 columns">
|
||||||
|
<br>
|
||||||
|
<p>{% trans "Other photos" %}:</p>
|
||||||
|
<div>
|
||||||
|
{% for photo in gallery.public %}
|
||||||
|
<div style="float: left; padding: 4px">
|
||||||
|
<a href="{{ photo.get_absolute_url }}" class="select-image" data-id="{{forloop.counter}}">
|
||||||
<img src="{{ photo.get_thumbnail_url }}" class="thumbnail" alt="{{ photo.title }}">
|
<img src="{{ photo.get_thumbnail_url }}" class="thumbnail" alt="{{ photo.title }}">
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
|
||||||
<div><a href="{% url 'photologue:gallery-list' %}" class="btn btn-default">{% trans "View all galleries" %}</a></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -4,45 +4,21 @@
|
||||||
{% block title %}{{ object.title }}{% endblock %}
|
{% block title %}{{ object.title }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% for gallery in object.public_galleries %}
|
<div class="row">
|
||||||
<div class="row">
|
|
||||||
<div class="medium-9 columns">
|
<div class="medium-9 columns">
|
||||||
{% if gallery.content.exists %}
|
<img src="{{ object.get_display_url }}" alt="{{ object.title }}">
|
||||||
<h6 class="page-header"><a href="{{ gallery.content.all.0.get_absolute_url }}">Back to {{ gallery.content.all.0.title }}</a></h6>
|
|
||||||
{% endif %}
|
|
||||||
<h5>{{ gallery.title }}</h5>
|
|
||||||
<ul class="slider1">
|
|
||||||
{% for photo in gallery.public %}
|
|
||||||
<li id="slide-{{photo.slug}}">
|
|
||||||
<img src="{{ photo.get_display_url }}" alt="{{ photo.title }}">
|
|
||||||
<p>
|
<p>
|
||||||
{{ photo.caption|safe }}
|
{{ object.caption|safe }}
|
||||||
{% if photo.caption %}<br>{%endif%}
|
{% if object.caption %}<br>{%endif%}
|
||||||
<a href="{{ photo.image.url }}" target="_blank" >Link to original file</a>
|
<a href="{{ object.image.url }}" target="_blank" >Link to original file</a>
|
||||||
</p>
|
</p>
|
||||||
|
<ul>
|
||||||
</li>
|
{% for gallery in object.public_galleries %}
|
||||||
|
{% if gallery.content.exists %}
|
||||||
|
<li><a href="{{ gallery.content.all.0.get_absolute_url }}">{{ gallery.content.all.0.title }}</a></li>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="medium-3 columns">
|
</div>
|
||||||
{% if object.public_galleries %}
|
|
||||||
<br>
|
|
||||||
<p>{% trans "Other photos" %}:</p>
|
|
||||||
<div>
|
|
||||||
{% for photo in gallery.public %}
|
|
||||||
<div style="float: left; padding: 4px">
|
|
||||||
<a href="{{ photo.get_absolute_url }}" class="select-image" data-id="{{forloop.counter}}">
|
|
||||||
<img src="{{ photo.get_thumbnail_url }}" class="thumbnail" alt="{{ photo.title }}">
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
<script>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user