minor edits and cleanup of template

This commit is contained in:
rra 2024-03-10 20:19:32 +01:00
parent b9f3e92acf
commit bfb3827d34
3 changed files with 112 additions and 116 deletions

View file

@ -7,73 +7,71 @@
{% from 'bootstrap/form.html' import render_field %}
{% block app_content %}
<div class="card" style="max-width:unset;">
<div class="card-header">
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active">{{ _('Edit profile') }}</li>
</ol>
</nav>
<ul class="nav nav-tabs flex-column flex-sm-row card-header-tabs">
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link" href="/user/settings">Basic</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link" href="/user/settings/filters">Blocks & Filters</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link active" href="/u/{{ current_user.user_name }}/profile">Profile</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link disabled" href="#">Other</a>
</li>
</ul>
</div>
<div class="card-body">
<h1>{{ _('Edit profile of %(name)s', name=user.user_name) }}</h1>
<p class="card-text"></p>
<form method='post' enctype="multipart/form-data" role="form" autocomplete="off">
{{ form.csrf_token() }}
{{ render_field(form.email) }}
{{ render_field(form.password_field) }}
<h5> Profile Data </h5>
{{ render_field(form.title) }}
{{ render_field(form.about) }}
{% if not low_bandwidth %}
{% if markdown_editor %}
<script nonce="{{ session['nonce'] }}">
window.addEventListener("load", function () {
var downarea = new DownArea({
elem: document.querySelector('#about'),
resize: DownArea.RESIZE_VERTICAL,
hide: ['heading', 'bold-italic'],
value: {{ form.about.data | tojson | safe }}
});
setupAutoResize('about');
});
</script>
{% else %}
<a href="#" aria-hidden="true" class="markdown_editor_enabler create_post_markdown_editor_enabler" data-id="about">{{ _('Enable markdown editor') }}</a>
{% endif %}
{% endif %}
{{ render_field(form.bot) }}
{{ render_field(form.matrixuserid) }}
<small class="field_hint">e.g. @something:matrix.org. Include leading @ and use : before server</small>
<h5> Profile Images </h5>
{{ render_field(form.profile_file) }}
<small class="field_hint">Provide a square image that looks good when small.</small>
{{ render_field(form.banner_file) }}
<small class="field_hint">Provide a wide image - letterbox orientation.</small>
{{ render_field(form.submit) }}
</form>
<p class="mt-4 pt-4">
<a class="btn btn-warning" href="{{ url_for('user.delete_account') }}">{{ _('Delete account') }}</a>
</p>
</div>
<div class="card col-md-8" style="max-width:unset;">
<div class="card-header">
<nav class="mb-2" aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active">{{ _('Edit profile') }}</li>
</ol>
</nav>
<ul class="nav nav-tabs flex-column flex-sm-row card-header-tabs">
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link" href="/user/settings">Basic</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link" href="/user/settings/filters">Blocks & Filters</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link active" href="/u/{{ current_user.user_name }}/profile">Profile</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link disabled" href="#">Other</a>
</li>
</ul>
</div>
<div class="card-body">
<h1>{{ _('Edit profile of %(name)s', name=user.user_name) }}</h1>
<p class="card-text"></p>
<form method='post' enctype="multipart/form-data" role="form" autocomplete="off">
{{ form.csrf_token() }}
{{ render_field(form.email) }}
{{ render_field(form.password_field) }}
<h5> Profile Data </h5>
{{ render_field(form.title) }}
{{ render_field(form.about) }}
{% if not low_bandwidth %}
{% if markdown_editor %}
<script nonce="{{ session['nonce'] }}">
window.addEventListener("load", function () {
var downarea = new DownArea({
elem: document.querySelector('#about'),
resize: DownArea.RESIZE_VERTICAL,
hide: ['heading', 'bold-italic'],
value: {{ form.about.data | tojson | safe }}
});
setupAutoResize('about');
});
</script>
{% else %}
<a href="#" aria-hidden="true" class="markdown_editor_enabler create_post_markdown_editor_enabler" data-id="about">{{ _('Enable markdown editor') }}</a>
{% endif %}
{% endif %}
{{ render_field(form.bot) }}
{{ render_field(form.matrixuserid) }}
<small class="field_hint">e.g. @something:matrix.org. Include leading @ and use : before server</small>
<h5> Profile Images </h5>
{{ render_field(form.profile_file) }}
<small class="field_hint">Provide a square image that looks good when small.</small>
{{ render_field(form.banner_file) }}
<small class="field_hint">Provide a wide image - letterbox orientation.</small>
{{ render_field(form.submit) }}
</form>
<p class="mt-4 pt-4">
<a class="btn btn-warning" href="{{ url_for('user.delete_account') }}">{{ _('Delete account') }}</a>
</p>
</div>
</div>
{% endblock %}

