67 lines
2.7 KiB
Plaintext
67 lines
2.7 KiB
Plaintext
@page "/admin/dungeonbuilder/stamps"
|
|
@model DungeonBuilder.Stamps.IndexModel
|
|
@{
|
|
ViewData["Title"] = "Tile Stamps";
|
|
}
|
|
|
|
<div class="mb-4">
|
|
<a href="/admin/dungeonbuilder" class="text-blue-400 hover:text-blue-300 text-sm">← Back to Dungeon Builder</a>
|
|
</div>
|
|
|
|
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-6">
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-white">Tile Stamps</h1>
|
|
<p class="text-gray-400 text-sm mt-1">Saved multi-tile patterns for fast painting</p>
|
|
</div>
|
|
<a href="/admin/dungeonbuilder/stamps/edit" class="btn btn-primary">+ New Stamp</a>
|
|
</div>
|
|
|
|
@if (!string.IsNullOrEmpty(Model.Message))
|
|
{
|
|
<div class="mb-4 p-3 rounded @(Model.IsError ? "bg-red-900/50 text-red-300" : "bg-green-900/50 text-green-300")">
|
|
@Model.Message
|
|
</div>
|
|
}
|
|
|
|
<div class="card p-4">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="text-left text-gray-400 border-b border-gray-700">
|
|
<th class="pb-2 pr-4">Name</th>
|
|
<th class="pb-2 pr-4">Size</th>
|
|
<th class="pb-2 pr-4">Enabled</th>
|
|
<th class="pb-2">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-700/50">
|
|
@foreach (var s in Model.Stamps)
|
|
{
|
|
<tr class="hover:bg-gray-800/50">
|
|
<td class="py-2 pr-4 text-white">@s.Name</td>
|
|
<td class="py-2 pr-4 text-gray-400">@s.Width x @s.Height</td>
|
|
<td class="py-2 pr-4">
|
|
<span class="px-2 py-0.5 text-xs rounded @(s.IsEnabled ? "bg-green-900 text-green-300" : "bg-red-900 text-red-300")">
|
|
@(s.IsEnabled ? "On" : "Off")
|
|
</span>
|
|
</td>
|
|
<td class="py-2">
|
|
<div class="flex gap-2">
|
|
<a href="/admin/dungeonbuilder/stamps/edit?id=@s.Id" class="text-blue-400 hover:text-blue-300">Edit</a>
|
|
<form method="post" asp-page-handler="Delete" class="inline" onsubmit="return confirm('Delete this stamp?')">
|
|
<input type="hidden" name="id" value="@s.Id" />
|
|
<button type="submit" class="text-red-400 hover:text-red-300">Delete</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
}
|
|
@if (!Model.Stamps.Any())
|
|
{
|
|
<tr>
|
|
<td colspan="4" class="py-8 text-center text-gray-500">No stamps created yet.</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|