From d35c029bdb5258d080c03dbf9152ce5dd2ce96f6 Mon Sep 17 00:00:00 2001 From: carofun Date: Mon, 8 Feb 2021 18:21:15 +0100 Subject: [PATCH 1/2] Add view partials for repeated content on post or topic writer If we want to override the way the last writer of a post or a topic is shown, the project forces us to repeat our modification in multiple templates. We introduce a partials to simplify the overload. --- .../templates/machina/forum/forum_list.html | 22 ++----------- .../forum_conversation/post_create.html | 15 +++------ .../forum_conversation/topic_detail.html | 17 +++------- .../forum_conversation/topic_list.html | 22 ++----------- .../machina/forum_member/user_posts_list.html | 7 ++-- .../moderation_queue/detail.html | 26 +++------------ .../moderation_queue/list.html | 13 ++------ .../templates/machina/partials/posted_by.html | 33 +++++++++++++++++++ 8 files changed, 55 insertions(+), 100 deletions(-) create mode 100644 machina/templates/machina/partials/posted_by.html diff --git a/machina/templates/machina/forum/forum_list.html b/machina/templates/machina/forum/forum_list.html index ac00f087d..d85475690 100644 --- a/machina/templates/machina/forum/forum_list.html +++ b/machina/templates/machina/forum/forum_list.html @@ -72,16 +72,7 @@

{% trans "Forums" %}

{{ node.posts_count }}
{% if node.last_post %} - {% if node.last_post.poster %} - {% url 'forum_member:profile' node.last_post.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=node.last_post.poster|forum_member_display_name %} - By: {{ username }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=node.last_post.username %} - By: {{ poster_username }} - {% endblocktrans %} - {% endif %} + {% include "partials/posted_by.html" with poster=node.last_post.poster username=node.last_post.username %}  
{{ node.last_post.created }} @@ -145,16 +136,7 @@

{% trans "Forums" %}

{{ node.posts_count }}
{% if node.last_post %} - {% if node.last_post.poster_id %} - {% url 'forum_member:profile' node.last_post.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=node.last_post.poster|forum_member_display_name %} - By: {{ username }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=node.last_post.username %} - By: {{ poster_username }} - {% endblocktrans %} - {% endif %} + {% include "partials/posted_by.html" with poster=node.last_post.poster username=node.last_post.username %}  
{{ node.last_post.created }} diff --git a/machina/templates/machina/forum_conversation/post_create.html b/machina/templates/machina/forum_conversation/post_create.html index ce9aeac07..160e4cbb9 100644 --- a/machina/templates/machina/forum_conversation/post_create.html +++ b/machina/templates/machina/forum_conversation/post_create.html @@ -46,16 +46,7 @@

{{ post.subject }}

{% spaceless %}   - {% if post.poster %} - {% url 'forum_member:profile' post.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=post.username creation_date=post.created %} - By: {{ poster_username }} on {{ creation_date }} - {% endblocktrans %} - {% endif %} + {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} {% endspaceless %}

@@ -64,7 +55,9 @@

{{ post.subject }}

{% include "forum_conversation/forum_attachments/attachments_detail.html" %}
{% endfor %} diff --git a/machina/templates/machina/forum_conversation/topic_detail.html b/machina/templates/machina/forum_conversation/topic_detail.html index d1b5875de..95e3f92c9 100644 --- a/machina/templates/machina/forum_conversation/topic_detail.html +++ b/machina/templates/machina/forum_conversation/topic_detail.html @@ -45,21 +45,14 @@

{% endspaceless %}

+ {% block written_by %} {% spaceless %}   - {% if post.poster %} - {% url 'forum_member:profile' post.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=post.username creation_date=post.created %} - By: {{ poster_username }} on {{ creation_date }} - {% endblocktrans %} - {% endif %} + {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} {% endspaceless %} + {% endblock %}

{{ post.content.rendered }} @@ -73,7 +66,7 @@

{% if post.updates_count %}
-  {% if post.updated_by %}{% trans "Last edited by:" %} {{ post.updated_by|forum_member_display_name }} {% else %}{% trans "Updated" %} {% endif %}{% trans "on" %} {{ post.updated }}, {% blocktrans count counter=post.updates_count %}edited {{counter }} time in total.{% plural %}edited {{counter }} times in total.{% endblocktrans %} +  {% if post.updated_by %}{% trans "Last edited by:" %} {% include "partials/posted_by.html" with poster=post.updated_by no_trans=True%} {% else %}{% trans "Updated" %} {% endif %}{% trans "on" %} {{ post.updated }}, {% blocktrans count counter=post.updates_count %}edited {{counter }} time in total.{% plural %}edited {{counter }} times in total.{% endblocktrans %} {% if post.update_reason %}
@@ -91,7 +84,7 @@

