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>
76 lines
3.1 KiB
Plaintext
76 lines
3.1 KiB
Plaintext
@using HrynCo.NotificationService.Web.Controllers.Admin.ViewModels
|
|
@model EmailTemplateEditViewModel
|
|
@{
|
|
Layout = "~/Views/Shared/_EditorLayout.cshtml";
|
|
ViewData["Title"] = Model.PageTitle;
|
|
ViewData["EditorTitle"] = Model.PageTitle;
|
|
}
|
|
|
|
<form id="templateForm" asp-action="Save" asp-controller="AdminTemplates" method="post">
|
|
@Html.AntiForgeryToken()
|
|
<input asp-for="Id" type="hidden" />
|
|
<input type="hidden" name="IsNew" value="@Model.IsNew" />
|
|
|
|
@if (!ViewData.ModelState.IsValid)
|
|
{
|
|
<div class="alert alert-danger mb-3">
|
|
@foreach (var error in ViewData.ModelState.Values.SelectMany(v => v.Errors))
|
|
{
|
|
<div>@error.ErrorMessage</div>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
<div class="mb-4">
|
|
<label asp-for="ServiceName" class="form-label fw-semibold">Service Name</label>
|
|
<input asp-for="ServiceName" class="form-control" readonly="@(!Model.IsNew)" />
|
|
<span asp-validation-for="ServiceName" class="text-danger small"></span>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label asp-for="Key" class="form-label fw-semibold">Key</label>
|
|
<input asp-for="Key" class="form-control" readonly="@(!Model.IsNew)" />
|
|
<span asp-validation-for="Key" class="text-danger small"></span>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label asp-for="LanguageCode" class="form-label fw-semibold">Language Code</label>
|
|
<input asp-for="LanguageCode" class="form-control" readonly="@(!Model.IsNew)" />
|
|
<span asp-validation-for="LanguageCode" class="text-danger small"></span>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label asp-for="Subject" class="form-label fw-semibold">Subject</label>
|
|
<input asp-for="Subject" class="form-control" />
|
|
<span asp-validation-for="Subject" class="text-danger small"></span>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label asp-for="HtmlBody" class="form-label fw-semibold">HTML Body</label>
|
|
<textarea asp-for="HtmlBody" class="form-control font-monospace" rows="10"></textarea>
|
|
<span asp-validation-for="HtmlBody" class="text-danger small"></span>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label asp-for="TextBody" class="form-label fw-semibold">Text Body</label>
|
|
<textarea asp-for="TextBody" class="form-control font-monospace" rows="5"></textarea>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label asp-for="VariablesJson" class="form-label fw-semibold">Variables (JSON)</label>
|
|
<textarea asp-for="VariablesJson" class="form-control font-monospace" rows="4"
|
|
placeholder='[{"name":"UserName","required":true}]'></textarea>
|
|
<span asp-validation-for="VariablesJson" class="text-danger small"></span>
|
|
<div class="form-text">JSON array of <code>{"name":"...", "required":true|false}</code></div>
|
|
</div>
|
|
|
|
@section FormActions {
|
|
<button type="submit" form="templateForm" class="btn btn-primary">
|
|
<i class="bi bi-floppy me-1"></i> Save
|
|
</button>
|
|
<a href="/admin/templates" class="btn btn-secondary">
|
|
<i class="bi bi-x-lg me-1"></i> Cancel
|
|
</a>
|
|
}
|
|
</form>
|