Browse Source

make more idiomatic

micha 6 years ago
parent
commit
0d2c066413
2 changed files with 10 additions and 9 deletions
  1. 1 3
      flaskbb/templates/user/all_posts.html
  2. 9 6
      flaskbb/templates/user/all_topics.html

+ 1 - 3
flaskbb/templates/user/all_posts.html

@@ -16,9 +16,7 @@
     {% for post in posts.items %}
     <div class="panel page-panel">
         <div class="panel-heading page-head topic-head">
-            {# no attribute access in translated strings #}
-            {% set topic_title = post.topic.title %}
-            <a href="{{ post.url }}">{% trans %}In topic <strong>{{ topic_title }}</strong>{% endtrans %}</a>
+            <a href="{{ post.url }}">{% trans topic_title=post.topic.title %}In topic <strong>{{ topic_title }}</strong>{% endtrans %}</a>
         </div>
         <div class="panel-body page-body topic-content">
             <div class="col-md-12 col-sm-12 col-xs-12">

+ 9 - 6
flaskbb/templates/user/all_topics.html

@@ -16,12 +16,15 @@
     {% for topic in topics.items %}
     <div class="panel page-panel">
         <div class="panel-heading page-head topic-head">
-            {# no attribute access in translated strings #}
-            {% set topic_url = topic.url %}
-            {% set topic_title = topic.title %}
-            {% set forum_url = topic.forum.url %}
-            {% set forum_title = topic.forum.title %}
-            {% trans %}<strong><a href="{{ topic_url }}">{{ topic_title }}</a></strong> in forum <a href="{{ forum_url }}">{{ forum_title }}</a>{% endtrans %}
+            {% trans trimmed
+                topic_url=topic.url,
+                topic_title=topic.title,
+                forum_url=topic.forum.url,
+                forum_title=topic.forum.title
+            %}
+                <strong><a href="{{ topic_url }}">{{ topic_title }}</a></strong>
+                in forum <a href="{{ forum_url }}">{{ forum_title }}</a>
+            {% endtrans %}
         </div>
         <div class="panel-body page-body topic-content">
             <div class="col-md-12 col-sm-12 col-xs-12">