wip-feat: reduces env vars, adds getting-started page

This commit is contained in:
2025-05-15 23:25:12 -05:00
parent ce6fda257b
commit 5d5d66bd79
22 changed files with 500 additions and 62 deletions

View File

@@ -0,0 +1,79 @@
{% extends 'bare.html.twig' %}
{% block title %}Getting Started — Torsearch{% endblock %}
{% block body %}
<div class="flex flex-col bg-orange-500/50 p-4 rounded-lg gap-4 min-w-96 border-orange-500 border-2 text-gray-50">
<h2 class="text-2xl text-bold text-center text-gray-50">Getting Started</h2>
<p class="mb-2">Let's get started by creating your first User.</p>
{{ form_start(registrationForm) }}
<label for="name" class="flex flex-col mb-2">
{{ field_label(registrationForm.name) }}
{% if form_errors(registrationForm.name) %}
<span class="w-full p-1 text-[.775rem] font-bold border-2 border-red-600 text-black bg-red-500/70 rounded-md">
{{ form_errors(registrationForm.name) }}
</span>
{% endif %}
<input type="text"
name="{{ field_name(registrationForm.name) }}"
id="{{ field_name(registrationForm.name) }}"
value="{{ field_value(registrationForm.name) }}"
class="bg-gray-50 text-gray-50 p-1 bg-transparent border-b-2 border-orange-400" />
</label>
<label for="username" class="flex flex-col mb-2">
{{ field_label(registrationForm.username) }}
{% if form_errors(registrationForm.username) %}
<span class="w-full p-1 text-[.775rem] font-bold border-2 border-red-600 text-black bg-red-500/70 rounded-md">
{{ form_errors(registrationForm.username) }}
</span>
{% endif %}
<input type="text"
name="{{ field_name(registrationForm.username) }}"
id="{{ field_name(registrationForm.username) }}"
value="{{ field_value(registrationForm.username) }}"
class="bg-gray-50 text-gray-50 p-1 bg-transparent border-b-2 border-orange-400" />
</label>
<label for="email" class="flex flex-col mb-2">
{{ field_label(registrationForm.email) }}
{% if form_errors(registrationForm.email) %}
<span class="w-full p-1 text-[.775rem] font-bold text-black bg-red-500/70 rounded-md">
{{ form_errors(registrationForm.email) }}
</span>
{% endif %}
<input type="email"
name="{{ field_name(registrationForm.email) }}"
id="{{ field_name(registrationForm.email) }}"
value="{{ field_value(registrationForm.email) }}"
class="bg-gray-50 text-gray-50 p-1 bg-transparent border-b-2 border-orange-400" />
</label>
<label for="password" class="flex flex-col mb-2">
{{ field_label(registrationForm.plainPassword) }}
{% if form_errors(registrationForm.plainPassword) %}
<span class="w-full p-1 text-[.775rem] font-bold border-2 border-red-600 text-black bg-red-500/70 rounded-md">
{{ form_errors(registrationForm.plainPassword) }}
</span>
{% endif %}
<input type="password"
name="{{ field_name(registrationForm.plainPassword) }}"
id="{{ field_name(registrationForm.plainPassword) }}"
value="{{ field_value(registrationForm.plainPassword) }}"
class="bg-gray-50 text-gray-50 p-1 bg-transparent border-b-2 border-orange-400 mb-3" />
</label>
<button type="submit" class="bg-green-600/40 px-1.5 py-1 w-full rounded-md text-gray-50 backdrop-filter backdrop-blur-sm border-2 border-green-500 hover:bg-green-700/40">Register</button>
{{ form_end(registrationForm) }}
</div>
{% endblock %}

View File

@@ -3,11 +3,13 @@
{% block title %}Log in &mdash; Torsearch{% endblock %}
{% block body %}
<div class="flex flex-col bg-orange-500 bg-opacity-60 border-orange-500 border-2 p-4 rounded-lg gap-2 min-w-96 text-gray-50">
<div class="flex flex-col bg-orange-500/50 p-4 rounded-lg gap-4 min-w-96 border-orange-500 border-2 text-gray-50">
<h2 class="text-xl font-bold">Login</h2>
<form method="post" class="flex flex-col gap-2">
{% if error %}
<div class="bg-red-400 border-red-600 rounded p-2 text-red-600">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
<div class="w-full p-1 mb-3 font-bold text-black bg-red-500/70 rounded-md">
{{ error.messageKey|trans(error.messageData, 'security') }}
</div>
{% endif %}
{% if app.user %}
@@ -16,15 +18,15 @@
</div>
{% endif %}
<label for="username" class="mb-2 flex flex-col">
<label for="username" class="flex flex-col mb-2">
User
<input type=""
value="{{ last_username }}"
<input type="text"
name="_username"
id="username"
class="bg-gray-50 text-gray-950 p-1 rounded-md"
autocomplete="email"
required autofocus>
value="{{ last_username }}"
class="bg-gray-50 text-gray-50 p-1 bg-transparent border-b-2 border-orange-400"
required autofocus
/>
</label>
<label for="password" class="mb-2 flex flex-col">
@@ -32,7 +34,7 @@
<input type="password"
name="_password"
id="password"
class="bg-gray-50 text-gray-950 p-1 rounded-md"
class="bg-gray-50 text-gray-50 p-1 bg-transparent border-b-2 border-orange-400"
autocomplete="current-password"
required>
</label>
@@ -43,8 +45,7 @@
<label for="_remember_me">Remember me</label>
</div>
<button class="bg-green-600 px-1.5 py-1 rounded-md text-gray-50" type="submit">
<button type="submit" class="bg-green-600/40 px-1.5 py-1 w-full rounded-md text-gray-50 backdrop-filter backdrop-blur-sm border-2 border-green-500 hover:bg-green-700/40">
Sign in
</button>
</form>