add settings routes

This commit is contained in:
2026-05-22 00:39:27 +03:00
parent 84ee969e7a
commit 9ca40e1814
8 changed files with 375 additions and 50 deletions

View File

@@ -72,7 +72,7 @@
<div class="tab-container">
<div class="tab-bar" role="tablist">
{%- for tab_label in labels -%}
<button type="button" class="tab-button" role="tab" aria-selected="{{'true' if loop.index0==0 else 'false'}}" id="{{prefix+'-'+(tab_label | lower)+'-tab'}}" aria-controls="{{prefix+'-'+(tab_label | lower)+'-content'}}">{{tab_label}}</button>
<button type="button" class="tab-button" role="tab" aria-selected="{{'true' if loop.index0==0 else 'false'}}" id="{{prefix+'-'+(tab_label | lower)+'-tab'}}" aria-controls="{{prefix+'-'+(tab_label | lower)+'-content'}}" disabled>{{tab_label}}</button>
{%- endfor -%}
</div>
{%- for tab_label in labels -%}
@@ -87,25 +87,38 @@
placeholder='Post content',
prefill='',
required=true,
id='babycode-content'
id='babycode-content',
banned_tags=[]
) -%}
{%- call(idx) tabs(prefix='babycode', labels=['Write', 'Preview']) -%}
{%- if idx == 0 -%}
<span class="babycode-editor-controls">
<span class="button-row">
<button type="button" class="minimal"><b>B</b></button>
<button type="button" class="minimal"><i>i</i></button>
<button type="button" class="minimal"><s>S</s></button>
<button type="button" class="minimal"><u>U</u></button>
<button type="button" class="minimal"><code>://</code></button>
<button type="button" class="minimal"><code>&lt;/&gt;</code></button>
<button type="button" class="minimal">1.</button>
<button type="button" class="minimal">&bullet;</button>
<button type="button" class="minimal"><img src="/static/emoji/angry.png" class="emoji"></button>
<span class="babycode-editor-controls">
<span class="button-row">
<button type="button" class="minimal" disabled><b>B</b></button>
<button type="button" class="minimal" disabled><i>i</i></button>
<button type="button" class="minimal" disabled><s>S</s></button>
<button type="button" class="minimal" disabled><u>U</u></button>
<button type="button" class="minimal" disabled><code>://</code></button>
<button type="button" class="minimal" disabled><code>&lt;/&gt;</code></button>
<button type="button" class="minimal" disabled>1.</button>
<button type="button" class="minimal" disabled>&bullet;</button>
<button type="button" class="minimal" disabled><img src="/static/emoji/angry.png" class="emoji"></button>
</span>
<span class="flex-last">{# stub: char count #}</span>
</span>
</span>
<textarea name="babycode_content" id="{{id}}" class="babycode-editor" placeholder="{{placeholder}}" {{'required' if required else ''}}>{{ prefill }}</textarea>
<a href="##">babycode help</a>
<input type="hidden" name="babycode_banned_tags" id="{{id}}-banned-tags" value="{{banned_tags | unique | list | tojson | forceescape}}">
<textarea name="babycode_content" id="{{id}}" class="babycode-editor" placeholder="{{placeholder}}" {{'required' if required else ''}} autocomplete="off" maxlength="5000">{{ prefill }}</textarea>
{%- if banned_tags -%}
<div>
<span>Forbidden tags:</span>
<ul class="horizontal">
{%- for tag in banned_tags -%}
<li><code class="inline-code">{{tag}}</code></li>
{%- endfor -%}
</ul>
</div>
{%- endif -%}
<a href="##">babycode help</a>
{%- endif -%}
{%- endcall -%}
{%- endmacro %}
@@ -132,7 +145,7 @@
<div class="usercard-inner">
{{avatar(post.avatar_path)}}
<div class="usercard-rest">
<a href="{{url_for('users.user_page', username=post.username)}}">{{post.display_name if post.display_name else post.username}}</a>
<a href="{{url_for('users.user_page', username=post.username)}}" class="usercard-username">{{post.display_name if post.display_name else post.username}}</a>
<abbr title="mention">@{{post.username}}</abbr>
<i>{{post.status}}</i>
{%- set badges=post.badges_json | fromjson -%}