##// END OF EJS Templates
Don't show tag children, only a parent
neko259 -
r1350:fce14c9c default
parent child Browse files
Show More
@@ -1,195 +1,187 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.text }}</div>
34 <div>{{ banner.text }}</div>
35 <div>{% trans 'Related message' %}: <a href="{{ banner.post.get_absolute_url }}">>>{{ banner.post.id }}</a></div>
35 <div>{% trans 'Related message' %}: <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 }}"/></a>
47 height="{{ image.pre_height }}"/></a>
48 {% endwith %}
48 {% endwith %}
49 </div>
49 </div>
50 {% endif %}
50 {% endif %}
51 <div class="tag-text-data">
51 <div class="tag-text-data">
52 <h2>
52 <h2>
53 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
53 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
54 {% if is_favorite %}
54 {% if is_favorite %}
55 <button name="method" value="unsubscribe" class="fav"></button>
55 <button name="method" value="unsubscribe" class="fav"></button>
56 {% else %}
56 {% else %}
57 <button name="method" value="subscribe" class="not_fav"></button>
57 <button name="method" value="subscribe" class="not_fav"></button>
58 {% endif %}
58 {% endif %}
59 </form>
59 </form>
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_hidden %}
61 {% if is_hidden %}
62 <button name="method" value="unhide" class="fav">H</button>
62 <button name="method" value="unhide" class="fav">H</button>
63 {% else %}
63 {% else %}
64 <button name="method" value="hide" class="not_fav">H</button>
64 <button name="method" value="hide" class="not_fav">H</button>
65 {% endif %}
65 {% endif %}
66 </form>
66 </form>
67 {{ tag.get_view|safe }}
67 {{ tag.get_view|safe }}
68 {% if moderator %}
68 {% if moderator %}
69 <span class="moderator_info">| <a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></span>
69 <span class="moderator_info">| <a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></span>
70 {% endif %}
70 {% endif %}
71 </h2>
71 </h2>
72 {% if tag.get_description %}
72 {% if tag.get_description %}
73 <p>{{ tag.get_description|safe }}</p>
73 <p>{{ tag.get_description|safe }}</p>
74 {% endif %}
74 {% endif %}
75 <p>{% blocktrans with active_thread_count=tag.get_active_thread_count thread_count=tag.get_thread_count post_count=tag.get_post_count %}This tag has {{ thread_count }} threads ({{ active_thread_count}} active) and {{ post_count }} posts.{% endblocktrans %}</p>
75 <p>{% blocktrans with active_thread_count=tag.get_active_thread_count thread_count=tag.get_thread_count post_count=tag.get_post_count %}This tag has {{ thread_count }} threads ({{ active_thread_count}} active) and {{ post_count }} posts.{% endblocktrans %}</p>
76 {% with children=tag.get_children.all %}
76 {% if tag.get_parent %}
77 {% if tag.get_parent or children %}
77 <p>
78 <p>
79 {% if tag.get_parent %}
78 {% if tag.get_parent %}
80 {{ tag.get_parent.get_view|safe }} /
79 {{ tag.get_parent.get_view|safe }} /
81 {% endif %}
80 {% endif %}
82 {{ tag.get_view|safe }}
81 {{ tag.get_view|safe }}
83 {% if children %}
82 </p>
84 /
83 {% endif %}
85 {% for child in children %}
86 {{ child.get_view|safe }}{% if not forloop.last %}, {% endif %}
87 {% endfor %}
88 {% endif %}
89 </p>
90 {% endif %}
91 {% endwith %}
92 </div>
84 </div>
93 </div>
85 </div>
94 {% endif %}
86 {% endif %}
95
87
96 {% if threads %}
88 {% if threads %}
97 {% if prev_page_link %}
89 {% if prev_page_link %}
98 <div class="page_link">
90 <div class="page_link">
99 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
91 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
100 </div>
92 </div>
101 {% endif %}
93 {% endif %}
102
94
103 {% for thread in threads %}
95 {% for thread in threads %}
104 <div class="thread">
96 <div class="thread">
105 {% post_view thread.get_opening_post moderator=moderator thread=thread truncated=True need_open_link=True %}
97 {% post_view thread.get_opening_post moderator=moderator thread=thread truncated=True need_open_link=True %}
106 {% if not thread.archived %}
98 {% if not thread.archived %}
107 {% with last_replies=thread.get_last_replies %}
99 {% with last_replies=thread.get_last_replies %}
108 {% if last_replies %}
100 {% if last_replies %}
109 {% with skipped_replies_count=thread.get_skipped_replies_count %}
101 {% with skipped_replies_count=thread.get_skipped_replies_count %}
110 {% if skipped_replies_count %}
102 {% if skipped_replies_count %}
111 <div class="skipped_replies">
103 <div class="skipped_replies">
112 <a href="{% url 'thread' thread.get_opening_post_id %}">
104 <a href="{% url 'thread' thread.get_opening_post_id %}">
113 {% 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 %}
105 {% 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 %}
114 </a>
106 </a>
115 </div>
107 </div>
116 {% endif %}
108 {% endif %}
117 {% endwith %}
109 {% endwith %}
118 <div class="last-replies">
110 <div class="last-replies">
119 {% for post in last_replies %}
111 {% for post in last_replies %}
120 {% post_view post moderator=moderator truncated=True %}
112 {% post_view post moderator=moderator truncated=True %}
121 {% endfor %}
113 {% endfor %}
122 </div>
114 </div>
123 {% endif %}
115 {% endif %}
124 {% endwith %}
116 {% endwith %}
125 {% endif %}
117 {% endif %}
126 </div>
118 </div>
127 {% endfor %}
119 {% endfor %}
128
120
129 {% if next_page_link %}
121 {% if next_page_link %}
130 <div class="page_link">
122 <div class="page_link">
131 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
123 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
132 </div>
124 </div>
133 {% endif %}
125 {% endif %}
134 {% else %}
126 {% else %}
135 <div class="post">
127 <div class="post">
136 {% trans 'No threads exist. Create the first one!' %}</div>
128 {% trans 'No threads exist. Create the first one!' %}</div>
137 {% endif %}
129 {% endif %}
138
130
139 <div class="post-form-w">
131 <div class="post-form-w">
140 <script src="{% static 'js/panel.js' %}"></script>
132 <script src="{% static 'js/panel.js' %}"></script>
141 <div class="post-form">
133 <div class="post-form">
142 <div class="form-title">{% trans "Create new thread" %}</div>
134 <div class="form-title">{% trans "Create new thread" %}</div>
143 <div class="swappable-form-full">
135 <div class="swappable-form-full">
144 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
136 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
145 {{ form.as_div }}
137 {{ form.as_div }}
146 <div class="form-submit">
138 <div class="form-submit">
147 <input type="submit" value="{% trans "Post" %}"/>
139 <input type="submit" value="{% trans "Post" %}"/>
148 <button id="preview-button" onclick="return false;">{% trans 'Preview' %}</button>
140 <button id="preview-button" onclick="return false;">{% trans 'Preview' %}</button>
149 </div>
141 </div>
150 </form>
142 </form>
151 </div>
143 </div>
152 <div>
144 <div>
153 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
145 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
154 </div>
146 </div>
155 <div id="preview-text"></div>
147 <div id="preview-text"></div>
156 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Text syntax' %}</a></div>
148 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Text syntax' %}</a></div>
157 <div><a href="{% url "tags" "required" %}">{% trans 'Tags' %}</a></div>
149 <div><a href="{% url "tags" "required" %}">{% trans 'Tags' %}</a></div>
158 </div>
150 </div>
159 </div>
151 </div>
160
152
161 <script src="{% static 'js/form.js' %}"></script>
153 <script src="{% static 'js/form.js' %}"></script>
162 <script src="{% static 'js/thread_create.js' %}"></script>
154 <script src="{% static 'js/thread_create.js' %}"></script>
163
155
164 {% endblock %}
156 {% endblock %}
165
157
166 {% block metapanel %}
158 {% block metapanel %}
167
159
168 <span class="metapanel">
160 <span class="metapanel">
169 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
161 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
170 {% trans "Pages:" %}
162 {% trans "Pages:" %}
171 [
163 [
172 {% with dividers=paginator.get_dividers %}
164 {% with dividers=paginator.get_dividers %}
173 {% for page in paginator.get_divided_range %}
165 {% for page in paginator.get_divided_range %}
174 {% if page in dividers %}
166 {% if page in dividers %}
175 …,
167 …,
176 {% endif %}
168 {% endif %}
177 <a
169 <a
178 {% ifequal page current_page.number %}
170 {% ifequal page current_page.number %}
179 class="current_page"
171 class="current_page"
180 {% endifequal %}
172 {% endifequal %}
181 href="
173 href="
182 {% if tag %}
174 {% if tag %}
183 {% url "tag" tag_name=tag.name %}?page={{ page }}
175 {% url "tag" tag_name=tag.name %}?page={{ page }}
184 {% else %}
176 {% else %}
185 {% url "index" %}?page={{ page }}
177 {% url "index" %}?page={{ page }}
186 {% endif %}
178 {% endif %}
187 ">{{ page }}</a>
179 ">{{ page }}</a>
188 {% if not forloop.last %},{% endif %}
180 {% if not forloop.last %},{% endif %}
189 {% endfor %}
181 {% endfor %}
190 {% endwith %}
182 {% endwith %}
191 ]
183 ]
192 [<a href="rss/">RSS</a>]
184 [<a href="rss/">RSS</a>]
193 </span>
185 </span>
194
186
195 {% endblock %}
187 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now