diff options
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/base.html | 3 | ||||
-rw-r--r-- | apioforum/templates/common.html | 2 | ||||
-rw-r--r-- | apioforum/templates/config_thread.html | 26 | ||||
-rw-r--r-- | apioforum/templates/delete_post.html | 4 | ||||
-rw-r--r-- | apioforum/templates/search_results.html | 4 | ||||
-rw-r--r-- | apioforum/templates/user_settings.html | 6 | ||||
-rw-r--r-- | apioforum/templates/view_thread.html | 4 | ||||
-rw-r--r-- | apioforum/templates/view_user.html | 6 |
8 files changed, 20 insertions, 35 deletions
diff --git a/apioforum/templates/base.html b/apioforum/templates/base.html index 573c9ce..637cc09 100644 --- a/apioforum/templates/base.html +++ b/apioforum/templates/base.html @@ -1,4 +1,5 @@ {# BASED? BASED ON WHAT? #} +{% from 'common.html' import disp_user with context %} <!DOCTYPE html> <html> <head> @@ -20,7 +21,7 @@ <p><a href="{{url_for('index')}}">home</a></p> {% if g.user %} - <p><a class="username" href="{{url_for('user.view_user', username=g.user)}}">{{g.user}}</a></p> + <p>{{ disp_user(g.user) }}</p> {% if is_admin %} <p><a href="{{url_for('admin.admin_page')}}">admin</a></p> diff --git a/apioforum/templates/common.html b/apioforum/templates/common.html index 3db9974..28598e7 100644 --- a/apioforum/templates/common.html +++ b/apioforum/templates/common.html @@ -23,7 +23,7 @@ </span> </div> <div class="post-content"> - {{ caller() }} + {{ post.content|md|safe }} </div> </div> {% endmacro %} diff --git a/apioforum/templates/config_thread.html b/apioforum/templates/config_thread.html index 973fbf5..b26a73d 100644 --- a/apioforum/templates/config_thread.html +++ b/apioforum/templates/config_thread.html @@ -5,25 +5,23 @@ <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" id="do_title" name="do_title"><br> <label for="title">thread title</label> <input type="text" id="title" name="title" value="{{thread.title}}"> </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> +{% if avail_tags %} + <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> +{% else %} + <p>there are no available tags.</p> +{% endif %} </fieldset> <p>confirm changes?</p> <input type="submit" value="confirm"> diff --git a/apioforum/templates/delete_post.html b/apioforum/templates/delete_post.html index 6f99704..2f16598 100644 --- a/apioforum/templates/delete_post.html +++ b/apioforum/templates/delete_post.html @@ -5,9 +5,7 @@ {% endblock %} {% block content %} -{% call disp_post(post, False) %} -{{ rendered_content | safe }} -{% endcall %} +{{ disp_post(post, False) }} <form method="post"> <p>confirm delete?</p> diff --git a/apioforum/templates/search_results.html b/apioforum/templates/search_results.html index 4d0be2f..fe016ab 100644 --- a/apioforum/templates/search_results.html +++ b/apioforum/templates/search_results.html @@ -16,9 +16,7 @@ </a></h3> <div class="posts"> {% endif %} - {% call disp_post(result, False) %} - {{ rendered_posts[loop.index0] | safe}} - {% endcall %} + {{ disp_post(result, False) }} {% endfor %} {% if results|length > 0 %} diff --git a/apioforum/templates/user_settings.html b/apioforum/templates/user_settings.html index ad93036..cac613a 100644 --- a/apioforum/templates/user_settings.html +++ b/apioforum/templates/user_settings.html @@ -4,9 +4,6 @@ <form method="post"> <fieldset> <legend>change password</legend> -<p>if you want to change your password, make sure you check the "change password?" box.</p> -<label for="do_chpass">change password?</label> -<input type="checkbox" id="do_chpass" name="do_chpass"><br> <label for="password">current password</label> <input type="text" id="password" name="password"><br> <label for="new_password">new password</label> @@ -14,9 +11,6 @@ </fieldset> <fieldset> <legend>change bio</legend> -<p>if you want to change your bio, make sure you check the "change bio?" box.</p> -<label for="do_chbio">change bio?</label> -<input type="checkbox" name="do_chbio" id="do_chbio"><br> <textarea class="new-post-box" name="bio" maxlength="4000"> {{- user.bio or "hail GEORGE" -}} </textarea> diff --git a/apioforum/templates/view_thread.html b/apioforum/templates/view_thread.html index abd6aaa..fb62880 100644 --- a/apioforum/templates/view_thread.html +++ b/apioforum/templates/view_thread.html @@ -21,9 +21,7 @@ <div class="posts"> {% for post in posts %} - {% call disp_post(post, True) %} - {{ rendered_posts[loop.index0] | safe}} - {% endcall %} + {{ disp_post(post, True) }} {% endfor %} </div> {% if g.user %} diff --git a/apioforum/templates/view_user.html b/apioforum/templates/view_user.html index f773978..612c2c0 100644 --- a/apioforum/templates/view_user.html +++ b/apioforum/templates/view_user.html @@ -12,7 +12,7 @@ </div> <div class="user_info"> <div class="user_bio_quote"> - <div class="user_bio">{{rendered_bio|safe}}</div> + <div class="user_bio">{{(user.bio or "hail GEORGE")|md|safe}}</div> <p class="user_bio_attribution">— {{user.username|e}}</p> </div> <dl> @@ -28,9 +28,7 @@ <h2>recent posts</h2> <div class="user_posts"> {% for post in posts %} - {% call disp_post(post, False) %} - {{ rendered_posts[loop.index0] | safe}} - {% endcall %} + {{ disp_post(post, False) }} {% endfor %} </div> {% endif %} |