Files
Anatolii Grynchuk c90b07386d feat: polished admin UI styles + email channels admin CRUD
- Extract inline styles to wwwroot/css/admin.css
- Bootstrap Icons for nav and buttons
- Styled page headers, table, empty state, readonly fields
- Email Channels admin: list, create, edit, delete
- GetAllEmailChannelsQuery + handler
- AdminChannelsController with full CRUD
- form id + form= attribute pattern for EditorLayout footer buttons

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 02:43:59 +03:00

81 lines
3.0 KiB
Plaintext

@using HrynCo.NotificationService.DAL.Abstract.Templates
@model IReadOnlyList<EmailTemplate>
@{
ViewData["Title"] = "Email Templates";
}
<div class="page-header">
<h2><i class="bi bi-envelope-paper"></i> Email Templates</h2>
<a href="/admin/templates/create" class="btn btn-primary btn-sm">
<i class="bi bi-plus-lg me-1"></i> Create New Template
</a>
</div>
@if (!ViewData.ModelState.IsValid)
{
<div class="alert alert-danger">
@foreach (var error in ViewData.ModelState.Values.SelectMany(v => v.Errors))
{
<div>@error.ErrorMessage</div>
}
</div>
}
@if (Model is null || Model.Count == 0)
{
<div class="card shadow-sm table-card">
<div class="empty-state">
<i class="bi bi-envelope-paper"></i>
<p class="mt-2 mb-0">No email templates found.</p>
<a href="/admin/templates/create" class="btn btn-primary btn-sm mt-3">
<i class="bi bi-plus-lg me-1"></i> Create First Template
</a>
</div>
</div>
}
else
{
<div class="card shadow-sm table-card">
<div class="table-responsive">
<table class="table table-hover table-sm mb-0">
<thead class="table-dark">
<tr>
<th>Service Name</th>
<th>Key</th>
<th>Language</th>
<th>Subject</th>
<th class="text-end">Actions</th>
</tr>
</thead>
<tbody>
@foreach (var t in Model)
{
<tr>
<td>@t.ServiceName</td>
<td>@t.Key</td>
<td>@t.LanguageCode</td>
<td>@t.Subject</td>
<td class="text-end">
<a href="/admin/templates/@t.ServiceName/@t.Key/@t.LanguageCode"
class="btn btn-sm btn-outline-primary me-1">
<i class="bi bi-pencil"></i> Edit
</a>
<form method="post"
action="/admin/templates/@t.ServiceName/@t.Key/@t.LanguageCode/delete"
class="d-inline">
@Html.AntiForgeryToken()
<button type="submit"
class="btn btn-sm btn-outline-danger"
onclick="return confirm('Delete this template?')">
<i class="bi bi-trash"></i> Delete
</button>
</form>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}