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

+ 1 - 2
static/cranefly/css/cranefly.css

@@ -902,8 +902,7 @@ a.btn-link:hover,a.btn-link:active,a.btn-link:focus{color:#333;text-decoration:n
 .forum-map-category.forum-map-category-important .header{background-color:#cf402e;border:1px solid #a53325}.forum-map-category.forum-map-category-important .header h2{color:#fff;text-shadow:0 1px 0 #672017}.forum-map-category.forum-map-category-important .header h2 small{color:#280c09;text-shadow:none}
 .forum-map-category.forum-map-category-inverse .header{background-color:#333;border:1px solid #1a1a1a}.forum-map-category.forum-map-category-inverse .header h2{color:#eee;text-shadow:0 1px 0 #000}.forum-map-category.forum-map-category-inverse .header h2 small{color:#b3b3b3;text-shadow:none}
 .forum-map-category.forum-map-category-info .header{background-color:#3c85a3;border:1px solid #2e677e}.forum-map-category.forum-map-category-info .header h2{color:#fff;text-shadow:0 1px 0 #1a3946}.forum-map-category.forum-map-category-info .header h2 small{color:#1a3946;text-shadow:none}
-.watched-threads .thread-last-reply{border-left:none !important;padding-left:0 !important}
-.watched-threads .thread-options{float:right;overflow:auto;position:relative;top:8px}.watched-threads .thread-options form{display:inline-block;float:left;margin:0;padding:0;overflow:auto}.watched-threads .thread-options form .btn{float:right;padding:3px 5px;padding-bottom:0;margin-left:16px}
+.watched-threads .thread-actions{float:right;overflow:auto;padding:0 14px;position:relative;top:8px}.watched-threads .thread-actions form{display:inline-block;float:left;margin:0;padding:0;overflow:auto}.watched-threads .thread-actions form .btn{float:right;padding:4px 10px;margin-left:16px;text-align:center}.watched-threads .thread-actions form .btn i{margin-right:6px;font-size:17.5px;text-align:center}
 .user-alerts td{vertical-align:middle}.user-alerts td.alert-icon{color:#d5d5d5;font-size:17.5px}.user-alerts td.alert-icon.alert-new{color:#cf402e}
 .user-alerts td.alert-message{color:#555;font-size:16.8px}.user-alerts td.alert-message a:link,.user-alerts td.alert-message a:visited{color:#333;font-weight:bold}
 .user-alerts td.alert-date{color:#999;text-align:right}

+ 12 - 8
static/cranefly/css/cranefly/watchedthreads.less

@@ -2,14 +2,10 @@
 // -------------------------
 
 .watched-threads {
-  .thread-last-reply {
-    border-left: none !important;
-    padding-left: 0px !important;
-  }
-
-  .thread-options {
+  .thread-actions {
     float: right;
     overflow: auto;
+    padding: 0px @baseFontSize;
     position: relative;
     top: 8px;
 
@@ -22,9 +18,17 @@
 
       .btn {
         float: right;
-        padding: 3px 5px;
-        padding-bottom: 0px;
+        padding: 4px 10px;
         margin-left: @baseFontSize + 2px;
+
+        text-align: center;
+
+        i {
+        	margin-right: 6px;
+
+        	font-size: @fontSizeLarge;
+        	text-align: center;
+        }
       }
     }
   }

+ 18 - 6
templates/cranefly/threads/list.html

@@ -117,19 +117,31 @@
       {% for thread in threads %}
       <li{% if not thread.is_read %} class="thread-new"{% endif %}>
         <div class="thread-icon">
+          {% if thread.weight == 2 %}
           {% if thread.is_read %}
-          <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Click to see last post{% endtrans %}">
+          <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Announcement, click to see last post{% endtrans %}">
           {% else %}
-          <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Click to see first unread post{% endtrans %}">
+          <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Announcement, click to see first unread post{% endtrans %}">
           {% endif %}
-            {% if thread.weight == 2%}
             <i class="icon-star{% if thread.is_read %}-empty{% endif %}"></i>
-            {% elif thread.weight == 1 %}
+          </a>
+          {% elif thread.weight == 1 %}
+          {% if thread.is_read %}
+          <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Pinned, click to see last post{% endtrans %}">
+          {% else %}
+          <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Pinned, click to see first unread post{% endtrans %}">
+          {% endif %}
             <i class="icon-bookmark{% if thread.is_read %}-empty{% endif %}"></i>
-            {% else %}
+          </a>
+          {% else %}
+          {% if thread.is_read %}
+          <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Click to see last post{% endtrans %}">
+          {% else %}
+          <a href="{{ url('thread_new', thread=thread.pk, slug=thread.slug) }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Click to see first unread post{% endtrans %}">
+          {% endif %}
             <i class="icon-circle{% if thread.is_read %}-blank{% endif %}"></i>
-            {% endif %}
           </a>
+          {% endif %}
         </div>
         {% if user.is_authenticated() and list_form %}
         <div class="thread-select">

+ 50 - 101
templates/cranefly/watched.html

@@ -25,110 +25,71 @@
 
   {% if threads %}
   {{ pager() }}
-  <div class="forum-threads-list watched-threads">
-    <div class="header">
-      <div class="row-fluid">
-        <div class="span7">{% trans %}Thread{% endtrans %}</div>
-        <div class="span5 thread-activity">
-          <div class="thread-replies">{% trans %}Activity{% endtrans %}</div>
-        </div>
-      </div>
-    </div>
-    {% for thread in threads %}
-    <div id="watch-{{ loop.index }}" class="thread-row{% if not thread.is_read %} thread-new{% endif %}{% if loop.last %} thread-last{% endif %}">
-      <div class="row-fluid">
-        <div class="span7">
+  <div class="forum-threads-list-new watched-threads">
+    <ul>
+      {% for thread in threads %}
+      <li id="watch-{{ loop.index }}"{% if not thread.is_read %} class="thread-new"{% endif %}>
+        <div class="thread-icon">
+          {% if thread.weight == 2 %}
           {% if thread.is_read %}
-          <a href="{{ thread_url(thread, 'new') }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Click to see last post{% endtrans %}"><i class="icon-circle-blank"></i></a>
+          <a href="{{ thread_url(thread, 'new') }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Announcement, click to see last post{% endtrans %}">
           {% else %}
-          <a href="{{ thread_url(thread, 'new') }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Click to see first unread post{% endtrans %}"><i class="icon-circle"></i></a>
+          <a href="{{ thread_url(thread, 'new') }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Announcement, click to see first unread post{% endtrans %}">
           {% endif %}
-
-          {{ macros.thread_flags(thread) }}
-
-          <a href="{{ thread_url(thread) }}" class="thread-name">{{ thread.name }}</a>
-
-          <div class="thread-details">
-            {% trans user=thread_starter(thread), forum=thread_forum(thread), start=thread.start|reltimesince|low %}by {{ user }} in {{ forum }} {{ start }}{% endtrans %}
-          </div>
-
-        </div>
-        <div class="span5 thread-activity">
-          {% if settings.avatars_on_threads_list %}
-          <div class="thread-last-avatar">
-            {% if thread.last_poster_id %}
-            <a href="{{ url('user', user=thread.last_poster.pk, username=thread.last_poster.username_slug) }}"><img src="{{ thread.last_poster.get_avatar(40) }}" alt=""></a>
-            {% else %}
-            <img src="{{ macros.avatar_guest(40) }}" alt="" class="user-avatar">
-            {% endif %}
-          </div>
+            <i class="icon-star{% if thread.is_read %}-empty{% endif %}"></i>
+          </a>
+          {% elif thread.weight == 1 %}
+          {% if thread.is_read %}
+          <a href="{{ thread_url(thread, 'new') }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Pinned, click to see last post{% endtrans %}">
+          {% else %}
+          <a href="{{ thread_url(thread, 'new') }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Pinned, click to see first unread post{% endtrans %}">
           {% endif %}
-
-          <div class="thread-replies">
-            <strong class="lead">{{ thread_reply(thread) }}, {{ thread.last|reldate|low }}</strong><br>
-            {{ replies(thread.replies) }}, <span{% if (thread.upvotes-thread.downvotes) > 0 %} class="text-success"{% elif (thread.upvotes-thread.downvotes) < 0 %} class="text-error"{% endif %}><strong>{% if (thread.upvotes-thread.downvotes) > 0 %}+{% elif (thread.upvotes-thread.downvotes) < 0 %}-{% endif %}</strong>{% trans rating=(thread.upvotes-thread.downvotes)|abs|intcomma %}{{ rating }} thread rating{% endtrans %}</span>
-          </div>
-
-          <div class="thread-options">
+            <i class="icon-bookmark{% if thread.is_read %}-empty{% endif %}"></i>
+          </a>
+          {% else %}
+          {% if thread.is_read %}
+          <a href="{{ thread_url(thread, 'new') }}" class="thread-icon thread-icon-last tooltip-top" title="{% trans %}Click to see last post{% endtrans %}">
+          {% else %}
+          <a href="{{ thread_url(thread, 'new') }}" class="thread-icon thread-icon-new tooltip-top" title="{% trans %}Click to see first unread post{% endtrans %}">
+          {% endif %}
+            <i class="icon-circle{% if thread.is_read %}-blank{% endif %}"></i>
+          </a>
+          {% endif %}
+        </div>
+        <div class="thread-body">
+          <div class="thread-actions">
             <form action="{% if thread.send_email %}{{ thread_url(thread, 'unwatch_email') }}{% else %}{{ thread_url(thread, 'watch_email') }}{% endif %}" method="post">
               <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
               <input type="hidden" name="retreat" value="{{ request_path }}#watch-{{ loop.index }}">
-              <button type="submit" class="btn btn-{% if thread.send_email %}success{% else %}inverse{% endif %} tooltip-top" title="{% if thread.send_email %}{% trans %}Don't notify with e-mail{% endtrans %}{% else %}{% trans %}Notify with e-mail{% endtrans %}{% endif %}"><i class="icon-envelope"></i></button>
+              <button type="submit" class="btn{% if thread.send_email %} btn-success{% endif %} tooltip-top" title="{% if thread.send_email %}{% trans %}Click to don't notify with e-mail{% endtrans %}{% else %}{% trans %}Click to notify with e-mail{% endtrans %}{% endif %}"><i class="icon-envelope-alt"></i> {% if thread.send_email %}{% trans %}Notify{% endtrans %}{% else %}{% trans %}Notify{% endtrans %}{% endif %}</button>
             </form>
 
             <form action="{{ thread_url(thread, 'unwatch') }}" method="post">
               <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
               <input type="hidden" name="retreat" value="{{ delete_retreat(loop) }}">
-              <button type="submit" class="btn btn-danger tooltip-top" title="{% trans %}Unwatch{% endtrans %}"><i class="icon-remove"></i></button>
+              <button type="submit" class="btn btn-danger tooltip-top" title="{% trans %}Click to remove from list{% endtrans %}"><i class="icon-remove"></i> {% trans %}Unwatch{% endtrans %}</button>
             </form>
           </div>
+          <div class="thread-title">
+            <a href="{{ thread_url(thread) }}">{{ thread.name }}</a>
+          </div>
+          <ul class="thread-details">
+            <li><a href="{{ thread.forum.url }}" class="forum-link">{{ thread.forum }}</a></li>
+            <li>{% trans user=thread_starter(thread), start=thread.start|reldate|low %}Started by {{ user }}, {{ start }}{% endtrans %}</li>
+            {% if thread.replies %}
+            <li><i class="icon-comments-alt"></i> {% trans count=thread.replies, replies=thread.replies|intcomma, user=thread_reply(thread), last=thread.last|reldate|low -%}
+              {{ replies }} reply, by {{ user }} {{ last }}
+              {%- pluralize -%}
+              {{ replies }} replies, last by {{ user }} {{ last }}
+              {%- endtrans %}</li>
+            {% else %}
+            <li><i class="icon-comments-alt"></i> {% trans %}No replies{% endtrans %}</li>
+            {% endif %}
+          </ul>
         </div>
-      </div>
-    </div>
-    {% endfor %}
-    {#<table class="table">
-      <thead>
-        <tr>
-          <th>{% trans %}Thread{% endtrans %}</th>
-          <th colspan="2" class="span5">{% trans %}Activity{% endtrans %}</th>
-        </tr>
-      </thead>
-      <tbody>
-        {% for thread in threads %}
-        <tr id="watch-{{ loop.index }}">
-          <td>
-            <a href="{{ thread_url(thread, 'new') }}" class="thread-icon{% if not thread.is_read %} thread-new{% endif %} tooltip-top" title="{% if not thread.is_read -%}
-            {% trans %}Click to see first unread post{% endtrans %}
-            {%- else -%}
-            {% trans %}Click to see last post{% endtrans %}
-            {%- endif %}"><i class="icon-comment"></i></a>
-            <a href="{{ thread_url(thread) }}" class="thread-name">{{ thread.name }}</a>
-            <span class="thread-details">
-              {% trans user=thread_starter(thread), forum=thread_forum(thread), start=thread.start|reltimesince|low %}by {{ user }} in {{ forum }} {{ start }}{% endtrans %}
-            </span>
-          </td>
-          <td>
-            <div class="thread-last-reply">
-              {{ replies(thread.replies) }} - {% trans user=thread_reply(thread), last=thread.last|reltimesince|low %}last by {{ user }} {{ last }}{% endtrans %}
-            </div>
-          </td>
-          <td class="watched-thread-flags">
-            <form action="{{ thread_url(thread, 'unwatch') }}" method="post">
-              <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
-              <input type="hidden" name="retreat" value="{{ delete_retreat(loop) }}">
-              <button type="submit" class="btn btn-danger tooltip-top" title="{% trans %}Unwatch{% endtrans %}"><i class="icon-remove"></i></button>
-            </form>
-
-            <form action="{% if thread.send_email %}{{ thread_url(thread, 'unwatch_email') }}{% else %}{{ thread_url(thread, 'watch_email') }}{% endif %}" method="post">
-              <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
-              <input type="hidden" name="retreat" value="{{ request_path }}#watch-{{ loop.index }}">
-              <button type="submit" class="btn btn-{% if thread.send_email %}success{% else %}inverse{% endif %} tooltip-top" title="{% if thread.send_email %}{% trans %}Don't notify with e-mail{% endtrans %}{% else %}{% trans %}Notify with e-mail{% endtrans %}{% endif %}"><i class="icon-envelope"></i></button>
-            </form>
-          </td>
-        </tr>
-        {% endfor %}
-      </tbody>
-    </table>#}
+      </li>
+      {% endfor %}
+    </ul>
   </div>
   {{ pager() }}
   {% else %}
@@ -153,22 +114,10 @@
 {%- endif -%}
 {%- endmacro %}
 
-{% macro replies(thread_replies) -%}
-{% trans count=thread_replies, replies=('<strong>' ~ (thread_replies|intcomma) ~ '</strong>')|safe -%}
-{{ replies }} reply
-{%- pluralize -%}
-{{ replies }} replies
-{%- endtrans %}
-{%- endmacro %}
-
 {% macro thread_starter(thread) -%}
 {% if thread.start_poster_id %}<a href="{{ url('user', user=thread.start_poster_id, username=thread.start_poster_slug) }}" class="user-link">{{ thread.start_poster_name }}</a>{% else %}{{ thread.start_poster_name }}{% endif %}
 {%- endmacro %}
 
-{% macro thread_forum(thread) -%}
-<a href="{{ thread.forum.url }}" class="forum-link">{{ thread.forum }}</a>
-{%- endmacro %}
-
 {% macro thread_reply(thread) -%}
 {% if thread.last_poster_id %}<a href="{{ url('user', user=thread.last_poster_id, username=thread.last_poster_slug) }}" class="user-link">{{ thread.last_poster_name }}</a>{% else %}{{ thread.last_poster_name }}{% endif %}
 {%- endmacro %}