]> git.lizzy.rs Git - cheatdb.git/commitdiff
Improve thread list design further
authorrubenwardy <rw@rubenwardy.com>
Fri, 10 Jul 2020 19:06:26 +0000 (20:06 +0100)
committerrubenwardy <rw@rubenwardy.com>
Fri, 10 Jul 2020 19:10:51 +0000 (20:10 +0100)
app/templates/macros/threads.html

index 50be4fde8435ec2ebf50587dd0677296d38332b1..eeb28ccba518f494b27e03301362aef99205a783 100644 (file)
        {% for t in threads %}
                <a class="list-group-item list-group-item-action"
                                href="{{ url_for('threads.view', id=t.id) }}">
-                       {% if not compact %}
-                               <span class="text-muted float-right">
-                                       {{ t.created_at | datetime }}
-                               </span>
+                       {% if compact %}
+                               {% if t.private %}&#x1f512; {% endif %}
+                               <strong>{{ t.title }}</strong>
+                               by {{ t.author.display_name }}
+                       {% else %}
+                               <div class="row">
+                                       <div class="col-sm">
+                                               <span class="mr-3">
+                                                       {% if not t.review %}
+                                                               <i class="fas fa-comment-alt" style="color:#666;"></i>
+                                                       {% elif t.review.recommends %}
+                                                               <i class="fas fa-thumbs-up" style="color:#6f6;"></i>
+                                                       {% else %}
+                                                               <i class="fas fa-thumbs-down" style="color:#f66;"></i>
+                                                       {% endif %}
+                                               </span>
 
-                               <span class="mr-2">
-                                       {% if not t.review %}
-                                               <i class="fas fa-comment-alt" style="color:#666;"></i>
-                                       {% elif t.review.recommends %}
-                                               <i class="fas fa-thumbs-up" style="color:#6f6;"></i>
-                                       {% else %}
-                                               <i class="fas fa-thumbs-down" style="color:#f66;"></i>
-                                       {% endif %}
-                               </span>
-                       {% endif %}
+                                               {% if t.private %}&#x1f512; {% endif %}
+                                               <strong>{{ t.title }}</strong>
+                                               by {{ t.author.display_name }}
+                                       </div>
+
+                                       <div class="col-sm">
+                                               {% if t.package %}
+                                                       {{ _("%(title)s by %(author)s",
+                                                                       title="<b>" | safe + t.package.title + "</b>" | safe,
+                                                                       author=t.package.author.display_name) }}
+                                               {% endif %}
+                                       </div>
 
-                       {% if t.private %}&#x1f512; {% endif %}
-                       <strong>{{ t.title }}</strong>
-                       by {{ t.author.display_name }}
+                                       <div class="col-sm text-muted text-right">
+                                               {{ t.created_at | datetime }}
+                                       </div>
+                               </div>
+                       {% endif %}
                </a>
        {% else %}
                <p>{% if list_group %}class="list-group-item"{% endif %}><i>No threads found</i></p>