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

Improved reply counters on threads list.

Rafał Pitoń 10 лет назад
Родитель
Сommit
ecfad015fd

+ 8 - 0
misago/static/misago/css/misago/threadslists.less

@@ -100,6 +100,14 @@
                 font-size: @font-size-base;
               }
             }
+
+            &.new-replies {
+              color: @brand-primary;
+            }
+
+            &.new-thread {
+              color: @brand-success;
+            }
           }
 
           .thread-author {

+ 16 - 0
misago/templates/misago/threads/base.html

@@ -54,12 +54,28 @@
               </span>
               {% endif %}
 
+              {% if thread.is_read %}
               <div class="thread-replies">
                 <div class="tooltip-top" title="{% blocktrans trimmed with replies=thread.replies|intcomma count counter=thread.replies %}{{ replies }} reply{% plural %}{{ replies }} replies{% endblocktrans %}">
                   <span class="glyphicon glyphicon-comment"></span>
                   {{ thread.replies|intcomma }}
                 </div>
               </div>
+              {% elif thread.replies and thread.unread_replies %}
+              <div class="thread-replies new-replies">
+                <div class="tooltip-top" title="{% blocktrans trimmed with replies=thread.unread_replies|intcomma count counter=thread.unread_replies %}{{ replies }} new reply{% plural %}{{ replies }} new replies{% endblocktrans %}">
+                  <span class="glyphicon glyphicon-plus"></span>
+                  {{ thread.unread_replies|intcomma }}
+                </div>
+              </div>
+              {% else %}
+              <div class="thread-replies new-thread">
+                <div class="tooltip-top" title="{% blocktrans trimmed with replies=thread.replies|intcomma count counter=thread.replies %}New thread with {{ replies }} reply{% plural %}New thread with {{ replies }} replies{% endblocktrans %}">
+                  <span class="glyphicon glyphicon-leaf"></span>
+                  {{ thread.replies|intcomma }}
+                </div>
+              </div>
+              {% endif %}
 
               <ul class="list-unstyled thread-flags">
                 {% if thread.label %}