Просмотр исходного кода

Compare entities in templates

Leaving current_user alone for now as messing with it might cause bugs
Alec Nikolas Reiter 7 лет назад
Родитель
Сommit
2624366b66
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      flaskbb/templates/forum/topic.html
  2. 1 1
      flaskbb/templates/forum/topic_horizontal.html

+ 1 - 1
flaskbb/templates/forum/topic.html

@@ -110,7 +110,7 @@
                             <!-- Edit Post -->
                             <!-- Edit Post -->
                             <a href="{{ url_for('forum.edit_post', post_id=post.id) }}" class="btn btn-icon icon-edit" data-toggle="tooltip" data-placement="top" title="Edit this post"></a>
                             <a href="{{ url_for('forum.edit_post', post_id=post.id) }}" class="btn btn-icon icon-edit" data-toggle="tooltip" data-placement="top" title="Edit this post"></a>
                             {% endif %}
                             {% endif %}
-                            {% if topic.first_post_id == post.id %}
+                            {% if topic.first_post == post %}
                                 {% if current_user|delete_topic(topic) %}
                                 {% if current_user|delete_topic(topic) %}
                                 <form class="inline-form" method="post" action="{{ url_for('forum.delete_topic', topic_id=topic.id, slug=topic.slug) }}">
                                 <form class="inline-form" method="post" action="{{ url_for('forum.delete_topic', topic_id=topic.id, slug=topic.slug) }}">
                                     <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                                     <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />

+ 1 - 1
flaskbb/templates/forum/topic_horizontal.html

@@ -111,7 +111,7 @@
                             <!-- Edit Post -->
                             <!-- Edit Post -->
                             <a href="{{ url_for('forum.edit_post', post_id=post.id) }}" class="btn btn-icon icon-edit" data-toggle="tooltip" data-placement="top" title="Edit this post"></a>
                             <a href="{{ url_for('forum.edit_post', post_id=post.id) }}" class="btn btn-icon icon-edit" data-toggle="tooltip" data-placement="top" title="Edit this post"></a>
                             {% endif %}
                             {% endif %}
-                            {% if topic.first_post_id == post.id %}
+                            {% if topic.first_post == post %}
                                 {% if current_user|delete_topic(topic) %}
                                 {% if current_user|delete_topic(topic) %}
                                 <form class="inline-form" method="post" action="{{ url_for('forum.delete_topic', topic_id=topic.id, slug=topic.slug) }}">
                                 <form class="inline-form" method="post" action="{{ url_for('forum.delete_topic', topic_id=topic.id, slug=topic.slug) }}">
                                     <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                                     <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />