diff options
| author | rubenwardy <rw@rubenwardy.com> | 2020-07-10 19:46:14 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2020-07-10 19:46:14 +0100 |
| commit | d91f537bdd4915448a189b238051905975324d71 (patch) | |
| tree | 85c02f40c2d61f154b14aa816c4a85514cbe677d /app/templates/macros/threads.html | |
| parent | 436a4cce2b819740d10721e320c3c80f07c0c27b (diff) | |
| download | cheatdb-d91f537bdd4915448a189b238051905975324d71.tar.xz | |
Improve thread list style
Diffstat (limited to 'app/templates/macros/threads.html')
| -rw-r--r-- | app/templates/macros/threads.html | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/app/templates/macros/threads.html b/app/templates/macros/threads.html index 16b67a0..50be4fd 100644 --- a/app/templates/macros/threads.html +++ b/app/templates/macros/threads.html @@ -60,24 +60,31 @@ {% endif %} {% endmacro %} -{% macro render_threadlist(threads, list_group=False) -%} - {% if not list_group %}<ul>{% endif %} - {% for t in threads %} - <li {% if list_group %}class="list-group-item"{% endif %}> - {% if list_group %} - <a href="{{ url_for('threads.view', id=t.id) }}"> - {% if t.private %}🔒 {% endif %} - {{ t.title }} - by {{ t.author.display_name }} - </a> - {% else %} - {% if t.private %}🔒 {% endif %} - <a href="{{ url_for('threads.view', id=t.id) }}">{{ t.title }}</a> - by {{ t.author.display_name }} - {% endif %} - </li> - {% else %} - <li {% if list_group %}class="list-group-item"{% endif %}><i>No threads found</i></li> - {% endfor %} - {% if not list_group %}</ul>{% endif %} +{% macro render_threadlist(threads, compact=False) -%} + {% 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> + + <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 %}🔒 {% endif %} + <strong>{{ t.title }}</strong> + by {{ t.author.display_name }} + </a> + {% else %} + <p>{% if list_group %}class="list-group-item"{% endif %}><i>No threads found</i></p> + {% endfor %} {% endmacro %} |
