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,170 @@
@using PowderCoating.Core.Entities
@model IReadOnlyList<PlatformSetting>
@{
ViewData["Title"] = "Platform Settings";
ViewData["PageIcon"] = "bi-gear-wide-connected";
var groups = Model.GroupBy(s => s.GroupName ?? "General").OrderBy(g => g.Key);
}
@section Styles {
<style>
[data-bs-theme="dark"] a.text-dark { color: var(--bs-body-color) !important; }
</style>
}
<div class="mb-4"></div>
@foreach (var group in groups)
{
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-white border-0 py-3">
<h5 class="mb-0 fw-semibold">
<i class="bi bi-sliders me-2 text-primary"></i>@group.Key
</h5>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table mb-0">
<thead>
<tr>
<th class="ps-4" style="width:30%">Setting</th>
<th style="width:45%">Value</th>
<th class="text-end pe-4" style="width:25%">Actions</th>
</tr>
</thead>
<tbody>
@foreach (var s in group)
{
<tr>
<td class="ps-4 align-middle">
<div class="fw-semibold">@(s.Label ?? s.Key)</div>
@if (!string.IsNullOrWhiteSpace(s.Description))
{
<small class="text-muted">@s.Description</small>
}
</td>
<td class="align-middle">
@if (string.IsNullOrWhiteSpace(s.Value))
{
<span class="text-muted fst-italic">Not set</span>
}
else
{
<span>@s.Value</span>
}
</td>
<td class="text-end pe-4 align-middle">
<button class="btn btn-sm btn-outline-primary"
data-bs-toggle="modal"
data-bs-target="#editModal"
data-key="@s.Key"
data-label="@(s.Label ?? s.Key)"
data-value="@s.Value">
<i class="bi bi-pencil me-1"></i>Edit
</button>
</td>
</tr>
}
</tbody>
</table>
</div>
<!-- Mobile card view — shown on screens < 992px -->
<div class="mobile-card-view">
<div class="mobile-card-list">
@foreach (var s in group)
{
<div class="mobile-data-card">
<div class="mobile-card-header">
<div class="mobile-card-icon bg-primary"><i class="bi bi-sliders"></i></div>
<div class="mobile-card-title">
<h6>@(s.Label ?? s.Key)</h6>
@if (!string.IsNullOrWhiteSpace(s.Description))
{
<small>@s.Description</small>
}
</div>
</div>
<div class="mobile-card-body">
<div class="mobile-card-row">
<span class="mobile-card-label">Value</span>
<span class="mobile-card-value">
@if (string.IsNullOrWhiteSpace(s.Value))
{
<span class="text-muted fst-italic">Not set</span>
}
else
{
@s.Value
}
</span>
</div>
<div class="mobile-card-row">
<span class="mobile-card-label">Key</span>
<span class="mobile-card-value text-muted small font-monospace">@s.Key</span>
</div>
</div>
<div class="mobile-card-footer">
<button class="btn btn-sm btn-outline-primary"
data-bs-toggle="modal"
data-bs-target="#editModal"
data-key="@s.Key"
data-label="@(s.Label ?? s.Key)"
data-value="@s.Value">
<i class="bi bi-pencil me-1"></i>Edit
</button>
</div>
</div>
}
</div>
</div>
</div>
</div>
}
@if (!Model.Any())
{
<div class="card border-0 shadow-sm">
<div class="card-body text-center py-5">
<i class="bi bi-sliders fs-1 text-muted opacity-50"></i>
<p class="mt-3 text-muted">No platform settings found. Run a database migration to seed defaults.</p>
</div>
</div>
}
<!-- Edit Modal -->
<div class="modal fade" id="editModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<form asp-action="Save" method="post">
@Html.AntiForgeryToken()
<input type="hidden" id="editKey" name="key" />
<div class="modal-header">
<h5 class="modal-title">Edit Setting: <span id="editLabel"></span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<label class="form-label fw-semibold" for="editValue">Value</label>
<input type="text" class="form-control" id="editValue" name="value" />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">
<i class="bi bi-check-lg me-1"></i>Save
</button>
</div>
</form>
</div>
</div>
</div>
@section Scripts {
<script>
document.getElementById('editModal').addEventListener('show.bs.modal', function (e) {
const btn = e.relatedTarget;
document.getElementById('editKey').value = btn.dataset.key;
document.getElementById('editLabel').textContent = btn.dataset.label;
document.getElementById('editValue').value = btn.dataset.value ?? '';
});
</script>
}