diff options
author | ubq323 <ubq323> | 2021-06-19 09:05:05 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-06-19 09:05:05 +0000 |
commit | b887340ebc120923178ff20cc79f43d7bc19f62a (patch) | |
tree | 416a5f714035725e81828d8f10f1468274c09bfb /apioforum/templates | |
parent | c6491d055447cba9efc6a45df172e932ca6e9e80 (diff) | |
parent | e7f520b6865482cab89b55f70f8c41bec6ca30b3 (diff) |
mergy merge
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/base.html | 10 | ||||
-rw-r--r-- | apioforum/templates/common.html | 7 | ||||
-rw-r--r-- | apioforum/templates/user_settings.html | 28 | ||||
-rw-r--r-- | apioforum/templates/view_forum.html | 6 | ||||
-rw-r--r-- | apioforum/templates/view_user.html | 37 |
5 files changed, 80 insertions, 8 deletions
diff --git a/apioforum/templates/base.html b/apioforum/templates/base.html index bf3748f..3eb112e 100644 --- a/apioforum/templates/base.html +++ b/apioforum/templates/base.html @@ -19,25 +19,25 @@ <p><a href="{{url_for('index')}}">home</a></p> {% if g.user %} - <p>{{ g.user }}</p> + <p><a href="{{url_for('user.view_user', username=g.user)}}">{{g.user}}</a></p> {% if is_admin %} <p><a href="{{url_for('admin.admin_page')}}">admin</a></p> {% endif %} <p> - <a href="{{ url_for('auth.logout',next=path_for_next) }}"> + <a href="{{url_for('auth.logout',next=path_for_next)}}"> logout </a> </p> {% else %} <p> - <a href="{{ url_for('auth.login',next=path_for_next) }}"> + <a href="{{url_for('auth.login',next=path_for_next)}}"> login </a> </p> <p> - <a href="{{ url_for('auth.register',next=path_for_next) }}"> + <a href="{{url_for('auth.register',next=path_for_next)}}"> register </a> </p> @@ -60,6 +60,8 @@ </main> {% endblock %} <script>/* bees */</script> + <!-- citrons was here --> + <!-- Complete hybridisation of various species of wild duck gene pools could result in the extinction of many indigenous waterfowl. --> </body> </html> diff --git a/apioforum/templates/common.html b/apioforum/templates/common.html index 2e59b2c..c484a9d 100644 --- a/apioforum/templates/common.html +++ b/apioforum/templates/common.html @@ -1,8 +1,13 @@ +{% macro disp_user(username) -%} +<a href="{{url_for('user.view_user',username=username)}}" class="username">{{username}}</a> +{%- endmacro %} + {% macro disp_post(post, buttons=False) %} <div class="post" id="post_{{post.id}}"> <div class="post-heading"> <span class="post-heading-a"> - <span class="post-heading-em">{{post.author}}</span> {{ts(post.created)}} + <span class="post-heading-em">{{disp_user(post.author)}}</span> + {{ts(post.created)}} {% if post.edited %} (edited {{ts(post.updated)}}) {% endif %} diff --git a/apioforum/templates/user_settings.html b/apioforum/templates/user_settings.html new file mode 100644 index 0000000..ad93036 --- /dev/null +++ b/apioforum/templates/user_settings.html @@ -0,0 +1,28 @@ +{% extends 'base.html' %} +{% block header %}<h1>{% block title %}user settings{% endblock %}</h1>{% endblock %} +{% block content %} +<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> +<input type="text" id="new_password" name="new_password"> +</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> +</fieldset> +<p>confirm changes?</p> +<input type="submit" value="confirm"> +<a href="{{url_for('user.view_user',username=user.username)}}">cancel</a> +</form> +{% endblock %} diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index 3edb7f0..59c594b 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 %} +{% from 'common.html' import ts, tag, disp_user %} {% block header %}<h1>{% block title %}apioforum{%endblock%}</h1>{%endblock%} {%block nmcontent%} <main class="widemain"> @@ -50,10 +50,10 @@ {{tag(the_tag)}} {% endfor %} </div> - <div class="threadlisting-part threadlisting-part-creator">{{thread.creator}}</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">{{thread.last_user}}</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%} diff --git a/apioforum/templates/view_user.html b/apioforum/templates/view_user.html new file mode 100644 index 0000000..f773978 --- /dev/null +++ b/apioforum/templates/view_user.html @@ -0,0 +1,37 @@ +{% from 'common.html' import disp_post,ts %} +{% extends 'base.html' %} +{% block header %} +<h1>{%block title %}{{user.username|e}}{% endblock %}</h1> +{% endblock %} + +{%block content%} +<div class="user-top-bar"> + {% if g.user == user.username %} + <a class="actionbutton" href="{{url_for('user.edit_user',username=user.username)}}">settings</a> + {% endif %} +</div> +<div class="user_info"> + <div class="user_bio_quote"> + <div class="user_bio">{{rendered_bio|safe}}</div> + <p class="user_bio_attribution">— {{user.username|e}}</p> + </div> + <dl> + <dt>joined</dt> + {% if user.joined %} + <dd>{{ts(user.joined)}} ago</dd> + {% else %} + <dd>a very long time ago</dd> + {% endif %} + </dl> +</div> +{% if posts %} + <h2>recent posts</h2> + <div class="user_posts"> + {% for post in posts %} + {% call disp_post(post, False) %} + {{ rendered_posts[loop.index0] | safe}} + {% endcall %} + {% endfor %} + </div> +{% endif %} +{% endblock %} |