##// END OF EJS Templates
Refactored gallery, use image.get_view instead of manual template block
neko259 -
r1124:7673e8db default
parent child Browse files
Show More
@@ -1,56 +1,44 b''
1 {% extends "boards/thread.html" %}
1 {% extends "boards/thread.html" %}
2
2
3 {% load i18n %}
3 {% load i18n %}
4 {% load static from staticfiles %}
4 {% load static from staticfiles %}
5 {% load board %}
5 {% load board %}
6 {% load tz %}
6 {% load tz %}
7
7
8 {% block head %}
8 {% block head %}
9 <meta name="robots" content="noindex">
9 <meta name="robots" content="noindex">
10 <title>{{ thread.get_opening_post.get_title|striptags|truncatewords:10 }}
10 <title>{{ thread.get_opening_post.get_title|striptags|truncatewords:10 }}
11 - {{ site_name }}</title>
11 - {{ site_name }}</title>
12 {% endblock %}
12 {% endblock %}
13
13
14 {% block content %}
14 {% block content %}
15 {% get_current_language as LANGUAGE_CODE %}
15 {% get_current_language as LANGUAGE_CODE %}
16 {% get_current_timezone as TIME_ZONE %}
16 {% get_current_timezone as TIME_ZONE %}
17
17
18 <div class="image-mode-tab">
18 <div class="image-mode-tab">
19 <a href="{% url 'thread' thread.get_opening_post.id %}">{% trans 'Normal mode' %}</a>,
19 <a href="{% url 'thread' thread.get_opening_post.id %}">{% trans 'Normal mode' %}</a>,
20 <a class="current_mode" href="{% url 'thread_gallery' thread.get_opening_post.id %}">{% trans 'Gallery mode' %}</a>
20 <a class="current_mode" href="{% url 'thread_gallery' thread.get_opening_post.id %}">{% trans 'Gallery mode' %}</a>
21 </div>
21 </div>
22
22
23 <div id="posts-table">
23 <div id="posts-table">
24 {% if posts %}
24 {% if posts %}
25 {% for post in posts %}
25 {% for post in posts %}
26 <div class="gallery_image">
26 <div class="gallery_image">
27 {% with post.get_first_image as image %}
27 {% with post.get_first_image as image %}
28 <div>
28 {% autoescape off %}
29 <a
29 {{ image.get_view }}
30 class="thumb"
30 {% endautoescape %}
31 href="{{ image.image.url }}">
32 <img class="post-image-preview"
33 src="{{ image.image.url_200x150 }}"
34 alt="{{ post.id }}"
35 width="{{ image.pre_width }}"
36 height="{{ image.pre_height }}"
37 data-width="{{ image.width }}"
38 data-height="{{ image.height }}"/>
39 <img class="post-image-full"
40 src="{{ image.image.url }}" />
41 </a>
42 </div>
43 <div class="gallery_image_metadata">
31 <div class="gallery_image_metadata">
44 {{ image.width }}x{{ image.height }}
32 {{ image.width }}x{{ image.height }}
45 {% image_actions image.image.url request.get_host %}
33 {% image_actions image.image.url request.get_host %}
46 <br />
34 <br />
47 <a href="{{ post.get_url }}">>>{{ post.id }}</a>
35 <a href="{{ post.get_url }}">>>{{ post.id }}</a>
48 </div>
36 </div>
49 {% endwith %}
37 {% endwith %}
50 </div>
38 </div>
51 {% endfor %}
39 {% endfor %}
52 {% else %}
40 {% else %}
53 {% trans 'No images.' %}
41 {% trans 'No images.' %}
54 {% endif %}
42 {% endif %}
55 </div>
43 </div>
56 {% endblock %}
44 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now