Initial commit

This commit is contained in:
2026-04-23 21:38:24 -04:00
commit 63e12a9636
1762 changed files with 1672620 additions and 0 deletions
@@ -0,0 +1,102 @@
@model List<PowderCoating.Core.Entities.JobTemplate>
@{
ViewData["Title"] = "Job Templates";
ViewData["PageIcon"] = "bi-layout-text-window-reverse";
}
<div class="d-flex justify-content-end align-items-center mb-4">
<a asp-controller="Jobs" asp-action="Index" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left me-2"></i>Back to Jobs
</a>
</div>
@if (TempData["Success"] != null)
{
<div class="alert alert-success alert-dismissible fade show">
<i class="bi bi-check-circle me-2"></i>@TempData["Success"]
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
}
@if (!Model.Any())
{
<div class="card border-0 shadow-sm">
<div class="card-body text-center py-5">
<i class="bi bi-layout-text-window-reverse text-muted" style="font-size:3rem"></i>
<h5 class="mt-3 text-muted">No Templates Yet</h5>
<p class="text-muted mb-4">Save a job as a template from the Job Details page to get started.</p>
<a asp-controller="Jobs" asp-action="Index" class="btn btn-primary">
<i class="bi bi-briefcase me-2"></i>Go to Jobs
</a>
</div>
</div>
}
else
{
<div class="row g-3">
@foreach (var template in Model)
{
var itemCount = template.Items.Count(i => !i.IsDeleted);
<div class="col-md-6 col-xl-4">
<div class="card border-0 shadow-sm h-100 @(template.IsActive ? "" : "opacity-50")">
<div class="card-body">
<div class="d-flex justify-content-between align-items-start mb-2">
<h6 class="fw-bold mb-0">@template.Name</h6>
@if (!template.IsActive)
{
<span class="badge bg-secondary">Inactive</span>
}
else
{
<span class="badge bg-success-subtle text-success border border-success-subtle">Active</span>
}
</div>
@if (!string.IsNullOrEmpty(template.Description))
{
<p class="text-muted small mb-2">@template.Description</p>
}
<div class="d-flex flex-wrap gap-2 mb-3">
@if (template.Customer != null)
{
<span class="badge bg-light text-dark border">
<i class="bi bi-building me-1"></i>
@(template.Customer.CompanyName ?? $"{template.Customer.ContactFirstName} {template.Customer.ContactLastName}".Trim())
</span>
}
<span class="badge bg-light text-dark border">
<i class="bi bi-stack me-1"></i>@itemCount item@(itemCount != 1 ? "s" : "")
</span>
@if (template.UsageCount > 0)
{
<span class="badge bg-light text-dark border" title="Times used to create a job">
<i class="bi bi-arrow-repeat me-1"></i>Used @template.UsageCount×
</span>
}
</div>
<div class="d-flex gap-2">
<a asp-action="Details" asp-route-id="@template.Id" class="btn btn-sm btn-outline-primary flex-fill">
<i class="bi bi-eye me-1"></i>View
</a>
<a asp-action="Edit" asp-route-id="@template.Id" class="btn btn-sm btn-outline-secondary">
<i class="bi bi-pencil"></i>
</a>
<form asp-action="Delete" asp-route-id="@template.Id" method="post" class="d-inline"
onsubmit="return confirm('Delete template \'@template.Name\'?')">
@Html.AntiForgeryToken()
<button type="submit" class="btn btn-sm btn-outline-danger">
<i class="bi bi-trash"></i>
</button>
</form>
</div>
</div>
<div class="card-footer bg-transparent border-0 pt-0 pb-3 px-3">
<small class="text-muted">Created @template.CreatedAt.ToString("MMM d, yyyy")</small>
</div>
</div>
</div>
}
</div>
}