feat: add persistence and restoration of email template filters in UI and backend

This commit is contained in:
2026-05-17 13:53:37 +03:00
parent 07f536938f
commit cc3857a409
4 changed files with 97 additions and 12 deletions
@@ -10,6 +10,8 @@
@Html.AntiForgeryToken()
<input asp-for="Id" type="hidden" />
<input type="hidden" name="IsNew" value="@Model.IsNew" />
<input asp-for="ServiceNameFilter" type="hidden" />
<input asp-for="KeyFilter" type="hidden" />
@if (!ViewData.ModelState.IsValid)
{
@@ -116,7 +118,7 @@
<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">
<a href="/admin/templates@(string.IsNullOrWhiteSpace(Model.ServiceNameFilter) && string.IsNullOrWhiteSpace(Model.KeyFilter) ? string.Empty : $"?serviceName={Uri.EscapeDataString(Model.ServiceNameFilter ?? string.Empty)}&key={Uri.EscapeDataString(Model.KeyFilter ?? string.Empty)}")" class="btn btn-secondary">
<i class="bi bi-x-lg me-1"></i> Cancel
</a>
}