comparison templates/sat_website/gallery.html @ 29:b45621706d83

use Bootstrap carousels to display images and videos galeries: - one carousel for a 3x3 thumbnails grid - a second one in a modal window to view bigger pictures when a thumbnail is clicked
author souliane <souliane@mailoo.org>
date Wed, 21 Jan 2015 20:13:19 +0100
parents
children 565d653a15d3
comparison
equal deleted inserted replaced
28:30a1edf90fae 29:b45621706d83
1 {% comment %}
2 SàT website: Salut à Toi's presentation website
3 Copyright (C) 2012 Jérôme Poisson (goffi@goffi.org)
4
5 This file is part of SàT website.
6
7 SàT website is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Affero General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 Foobar is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Affero General Public License for more details.
16
17 You should have received a copy of the GNU Affero General Public License
18 along with Foobar. If not, see <http://www.gnu.org/licenses/>.
19 {% endcomment %}
20
21 {% load i18n %}
22 {% load staticfiles %}
23 {% load utils %}
24
25 <div id="carousel-screenshots" class="carousel slide" data-ride="carousel" data-interval="0">
26 {% if screenshots|length > 9 %}
27 <ol class="carousel-indicators">
28 {% for row in screenshots|buffer:9 %}
29 <li data-target="#carousel-screenshots" data-slide-to="{{ forloop.counter0 }}"{% if not forloop.counter0 %} class="active"{% endif %}></li>
30 {% endfor %}
31 </ol>
32 {% endif %}
33 <div class="carousel-inner" role="listbox">
34 {% for row in screenshots|buffer:9 %}
35 <div class="item{% if not forloop.counter0 %} active{% endif %}">
36 {% for screenshot in row %}
37 <div class="col-md-4">
38 {% if screenshot.poster %}
39 <video index="{{ forloop.counter0 }}" class="thumbnail img-responsive" width="640" height="400" poster="{% static screenshot.poster %}" controls="controls" src="{% static screenshot.path %}" preload="none">
40 {% blocktrans with firefox="<a href=\"http://www.mozilla-europe.org/fr/\">Firefox</a>" %}Your browser doesn't manage the « video » tag, you should update, e.g. with the last {{ firefox }}{% endblocktrans %}
41 </video>
42 {% else %}
43 <img index="{{ forloop.counter0 }}" class="thumbnail img-responsive" src="{% static screenshot.path %}">
44 {% endif %}
45 </div>
46 {% endfor %}
47 </div>
48 {% endfor %}
49 {% if screenshots|length > 9 %}
50 <a class="left carousel-control" href="#carousel-screenshots" role="button" data-slide="prev">
51 <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
52 <span class="sr-only">Previous</span>
53 </a>
54 <a class="right carousel-control" href="#carousel-screenshots" role="button" data-slide="next">
55 <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
56 <span class="sr-only">Next</span>
57 </a>
58 {% endif %}
59 </div>
60 </div>
61
62 <div class="modal" id="modal-screenshots" role="dialog">
63 <div class="modal-dialog">
64 <div class="modal-content">
65 <div class="modal-header">
66 <button class="close" type="button" data-dismiss="modal">×</button>
67 </div>
68 <div class="modal-body">
69 <div id="carousel-screenshots-modal" class="carousel slide" data-ride="carousel" data-interval="0">
70 {% if screenshots|length > 1 %}
71 <ol class="carousel-indicators">
72 {% for screenshot in screenshots %}
73 <li data-target="#carousel-screenshots-modal" data-slide-to="{{ forloop.counter0 }}"{% if not forloop.counter0 %} class="active"{% endif %}></li>
74 {% endfor %}
75 </ol>
76 {% endif %}
77 <div class="carousel-inner" role="listbox">
78 {% for screenshot in screenshots %}
79 <div class="item{% if not forloop.counter0 %} active{% endif %}">
80 {% if screenshot.poster %}
81 <video class="img-responsive" width="640" height="400" poster="{% static screenshot.poster %}" controls="controls" src="{% static screenshot.path %}" preload="none">
82 {% blocktrans with firefox="<a href=\"http://www.mozilla-europe.org/fr/\">Firefox</a>" %}Your browser doesn't manage the « video » tag, you should update, e.g. with the last {{ firefox }}{% endblocktrans %}
83 </video>
84 {% else %}
85 <img class="img-responsive" src="{% static screenshot.path %}">
86 {% endif %}
87 <div class="carousel-caption">{{ screenshot.description }}</div>
88 </div>
89 {% endfor %}
90 </div>
91 {% if screenshots|length > 1 %}
92 <a class="left carousel-control" href="#carousel-screenshots-modal" data-slide="prev">
93 <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
94 <span class="sr-only">Previous</span>
95 </a>
96 <a class="right carousel-control" href="#carousel-screenshots-modal" data-slide="next">
97 <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
98 <span class="sr-only">Next</span>
99 </a>
100 {% endif %}
101 </div>
102 </div>
103 </div>
104 </div>
105 </div>