Files
robbiepaul e69d6856aa
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Update
2026-04-29 12:20:15 +01:00

73 lines
3.6 KiB
Plaintext

<% content_for :title, "Forecourt Admin" %>
<div class="min-h-screen bg-zinc-950 text-zinc-100">
<header class="border-b border-white/10 bg-zinc-950/90 backdrop-blur">
<div class="mx-auto flex max-w-6xl items-center justify-between px-6 py-5 lg:px-8">
<div>
<p class="text-xs font-semibold uppercase tracking-[0.24em] text-amber-400">Forecourt</p>
<h1 class="mt-1 text-2xl font-semibold text-white">Local admin console</h1>
</div>
<%= link_to "Back to vehicle", root_path, class: "inline-flex items-center rounded-full border border-white/15 px-4 py-2 text-sm font-medium text-zinc-200 transition hover:border-white/30 hover:text-white" %>
</div>
</header>
<main class="mx-auto max-w-6xl px-6 py-10 lg:px-8">
<% if flash[:notice].present? %>
<div class="mb-6 rounded-2xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-100">
<%= flash[:notice] %>
</div>
<% end %>
<% if flash[:alert].present? %>
<div class="mb-6 rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-100">
<%= flash[:alert] %>
</div>
<% end %>
<% if @unlocked %>
<section data-controller="admin-panel" class="mx-auto max-w-2xl rounded-3xl border border-white/10 bg-white/5 p-8 shadow-2xl shadow-black/20">
<p class="text-xs font-semibold uppercase tracking-[0.24em] text-emerald-300">Unlocked</p>
<h2 class="mt-2 text-3xl font-semibold text-white">Admin Panel Unlocked</h2>
<p class="mt-3 text-sm leading-6 text-zinc-300">
One final button. Press it if you want the ending.
</p>
<button
type="button"
data-action="admin-panel#celebrate"
class="mt-8 inline-flex items-center rounded-2xl bg-rose-600 px-6 py-3 text-sm font-semibold text-white transition hover:bg-rose-500"
>
Delete database
</button>
</section>
<% else %>
<section class="mx-auto max-w-2xl rounded-3xl border border-white/10 bg-white/5 p-8 shadow-2xl shadow-black/20">
<p class="text-xs font-semibold uppercase tracking-[0.24em] text-zinc-400">Restricted access</p>
<h2 class="mt-2 text-3xl font-semibold text-white">Admin login required</h2>
<p class="mt-3 text-sm leading-6 text-zinc-300">
Enter the four-word access phrase from the stock page in the format
<span class="rounded bg-white/10 px-2 py-1 font-mono text-xs text-zinc-100">WORD_1-WORD_2-WORD_3-WORD_4</span>.
</p>
<p class="mt-2 text-sm text-zinc-500">
Use the words in page order.
</p>
<%= form_with url: admin_path, method: :post, class: "mt-8 space-y-5" do |form| %>
<div>
<%= form.label :password, "Access phrase", class: "mb-2 block text-sm font-medium text-zinc-200" %>
<%= form.password_field :password,
autocomplete: "off",
placeholder: "WORD_1-WORD_2-WORD_3-WORD_4",
class: "w-full rounded-2xl border border-white/10 bg-zinc-950/70 px-4 py-3 font-mono text-sm text-white outline-none transition placeholder:text-zinc-500 focus:border-sky-400/60 focus:ring-2 focus:ring-sky-400/20" %>
</div>
<div class="flex flex-wrap items-center gap-3">
<%= form.submit "Unlock", class: "inline-flex items-center rounded-full bg-white px-5 py-2.5 text-sm font-semibold text-zinc-950 transition hover:bg-zinc-200" %>
<span class="text-sm text-zinc-500">Local preview only</span>
</div>
<% end %>
</section>
<% end %>
</main>
</div>