{% include "partials/avatar.html" with profile=post.poster.forum_profile show_placeholder=True %}

- +
{% include "partials/posted_by.html" with poster=post.poster username_highlighted=True no_trans=True %}
{% trans "Posts:" %} {{ post.poster.forum_profile.posts_count }}
{% else %}
{{ post.username }}
diff --git a/machina/templates/machina/forum_conversation/topic_list.html b/machina/templates/machina/forum_conversation/topic_list.html index f8c0305fd..13f1993c9 100644 --- a/machina/templates/machina/forum_conversation/topic_list.html +++ b/machina/templates/machina/forum_conversation/topic_list.html @@ -29,16 +29,7 @@ {{ topic.subject }}{% if topic.is_locked %} {% endif %}
- {% if topic.poster %} - {% url 'forum_member:profile' topic.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=topic.poster|forum_member_display_name creation_date=topic.created %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=topic.first_post.username creation_date=topic.created %} - By: {{ poster_username }} on {{ creation_date }} - {% endblocktrans %} - {% endif %} + {% include "partials/posted_by.html" with poster=topic.poster creation_date=topic.created username=topic.first_post.username %}
@@ -49,16 +40,7 @@
{{ topic.views_count }}
{% with last_post=topic.last_post %} - {% if last_post.poster %} - {% url 'forum_member:profile' last_post.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=last_post.poster|forum_member_display_name %} - By: {{ username }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=last_post.username %} - By: {{ poster_username }} - {% endblocktrans %} - {% endif %} + {% include "partials/posted_by.html" with poster=last_post.poster username=last_post.username %}  
{{ last_post.created }} diff --git a/machina/templates/machina/forum_member/user_posts_list.html b/machina/templates/machina/forum_member/user_posts_list.html index b7631a47b..7ed9c69da 100644 --- a/machina/templates/machina/forum_member/user_posts_list.html +++ b/machina/templates/machina/forum_member/user_posts_list.html @@ -46,10 +46,7 @@

{% spaceless %}   - {% url 'forum_member:profile' post.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} + {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created %} {% endspaceless %}

@@ -63,7 +60,7 @@

{% include "partials/avatar.html" with profile=post.poster placeholder=False %}

- +
{% include "partials/posted_by.html" with poster=post.poster username_highlighted=True no_trans=True %}
{% trans "Posts:" %} {{ post.poster.forum_profile.posts_count }}

diff --git a/machina/templates/machina/forum_moderation/moderation_queue/detail.html b/machina/templates/machina/forum_moderation/moderation_queue/detail.html index 11131b2aa..d5af3c6c6 100644 --- a/machina/templates/machina/forum_moderation/moderation_queue/detail.html +++ b/machina/templates/machina/forum_moderation/moderation_queue/detail.html @@ -81,16 +81,7 @@

{{ post.subject }}

{% spaceless %}   - {% if post.poster %} - {% url 'forum_member:profile' post.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=post.username creation_date=post.created %} - By: {{ poster_username }} on {{ creation_date }} - {% endblocktrans %} - {% endif %} + {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} {% endspaceless %}

@@ -113,7 +104,7 @@

{{ post.subject }}

{% endif %} -
{{ post.poster|forum_member_display_name }}
+
{% include "partials/posted_by.html" with poster=post.poster username_highlighted=True no_trans=True %}
{% trans "Posts:" %} {{ post.poster.forum_profile.posts_count }}
{% else %}
{{ post.username }}
@@ -140,16 +131,7 @@

{{ post.subject }}

{% spaceless %}   - {% if post.poster %} - {% url 'forum_member:profile' post.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=post.username creation_date=post.created %} - By: {{ poster_username }} on {{ creation_date }} - {% endblocktrans %} - {% endif %} + {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} {% endspaceless %}

@@ -158,7 +140,7 @@

{{ post.subject }}

{% include "forum_conversation/forum_attachments/attachments_detail.html" %}
-
{% if post.poster %}{{ post.poster|forum_member_display_name }}{% else %}{{ post.username }}{% endif %}
+
{% include "partials/posted_by.html" with poster=post.poster username=post.username username_highlighted=True no_trans=True %}
{% endfor %} diff --git a/machina/templates/machina/forum_moderation/moderation_queue/list.html b/machina/templates/machina/forum_moderation/moderation_queue/list.html index 687700fb6..01e94a169 100644 --- a/machina/templates/machina/forum_moderation/moderation_queue/list.html +++ b/machina/templates/machina/forum_moderation/moderation_queue/list.html @@ -46,16 +46,9 @@

