mirror of
https://github.com/Xevion/runnerspace.git
synced 2025-12-09 14:08:31 -06:00
Revamp all form submissions with Flask-WTF forms
- Rename blueprint route 'main.user' to 'main.view_user' for clarity - Rename 'forms.py' to 'route_forms.py'
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="header-login">
|
||||
{% if current_user.is_authenticated %}
|
||||
Logged in as
|
||||
<a href="{{ url_for('main.user', username=current_user.username) }}" class="username">{{ current_user.username }}</a>
|
||||
<a href="{{ url_for('main.view_user', username=current_user.username) }}" class="username">{{ current_user.username }}</a>
|
||||
<a href="{{ url_for('main.edit_user', username=current_user.username) }}"><i class="fas fa-cog fa-1x"></i></a>
|
||||
| <a href="{{ url_for('auth.logout') }}">Logout</a>
|
||||
{% else %}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div>
|
||||
<ul>
|
||||
{% for new_user in new_users %}
|
||||
<li><a href="{{ url_for('main.user', username=new_user.username) }}">{{ new_user.username }}</a> as
|
||||
<li><a href="{{ url_for('main.view_user', username=new_user.username) }}">{{ new_user.username }}</a> as
|
||||
of {{ new_user.get_registration_delta() }} ago
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
@@ -13,21 +13,27 @@
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
Username
|
||||
<input class="input is-large" type="text" name="username" placeholder="Username" autofocus>
|
||||
<input class="input" type="text" name="username" placeholder="Username" autofocus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
Name
|
||||
<input class="input is-large" type="text" name="name" placeholder="Name" autofocus>
|
||||
<input class="input" type="text" name="name" placeholder="Name" autofocus>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
Password
|
||||
<input class="input is-large" type="password" name="password" placeholder="Password">
|
||||
<input class="input" type="password" name="password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
Confirm Password
|
||||
<input class="input" type="password" name="confirm" placeholder="Confirm Password">
|
||||
</div>
|
||||
</div>
|
||||
<button>Sign Up</button>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="user-box-top">
|
||||
|
||||
<span class="user-box-username">
|
||||
<a href="{{ url_for('main.user', username=user.username) }}">{{ user.name }}</a>
|
||||
<a href="{{ url_for('main.view_user', username=user.username) }}">{{ user.name }}</a>
|
||||
</span>
|
||||
{% with seen_text = user.get_last_seen() %}
|
||||
{% if seen_text == 'Online now!' %}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="post-box">
|
||||
{{ post.text }}
|
||||
<div class="post-author no-border">
|
||||
<em>Posted by <a href="{{ url_for('main.user', username=author.username) }}">{{ author.name }}</a></em> <span
|
||||
<em>Posted by <a href="{{ url_for('main.view_user', username=author.username) }}">{{ author.name }}</a></em> <span
|
||||
title="{{ post.date_posted }}">{{ post.get_time_ago() }} ago</span>. |
|
||||
<a href="{{ url_for('main.view_post', post_id=post.id) }}"><span>{{ post.comments|length }} comments</span></a>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{{ post.text }}
|
||||
<br>
|
||||
<div class="post-author">
|
||||
<em>Posted by <a href="{{ url_for('main.user', username=author.username) }}">{{ author.name }}</a></em> <span
|
||||
<em>Posted by <a href="{{ url_for('main.view_user', username=author.username) }}">{{ author.name }}</a></em> <span
|
||||
title="{{ post.date_posted }}">{{ post.get_time_ago() }} ago</span>.
|
||||
</div>
|
||||
<div class="post-comments">
|
||||
@@ -30,7 +30,7 @@
|
||||
<div class="post-comment">
|
||||
|
||||
<span class="comment-text">"{{ comment.text }}"</span> — <a class="comment-author"
|
||||
href="{{ url_for('main.user', username=author.username) }}">{{ author.name }}</a>
|
||||
href="{{ url_for('main.view_user', username=author.username) }}">{{ author.name }}</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user