##// END OF EJS Templates
Show reflink popups from left-top always. Don't insert spaces after comma in...
neko259 -
r1457:f9070df0 default
parent child Browse files
Show More
@@ -1,120 +1,122 b''
1 function $X(path, root) {
1 function $X(path, root) {
2 return document.evaluate(path, root || document, null, 6, null);
2 return document.evaluate(path, root || document, null, 6, null);
3 }
3 }
4 function $x(path, root) {
4 function $x(path, root) {
5 return document.evaluate(path, root || document, null, 8, null).singleNodeValue;
5 return document.evaluate(path, root || document, null, 8, null).singleNodeValue;
6 }
6 }
7
7
8 function $del(el) {
8 function $del(el) {
9 if(el) el.parentNode.removeChild(el);
9 if(el) el.parentNode.removeChild(el);
10 }
10 }
11
11
12 function $each(list, fn) {
12 function $each(list, fn) {
13 if(!list) return;
13 if(!list) return;
14 var i = list.snapshotLength;
14 var i = list.snapshotLength;
15 if(i > 0) while(i--) fn(list.snapshotItem(i), i);
15 if(i > 0) while(i--) fn(list.snapshotItem(i), i);
16 }
16 }
17
17
18 function mkPreview(cln, html) {
18 function mkPreview(cln, html) {
19 cln.innerHTML = html;
19 cln.innerHTML = html;
20
20
21 addScriptsToPost($(cln));
21 addScriptsToPost($(cln));
22 }
22 }
23
23
24 function isElementInViewport (el) {
24 function isElementInViewport (el) {
25 //special bonus for those using jQuery
25 //special bonus for those using jQuery
26 if (typeof jQuery === "function" && el instanceof jQuery) {
26 if (typeof jQuery === "function" && el instanceof jQuery) {
27 el = el[0];
27 el = el[0];
28 }
28 }
29
29
30 var rect = el.getBoundingClientRect();
30 var rect = el.getBoundingClientRect();
31
31
32 return (
32 return (
33 rect.top >= 0 &&
33 rect.top >= 0 &&
34 rect.left >= 0 &&
34 rect.left >= 0 &&
35 rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */
35 rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */
36 rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */
36 rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */
37 );
37 );
38 }
38 }
39
39
40 function addRefLinkPreview(node) {
40 function addRefLinkPreview(node) {
41 $each($X('.//a[starts-with(text(),">>")]', node || document), function(link) {
41 $each($X('.//a[starts-with(text(),">>")]', node || document), function(link) {
42 link.addEventListener('mouseover', showPostPreview, false);
42 link.addEventListener('mouseover', showPostPreview, false);
43 link.addEventListener('mouseout', delPostPreview, false);
43 link.addEventListener('mouseout', delPostPreview, false);
44 });
44 });
45 }
45 }
46
46
47 function showPostPreview(e) {
47 function showPostPreview(e) {
48 var doc = document;
48 var doc = document;
49
49
50 var reflink = $(this);
50 var reflink = $(this);
51 var pNum = reflink.text().match(/\d+/);
51 var pNum = reflink.text().match(/\d+/);
52
52
53 if (pNum == null || pNum.length == 0) {
53 if (pNum == null || pNum.length == 0) {
54 return;
54 return;
55 }
55 }
56
56
57 var post = $('#' + pNum);
57 var post = $('#' + pNum);
58 if (post.length > 0 && isElementInViewport(post)) {
58 if (post.length > 0 && isElementInViewport(post)) {
59 post.addClass('highlight');
59 post.addClass('highlight');
60 } else {
60 } else {
61 var x = reflink.offset().left;
61 var x = reflink.offset().left;
62 var y = reflink.offset().top;
62 var y = reflink.offset().top;
63
63
64 var cln = doc.createElement('div');
64 var cln = doc.createElement('div');
65 cln.id = 'pstprev_' + pNum;
65 cln.id = 'pstprev_' + pNum;
66 cln.className = 'post_preview';
66 cln.className = 'post_preview';
67
67
68 cln.style.cssText = 'top:' + y + 'px;' + (x < doc.body.clientWidth/2 ? 'left:' + x + 'px' : 'right:' + parseInt(doc.body.clientWidth - x + 1) + 'px');
68 // var newX = x < doc.body.clientWidth/2 ? 'left:' + x : 'right:' + parseInt(doc.body.clientWidth - x - reflink.width());
69 // var newY = y < doc.body.clientHeight/2 ? 'top:' + y : 'bottom:' + parseInt(doc.body.clientHeight - y - reflink.height());
70 cln.style.cssText = 'left:' + x + 'px; top:' + y + 'px';
69
71
70 cln.addEventListener('mouseout', delPostPreview, false);
72 cln.addEventListener('mouseout', delPostPreview, false);
71
73
72 cln.innerHTML = "<div class=\"post\">" + gettext('Loading...') + "</div>";
74 cln.innerHTML = "<div class=\"post\">" + gettext('Loading...') + "</div>";
73
75
74 if(post.length > 0) {
76 if(post.length > 0) {
75 var postdata = post.clone().wrap("<div/>").parent().html();
77 var postdata = post.clone().wrap("<div/>").parent().html();
76
78
77 mkPreview(cln, postdata);
79 mkPreview(cln, postdata);
78 } else {
80 } else {
79 $.ajax({
81 $.ajax({
80 url: '/api/post/' + pNum + '/?truncated'
82 url: '/api/post/' + pNum + '/?truncated'
81 })
83 })
82 .success(function(data) {
84 .success(function(data) {
83 var postdata = $(data).wrap("<div/>").parent().html();
85 var postdata = $(data).wrap("<div/>").parent().html();
84
86
85 //make preview
87 //make preview
86 mkPreview(cln, postdata);
88 mkPreview(cln, postdata);
87
89
88 })
90 })
89 .error(function() {
91 .error(function() {
90 cln.innerHTML = "<div class=\"post\">"
92 cln.innerHTML = "<div class=\"post\">"
91 + gettext('Post not found') + "</div>";
93 + gettext('Post not found') + "</div>";
92 });
94 });
93 }
95 }
94
96
95 $del(doc.getElementById(cln.id));
97 $del(doc.getElementById(cln.id));
96
98
97 //add preview
99 //add preview
98 $(cln).fadeIn(200);
100 $(cln).fadeIn(200);
99 $('body').append(cln);
101 $('body').append(cln);
100 }
102 }
101 }
103 }
102
104
103 function delPostPreview(e) {
105 function delPostPreview(e) {
104 var el = $x('ancestor-or-self::*[starts-with(@id,"pstprev")]', e.relatedTarget);
106 var el = $x('ancestor-or-self::*[starts-with(@id,"pstprev")]', e.relatedTarget);
105 if(!el) {
107 if(!el) {
106 $each($X('.//div[starts-with(@id,"pstprev")]'), function(clone) {
108 $each($X('.//div[starts-with(@id,"pstprev")]'), function(clone) {
107 $del(clone)
109 $del(clone)
108 });
110 });
109 } else {
111 } else {
110 while(el.nextSibling) $del(el.nextSibling);
112 while(el.nextSibling) $del(el.nextSibling);
111 }
113 }
112
114
113 $('.highlight').removeClass('highlight');
115 $('.highlight').removeClass('highlight');
114 }
116 }
115
117
116 function addPreview() {
118 function addPreview() {
117 $('.post').find('a').each(function() {
119 $('.post').find('a').each(function() {
118 showPostPreview($(this));
120 showPostPreview($(this));
119 });
121 });
120 }
122 }
@@ -1,211 +1,210 b''
1 {% extends "boards/base.html" %}
1 {% extends "boards/base.html" %}
2
2
3 {% load i18n %}
3 {% load i18n %}
4 {% load board %}
4 {% load board %}
5 {% load static %}
5 {% load static %}
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
10
11 {% if tag %}
11 {% if tag %}
12 <title>{{ tag.name }} - {{ site_name }}</title>
12 <title>{{ tag.name }} - {{ site_name }}</title>
13 {% else %}
13 {% else %}
14 <title>{{ site_name }}</title>
14 <title>{{ site_name }}</title>
15 {% endif %}
15 {% endif %}
16
16
17 {% if prev_page_link %}
17 {% if prev_page_link %}
18 <link rel="prev" href="{{ prev_page_link }}" />
18 <link rel="prev" href="{{ prev_page_link }}" />
19 {% endif %}
19 {% endif %}
20 {% if next_page_link %}
20 {% if next_page_link %}
21 <link rel="next" href="{{ next_page_link }}" />
21 <link rel="next" href="{{ next_page_link }}" />
22 {% endif %}
22 {% endif %}
23
23
24 {% endblock %}
24 {% endblock %}
25
25
26 {% block content %}
26 {% block content %}
27
27
28 {% get_current_language as LANGUAGE_CODE %}
28 {% get_current_language as LANGUAGE_CODE %}
29 {% get_current_timezone as TIME_ZONE %}
29 {% get_current_timezone as TIME_ZONE %}
30
30
31 {% for banner in banners %}
31 {% for banner in banners %}
32 <div class="post">
32 <div class="post">
33 <div class="title">{{ banner.title }}</div>
33 <div class="title">{{ banner.title }}</div>
34 <div>{{ banner.get_text|safe }}</div>
34 <div>{{ banner.get_text|safe }}</div>
35 <div>{% trans 'Details' %}: <a href="{{ banner.post.get_absolute_url }}">>>{{ banner.post.id }}</a></div>
35 <div>{% trans 'Details' %}: <a href="{{ banner.post.get_absolute_url }}">>>{{ banner.post.id }}</a></div>
36 </div>
36 </div>
37 {% endfor %}
37 {% endfor %}
38
38
39 {% if tag %}
39 {% if tag %}
40 <div class="tag_info" style="border-bottom: solid .5ex #{{ tag.get_color }}">
40 <div class="tag_info" style="border-bottom: solid .5ex #{{ tag.get_color }}">
41 {% if random_image_post %}
41 {% if random_image_post %}
42 <div class="tag-image">
42 <div class="tag-image">
43 {% with image=random_image_post.images.first %}
43 {% with image=random_image_post.images.first %}
44 <a href="{{ random_image_post.get_absolute_url }}"><img
44 <a href="{{ random_image_post.get_absolute_url }}"><img
45 src="{{ image.image.url_200x150 }}"
45 src="{{ image.image.url_200x150 }}"
46 width="{{ image.pre_width }}"
46 width="{{ image.pre_width }}"
47 height="{{ image.pre_height }}"
47 height="{{ image.pre_height }}"
48 alt="{{ random_image_post.id }}"/></a>
48 alt="{{ random_image_post.id }}"/></a>
49 {% endwith %}
49 {% endwith %}
50 </div>
50 </div>
51 {% endif %}
51 {% endif %}
52 <div class="tag-text-data">
52 <div class="tag-text-data">
53 <h2>
53 <h2>
54 /{{ tag.get_view|safe }}/
54 /{{ tag.get_view|safe }}/
55 {% if perms.change_tag %}
55 {% if perms.change_tag %}
56 <span class="moderator_info">| <a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></span>
56 <span class="moderator_info">| <a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></span>
57 {% endif %}
57 {% endif %}
58 </h2>
58 </h2>
59 <p>
59 <p>
60 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
60 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
61 {% if is_favorite %}
61 {% if is_favorite %}
62 <button name="method" value="unsubscribe" class="fav">★ {% trans "Remove from favorites" %}</button>
62 <button name="method" value="unsubscribe" class="fav">★ {% trans "Remove from favorites" %}</button>
63 {% else %}
63 {% else %}
64 <button name="method" value="subscribe" class="not_fav">★ {% trans "Add to favorites" %}</button>
64 <button name="method" value="subscribe" class="not_fav">★ {% trans "Add to favorites" %}</button>
65 {% endif %}
65 {% endif %}
66 </form>
66 </form>
67 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
67 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
68 {% if is_hidden %}
68 {% if is_hidden %}
69 <button name="method" value="unhide" class="fav">{% trans "Show" %}</button>
69 <button name="method" value="unhide" class="fav">{% trans "Show" %}</button>
70 {% else %}
70 {% else %}
71 <button name="method" value="hide" class="not_fav">{% trans "Hide" %}</button>
71 <button name="method" value="hide" class="not_fav">{% trans "Hide" %}</button>
72 {% endif %}
72 {% endif %}
73 </form>
73 </form>
74 <a href="{% url 'tag_gallery' tag.name %}">{% trans 'Gallery' %}</a>
74 <a href="{% url 'tag_gallery' tag.name %}">{% trans 'Gallery' %}</a>
75 </p>
75 </p>
76 {% if tag.get_description %}
76 {% if tag.get_description %}
77 <p>{{ tag.get_description|safe }}</p>
77 <p>{{ tag.get_description|safe }}</p>
78 {% endif %}
78 {% endif %}
79 <p>
79 <p>
80 {% with active_count=tag.get_active_thread_count bumplimit_count=tag.get_bumplimit_thread_count archived_count=tag.get_archived_thread_count %}
80 {% with active_count=tag.get_active_thread_count bumplimit_count=tag.get_bumplimit_thread_count archived_count=tag.get_archived_thread_count %}
81 {% if active_count %}
81 {% if active_count %}
82 {% blocktrans count count=active_count %}{{ count }} active thread{% plural %}active threads{% endblocktrans %},
82 {% blocktrans count count=active_count %}{{ count }} active thread{% plural %}active threads{% endblocktrans %},
83 {% endif %}
83 {% endif %}
84 {% if bumplimit_count %}
84 {% if bumplimit_count %}
85 {% blocktrans count count=bumplimit_count %}{{ count }} thread in bumplimit{% plural %} threads in bumplimit{% endblocktrans %},
85 {% blocktrans count count=bumplimit_count %}{{ count }} thread in bumplimit{% plural %} threads in bumplimit{% endblocktrans %},
86 {% endif %}
86 {% endif %}
87 {% if archived_count %}
87 {% if archived_count %}
88 {% blocktrans count count=archived_count %}{{ count }} archived thread{% plural %}archived threads{% endblocktrans %},
88 {% blocktrans count count=archived_count %}{{ count }} archived thread{% plural %}archived threads{% endblocktrans %},
89 {% endif %}
89 {% endif %}
90 {% endwith %}
90 {% endwith %}
91 {% blocktrans count count=tag.get_post_count %}{{ count }} message{% plural %}messages{% endblocktrans %}.
91 {% blocktrans count count=tag.get_post_count %}{{ count }} message{% plural %}messages{% endblocktrans %}.
92 </p>
92 </p>
93 {% if tag.get_all_parents %}
93 {% if tag.get_all_parents %}
94 <p>
94 <p>
95 {% for parent in tag.get_all_parents %}
95 {% for parent in tag.get_all_parents %}
96 {{ parent.get_view|safe }} &gt;
96 {{ parent.get_view|safe }} &gt;
97 {% endfor %}
97 {% endfor %}
98 {{ tag.get_view|safe }}
98 {{ tag.get_view|safe }}
99 </p>
99 </p>
100 {% endif %}
100 {% endif %}
101 {% if tag.get_children.all %}
101 {% if tag.get_children.all %}
102 <p>
102 <p>
103 {% trans "Subsections: " %}
103 {% trans "Subsections: " %}
104 {% for child in tag.get_children.all %}
104 {% for child in tag.get_children.all %}
105 {{ child.get_view|safe }}{% if not forloop.last%}, {% endif %}
105 {{ child.get_view|safe }}{% if not forloop.last%}, {% endif %}
106 {% endfor %}
106 {% endfor %}
107 </p>
107 </p>
108 {% endif %}
108 {% endif %}
109 </div>
109 </div>
110 </div>
110 </div>
111 {% endif %}
111 {% endif %}
112
112
113 {% if threads %}
113 {% if threads %}
114 {% if prev_page_link %}
114 {% if prev_page_link %}
115 <div class="page_link">
115 <div class="page_link">
116 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
116 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
117 </div>
117 </div>
118 {% endif %}
118 {% endif %}
119
119
120 {% for thread in threads %}
120 {% for thread in threads %}
121 <div class="thread">
121 <div class="thread">
122 {% post_view thread.get_opening_post thread=thread truncated=True need_open_link=True %}
122 {% post_view thread.get_opening_post thread=thread truncated=True need_open_link=True %}
123 {% if not thread.archived %}
123 {% if not thread.archived %}
124 {% with last_replies=thread.get_last_replies %}
124 {% with last_replies=thread.get_last_replies %}
125 {% if last_replies %}
125 {% if last_replies %}
126 {% with skipped_replies_count=thread.get_skipped_replies_count %}
126 {% with skipped_replies_count=thread.get_skipped_replies_count %}
127 {% if skipped_replies_count %}
127 {% if skipped_replies_count %}
128 <div class="skipped_replies">
128 <div class="skipped_replies">
129 <a href="{% url 'thread' thread.get_opening_post_id %}">
129 <a href="{% url 'thread' thread.get_opening_post_id %}">
130 {% blocktrans count count=skipped_replies_count %}Skipped {{ count }} reply. Open thread to see all replies.{% plural %}Skipped {{ count }} replies. Open thread to see all replies.{% endblocktrans %}
130 {% blocktrans count count=skipped_replies_count %}Skipped {{ count }} reply. Open thread to see all replies.{% plural %}Skipped {{ count }} replies. Open thread to see all replies.{% endblocktrans %}
131 </a>
131 </a>
132 </div>
132 </div>
133 {% endif %}
133 {% endif %}
134 {% endwith %}
134 {% endwith %}
135 <div class="last-replies">
135 <div class="last-replies">
136 {% for post in last_replies %}
136 {% for post in last_replies %}
137 {% post_view post truncated=True %}
137 {% post_view post truncated=True %}
138 {% endfor %}
138 {% endfor %}
139 </div>
139 </div>
140 {% endif %}
140 {% endif %}
141 {% endwith %}
141 {% endwith %}
142 {% endif %}
142 {% endif %}
143 </div>
143 </div>
144 {% endfor %}
144 {% endfor %}
145
145
146 {% if next_page_link %}
146 {% if next_page_link %}
147 <div class="page_link">
147 <div class="page_link">
148 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
148 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
149 </div>
149 </div>
150 {% endif %}
150 {% endif %}
151 {% else %}
151 {% else %}
152 <div class="post">
152 <div class="post">
153 {% trans 'No threads exist. Create the first one!' %}</div>
153 {% trans 'No threads exist. Create the first one!' %}</div>
154 {% endif %}
154 {% endif %}
155
155
156 <div class="post-form-w">
156 <div class="post-form-w">
157 <script src="{% static 'js/panel.js' %}"></script>
157 <script src="{% static 'js/panel.js' %}"></script>
158 <div class="post-form">
158 <div class="post-form">
159 <div class="form-title">{% trans "Create new thread" %}</div>
159 <div class="form-title">{% trans "Create new thread" %}</div>
160 <div class="swappable-form-full">
160 <div class="swappable-form-full">
161 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
161 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
162 {{ form.as_div }}
162 {{ form.as_div }}
163 <div class="form-submit">
163 <div class="form-submit">
164 <input type="submit" value="{% trans "Post" %}"/>
164 <input type="submit" value="{% trans "Post" %}"/>
165 <button id="preview-button" onclick="return false;">{% trans 'Preview' %}</button>
165 <button id="preview-button" onclick="return false;">{% trans 'Preview' %}</button>
166 </div>
166 </div>
167 </form>
167 </form>
168 </div>
168 </div>
169 <div>
169 <div>
170 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
170 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
171 {% with size=max_file_size|filesizeformat %}
171 {% with size=max_file_size|filesizeformat %}
172 {% blocktrans %}Max file size is {{ size }}.{% endblocktrans %}
172 {% blocktrans %}Max file size is {{ size }}.{% endblocktrans %}
173 {% endwith %}
173 {% endwith %}
174 </div>
174 </div>
175 <div id="preview-text"></div>
175 <div id="preview-text"></div>
176 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Text syntax' %}</a></div>
176 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Text syntax' %}</a></div>
177 <div><a href="{% url "tags" "required" %}">{% trans 'Tags' %}</a></div>
177 <div><a href="{% url "tags" "required" %}">{% trans 'Tags' %}</a></div>
178 </div>
178 </div>
179 </div>
179 </div>
180
180
181 <script src="{% static 'js/form.js' %}"></script>
181 <script src="{% static 'js/form.js' %}"></script>
182 <script id="sha256Script" src="{% static 'js/3party/sha256.js' %}"></script>
182 <script id="sha256Script" src="{% static 'js/3party/sha256.js' %}"></script>
183 <script id="powScript" src="{% static 'js/proof_of_work.js' %}"></script>
183 <script id="powScript" src="{% static 'js/proof_of_work.js' %}"></script>
184 <script src="{% static 'js/3party/jquery.blockUI.js' %}"></script>
184 <script src="{% static 'js/3party/jquery.blockUI.js' %}"></script>
185 <script src="{% static 'js/thread_create.js' %}"></script>
185 <script src="{% static 'js/thread_create.js' %}"></script>
186
186
187 {% endblock %}
187 {% endblock %}
188
188
189 {% block metapanel %}
189 {% block metapanel %}
190
190
191 <span class="metapanel">
191 <span class="metapanel">
192 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
192 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
193 {% trans "Pages:" %}
193 {% trans "Pages:" %}
194 [
194 [
195 {% with dividers=paginator.get_dividers %}
195 {% with dividers=paginator.get_dividers %}
196 {% for page in paginator.get_divided_range %}
196 {% for page in paginator.get_divided_range %}
197 {% if page in dividers %}
197 {% if page in dividers %}
198 …,
198 …,
199 {% endif %}
199 {% endif %}
200 <a
200 <a
201 {% ifequal page current_page.number %}
201 {% ifequal page current_page.number %}
202 class="current_page"
202 class="current_page"
203 {% endifequal %}
203 {% endifequal %}
204 href="{% page_url paginator page %}">{{ page }}</a>
204 href="{% page_url paginator page %}">{{ page }}</a>{% if not forloop.last %},{% endif %}
205 {% if not forloop.last %},{% endif %}
206 {% endfor %}
205 {% endfor %}
207 {% endwith %}
206 {% endwith %}
208 ]
207 ]
209 </span>
208 </span>
210
209
211 {% endblock %}
210 {% endblock %}
@@ -1,71 +1,70 b''
1 {% extends "boards/base.html" %}
1 {% extends "boards/base.html" %}
2
2
3 {% load i18n %}
3 {% load i18n %}
4 {% load board %}
4 {% load board %}
5 {% load static %}
5 {% load static %}
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
10
11 <title>{{ site_name }} - {% trans "feed" %}</title>
11 <title>{{ site_name }} - {% trans "feed" %}</title>
12
12
13 {% if prev_page_link %}
13 {% if prev_page_link %}
14 <link rel="prev" href="{{ prev_page_link }}" />
14 <link rel="prev" href="{{ prev_page_link }}" />
15 {% endif %}
15 {% endif %}
16 {% if next_page_link %}
16 {% if next_page_link %}
17 <link rel="next" href="{{ next_page_link }}" />
17 <link rel="next" href="{{ next_page_link }}" />
18 {% endif %}
18 {% endif %}
19
19
20 {% endblock %}
20 {% endblock %}
21
21
22 {% block content %}
22 {% block content %}
23
23
24 {% get_current_language as LANGUAGE_CODE %}
24 {% get_current_language as LANGUAGE_CODE %}
25 {% get_current_timezone as TIME_ZONE %}
25 {% get_current_timezone as TIME_ZONE %}
26
26
27 {% if posts %}
27 {% if posts %}
28 {% if prev_page_link %}
28 {% if prev_page_link %}
29 <div class="page_link">
29 <div class="page_link">
30 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
30 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
31 </div>
31 </div>
32 {% endif %}
32 {% endif %}
33
33
34 {% for post in posts %}
34 {% for post in posts %}
35 {% post_view post moderator=moderator truncated=True need_op_data=True %}
35 {% post_view post moderator=moderator truncated=True need_op_data=True %}
36 {% endfor %}
36 {% endfor %}
37
37
38 {% if next_page_link %}
38 {% if next_page_link %}
39 <div class="page_link">
39 <div class="page_link">
40 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
40 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
41 </div>
41 </div>
42 {% endif %}
42 {% endif %}
43 {% else %}
43 {% else %}
44 <div class="post">
44 <div class="post">
45 {% trans 'No posts exist. Create the first one!' %}</div>
45 {% trans 'No posts exist. Create the first one!' %}</div>
46 {% endif %}
46 {% endif %}
47 {% endblock %}
47 {% endblock %}
48
48
49 {% block metapanel %}
49 {% block metapanel %}
50
50
51 <span class="metapanel">
51 <span class="metapanel">
52 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
52 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
53 {% trans "Pages:" %}
53 {% trans "Pages:" %}
54 [
54 [
55 {% with dividers=paginator.get_dividers %}
55 {% with dividers=paginator.get_dividers %}
56 {% for page in paginator.get_divided_range %}
56 {% for page in paginator.get_divided_range %}
57 {% if page in dividers %}
57 {% if page in dividers %}
58 …,
58 …,
59 {% endif %}
59 {% endif %}
60 <a
60 <a
61 {% ifequal page current_page.number %}
61 {% ifequal page current_page.number %}
62 class="current_page"
62 class="current_page"
63 {% endifequal %}
63 {% endifequal %}
64 href="{% page_url paginator page %}">{{ page }}</a>
64 href="{% page_url paginator page %}">{{ page }}</a>{% if not forloop.last %},{% endif %}
65 {% if not forloop.last %},{% endif %}
66 {% endfor %}
65 {% endfor %}
67 {% endwith %}
66 {% endwith %}
68 ]
67 ]
69 </span>
68 </span>
70
69
71 {% endblock %}
70 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now