##// 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 1 {% extends "boards/base.html" %}
2 2
3 3 {% load i18n %}
4 4 {% load board %}
5 5 {% load static %}
6 6 {% load tz %}
7 7
8 8 {% block head %}
9 9 <meta name="robots" content="noindex">
10 10
11 11 {% if tag %}
12 12 <title>{{ tag.name }} - {{ site_name }}</title>
13 13 {% else %}
14 14 <title>{{ site_name }}</title>
15 15 {% endif %}
16 16
17 17 {% if prev_page_link %}
18 18 <link rel="prev" href="{{ prev_page_link }}" />
19 19 {% endif %}
20 20 {% if next_page_link %}
21 21 <link rel="next" href="{{ next_page_link }}" />
22 22 {% endif %}
23 23
24 24 {% endblock %}
25 25
26 26 {% block content %}
27 27
28 28 {% get_current_language as LANGUAGE_CODE %}
29 29 {% get_current_timezone as TIME_ZONE %}
30 30
31 31 {% for banner in banners %}
32 32 <div class="post">
33 33 <div class="title">{{ banner.title }}</div>
34 34 <div>{{ banner.text }}</div>
35 35 <div>{% trans 'Related message' %}: <a href="{{ banner.post.get_absolute_url }}">>>{{ banner.post.id }}</a></div>
36 36 </div>
37 37 {% endfor %}
38 38
39 39 {% if tag %}
40 40 <div class="tag_info" style="border-bottom: solid .5ex #{{ tag.get_color }}">
41 41 {% if random_image_post %}
42 42 <div class="tag-image">
43 43 {% with image=random_image_post.images.first %}
44 44 <a href="{{ random_image_post.get_absolute_url }}"><img
45 45 src="{{ image.image.url_200x150 }}"
46 46 width="{{ image.pre_width }}"
47 47 height="{{ image.pre_height }}"/></a>
48 48 {% endwith %}
49 49 </div>
50 50 {% endif %}
51 51 <div class="tag-text-data">
52 52 <h2>
53 53 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
54 54 {% if is_favorite %}
55 55 <button name="method" value="unsubscribe" class="fav"></button>
56 56 {% else %}
57 57 <button name="method" value="subscribe" class="not_fav"></button>
58 58 {% endif %}
59 59 </form>
60 60 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
61 61 {% if is_hidden %}
62 62 <button name="method" value="unhide" class="fav">H</button>
63 63 {% else %}
64 64 <button name="method" value="hide" class="not_fav">H</button>
65 65 {% endif %}
66 66 </form>
67 67 {{ tag.get_view|safe }}
68 68 {% if moderator %}
69 69 <span class="moderator_info">| <a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></span>
70 70 {% endif %}
71 71 </h2>
72 72 {% if tag.get_description %}
73 73 <p>{{ tag.get_description|safe }}</p>
74 74 {% endif %}
75 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 %}
77 {% if tag.get_parent or children %}
78 <p>
76 {% if tag.get_parent %}
77 <p>
79 78 {% if tag.get_parent %}
80 79 {{ tag.get_parent.get_view|safe }} /
81 80 {% endif %}
82 {{ tag.get_view|safe }}
83 {% if children %}
84 /
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 %}
81 {{ tag.get_view|safe }}
82 </p>
83 {% endif %}
92 84 </div>
93 85 </div>
94 86 {% endif %}
95 87
96 88 {% if threads %}
97 89 {% if prev_page_link %}
98 90 <div class="page_link">
99 91 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
100 92 </div>
101 93 {% endif %}
102 94
103 95 {% for thread in threads %}
104 96 <div class="thread">
105 97 {% post_view thread.get_opening_post moderator=moderator thread=thread truncated=True need_open_link=True %}
106 98 {% if not thread.archived %}
107 99 {% with last_replies=thread.get_last_replies %}
108 100 {% if last_replies %}
109 101 {% with skipped_replies_count=thread.get_skipped_replies_count %}
110 102 {% if skipped_replies_count %}
111 103 <div class="skipped_replies">
112 104 <a href="{% url 'thread' thread.get_opening_post_id %}">
113 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 106 </a>
115 107 </div>
116 108 {% endif %}
117 109 {% endwith %}
118 110 <div class="last-replies">
119 111 {% for post in last_replies %}
120 112 {% post_view post moderator=moderator truncated=True %}
121 113 {% endfor %}
122 114 </div>
123 115 {% endif %}
124 116 {% endwith %}
125 117 {% endif %}
126 118 </div>
127 119 {% endfor %}
128 120
129 121 {% if next_page_link %}
130 122 <div class="page_link">
131 123 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
132 124 </div>
133 125 {% endif %}
134 126 {% else %}
135 127 <div class="post">
136 128 {% trans 'No threads exist. Create the first one!' %}</div>
137 129 {% endif %}
138 130
139 131 <div class="post-form-w">
140 132 <script src="{% static 'js/panel.js' %}"></script>
141 133 <div class="post-form">
142 134 <div class="form-title">{% trans "Create new thread" %}</div>
143 135 <div class="swappable-form-full">
144 136 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
145 137 {{ form.as_div }}
146 138 <div class="form-submit">
147 139 <input type="submit" value="{% trans "Post" %}"/>
148 140 <button id="preview-button" onclick="return false;">{% trans 'Preview' %}</button>
149 141 </div>
150 142 </form>
151 143 </div>
152 144 <div>
153 145 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
154 146 </div>
155 147 <div id="preview-text"></div>
156 148 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Text syntax' %}</a></div>
157 149 <div><a href="{% url "tags" "required" %}">{% trans 'Tags' %}</a></div>
158 150 </div>
159 151 </div>
160 152
161 153 <script src="{% static 'js/form.js' %}"></script>
162 154 <script src="{% static 'js/thread_create.js' %}"></script>
163 155
164 156 {% endblock %}
165 157
166 158 {% block metapanel %}
167 159
168 160 <span class="metapanel">
169 161 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
170 162 {% trans "Pages:" %}
171 163 [
172 164 {% with dividers=paginator.get_dividers %}
173 165 {% for page in paginator.get_divided_range %}
174 166 {% if page in dividers %}
175 167 …,
176 168 {% endif %}
177 169 <a
178 170 {% ifequal page current_page.number %}
179 171 class="current_page"
180 172 {% endifequal %}
181 173 href="
182 174 {% if tag %}
183 175 {% url "tag" tag_name=tag.name %}?page={{ page }}
184 176 {% else %}
185 177 {% url "index" %}?page={{ page }}
186 178 {% endif %}
187 179 ">{{ page }}</a>
188 180 {% if not forloop.last %},{% endif %}
189 181 {% endfor %}
190 182 {% endwith %}
191 183 ]
192 184 [<a href="rss/">RSS</a>]
193 185 </span>
194 186
195 187 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now