diff options
author | ubq323 <ubq323> | 2021-06-15 23:40:03 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-06-15 23:40:03 +0000 |
commit | 8ec18ae1d985aee2bcf146c1e4f783b91643406a (patch) | |
tree | 2ce44f58bf2be3a2e5ff140f6b1dd9174cb69efe /apioforum/templates | |
parent | cdc3350992c11464c61782dd208d7671b56871ac (diff) | |
parent | 6096acce8b922af98e6846a687fcfd19cf0370cc (diff) |
merge tags into trunk
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/base.html | 2 | ||||
-rw-r--r-- | apioforum/templates/common.html | 4 | ||||
-rw-r--r-- | apioforum/templates/config_thread.html | 21 | ||||
-rw-r--r-- | apioforum/templates/view_forum.html | 26 | ||||
-rw-r--r-- | apioforum/templates/view_thread.html | 21 |
5 files changed, 63 insertions, 11 deletions
diff --git a/apioforum/templates/base.html b/apioforum/templates/base.html index 87b142f..5121b85 100644 --- a/apioforum/templates/base.html +++ b/apioforum/templates/base.html @@ -49,9 +49,11 @@ <div class="flashmsg">{{ msg }}</div> {% endfor %} + {% block nmcontent %} <main> {%block content %}{% endblock %} </main> + {% endblock %} <script>/* bees */</script> </body> </html> diff --git a/apioforum/templates/common.html b/apioforum/templates/common.html index 33aee0b..2e59b2c 100644 --- a/apioforum/templates/common.html +++ b/apioforum/templates/common.html @@ -26,3 +26,7 @@ {% macro ts(dt) -%} <time title="{{dt.isoformat(' ')}}" datetime="{{dt.isoformat(' ')}}">{{dt | fuzzy}}</time> {%- endmacro %} + +{% macro tag(the_tag) -%} +<span class="tag" style="color: {{the_tag.text_colour}}; background-color: {{the_tag.bg_colour}}">{{the_tag.name}}</span> +{%- endmacro %} diff --git a/apioforum/templates/config_thread.html b/apioforum/templates/config_thread.html index b0dd5f0..973fbf5 100644 --- a/apioforum/templates/config_thread.html +++ b/apioforum/templates/config_thread.html @@ -1,13 +1,30 @@ {% extends 'base.html' %} +{% from 'common.html' import tag %} {% block header %}<h1>{% block title %}configure thread '{{thread.title}}'{% endblock %}</h1>{% endblock %} {% block content %} <form method="post"> +<fieldset> +<legend>title</legend> <p>if you want to change the title of this thread, make sure you check the "change title?" box.</p> <label for="do_title">change title?</label> -<input type="checkbox" name="do_title"><br> +<input type="checkbox" id="do_title" name="do_title"><br> <label for="title">thread title</label> <input type="text" id="title" name="title" value="{{thread.title}}"> -<br> +</fieldset> +<fieldset> +<legend>tags</legend> +<p>if you want to change the tags on this thread, make sure you check the "change tags?" box.</p> +<label for="do_chtags">change tags?</label> +<input type="checkbox" name="do_chtags" id="do_chtags"><br> +<ul> + {% for the_tag in avail_tags %} + <li> + <input type="checkbox" id="tag_{{the_tag.id}}" name="tag_{{the_tag.id}}" {%- if the_tag.id in thread_tags %} checked{% endif %}> + <label for="tag_{{the_tag.id}}">#{{the_tag.id}} {{tag(the_tag)}}</label> + </li> + {% endfor %} +</ul> +</fieldset> <p>confirm changes?</p> <input type="submit" value="confirm"> <a href="{{url_for('thread.view_thread',thread_id=thread.id)}}">cancel</a> diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index dd3d7a8..3edb7f0 100644 --- a/apioforum/templates/view_forum.html +++ b/apioforum/templates/view_forum.html @@ -1,7 +1,8 @@ {% extends 'base.html' %} -{% from 'common.html' import ts %} +{% from 'common.html' import ts, tag %} {% block header %}<h1>{% block title %}apioforum{%endblock%}</h1>{%endblock%} -{%block content%} +{%block nmcontent%} +<main class="widemain"> <p>welcome to the apioforum</p> <p>forum rules: do not be a bad person. do not do bad things.</p> {% if g.user %} @@ -12,7 +13,10 @@ <div class="threadlistings"> <div class="threadlisting"> <div class="threadlisting-part threadlisting-part-title threadlisting-header"> - name + 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 @@ -32,7 +36,20 @@ </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></div> + <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">{{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> @@ -41,4 +58,5 @@ </div> {%endfor%} </div> +</main> {%endblock%} diff --git a/apioforum/templates/view_thread.html b/apioforum/templates/view_thread.html index eaaf581..abd6aaa 100644 --- a/apioforum/templates/view_thread.html +++ b/apioforum/templates/view_thread.html @@ -1,13 +1,24 @@ -{% from 'common.html' import disp_post %} +{% from 'common.html' import disp_post,tag %} {% extends 'base.html' %} {% block header %} <h1>{%block title %}{{thread.title}}{% endblock %}</h1> {% endblock %} {%block content%} -{% if g.user == thread.creator %} -<a class="actionbutton" href="{{url_for('thread.config_thread',thread_id=thread_id)}}">configure thread</a> -{% endif %} +<div class="thread-top-bar"> + <span class="thread-top-bar-a"> + {% if g.user == thread.creator %} + <a class="actionbutton" href="{{url_for('thread.config_thread',thread_id=thread.id)}}">configure thread</a> + {% endif %} + </span> + + <span class="thread-top-bar-b"> + {% for the_tag in tags %} + {{ tag(the_tag) }} + {% endfor %} + </span> +</div> + <div class="posts"> {% for post in posts %} {% call disp_post(post, True) %} @@ -16,7 +27,7 @@ {% endfor %} </div> {% if g.user %} -<form class="new-post" action="{{url_for('thread.create_post',thread_id=thread_id)}}" method="POST"> +<form class="new-post" action="{{url_for('thread.create_post',thread_id=thread.id)}}" method="POST"> <textarea class="new-post-box" placeholder="your post here..." name="content"></textarea> <input type="submit" value="yes"> </form> |