Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.

Commit 6e73411

Browse files
committed
topic.html: Added info if topic is discussion for wiki-article(s)
1 parent 3bfc17f commit 6e73411

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

inyoka_theme_default/templates/forum/topic.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,24 @@
8686
{% set rendered_pagination = macros.render_pagination(pagination) %}
8787

8888
<h1>{{ topic.title|e }}</h1>
89+
90+
{% if discussions %}
91+
{% macro render_article_list(discussions) %}
92+
{% for article in discussions %}
93+
<a class="article_discussion_list" href="{{ article|url }}">{{ article.name|e }}</a>
94+
{% if not loop.last %},{% endif %}
95+
{% endfor %}
96+
{% endmacro %}
97+
98+
{% call macros.render_message('info') %}
99+
{% trans count=discussions|count, article_list=render_article_list(discussions) %}
100+
This topic is the discussion of the article {{ article_list }}.
101+
{% pluralize %}
102+
This topic is the discussion of the articles {{ article_list }}.
103+
{% endtrans %}
104+
{% endcall %}
105+
{% endif %}
106+
89107
{{ rendered_pagination }}
90108
{% for post in posts %}
91109
<div class="forum-post {% if post.hidden %}forum-post-muted{% endif %}" id="post-{{ post.id }}">

inyoka_theme_default/templates/macros.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,16 @@ <h1>{% trans %}Staff{% endtrans %}</h1>
243243
{% endmacro %}
244244

245245
{% macro render_message(type, content) %}
246+
{# instead of passing the content via the parameter, a caller can be used #}
246247
<div class="message-{{ type }}" role="alert">
247248
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
248249
<span aria-hidden="true">&times;</span>
249250
</button>
251+
252+
{% if caller %}
253+
{{ caller() }}
254+
{% endif %}
255+
250256
{{ content }}
251257
</div>
252258
{% endmacro %}

0 commit comments

Comments
 (0)