{% trans "Moderation queue" %}

{{ post.subject }}
- {% if post.poster %} - {% url 'forum_member:profile' post.poster_id as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=post.poster|forum_member_display_name creation_date=post.created %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=post.username creation_date=post.created %} - By: {{ poster_username }} on {{ creation_date }} - {% endblocktrans %} - {% endif %} + {% block written_by %} + {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} + {% endblock %}
diff --git a/machina/templates/machina/partials/posted_by.html b/machina/templates/machina/partials/posted_by.html new file mode 100644 index 000000000..c91d6fb27 --- /dev/null +++ b/machina/templates/machina/partials/posted_by.html @@ -0,0 +1,33 @@ +{% load forum_member_tags %} +{% load i18n %} + +{% if poster %} + {% url 'forum_member:profile' poster.id as profil_url %} + {% if no_trans %} + {% if username_highlighted %}{% endif %}{{ poster|forum_member_display_name }}{% if username_highlighted %}{% endif %} + {% else %} + {% if creation_date %} + {% blocktrans trimmed with username=poster|forum_member_display_name %} + By: {{ username }} on {{ creation_date }} + {% endblocktrans %} + {% else %} + {% blocktrans trimmed with username=poster|forum_member_display_name %} + By: {{ username }} + {% endblocktrans %} + {% endif %} + {% endif %} +{% else %} + {% if no_trans %} + {% if username_highlighted %}{% endif %}{{ username }}{% if username_highlighted %}{% endif %} + {% else %} + {% if creation_date %} + {% blocktrans trimmed %} + By: {{ username }} on {{ creation_date }} + {% endblocktrans %} + {% else %} + {% blocktrans trimmed %} + By: {{ username }} + {% endblocktrans %} + {% endif %} + {% endif %} +{% endif %} From bb440c9aafe6371529b3090be8ace5352eca7937 Mon Sep 17 00:00:00 2001 From: carofun Date: Fri, 19 Mar 2021 16:22:32 +0100 Subject: [PATCH 2/2] fixup! Add view partials for repeated content on post or topic writer --- .../templates/machina/forum/forum_list.html | 4 +- .../forum_conversation/post_create.html | 4 +- .../forum_conversation/topic_detail.html | 6 +- .../forum_conversation/topic_list.html | 4 +- .../machina/forum_member/user_posts_list.html | 4 +- .../moderation_queue/detail.html | 8 +- .../moderation_queue/list.html | 2 +- .../machina/forum_search/search.html | 13 +--- .../templates/machina/partials/posted_by.html | 74 +++++++++++++------ 9 files changed, 69 insertions(+), 50 deletions(-) diff --git a/machina/templates/machina/forum/forum_list.html b/machina/templates/machina/forum/forum_list.html index d85475690..ed6f9630c 100644 --- a/machina/templates/machina/forum/forum_list.html +++ b/machina/templates/machina/forum/forum_list.html @@ -72,7 +72,7 @@

{% trans "Forums" %}

{{ node.posts_count }}
{% if node.last_post %} - {% include "partials/posted_by.html" with poster=node.last_post.poster username=node.last_post.username %} + {% include "partials/posted_by.html" with item=node.last_post %}  
{{ node.last_post.created }} @@ -136,7 +136,7 @@

{% trans "Forums" %}

{{ node.posts_count }}
{% if node.last_post %} - {% include "partials/posted_by.html" with poster=node.last_post.poster username=node.last_post.username %} + {% include "partials/posted_by.html" with item=node.last_post %}  
{{ node.last_post.created }} diff --git a/machina/templates/machina/forum_conversation/post_create.html b/machina/templates/machina/forum_conversation/post_create.html index 160e4cbb9..9fa71b387 100644 --- a/machina/templates/machina/forum_conversation/post_create.html +++ b/machina/templates/machina/forum_conversation/post_create.html @@ -46,7 +46,7 @@

{{ post.subject }}

{% spaceless %}   - {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} + {% include "partials/posted_by.html" with item=post show_creation_date=True%} {% endspaceless %}

@@ -56,7 +56,7 @@

{{ post.subject }}

diff --git a/machina/templates/machina/forum_conversation/topic_detail.html b/machina/templates/machina/forum_conversation/topic_detail.html index 95e3f92c9..b858e39d0 100644 --- a/machina/templates/machina/forum_conversation/topic_detail.html +++ b/machina/templates/machina/forum_conversation/topic_detail.html @@ -49,7 +49,7 @@

