Files
PowderCoatingLogix/src/PowderCoating.Web/Views/JobTemplates/Edit.cshtml
T
2026-04-23 21:38:24 -04:00

79 lines
3.9 KiB
Plaintext

@model PowderCoating.Core.Entities.JobTemplate
@{
ViewData["Title"] = $"Edit Template: {Model.Name}";
ViewData["PageIcon"] = "bi-pencil-square";
}
<div class="d-flex justify-content-end mb-4">
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left me-2"></i>Back
</a>
</div>
<div class="row justify-content-center">
<div class="col-lg-7">
<div class="card border-0 shadow-sm">
<div class="card-body p-4">
<form asp-action="Edit" asp-route-id="@Model.Id" method="post">
@Html.AntiForgeryToken()
<div class="mb-3">
<label class="form-label fw-semibold">Template Name <span class="text-danger">*</span></label>
<input type="text" name="name" class="form-control" value="@Model.Name" required maxlength="100">
</div>
<div class="mb-3">
<label class="form-label fw-semibold">Description</label>
<textarea name="description" class="form-control" rows="2" maxlength="500">@Model.Description</textarea>
<div class="form-text">Briefly describe what this template is used for.</div>
</div>
<div class="mb-3">
<label class="form-label fw-semibold">Default Customer</label>
<select name="customerId" class="form-select">
<option value="">— Any customer —</option>
@foreach (SelectListItem item in (ViewBag.Customers as IEnumerable<SelectListItem> ?? Enumerable.Empty<SelectListItem>()))
{
if (item.Selected)
{
<option value="@item.Value" selected>@item.Text</option>
}
else
{
<option value="@item.Value">@item.Text</option>
}
}
</select>
<div class="form-text">Pre-selects this customer when creating a job from the template. Optional.</div>
</div>
<div class="mb-3">
<label class="form-label fw-semibold">Special Instructions</label>
<textarea name="specialInstructions" class="form-control" rows="3" maxlength="2000">@Model.SpecialInstructions</textarea>
</div>
<div class="mb-4">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" name="isActive" value="true" id="isActive" @(Model.IsActive ? "checked" : "")>
<label class="form-check-label fw-semibold" for="isActive">Active</label>
</div>
<div class="form-text">Inactive templates won't appear in the "Create from Template" picker.</div>
</div>
<div class="d-flex gap-2">
<button type="submit" class="btn btn-primary">
<i class="bi bi-check-circle me-2"></i>Save Changes
</button>
<a asp-action="Details" asp-route-id="@Model.Id" class="btn btn-outline-secondary">Cancel</a>
</div>
</form>
</div>
</div>
<div class="alert alert-info mt-3">
<i class="bi bi-info-circle me-2"></i>
To update the <strong>items and coatings</strong> on this template, create a new job with the desired configuration and save it as a template.
</div>
</div>
</div>