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

Do not show "PM" link on posts by the current_user, as you can't PM yourself anyhow

Casper Van Gheluwe 10 лет назад
Родитель
Сommit
1a36bd8c6c
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      flaskbb/templates/forum/topic.html

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

@@ -145,8 +145,8 @@
         <tr>
             <td>
                 <span class="pull-left">
-                    {% if current_user.is_authenticated() and post.user_id %}
-                    <a href="{{ url_for('user.new_message') }}?to_user={{ post.user.username }}">PM</a>
+                    {% if current_user.is_authenticated() and post.user_id and post.user_id != current_user.id %}
+                    <a href="{{ url_for('user.new_message', to_user=post.user.username) }}">PM</a>
                     {% endif %}
                     {% if post.user.website %}
                     {% if current_user.is_authenticated() %}| {% endif %}<a href="{{post.user.website}}">Website</a>