refactor: migrate and consolidate UI templates to compile-time Askama component macros
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "components/macros.html" as ui %}
|
||||
|
||||
{% block title %}Sign In - Stick{% endblock %}
|
||||
|
||||
@@ -22,20 +23,12 @@
|
||||
{% endif %}
|
||||
|
||||
<form class="space-y-5" action="/auth/login" method="post">
|
||||
<div>
|
||||
<label for="username" class="block text-sm font-medium text-slate-400 mb-1.5">Username</label>
|
||||
<input id="username" name="username" type="text" required class="appearance-none rounded-xl relative block w-full px-4 py-3 bg-[#0f172a]/80 border border-slate-800 placeholder-slate-500 text-white focus:outline-none focus:ring-2 focus:ring-sky-500 focus:border-sky-500 transition duration-200 text-sm" placeholder="Enter username">
|
||||
</div>
|
||||
{{ ui::text_input(id="username", name="username", label="Username", type="text", placeholder="Enter username", required=true) }}
|
||||
|
||||
<div>
|
||||
<label for="password" class="block text-sm font-medium text-slate-400 mb-1.5">Password</label>
|
||||
<input id="password" name="password" type="password" required class="appearance-none rounded-xl relative block w-full px-4 py-3 bg-[#0f172a]/80 border border-slate-800 placeholder-slate-500 text-white focus:outline-none focus:ring-2 focus:ring-sky-500 focus:border-sky-500 transition duration-200 text-sm" placeholder="••••••••">
|
||||
</div>
|
||||
{{ ui::text_input(id="password", name="password", label="Password", type="password", placeholder="••••••••", required=true) }}
|
||||
|
||||
<div>
|
||||
<button type="submit" class="group relative w-full flex justify-center py-3.5 px-4 border border-transparent text-sm font-semibold rounded-xl text-white bg-gradient-to-r from-sky-500 to-indigo-600 hover:opacity-95 transition focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500 focus:ring-offset-[#0f172a] shadow-lg shadow-sky-500/10">
|
||||
Sign In
|
||||
</button>
|
||||
{{ ui::button(label="Sign In", variant="indigo", type="submit", extra_class="w-full py-3.5 shadow-lg shadow-sky-500/10") }}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "components/macros.html" as ui %}
|
||||
|
||||
{% block title %}Sign Up - Stick{% endblock %}
|
||||
|
||||
@@ -31,20 +32,12 @@
|
||||
{% endif %}
|
||||
|
||||
<form class="space-y-5" action="/auth/register" method="post">
|
||||
<div>
|
||||
<label for="username" class="block text-sm font-medium text-slate-400 mb-1.5">Username</label>
|
||||
<input id="username" name="username" type="text" required class="appearance-none rounded-xl relative block w-full px-4 py-3 bg-[#0f172a]/80 border border-slate-800 placeholder-slate-500 text-white focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 transition duration-200 text-sm" placeholder="Choose a username">
|
||||
</div>
|
||||
{{ ui::text_input(id="username", name="username", label="Username", type="text", placeholder="Choose a username", required=true) }}
|
||||
|
||||
<div>
|
||||
<label for="password" class="block text-sm font-medium text-slate-400 mb-1.5">Password</label>
|
||||
<input id="password" name="password" type="password" required class="appearance-none rounded-xl relative block w-full px-4 py-3 bg-[#0f172a]/80 border border-slate-800 placeholder-slate-500 text-white focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 transition duration-200 text-sm" placeholder="••••••••">
|
||||
</div>
|
||||
{{ ui::text_input(id="password", name="password", label="Password", type="password", placeholder="••••••••", required=true) }}
|
||||
|
||||
<div>
|
||||
<button type="submit" class="group relative w-full flex justify-center py-3.5 px-4 border border-transparent text-sm font-semibold rounded-xl text-white bg-gradient-to-r from-emerald-500 to-teal-600 hover:opacity-95 transition focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-emerald-500 focus:ring-offset-[#0f172a] shadow-lg shadow-emerald-500/10">
|
||||
Sign Up
|
||||
</button>
|
||||
{{ ui::button(label="Sign Up", variant="primary", type="submit", extra_class="w-full py-3.5 bg-gradient-to-r from-emerald-500 to-teal-600 hover:opacity-95 text-white shadow-lg shadow-emerald-500/10 focus:ring-emerald-500") }}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user