Show More
@@ -0,0 +1,31 b'' | |||||
|
1 | {% extends "boards/base.html" %} | |||
|
2 | ||||
|
3 | {% load i18n %} | |||
|
4 | {% load static %} | |||
|
5 | ||||
|
6 | {% block head %} | |||
|
7 | <title>{{ site_name }}</title> | |||
|
8 | {% endblock %} | |||
|
9 | ||||
|
10 | {% block content %} | |||
|
11 | <div class="post"> | |||
|
12 | <div class="landing-images"> | |||
|
13 | {% for image in images %} | |||
|
14 | <div class="gallery_image"> | |||
|
15 | {{ image.get_view|safe }} | |||
|
16 | {% with image.get_random_associated_post as post %} | |||
|
17 | {{ post.get_link_view|safe }} | |||
|
18 | {% endwith %} | |||
|
19 | </div> | |||
|
20 | {% endfor %} | |||
|
21 | </div> | |||
|
22 | <div class="landing-tags"> | |||
|
23 | {{ section_str|safe }} | |||
|
24 | </div> | |||
|
25 | <div class="landing-threads"> | |||
|
26 | {% for op in latest_threads %} | |||
|
27 | {{ op.get_link_view|safe }} {{ op.get_title_or_text }}<br /> | |||
|
28 | {% endfor %} | |||
|
29 | </div> | |||
|
30 | </div> | |||
|
31 | {% endblock %} |
@@ -0,0 +1,32 b'' | |||||
|
1 | from django.shortcuts import render | |||
|
2 | from django.utils.decorators import method_decorator | |||
|
3 | from django.views.decorators.csrf import csrf_protect | |||
|
4 | ||||
|
5 | from boards.views.base import BaseBoardView | |||
|
6 | from boards.models import Tag, Post, Attachment | |||
|
7 | ||||
|
8 | ||||
|
9 | PARAM_SECTION_STR = 'section_str' | |||
|
10 | PARAM_LATEST_THREADS = 'latest_threads' | |||
|
11 | PARAM_IMAGES = 'images' | |||
|
12 | ||||
|
13 | TEMPLATE = 'boards/landing.html' | |||
|
14 | ||||
|
15 | MAX_NEW_THREADS = 10 | |||
|
16 | RANDOM_IMAGE_COUNT = 3 | |||
|
17 | ||||
|
18 | ||||
|
19 | class LandingView(BaseBoardView): | |||
|
20 | @method_decorator(csrf_protect) | |||
|
21 | def get(self, request): | |||
|
22 | params = dict() | |||
|
23 | ||||
|
24 | params[PARAM_SECTION_STR] = Tag.objects.get_tag_url_list( | |||
|
25 | Tag.objects.filter(required=True)) | |||
|
26 | params[PARAM_LATEST_THREADS] = Post.objects.filter(opening=True)\ | |||
|
27 | .order_by('-pub_time')[:MAX_NEW_THREADS] | |||
|
28 | params[PARAM_IMAGES] = Attachment.objects.get_random_images( | |||
|
29 | RANDOM_IMAGE_COUNT) | |||
|
30 | ||||
|
31 | return render(request, TEMPLATE, params) | |||
|
32 |
@@ -1,175 +1,186 b'' | |||||
1 | .ui-button { |
|
1 | .ui-button { | |
2 | display: none; |
|
2 | display: none; | |
3 | } |
|
3 | } | |
4 |
|
4 | |||
5 | .ui-dialog-content { |
|
5 | .ui-dialog-content { | |
6 | padding: 0; |
|
6 | padding: 0; | |
7 | min-height: 0; |
|
7 | min-height: 0; | |
8 | } |
|
8 | } | |
9 |
|
9 | |||
10 | .mark_btn { |
|
10 | .mark_btn { | |
11 | cursor: pointer; |
|
11 | cursor: pointer; | |
12 | } |
|
12 | } | |
13 |
|
13 | |||
14 | .img-full { |
|
14 | .img-full { | |
15 | position: fixed; |
|
15 | position: fixed; | |
16 | background-color: #CCC; |
|
16 | background-color: #CCC; | |
17 | border: 1px solid #000; |
|
17 | border: 1px solid #000; | |
18 | cursor: pointer; |
|
18 | cursor: pointer; | |
19 | } |
|
19 | } | |
20 |
|
20 | |||
21 | .strikethrough { |
|
21 | .strikethrough { | |
22 | text-decoration: line-through; |
|
22 | text-decoration: line-through; | |
23 | } |
|
23 | } | |
24 |
|
24 | |||
25 | .post_preview { |
|
25 | .post_preview { | |
26 | z-index: 300; |
|
26 | z-index: 300; | |
27 | position:absolute; |
|
27 | position:absolute; | |
28 | } |
|
28 | } | |
29 |
|
29 | |||
30 | .gallery_image { |
|
30 | .gallery_image { | |
31 | display: inline-block; |
|
31 | display: inline-block; | |
32 | } |
|
32 | } | |
33 |
|
33 | |||
34 | @media print { |
|
34 | @media print { | |
35 | .post-form-w { |
|
35 | .post-form-w { | |
36 | display: none; |
|
36 | display: none; | |
37 | } |
|
37 | } | |
38 | } |
|
38 | } | |
39 |
|
39 | |||
40 | input[name="image"] { |
|
40 | input[name="image"] { | |
41 | display: block; |
|
41 | display: block; | |
42 | width: 100px; |
|
42 | width: 100px; | |
43 | height: 100px; |
|
43 | height: 100px; | |
44 | cursor: pointer; |
|
44 | cursor: pointer; | |
45 | position: absolute; |
|
45 | position: absolute; | |
46 | opacity: 0; |
|
46 | opacity: 0; | |
47 | z-index: 1; |
|
47 | z-index: 1; | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 | .file_wrap { |
|
50 | .file_wrap { | |
51 | width: 100px; |
|
51 | width: 100px; | |
52 | height: 100px; |
|
52 | height: 100px; | |
53 | border: solid 1px white; |
|
53 | border: solid 1px white; | |
54 | display: inline-block; |
|
54 | display: inline-block; | |
55 | } |
|
55 | } | |
56 |
|
56 | |||
57 | form > .file_wrap { |
|
57 | form > .file_wrap { | |
58 | float: left; |
|
58 | float: left; | |
59 | } |
|
59 | } | |
60 |
|
60 | |||
61 | .file-thumb { |
|
61 | .file-thumb { | |
62 | width: 100px; |
|
62 | width: 100px; | |
63 | height: 100px; |
|
63 | height: 100px; | |
64 | background-size: cover; |
|
64 | background-size: cover; | |
65 | background-position: center; |
|
65 | background-position: center; | |
66 | } |
|
66 | } | |
67 |
|
67 | |||
68 | .compact-form-text { |
|
68 | .compact-form-text { | |
69 | margin-left:110px; |
|
69 | margin-left:110px; | |
70 | } |
|
70 | } | |
71 |
|
71 | |||
72 | textarea, input { |
|
72 | textarea, input { | |
73 | -moz-box-sizing: border-box; |
|
73 | -moz-box-sizing: border-box; | |
74 | -webkit-box-sizing: border-box; |
|
74 | -webkit-box-sizing: border-box; | |
75 | box-sizing: border-box; |
|
75 | box-sizing: border-box; | |
76 | } |
|
76 | } | |
77 |
|
77 | |||
78 | .compact-form-text > textarea { |
|
78 | .compact-form-text > textarea { | |
79 | height: 100px; |
|
79 | height: 100px; | |
80 | width: 100%; |
|
80 | width: 100%; | |
81 | } |
|
81 | } | |
82 |
|
82 | |||
83 | .post-button-form { |
|
83 | .post-button-form { | |
84 | display: inline; |
|
84 | display: inline; | |
85 | } |
|
85 | } | |
86 |
|
86 | |||
87 | .post-button-form > button, #autoupdate { |
|
87 | .post-button-form > button, #autoupdate { | |
88 | border: none; |
|
88 | border: none; | |
89 | margin: inherit; |
|
89 | margin: inherit; | |
90 | padding: inherit; |
|
90 | padding: inherit; | |
91 | background: none; |
|
91 | background: none; | |
92 | font-size: inherit; |
|
92 | font-size: inherit; | |
93 | cursor: pointer; |
|
93 | cursor: pointer; | |
94 | } |
|
94 | } | |
95 |
|
95 | |||
96 | #form-close-button { |
|
96 | #form-close-button { | |
97 | display: none; |
|
97 | display: none; | |
98 | } |
|
98 | } | |
99 |
|
99 | |||
100 | .post-image-full { |
|
100 | .post-image-full { | |
101 | width: 100%; |
|
101 | width: 100%; | |
102 | height: auto; |
|
102 | height: auto; | |
103 | } |
|
103 | } | |
104 |
|
104 | |||
105 | #preview-text { |
|
105 | #preview-text { | |
106 | display: none; |
|
106 | display: none; | |
107 | } |
|
107 | } | |
108 |
|
108 | |||
109 | .random-images-table { |
|
109 | .random-images-table { | |
110 | text-align: center; |
|
110 | text-align: center; | |
111 | width: 100%; |
|
111 | width: 100%; | |
112 | } |
|
112 | } | |
113 |
|
113 | |||
114 | .random-images-table > div { |
|
114 | .random-images-table > div { | |
115 | margin-left: auto; |
|
115 | margin-left: auto; | |
116 | margin-right: auto; |
|
116 | margin-right: auto; | |
117 | } |
|
117 | } | |
118 |
|
118 | |||
119 | .tag-image, .tag-text-data { |
|
119 | .tag-image, .tag-text-data { | |
120 | display: inline-block; |
|
120 | display: inline-block; | |
121 | } |
|
121 | } | |
122 |
|
122 | |||
123 | .tag-text-data > h2 { |
|
123 | .tag-text-data > h2 { | |
124 | margin: 0; |
|
124 | margin: 0; | |
125 | } |
|
125 | } | |
126 |
|
126 | |||
127 | .tag-image { |
|
127 | .tag-image { | |
128 | margin-right: 5px; |
|
128 | margin-right: 5px; | |
129 | } |
|
129 | } | |
130 |
|
130 | |||
131 | .reply-to-message { |
|
131 | .reply-to-message { | |
132 | display: none; |
|
132 | display: none; | |
133 | } |
|
133 | } | |
134 |
|
134 | |||
135 | .tripcode { |
|
135 | .tripcode { | |
136 | padding: 2px; |
|
136 | padding: 2px; | |
137 | } |
|
137 | } | |
138 |
|
138 | |||
139 | #fav-panel { |
|
139 | #fav-panel { | |
140 | display: none; |
|
140 | display: none; | |
141 | margin: 1ex; |
|
141 | margin: 1ex; | |
142 | } |
|
142 | } | |
143 |
|
143 | |||
144 | .hidden_post { |
|
144 | .hidden_post { | |
145 | opacity: 0.2; |
|
145 | opacity: 0.2; | |
146 | } |
|
146 | } | |
147 |
|
147 | |||
148 | .hidden_post:hover { |
|
148 | .hidden_post:hover { | |
149 | opacity: 1; |
|
149 | opacity: 1; | |
150 | } |
|
150 | } | |
151 |
|
151 | |||
152 | .monochrome > .image > .thumb > img { |
|
152 | .monochrome > .image > .thumb > img { | |
153 | filter: grayscale(100%); |
|
153 | filter: grayscale(100%); | |
154 | -webkit-filter: grayscale(100%); |
|
154 | -webkit-filter: grayscale(100%); | |
155 | } |
|
155 | } | |
156 |
|
156 | |||
157 | #quote-button { |
|
157 | #quote-button { | |
158 | position: absolute; |
|
158 | position: absolute; | |
159 | display: none; |
|
159 | display: none; | |
160 | cursor: pointer; |
|
160 | cursor: pointer; | |
161 | z-index: 400; |
|
161 | z-index: 400; | |
162 | } |
|
162 | } | |
163 |
|
163 | |||
164 | .required-field:before { |
|
164 | .required-field:before { | |
165 | content: '* '; |
|
165 | content: '* '; | |
166 | } |
|
166 | } | |
167 |
|
167 | |||
168 | .hint { |
|
168 | .hint { | |
169 | border-bottom: dashed 1px; |
|
169 | border-bottom: dashed 1px; | |
170 | cursor: help; |
|
170 | cursor: help; | |
171 | } |
|
171 | } | |
172 |
|
172 | |||
173 | .url-image:hover { |
|
173 | .url-image:hover { | |
174 | filter: invert(100%); |
|
174 | filter: invert(100%); | |
175 | } |
|
175 | } | |
|
176 | ||||
|
177 | .landing-tags, .landing-threads, .landing-images { | |||
|
178 | max-width: 800px; | |||
|
179 | margin-left: auto; | |||
|
180 | margin-right: auto; | |||
|
181 | } | |||
|
182 | ||||
|
183 | .landing-images { | |||
|
184 | text-align: center; | |||
|
185 | } | |||
|
186 |
@@ -1,94 +1,93 b'' | |||||
1 | {% load staticfiles %} |
|
1 | {% load staticfiles %} | |
2 | {% load i18n %} |
|
2 | {% load i18n %} | |
3 | {% load l10n %} |
|
3 | {% load l10n %} | |
4 | {% load static from staticfiles %} |
|
4 | {% load static from staticfiles %} | |
5 |
|
5 | |||
6 | <!DOCTYPE html> |
|
6 | <!DOCTYPE html> | |
7 | <html> |
|
7 | <html> | |
8 | <head> |
|
8 | <head> | |
9 | <link rel="stylesheet" type="text/css" href="{% static 'css/base.css' %}" media="all"/> |
|
9 | <link rel="stylesheet" type="text/css" href="{% static 'css/base.css' %}" media="all"/> | |
10 | <link rel="stylesheet" type="text/css" href="{% static 'css/3party/highlight.css' %}" media="all"/> |
|
10 | <link rel="stylesheet" type="text/css" href="{% static 'css/3party/highlight.css' %}" media="all"/> | |
11 | <link rel="stylesheet" type="text/css" href="{% static 'css/3party/jquery-ui.min.css' %}" media="all"/> |
|
11 | <link rel="stylesheet" type="text/css" href="{% static 'css/3party/jquery-ui.min.css' %}" media="all"/> | |
12 | <link rel="stylesheet" type="text/css" href="{% static theme_css %}" media="all"/> |
|
12 | <link rel="stylesheet" type="text/css" href="{% static theme_css %}" media="all"/> | |
13 |
|
13 | |||
14 | {% if rss_url %} |
|
14 | {% if rss_url %} | |
15 | <link rel="alternate" type="application/rss+xml" href="{{ rss_url }}" title="{% trans 'Feed' %}"/> |
|
15 | <link rel="alternate" type="application/rss+xml" href="{{ rss_url }}" title="{% trans 'Feed' %}"/> | |
16 | {% endif %} |
|
16 | {% endif %} | |
17 |
|
17 | |||
18 | <link rel="icon" type="image/png" |
|
18 | <link rel="icon" type="image/png" | |
19 | href="{% static 'favicon.png' %}"> |
|
19 | href="{% static 'favicon.png' %}"> | |
20 |
|
20 | |||
21 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
|
21 | <meta name="viewport" content="width=device-width, initial-scale=1"/> | |
22 | <meta charset="utf-8"/> |
|
22 | <meta charset="utf-8"/> | |
23 |
|
23 | |||
24 | {% block head %}{% endblock %} |
|
24 | {% block head %}{% endblock %} | |
25 | </head> |
|
25 | </head> | |
26 | <body data-image-viewer="{{ image_viewer }}" |
|
26 | <body data-image-viewer="{{ image_viewer }}" | |
27 | data-pow-difficulty="{{ pow_difficulty }}" |
|
27 | data-pow-difficulty="{{ pow_difficulty }}" | |
28 | data-update-script="{% static 'js/updates.js' %}"> |
|
28 | data-update-script="{% static 'js/updates.js' %}"> | |
29 | <script src="{% static 'js/jquery-2.2.0.min.js' %}"></script> |
|
29 | <script src="{% static 'js/jquery-2.2.0.min.js' %}"></script> | |
30 |
|
30 | |||
31 | <header class="navigation_panel"> |
|
31 | <header class="navigation_panel"> | |
32 |
<a class="link" href="{% url ' |
|
32 | <a class="link" href="{% url 'landing' %}">{{ site_name }}</a> | |
|
33 | <a class="link" href="{% url 'index' %}">{% trans "All threads" %}</a>, | |||
33 | {% if tags_str %} |
|
34 | {% if tags_str %} | |
34 | <form action="{% url 'index' %}" method="post" class="post-button-form">{% csrf_token %} |
|
35 | <form action="{% url 'index' %}" method="post" class="post-button-form">{% csrf_token %} | |
35 | {% if only_favorites %} |
|
36 | {% if only_favorites %} | |
36 | <button name="method" value="toggle_fav" class="fav">β </button>, |
|
37 | <button name="method" value="toggle_fav" class="fav">β </button>, | |
37 | {% else %} |
|
38 | {% else %} | |
38 | <button name="method" value="toggle_fav" class="not_fav">β </button>, |
|
39 | <button name="method" value="toggle_fav" class="not_fav">β </button>, | |
39 | {% endif %} |
|
40 | {% endif %} | |
40 | </form> |
|
41 | </form> | |
41 | {{ tags_str|safe }}, |
|
42 | {{ tags_str|safe }}, | |
42 | {% else %} |
|
|||
43 | {% trans 'Add tags' %} β |
|
|||
44 | {% endif %} |
|
43 | {% endif %} | |
45 | <a href="{% url 'tags' 'required'%}" title="{% trans 'Tag management' %}">{% trans "tags" %}</a>, |
|
44 | <a href="{% url 'tags' 'required'%}" title="{% trans 'Tag management' %}">{% trans "tags" %}</a>, | |
46 | <a href="{% url 'search' %}" title="{% trans 'Search' %}">{% trans 'search' %}</a>, |
|
45 | <a href="{% url 'search' %}" title="{% trans 'Search' %}">{% trans 'search' %}</a>, | |
47 | <a href="{% url 'feed' %}" title="{% trans 'Feed' %}">{% trans 'feed' %}</a>, |
|
46 | <a href="{% url 'feed' %}" title="{% trans 'Feed' %}">{% trans 'feed' %}</a>, | |
48 | <a href="{% url 'random' %}" title="{% trans 'Random images' %}">{% trans 'images' %}</a>{% if has_fav_threads %}, |
|
47 | <a href="{% url 'random' %}" title="{% trans 'Random images' %}">{% trans 'images' %}</a>{% if has_fav_threads %}, | |
49 |
|
48 | |||
50 | <a href="{% url 'feed' %}?favorites" id="fav-panel-btn">{% trans 'favorites' %} <span id="new-fav-post-count" {% if not new_post_count %}style="display: none" {% endif %}>{{ new_post_count }}</span></a> |
|
49 | <a href="{% url 'feed' %}?favorites" id="fav-panel-btn">{% trans 'favorites' %} <span id="new-fav-post-count" {% if not new_post_count %}style="display: none" {% endif %}>{{ new_post_count }}</span></a> | |
51 | {% endif %} |
|
50 | {% endif %} | |
52 |
|
51 | |||
53 | {% if usernames %} |
|
52 | {% if usernames %} | |
54 | <a class="right-link link" href="{% url 'notifications' %}" title="{% trans 'Notifications' %}"> |
|
53 | <a class="right-link link" href="{% url 'notifications' %}" title="{% trans 'Notifications' %}"> | |
55 | {% trans 'Notifications' %} |
|
54 | {% trans 'Notifications' %} | |
56 | {% ifnotequal new_notifications_count 0 %} |
|
55 | {% ifnotequal new_notifications_count 0 %} | |
57 | (<b>{{ new_notifications_count }}</b>) |
|
56 | (<b>{{ new_notifications_count }}</b>) | |
58 | {% endifnotequal %} |
|
57 | {% endifnotequal %} | |
59 | </a> |
|
58 | </a> | |
60 | {% endif %} |
|
59 | {% endif %} | |
61 |
|
60 | |||
62 | <a class="right-link link" href="{% url 'settings' %}">{% trans 'Settings' %}</a> |
|
61 | <a class="right-link link" href="{% url 'settings' %}">{% trans 'Settings' %}</a> | |
63 | </header> |
|
62 | </header> | |
64 |
|
63 | |||
65 | <div id="fav-panel"><div class="post">{% trans "Loading..." %}</div></div> |
|
64 | <div id="fav-panel"><div class="post">{% trans "Loading..." %}</div></div> | |
66 |
|
65 | |||
67 | {% block content %}{% endblock %} |
|
66 | {% block content %}{% endblock %} | |
68 |
|
67 | |||
69 | <script src="{% static 'js/3party/jquery-ui.min.js' %}"></script> |
|
68 | <script src="{% static 'js/3party/jquery-ui.min.js' %}"></script> | |
70 | <script src="{% static 'js/jquery.mousewheel.js' %}"></script> |
|
69 | <script src="{% static 'js/jquery.mousewheel.js' %}"></script> | |
71 | <script src="{% static 'js/3party/highlight.min.js' %}"></script> |
|
70 | <script src="{% static 'js/3party/highlight.min.js' %}"></script> | |
72 |
|
71 | |||
73 | <script src="{% url 'js_info_dict' %}"></script> |
|
72 | <script src="{% url 'js_info_dict' %}"></script> | |
74 |
|
73 | |||
75 | <script src="{% static 'js/popup.js' %}"></script> |
|
74 | <script src="{% static 'js/popup.js' %}"></script> | |
76 | <script src="{% static 'js/image.js' %}"></script> |
|
75 | <script src="{% static 'js/image.js' %}"></script> | |
77 | <script src="{% static 'js/refpopup.js' %}"></script> |
|
76 | <script src="{% static 'js/refpopup.js' %}"></script> | |
78 | <script src="{% static 'js/main.js' %}"></script> |
|
77 | <script src="{% static 'js/main.js' %}"></script> | |
79 |
|
78 | |||
80 | <footer class="navigation_panel"> |
|
79 | <footer class="navigation_panel"> | |
81 | {% block metapanel %}{% endblock %} |
|
80 | {% block metapanel %}{% endblock %} | |
82 | {% if rss_url %} |
|
81 | {% if rss_url %} | |
83 | [<a href="{{ rss_url }}">RSS</a>] |
|
82 | [<a href="{{ rss_url }}">RSS</a>] | |
84 | {% endif %} |
|
83 | {% endif %} | |
85 | [<a href="{% url 'admin:index' %}">{% trans 'Admin' %}</a>] |
|
84 | [<a href="{% url 'admin:index' %}">{% trans 'Admin' %}</a>] | |
86 | [<a href="{% url 'index' %}?order=pub">{% trans 'New threads' %}</a>] |
|
85 | [<a href="{% url 'index' %}?order=pub">{% trans 'New threads' %}</a>] | |
87 | {% with ppd=posts_per_day|floatformat:2 %} |
|
86 | {% with ppd=posts_per_day|floatformat:2 %} | |
88 | {% blocktrans %}Speed: {{ ppd }} posts per day{% endblocktrans %} |
|
87 | {% blocktrans %}Speed: {{ ppd }} posts per day{% endblocktrans %} | |
89 | {% endwith %} |
|
88 | {% endwith %} | |
90 | <a class="link" href="#top" id="up">{% trans 'Up' %}</a> |
|
89 | <a class="link" href="#top" id="up">{% trans 'Up' %}</a> | |
91 | </footer> |
|
90 | </footer> | |
92 |
|
91 | |||
93 | </body> |
|
92 | </body> | |
94 | </html> |
|
93 | </html> |
@@ -1,37 +1,35 b'' | |||||
1 | {% extends "boards/base.html" %} |
|
1 | {% extends "boards/base.html" %} | |
2 |
|
2 | |||
3 | {% load i18n %} |
|
3 | {% load i18n %} | |
4 |
|
4 | |||
5 | {% block head %} |
|
5 | {% block head %} | |
6 | <title>{% trans 'Random images' %} - {{ site_name }}</title> |
|
6 | <title>{% trans 'Random images' %} - {{ site_name }}</title> | |
7 | {% endblock %} |
|
7 | {% endblock %} | |
8 |
|
8 | |||
9 | {% block content %} |
|
9 | {% block content %} | |
10 |
|
10 | |||
11 | {% if images %} |
|
11 | {% if images %} | |
12 | <div class="random-images-table"> |
|
12 | <div class="random-images-table"> | |
13 | <div> |
|
13 | <div> | |
14 | {% for image in images %} |
|
14 | {% for image in images %} | |
15 | <div class="gallery_image"> |
|
15 | <div class="gallery_image"> | |
16 |
{ |
|
16 | {{ image.get_view|safe }} | |
17 | {{ image.get_view }} |
|
|||
18 | {% endautoescape %} |
|
|||
19 | {% with image.get_random_associated_post as post %} |
|
17 | {% with image.get_random_associated_post as post %} | |
20 | {{ post.get_link_view|safe }} |
|
18 | {{ post.get_link_view|safe }} | |
21 | <div> |
|
19 | <div> | |
22 | {% for tag in post.get_thread.get_required_tags.all %} |
|
20 | {% for tag in post.get_thread.get_required_tags.all %} | |
23 | {{ tag.get_view|safe }}{% if not forloop.last %},{% endif %} |
|
21 | {{ tag.get_view|safe }}{% if not forloop.last %},{% endif %} | |
24 | {% endfor %} |
|
22 | {% endfor %} | |
25 | </div> |
|
23 | </div> | |
26 | {% endwith %} |
|
24 | {% endwith %} | |
27 | </div> |
|
25 | </div> | |
28 | {% if forloop.counter|divisibleby:"3" %} |
|
26 | {% if forloop.counter|divisibleby:"3" %} | |
29 | </div> |
|
27 | </div> | |
30 | <div> |
|
28 | <div> | |
31 | {% endif %} |
|
29 | {% endif %} | |
32 | {% endfor %} |
|
30 | {% endfor %} | |
33 | </div> |
|
31 | </div> | |
34 | </div> |
|
32 | </div> | |
35 | {% endif %} |
|
33 | {% endif %} | |
36 |
|
34 | |||
37 | {% endblock %} |
|
35 | {% endblock %} |
@@ -1,95 +1,97 b'' | |||||
1 | from django.conf.urls import url |
|
1 | from django.conf.urls import url | |
2 |
|
2 | |||
3 | import neboard |
|
3 | import neboard | |
4 |
|
4 | |||
5 | from boards import views |
|
5 | from boards import views | |
6 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed |
|
6 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed | |
7 | from boards.views import api, tag_threads, all_threads, \ |
|
7 | from boards.views import api, tag_threads, all_threads, \ | |
8 | settings, all_tags, feed, alias |
|
8 | settings, all_tags, feed, alias | |
9 | from boards.views.authors import AuthorsView |
|
9 | from boards.views.authors import AuthorsView | |
10 | from boards.views.notifications import NotificationView |
|
10 | from boards.views.notifications import NotificationView | |
11 | from boards.views.static import StaticPageView |
|
11 | from boards.views.static import StaticPageView | |
12 | from boards.views.preview import PostPreviewView |
|
12 | from boards.views.preview import PostPreviewView | |
13 | from boards.views.sync import get_post_sync_data, response_get, response_list |
|
13 | from boards.views.sync import get_post_sync_data, response_get, response_list | |
14 | from boards.views.random import RandomImageView |
|
14 | from boards.views.random import RandomImageView | |
15 | from boards.views.tag_gallery import TagGalleryView |
|
15 | from boards.views.tag_gallery import TagGalleryView | |
16 | from boards.views.translation import cached_javascript_catalog |
|
16 | from boards.views.translation import cached_javascript_catalog | |
17 | from boards.views.search import BoardSearchView |
|
17 | from boards.views.search import BoardSearchView | |
|
18 | from boards.views.landing import LandingView | |||
18 |
|
19 | |||
19 |
|
20 | |||
20 | js_info_dict = { |
|
21 | js_info_dict = { | |
21 | 'packages': ('boards',), |
|
22 | 'packages': ('boards',), | |
22 | } |
|
23 | } | |
23 |
|
24 | |||
24 | urlpatterns = [ |
|
25 | urlpatterns = [ | |
25 | # /boards/ |
|
26 | # /boards/ | |
26 | url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), |
|
27 | url(r'^all/$', all_threads.AllThreadsView.as_view(), name='index'), | |
27 |
|
28 | |||
28 | # /boards/tag/tag_name/ |
|
29 | # /boards/tag/tag_name/ | |
29 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), |
|
30 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), | |
30 | name='tag'), |
|
31 | name='tag'), | |
31 |
|
32 | |||
32 | # /boards/thread/ |
|
33 | # /boards/thread/ | |
33 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.NormalThreadView.as_view(), |
|
34 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.NormalThreadView.as_view(), | |
34 | name='thread'), |
|
35 | name='thread'), | |
35 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(), |
|
36 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(), | |
36 | name='thread_gallery'), |
|
37 | name='thread_gallery'), | |
37 | url(r'^thread/(?P<post_id>\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(), |
|
38 | url(r'^thread/(?P<post_id>\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(), | |
38 | name='thread_tree'), |
|
39 | name='thread_tree'), | |
39 | # /feed/ |
|
40 | # /feed/ | |
40 | url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'), |
|
41 | url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'), | |
41 |
|
42 | |||
42 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), |
|
43 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), | |
43 | url(r'^aliases/(?P<category>\w+)/$', alias.AliasesView.as_view(), name='aliases'), |
|
44 | url(r'^aliases/(?P<category>\w+)/$', alias.AliasesView.as_view(), name='aliases'), | |
44 | url(r'^tags/(?P<query>\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'), |
|
45 | url(r'^tags/(?P<query>\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'), | |
45 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), |
|
46 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), | |
46 |
|
47 | |||
47 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), |
|
48 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), | |
48 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), |
|
49 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), | |
49 | name='staticpage'), |
|
50 | name='staticpage'), | |
50 |
|
51 | |||
51 | url(r'^random/$', RandomImageView.as_view(), name='random'), |
|
52 | url(r'^random/$', RandomImageView.as_view(), name='random'), | |
52 | url(r'^tag/(?P<tag_name>\w+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'), |
|
53 | url(r'^tag/(?P<tag_name>\w+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'), | |
53 | url(r'^search/$', BoardSearchView.as_view(), name='search'), |
|
54 | url(r'^search/$', BoardSearchView.as_view(), name='search'), | |
|
55 | url(r'^$', LandingView.as_view(), name='landing'), | |||
54 |
|
56 | |||
55 | # RSS feeds |
|
57 | # RSS feeds | |
56 | url(r'^rss/$', AllThreadsFeed()), |
|
58 | url(r'^rss/$', AllThreadsFeed()), | |
57 | url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()), |
|
59 | url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()), | |
58 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), |
|
60 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), | |
59 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), |
|
61 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), | |
60 | url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()), |
|
62 | url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()), | |
61 |
|
63 | |||
62 | # i18n |
|
64 | # i18n | |
63 | url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict, |
|
65 | url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict, | |
64 | name='js_info_dict'), |
|
66 | name='js_info_dict'), | |
65 |
|
67 | |||
66 | # API |
|
68 | # API | |
67 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), |
|
69 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), | |
68 | url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"), |
|
70 | url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"), | |
69 | url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, |
|
71 | url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, | |
70 | name='get_threads'), |
|
72 | name='get_threads'), | |
71 | url(r'^api/tags/$', api.api_get_tags, name='get_tags'), |
|
73 | url(r'^api/tags/$', api.api_get_tags, name='get_tags'), | |
72 | url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts, |
|
74 | url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts, | |
73 | name='get_thread'), |
|
75 | name='get_thread'), | |
74 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, |
|
76 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, | |
75 | name='add_post'), |
|
77 | name='add_post'), | |
76 | url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications, |
|
78 | url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications, | |
77 | name='api_notifications'), |
|
79 | name='api_notifications'), | |
78 | url(r'^api/preview/$', api.api_get_preview, name='preview'), |
|
80 | url(r'^api/preview/$', api.api_get_preview, name='preview'), | |
79 | url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'), |
|
81 | url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'), | |
80 | url(r'^api/stickers/$', api.api_get_stickers, name='get_stickers'), |
|
82 | url(r'^api/stickers/$', api.api_get_stickers, name='get_stickers'), | |
81 |
|
83 | |||
82 | # Sync protocol API |
|
84 | # Sync protocol API | |
83 | url(r'^api/sync/list/$', response_list, name='api_sync_list'), |
|
85 | url(r'^api/sync/list/$', response_list, name='api_sync_list'), | |
84 | url(r'^api/sync/get/$', response_get, name='api_sync_get'), |
|
86 | url(r'^api/sync/get/$', response_get, name='api_sync_get'), | |
85 |
|
87 | |||
86 | # Notifications |
|
88 | # Notifications | |
87 | url(r'^notifications/(?P<username>\w+)/$', NotificationView.as_view(), name='notifications'), |
|
89 | url(r'^notifications/(?P<username>\w+)/$', NotificationView.as_view(), name='notifications'), | |
88 | url(r'^notifications/$', NotificationView.as_view(), name='notifications'), |
|
90 | url(r'^notifications/$', NotificationView.as_view(), name='notifications'), | |
89 |
|
91 | |||
90 | # Post preview |
|
92 | # Post preview | |
91 | url(r'^preview/$', PostPreviewView.as_view(), name='preview'), |
|
93 | url(r'^preview/$', PostPreviewView.as_view(), name='preview'), | |
92 | url(r'^post_xml/(?P<post_id>\d+)$', get_post_sync_data, |
|
94 | url(r'^post_xml/(?P<post_id>\d+)$', get_post_sync_data, | |
93 | name='post_sync_data'), |
|
95 | name='post_sync_data'), | |
94 | ] |
|
96 | ] | |
95 |
|
97 |
General Comments 0
You need to be logged in to leave comments.
Login now