{% spaceless %}   - {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} + {% include "partials/posted_by.html" with item=post show_creation_date=True%} {% endspaceless %} {% endblock %} @@ -66,7 +66,7 @@

{% if post.updates_count %}
-  {% if post.updated_by %}{% trans "Last edited by:" %} {% include "partials/posted_by.html" with poster=post.updated_by no_trans=True%} {% else %}{% trans "Updated" %} {% endif %}{% trans "on" %} {{ post.updated }}, {% blocktrans count counter=post.updates_count %}edited {{counter }} time in total.{% plural %}edited {{counter }} times in total.{% endblocktrans %} +  {% if post.updated_by %}{% trans "Last edited by:" %} {% include "partials/posted_by.html" with item=post.updated_by show_by_prefix=True%} {% else %}{% trans "Updated" %} {% endif %}{% trans "on" %} {{ post.updated }}, {% blocktrans count counter=post.updates_count %}edited {{counter }} time in total.{% plural %}edited {{counter }} times in total.{% endblocktrans %} {% if post.update_reason %}
@@ -84,7 +84,7 @@

{% include "partials/avatar.html" with profile=post.poster.forum_profile show_placeholder=True %}

-
{% include "partials/posted_by.html" with poster=post.poster username_highlighted=True no_trans=True %}
+
{% include "partials/posted_by.html" with item=post highlight_username=True show_by_prefix=True %}
{% trans "Posts:" %} {{ post.poster.forum_profile.posts_count }}
{% else %}
{{ post.username }}
diff --git a/machina/templates/machina/forum_conversation/topic_list.html b/machina/templates/machina/forum_conversation/topic_list.html index 13f1993c9..57a750a38 100644 --- a/machina/templates/machina/forum_conversation/topic_list.html +++ b/machina/templates/machina/forum_conversation/topic_list.html @@ -29,7 +29,7 @@ {{ topic.subject }}{% if topic.is_locked %} {% endif %}
- {% include "partials/posted_by.html" with poster=topic.poster creation_date=topic.created username=topic.first_post.username %} + {% include "partials/posted_by.html" with item=topic is_topic=True show_creation_date=True %}
@@ -40,7 +40,7 @@
{{ topic.views_count }}
{% with last_post=topic.last_post %} - {% include "partials/posted_by.html" with poster=last_post.poster username=last_post.username %} + {% include "partials/posted_by.html" with item=last_post %}  
{{ last_post.created }} diff --git a/machina/templates/machina/forum_member/user_posts_list.html b/machina/templates/machina/forum_member/user_posts_list.html index 7ed9c69da..0731afe91 100644 --- a/machina/templates/machina/forum_member/user_posts_list.html +++ b/machina/templates/machina/forum_member/user_posts_list.html @@ -46,7 +46,7 @@

{% spaceless %}   - {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created %} + {% include "partials/posted_by.html" with item=post show_creation_date=True %} {% endspaceless %}

@@ -60,7 +60,7 @@

{% include "partials/avatar.html" with profile=post.poster placeholder=False %}

-
{% include "partials/posted_by.html" with poster=post.poster username_highlighted=True no_trans=True %}
+
{% include "partials/posted_by.html" with item=post highlight_username=True show_by_prefix=True %}
{% trans "Posts:" %} {{ post.poster.forum_profile.posts_count }}

diff --git a/machina/templates/machina/forum_moderation/moderation_queue/detail.html b/machina/templates/machina/forum_moderation/moderation_queue/detail.html index d5af3c6c6..33f5af5ba 100644 --- a/machina/templates/machina/forum_moderation/moderation_queue/detail.html +++ b/machina/templates/machina/forum_moderation/moderation_queue/detail.html @@ -81,7 +81,7 @@

{{ post.subject }}

{% spaceless %}   - {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} + {% include "partials/posted_by.html" with item=post show_creation_date=True%} {% endspaceless %}

@@ -104,7 +104,7 @@

{{ post.subject }}

{% endif %} -
{% include "partials/posted_by.html" with poster=post.poster username_highlighted=True no_trans=True %}
+
{% include "partials/posted_by.html" with item=post highlight_username=True show_by_prefix=True %}
{% trans "Posts:" %} {{ post.poster.forum_profile.posts_count }}
{% else %}
{{ post.username }}
@@ -131,7 +131,7 @@

{{ post.subject }}

{% spaceless %}   - {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} + {% include "partials/posted_by.html" with item=post show_creation_date=True%} {% endspaceless %}

@@ -140,7 +140,7 @@

{{ post.subject }}