View file

@ -8,54 +8,52 @@
{% block app_content %}
<div class="card" style="max-width:unset;">
<div class="card-header">
<nav class="mb-2" aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active">{{ _('Change settings') }}</li>
</ol>
</nav>
<ul class="nav nav-tabs flex-column flex-sm-row card-header-tabs">
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link active" href="/user/settings">Basic</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link" href="/user/settings/filters">Blocks & Filters</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link" href="/u/{{ current_user.user_name }}/profile">Profile</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link disabled" href="#">Other</a>
</li>
</ul>
</div>
<div class="card-body">
<h1>{{ _('Change settings') }}</h1>
<p class="card-text">Change your basic settings and preferences </p>
<form method='post' enctype="multipart/form-data" role="form">
{{ form.csrf_token() }}
<h5> Mail Settings </h5>
{{ render_field(form.newsletter) }}
{{ render_field(form.email_unread) }}
<h5> Visibility </h5>
{{ render_field(form.ignore_bots) }}
{{ render_field(form.nsfw) }}
{{ render_field(form.nsfl) }}
{{ render_field(form.searchable) }}
{{ render_field(form.indexable) }}
<h5> Preferences </h5>
{{ render_field(form.markdown_editor) }}
{{ render_field(form.default_sort) }}
{{ render_field(form.theme) }}
<h5>Import</h5>
{{ render_field(form.import_file) }}
{{ render_field(form.submit) }}
</form>
</div>
</div>
<div class="card col-md-8" style="max-width:unset;">
<div class="card-header">
<nav class="mb-2" aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>
<li class="breadcrumb-item active">{{ _('Change settings') }}</li>
</ol>
</nav>
<ul class="nav nav-tabs flex-column flex-sm-row card-header-tabs">
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link active" href="/user/settings">Basic</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link" href="/user/settings/filters">Blocks & Filters</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link" href="/u/{{ current_user.user_name }}/profile">Profile</a>
</li>
<li class="nav-item">
<a class="flex-sm-fill text-sm-center nav-link disabled" href="#">Other</a>
</li>
</ul>
</div>
<div class="card-body">
<h1>{{ _('Change settings') }}</h1>
<p class="card-text">Change your basic settings and preferences </p>
<form method='post' enctype="multipart/form-data" role="form">
{{ form.csrf_token() }}
<h5> Mail Settings </h5>
{{ render_field(form.newsletter) }}
{{ render_field(form.email_unread) }}
<h5> Visibility </h5>
{{ render_field(form.ignore_bots) }}
{{ render_field(form.nsfw) }}
{{ render_field(form.nsfl) }}
{{ render_field(form.searchable) }}
{{ render_field(form.indexable) }}
<h5> Preferences </h5>
{{ render_field(form.markdown_editor) }}
{{ render_field(form.default_sort) }}
{{ render_field(form.theme) }}
<h5>Import</h5>
{{ render_field(form.import_file) }}
{{ render_field(form.submit) }}
</form>
</div>
</div>
{% endblock %}

View file

@ -7,9 +7,9 @@
{% set active_child = 'filters' %}
{% block app_content %}
<div class="card" style="max-width:unset;">
<div class="card col-md-8" style="max-width:unset;">
<div class="card-header">
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<nav class="mb-2" aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
<li class="breadcrumb-item"><a href="/u/{{ user.link() }}">{{ user.display_name() }}</a></li>