diff options
author | ubq323 <ubq323> | 2021-06-21 22:26:51 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-06-21 22:26:51 +0000 |
commit | 118140566e1a26bdbd0ea3ab127bf9ec6f5af46b (patch) | |
tree | 2653dfb82bcc27f0483f12662f4134958afb358b /apioforum/templates | |
parent | 1347f14e3125a36ec74663c88e5743fb68e002dd (diff) | |
parent | a3e72931780f4ecf9d59e537db4ff4c45f9924a7 (diff) |
merge the redesign
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/common.html | 6 | ||||
-rw-r--r-- | apioforum/templates/view_forum.html | 85 |
2 files changed, 42 insertions, 49 deletions
diff --git a/apioforum/templates/common.html b/apioforum/templates/common.html index 28598e7..9301a49 100644 --- a/apioforum/templates/common.html +++ b/apioforum/templates/common.html @@ -2,6 +2,10 @@ <a href="{{url_for('user.view_user',username=username)}}" class="username">{{username}}</a> {%- endmacro %} +{% macro post_url(post) -%} + {{url_for('thread.view_thread', thread_id=post.thread)}}#post_{{post.id}} +{%- endmacro %} + {% macro disp_post(post, buttons=False) %} <div class="post" id="post_{{post.id}}"> <div class="post-heading"> @@ -19,7 +23,7 @@ <a class="actionbutton" href="{{url_for('thread.delete_post',post_id=post.id)}}">delete</a> {% endif %} - <a class="post-anchor-link" href="{{url_for('thread.view_thread', thread_id=post.thread)}}#post_{{post.id}}">#{{post.id}}</a> + <a class="post-anchor-link" href="{{post_url(post)}}">#{{post.id}}</a> </span> </div> <div class="post-content"> diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index 59c594b..d1489c8 100644 --- a/apioforum/templates/view_forum.html +++ b/apioforum/templates/view_forum.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% from 'common.html' import ts, tag, disp_user %} +{% from 'common.html' import ts, tag, disp_user, post_url %} {% block header %}<h1>{% block title %}apioforum{%endblock%}</h1>{%endblock%} {%block nmcontent%} <main class="widemain"> @@ -10,53 +10,42 @@ {% else %} <p>please log in to create a new thread</p> {% endif %} -<div class="threadlistings"> -<div class="threadlisting"> - <div class="threadlisting-part threadlisting-part-title threadlisting-header"> - name<span class="only-small"> & tags</span> - </div> - <div class="threadlisting-part threadlisting-part-tags threadlisting-header only-big"> - tags - </div> - <div class="threadlisting-part threadlisting-part-creator threadlisting-header"> - creator - </div> - <div class="threadlisting-part threadlisting-part-created threadlisting-header"> - created - </div> - <div class="threadlisting-part threadlisting-part-updated threadlisting-header"> - last updated - </div> - <div class="threadlisting-part threadlisting-part-lastactivityby threadlisting-header"> - last post by - </div> - <div class="threadlisting-part threadlisting-part-numreplies threadlisting-header"> - posts - </div> -</div> -{%for thread in threads%} -<div class="threadlisting"> - <div class="threadlisting-part threadlisting-part-title"><a href="{{url_for('thread.view_thread',thread_id=thread.id)}}">{{thread.title}}</a> - {% if thread_tags[thread.id]|length > 0 %} - <span class="only-small"> - {% for the_tag in thread_tags[thread.id] %} - {{tag(the_tag)}} - {% endfor %} - </span> - {%endif%} - </div> - <div class="threadlisting-part threadlisting-part-tags only-big"> - {% for the_tag in thread_tags[thread.id] %} - {{tag(the_tag)}} - {% endfor %} - </div> - <div class="threadlisting-part threadlisting-part-creator">{{disp_user(thread.creator)}}</div> - <div class="threadlisting-part threadlisting-part-created">{{ts(thread.created)}}</div> - <div class="threadlisting-part threadlisting-part-updated">{{ts(thread.updated)}}</div> - <div class="threadlisting-part threadlisting-part-lastactivityby">{{disp_user(thread.last_user)}}</div> - <div class="threadlisting-part threadlisting-part-numreplies">{{thread.num_replies}}</div> -</div> -{%endfor%} +<div class="thread-list"> + {%for thread in threads%} + <div class="thread-listing"> + <div class="thread-listing-main"> + <div class="thread-listing-title"> + <a href="{{url_for('thread.view_thread',thread_id=thread.id)}}"> + {{- thread.title -}} + </a> + </div> + <div class="thread-listing-tags"> + {% for the_tag in thread_tags[thread.id] %} + {{tag(the_tag)}} + {% endfor %} + </div> + <div class="thread-listing-creation"> + <div class="thread-listing-creator"> + {{ disp_user(thread.creator) }} + </div> + {{ ts(thread.created) }} + </div> + </div> + {% if preview_post[thread.id] %} + <div class="thread-preview"> + {{ disp_user(preview_post[thread.id].author) }} + <span class="thread-preview-ts"> + {{ ts(preview_post[thread.id].created) }} + </span> + <span class="thread-preview-post"> + <a href="{{post_url(preview_post[thread.id])}}"> + {{ preview_post[thread.id].content[:500]|e }} + </a> + </span> + </div> + {% endif %} + </div> + {%endfor%} </div> </main> {%endblock%} |