Files
soroushasadi/Pages/Admin/Sections/Index.cshtml
T

38 lines
1.4 KiB
Plaintext
Raw Normal View History

@page "/Admin/Sections"
@model SoroushAsadi.Pages.Admin.Sections.SectionsIndexModel
@{
Layout = "_AdminLayout";
ViewData["Title"] = "Sections";
var all = new[]{ "hero","services","dataflow","stack","expertise","portfolio","blog","contact","footer" };
}
<div class="mb-6 flex items-center justify-between">
<h1 class="font-display text-2xl font-bold text-white">Sections</h1>
</div>
<div class="space-y-2">
@foreach (var key in all)
{
var hasOverride = Model.OverrideKeys.Contains(key);
<div class="glass flex items-center justify-between p-4">
<div class="flex items-center gap-3">
<span class="font-mono text-sm text-white">@key</span>
@if (hasOverride)
{
<span class="rounded-full bg-electric/10 px-2 py-0.5 font-mono text-[.65rem] text-electric">customized</span>
}
</div>
<div class="flex gap-2">
<a href="/Admin/Sections/@key" class="btn-ghost text-xs py-1.5 px-3">Edit</a>
@if (hasOverride)
{
<form method="post" asp-page-handler="Reset" class="inline">
<input type="hidden" name="key" value="@key" />
<button type="submit" class="rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-1.5 text-xs text-red-400 hover:bg-red-500/20 transition-colors">Reset</button>
</form>
}
</div>
</div>
}
</div>