{% include "forum_conversation/forum_attachments/attachments_detail.html" %}
{% endfor %} diff --git a/machina/templates/machina/forum_moderation/moderation_queue/list.html b/machina/templates/machina/forum_moderation/moderation_queue/list.html index 01e94a169..c27499a73 100644 --- a/machina/templates/machina/forum_moderation/moderation_queue/list.html +++ b/machina/templates/machina/forum_moderation/moderation_queue/list.html @@ -47,7 +47,7 @@

{% trans "Moderation queue" %}

{% block written_by %} - {% include "partials/posted_by.html" with poster=post.poster creation_date=post.created username=post.username %} + {% include "partials/posted_by.html" with item=post show_creation_date=True %} {% endblock %}
diff --git a/machina/templates/machina/forum_search/search.html b/machina/templates/machina/forum_search/search.html index 9afe2595a..317128fd9 100644 --- a/machina/templates/machina/forum_search/search.html +++ b/machina/templates/machina/forum_search/search.html @@ -78,16 +78,9 @@

{{ result.topic_subject }}
- {% if result.poster %} - {% url 'forum_member:profile' result.poster as poster_url %} - {% blocktrans trimmed with poster_url=poster_url username=result.poster_name creation_date=result.created %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with poster_username=result.poster_name creation_date=result.created %} - By: {{ poster_username }} on {{ creation_date }} - {% endblocktrans %} - {% endif %} + {% block written_by %} + {% include "partials/posted_by.html" with item=result show_creation_date=True is_search=True %} + {% endblock %}
diff --git a/machina/templates/machina/partials/posted_by.html b/machina/templates/machina/partials/posted_by.html index c91d6fb27..d6266ccb9 100644 --- a/machina/templates/machina/partials/posted_by.html +++ b/machina/templates/machina/partials/posted_by.html @@ -1,33 +1,59 @@ {% load forum_member_tags %} {% load i18n %} -{% if poster %} - {% url 'forum_member:profile' poster.id as profil_url %} - {% if no_trans %} - {% if username_highlighted %}{% endif %}{{ poster|forum_member_display_name }}{% if username_highlighted %}{% endif %} +{% if is_search %} + {% if item.poster %} + {% url 'forum_member:profile' item.poster as poster_url %} + {% blocktrans trimmed with username=item.poster_name creation_date=item.created %} + By: {{ username }} on {{ creation_date }} + {% endblocktrans %} {% else %} - {% if creation_date %} - {% blocktrans trimmed with username=poster|forum_member_display_name %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with username=poster|forum_member_display_name %} - By: {{ username }} - {% endblocktrans %} - {% endif %} - {% endif %} + {% blocktrans trimmed with poster_username=item.poster_name creation_date=item.created %} + By: {{ poster_username }} on {{ creation_date }} + {% endblocktrans %} + {% endif %} {% else %} - {% if no_trans %} - {% if username_highlighted %}{% endif %}{{ username }}{% if username_highlighted %}{% endif %} + {% if item.poster %} + {% url 'forum_member:profile' item.poster_id as profil_url %} + {% if show_by_prefix %} + {% if highlight_username %}{% endif %}{{ item.poster|forum_member_display_name }}{% if highlight_username %}{% endif %} + {% else %} + {% if show_creation_date %} + {% blocktrans trimmed with username=item.poster|forum_member_display_name creation_date=item.created %} + By: {{ username }} on {{ creation_date }} + {% endblocktrans %} + {% else %} + {% blocktrans trimmed with username=item.poster|forum_member_display_name %} + By: {{ username }} + {% endblocktrans %} + {% endif %} + {% endif %} {% else %} - {% if creation_date %} - {% blocktrans trimmed %} - By: {{ username }} on {{ creation_date }} - {% endblocktrans %} - {% else %} - {% blocktrans trimmed %} - By: {{ username }} - {% endblocktrans %} + {% if show_by_prefix %} + {% if highlight_username %}{% endif %}{{ username }}{% if highlight_username %}{% endif %} + {% else %} + {% if show_creation_date %} + {% if is_topic %} + {% blocktrans trimmed with username=topic.first_post.username creation_date=item.created %} + By: {{ username }} on {{ creation_date }} + {% endblocktrans %} + {% else %} + {% blocktrans trimmed with username=item.username creation_date=item.created %} + By: {{ username }} on {{ creation_date }} + {% endblocktrans %} + {% endif %} + {% else %} + {% if is_topic %} + {% blocktrans trimmed with username=topic.first_post.username %} + By: {{ username }} + {% endblocktrans %} + {% else %} + {% blocktrans trimmed with username=item.username %} + By: {{ username }} + {% endblocktrans %} + {% endif %} + {% endif %} {% endif %} {% endif %} {% endif %} +