c90b07386d
- 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>
94 lines
3.6 KiB
Plaintext
94 lines
3.6 KiB
Plaintext
@using HrynCo.NotificationService.DAL.Abstract.Providers
|
|
@model IReadOnlyList<EmailChannel>
|
|
@{
|
|
ViewData["Title"] = "Email Channels";
|
|
}
|
|
|
|
<div class="page-header">
|
|
<h2><i class="bi bi-broadcast"></i> Email Channels</h2>
|
|
<a href="/admin/channels/create" class="btn btn-primary btn-sm">
|
|
<i class="bi bi-plus-lg me-1"></i> Create New Channel
|
|
</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-broadcast"></i>
|
|
<p class="mt-2 mb-0">No email channels found.</p>
|
|
<a href="/admin/channels/create" class="btn btn-primary btn-sm mt-3">
|
|
<i class="bi bi-plus-lg me-1"></i> Create First Channel
|
|
</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>Type</th>
|
|
<th>Priority</th>
|
|
<th>Status</th>
|
|
<th>Daily Limit</th>
|
|
<th>Monthly Limit</th>
|
|
<th class="text-end">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var c in Model)
|
|
{
|
|
<tr>
|
|
<td>@c.ServiceName</td>
|
|
<td>@c.EmailChannelType</td>
|
|
<td>@c.Priority</td>
|
|
<td>
|
|
@if (c.IsActive)
|
|
{
|
|
<span class="badge bg-success">Active</span>
|
|
}
|
|
else
|
|
{
|
|
<span class="badge bg-secondary text-muted">Inactive</span>
|
|
}
|
|
</td>
|
|
<td>@(c.DailyLimit.HasValue ? c.DailyLimit.ToString() : "—")</td>
|
|
<td>@(c.MonthlyLimit.HasValue ? c.MonthlyLimit.ToString() : "—")</td>
|
|
<td class="text-end">
|
|
<a href="/admin/channels/@c.Id"
|
|
class="btn btn-sm btn-outline-primary me-1">
|
|
<i class="bi bi-pencil"></i> Edit
|
|
</a>
|
|
<form method="post"
|
|
action="/admin/channels/@c.Id/delete"
|
|
class="d-inline">
|
|
@Html.AntiForgeryToken()
|
|
<button type="submit"
|
|
class="btn btn-sm btn-outline-danger"
|
|
onclick="return confirm('Delete this channel?')">
|
|
<i class="bi bi-trash"></i> Delete
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
}
|