add settings routes
This commit is contained in:
80
app/templates/users/settings.html
Normal file
80
app/templates/users/settings.html
Normal file
@@ -0,0 +1,80 @@
|
||||
{%- from 'common/macros.html' import babycode_editor_component -%}
|
||||
{%- from 'common/macros.html' import subheader, avatar -%}
|
||||
{%- extends 'base.html' -%}
|
||||
{%- block title -%}settings{%- endblock -%}
|
||||
{%- block content -%}
|
||||
{%- set sub -%}
|
||||
{%- if user.is_guest() -%}You are a guest. Your customization options are limited until a moderator confirms your account.{%- endif -%}
|
||||
{%- endset -%}
|
||||
{{- subheader('User settings', sub) -}}
|
||||
{%- if not user.is_guest() -%}
|
||||
<fieldset class="plank">
|
||||
<legend>Avatar</legend>
|
||||
<form method="POST" class="avatar-form" action="{{url_for('users.set_avatar', username=user.username)}}" enctype="multipart/form-data">
|
||||
{{- avatar(user.get_avatar_url()) -}}
|
||||
<span class="avatar-form-controls">
|
||||
<label for="avatar" class="linkbutton alt">Upload…</label>
|
||||
<span class="avatar-form-size-label">1MB max. Will be cropped to square.</span>
|
||||
<input type="file" style="display: none;" id="avatar" name="avatar" accept="image/*">
|
||||
<input type="submit" value="Save">
|
||||
<input type="submit" class="warn" value="Clear" formaction="{{url_for('users.clear_avatar', username=user.username)}}">
|
||||
</span>
|
||||
</form>
|
||||
</fieldset>
|
||||
{%- endif -%}
|
||||
<fieldset class="plank">
|
||||
<legend>Change password</legend>
|
||||
<p>After you change your password, you will be logged out of all sessions and will need to log in again.</p>
|
||||
<form class="full-width" method="POST" action="{{ url_for('users.change_password', username=user.username) }}">
|
||||
<label for="current-password">Current password</label>
|
||||
<input type="password" name="current_password" id="current-password" autocomplete="current-password" required>
|
||||
<label for="new-password">New password</label>
|
||||
<input type="password" name="new_password" id="new-password" autocomplete="new-password" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_])(?!.*\s).{10,255}" title="10+ chars with at least: 1 uppercase, 1 lowercase, 1 number, 1 special char, and no spaces" required>
|
||||
<label for="new-password2">Confirm new password</label>
|
||||
<input type="password" name="new_password2" id="new-password2" autocomplete="new-password" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_])(?!.*\s).{10,255}" title="10+ chars with at least: 1 uppercase, 1 lowercase, 1 number, 1 special char, and no spaces" required>
|
||||
<input type="submit" value="Change password" class="warn">
|
||||
</form>
|
||||
</fieldset>
|
||||
{%- if not user.is_guest() -%}
|
||||
<fieldset class="plank">
|
||||
<legend>Personalization</legend>
|
||||
<form class="full-width" method="POST" action="{{ url_for('users.set_personalization', username=user.username)}}">
|
||||
<label for="sort-by">Sort threads by:</label>
|
||||
<select name="sort_by" id="sort-by" autocomplete=off>
|
||||
<option value="activity" {{ 'selected' if sort_by == 'activity' else '' }}>Activity</option>
|
||||
<option value="thread" {{ 'selected' if sort_by == 'thread' else '' }}>Newest</option>
|
||||
</select>
|
||||
<label for="display-name">Display name</label>
|
||||
<input type="text" name="display_name" id="display-name" value="{{user.display_name}}" placeholder="Same as username" pattern="(?:[\w!#$%^*\(\)\-_=+\[\]\{\}\|;:,.?\s]{3,50})?" title="Optional. 3-50 characters, no @, no <>, no &." maxlength="50" autocomplete=off>
|
||||
<label for="status">Status</label>
|
||||
<input type="text" name="status" id="status" maxlength="100" value="{{user.status}}" placeholder="Will be shown under your username on posts. Max. 100 characters." autocomplete="off">
|
||||
<span>
|
||||
<input type="checkbox" id="subscribe-by-default" name="subscribe_by_default" {{'' if session['dont_subscribe_by_default'] else 'checked'}} autocomplete="off">
|
||||
<label for="subscribe-by-default">Automatically subscribe to thread when responding</label>
|
||||
</span>
|
||||
<input type="submit" value="Save">
|
||||
</form>
|
||||
</fieldset>
|
||||
<fieldset class="plank">
|
||||
<legend>Signature</legend>
|
||||
<form method="POST" class="full-width" action="{{url_for('users.set_sig', username=user.username)}}">
|
||||
<p>The signature will appear under each of your posts.</p>
|
||||
{{babycode_editor_component(id='signature-content', placeholder='Signature content', prefill=user.signature_original_markup, required=false, banned_tags=['@mention'])}}
|
||||
<input type="submit" value="Save signature">
|
||||
</form>
|
||||
</fieldset>
|
||||
{#<fieldset class="plank">
|
||||
<legend>About me/Bio</legend>
|
||||
<form method="POST" class="full-width">
|
||||
<span>Your bio will appear on your profile.</span>
|
||||
{{babycode_editor_component(id='bio-content', placeholder='Bio content', prefill=user.signature_original_markup, required=false, banned_tags=['@mention'])}}
|
||||
<input type="submit" value="Save bio">
|
||||
</form>
|
||||
</fieldset>#}
|
||||
<fieldset class="plank">
|
||||
<legend>Badges</legend>
|
||||
<div>Loading badges…</div>
|
||||
<div>If badges fail to load, make sure JS is enabled.</div>
|
||||
</fieldset>
|
||||
{%- endif -%}
|
||||
{%- endblock -%}
|
||||
@@ -14,9 +14,9 @@ Please read the rules etc. stub
|
||||
<label for="username">Username</label>
|
||||
<input type="text" id="username" name="username" pattern="[a-zA-Z0-9_\-]{3,24}" title="3-24 characters. Only upper and lowercase letters, digits, hyphens, and underscores" autocomplete="username" required>
|
||||
<label for="password">Create password</label>
|
||||
<input type="password" id="password" name="password" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_])(?!.*\s).{10,255}" title="10+ chars with: 1 uppercase, 1 lowercase, 1 number, 1 special char, and no spaces" autocomplete="new-password" required>
|
||||
<input type="password" id="password" name="password" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_])(?!.*\s).{10,255}" title="10+ chars with at least: 1 uppercase, 1 lowercase, 1 number, 1 special char, and no spaces" autocomplete="new-password" required>
|
||||
<label for="password2">Confirm password</label>
|
||||
<input type="password" id="password2" name="password" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_])(?!.*\s).{10,255}" title="10+ chars with: 1 uppercase, 1 lowercase, 1 number, 1 special char, and no spaces" autocomplete="new-password" required>
|
||||
<input type="password" id="password2" name="password" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_])(?!.*\s).{10,255}" title="10+ chars with at least: 1 uppercase, 1 lowercase, 1 number, 1 special char, and no spaces" autocomplete="new-password" required>
|
||||
<span><input type="checkbox" name="remember" id="remember"> <label for="remember">Remember me</label></span>
|
||||
<input type="submit" value="Sign up">
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user