Initial commit
This commit is contained in:
@@ -0,0 +1,175 @@
|
||||
@using PowderCoating.Web.Controllers
|
||||
@model ContactViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Contact Us";
|
||||
ViewData["PageIcon"] = "bi-envelope";
|
||||
}
|
||||
|
||||
<div class="d-flex align-items-center gap-2 mb-4">
|
||||
<h1 class="h3 mb-0"><i class="bi bi-envelope text-primary me-2"></i>Contact Us</h1>
|
||||
</div>
|
||||
|
||||
@if (TempData["Success"] != null)
|
||||
{
|
||||
<div class="alert alert-success alert-permanent alert-dismissible fade show mb-4" role="alert">
|
||||
<i class="bi bi-check-circle me-2"></i>@TempData["Success"]
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
}
|
||||
@if (TempData["Error"] != null)
|
||||
{
|
||||
<div class="alert alert-danger alert-permanent alert-dismissible fade show mb-4" role="alert">
|
||||
<i class="bi bi-exclamation-triangle me-2"></i>@TempData["Error"]
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="row g-4">
|
||||
|
||||
@* ── Left column: Resources ── *@
|
||||
<div class="col-lg-4">
|
||||
|
||||
<h2 class="h6 fw-semibold text-muted text-uppercase mb-3" style="letter-spacing:.05em;font-size:.7rem;">
|
||||
Self-Service Resources
|
||||
</h2>
|
||||
|
||||
@* Help Center *@
|
||||
<a asp-controller="Help" asp-action="Index" class="card border-0 shadow-sm mb-3 text-decoration-none text-reset d-block">
|
||||
<div class="card-body d-flex align-items-center gap-3 py-3">
|
||||
<div class="rounded-3 bg-primary bg-opacity-10 p-2 flex-shrink-0">
|
||||
<i class="bi bi-book-half text-primary fs-4"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="fw-semibold">Help Center</div>
|
||||
<div class="text-muted small">Step-by-step articles for every part of the system.</div>
|
||||
</div>
|
||||
<i class="bi bi-arrow-right ms-auto text-muted"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@* AI Assistant *@
|
||||
<div class="card border-0 shadow-sm mb-3">
|
||||
<div class="card-body d-flex align-items-center gap-3 py-3">
|
||||
<div class="rounded-3 bg-success bg-opacity-10 p-2 flex-shrink-0">
|
||||
<i class="bi bi-robot text-success fs-4"></i>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<div class="fw-semibold">AI Assistant</div>
|
||||
<div class="text-muted small">Ask anything — available 24/7 in the bottom-right corner.</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-outline-success flex-shrink-0"
|
||||
onclick="document.getElementById('aiHelpTrigger')?.click()">
|
||||
Ask Now
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Facebook Community *@
|
||||
<a href="https://www.facebook.com/share/g/19CtDWf61N/" target="_blank" rel="noopener noreferrer"
|
||||
class="card border-0 shadow-sm mb-3 text-decoration-none text-reset d-block">
|
||||
<div class="card-body d-flex align-items-center gap-3 py-3">
|
||||
<div class="rounded-3 p-2 flex-shrink-0" style="background:rgba(24,119,242,.1);">
|
||||
<i class="bi bi-facebook fs-4" style="color:#1877F2;"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="fw-semibold">Community Group</div>
|
||||
<div class="text-muted small">Connect with other users, share tips, and get peer support.</div>
|
||||
</div>
|
||||
<i class="bi bi-box-arrow-up-right ms-auto text-muted small"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="card border-0 bg-body-secondary rounded-3 p-3 mt-2">
|
||||
<p class="small text-muted mb-1">
|
||||
<i class="bi bi-clock me-1"></i><strong>Response time:</strong> We typically reply within 1 business day.
|
||||
</p>
|
||||
<p class="small text-muted mb-0">
|
||||
<i class="bi bi-envelope me-1"></i>You can also email us directly at
|
||||
<a href="mailto:support@powdercoatinglogix.com">support@powdercoatinglogix.com</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@* ── Right column: Contact form ── *@
|
||||
<div class="col-lg-8">
|
||||
|
||||
<h2 class="h6 fw-semibold text-muted text-uppercase mb-3" style="letter-spacing:.05em;font-size:.7rem;">
|
||||
Send Us a Message
|
||||
</h2>
|
||||
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-body p-4">
|
||||
<form asp-action="Submit" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Form.Name" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Form.Name" class="form-control" />
|
||||
<span asp-validation-for="Form.Name" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Form.Email" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Form.Email" class="form-control" type="email" />
|
||||
<span asp-validation-for="Form.Email" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Form.CompanyName" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Form.CompanyName" class="form-control" />
|
||||
<span asp-validation-for="Form.CompanyName" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label asp-for="Form.Category" class="form-label fw-semibold"></label>
|
||||
<select asp-for="Form.Category" class="form-select">
|
||||
<option value="">— Select a Category —</option>
|
||||
@foreach (var cat in ContactFormModel.Categories)
|
||||
{
|
||||
<option value="@cat" selected="@(Model.Form.Category == cat)">@cat</option>
|
||||
}
|
||||
</select>
|
||||
<span asp-validation-for="Form.Category" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label asp-for="Form.Subject" class="form-label fw-semibold"></label>
|
||||
<input asp-for="Form.Subject" class="form-control" placeholder="Brief summary of your question or issue" />
|
||||
<span asp-validation-for="Form.Subject" class="text-danger small"></span>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label asp-for="Form.Message" class="form-label fw-semibold"></label>
|
||||
<textarea asp-for="Form.Message" class="form-control" rows="6"
|
||||
placeholder="Describe your question or issue in detail. The more context you provide, the faster we can help."></textarea>
|
||||
<div class="d-flex justify-content-between">
|
||||
<span asp-validation-for="Form.Message" class="text-danger small"></span>
|
||||
<span class="text-muted small mt-1" id="msgCount">0 / 4000</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<a asp-controller="Help" asp-action="Index" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-book-half me-1"></i>Browse Help First
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-send me-1"></i>Send Message
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
<script>
|
||||
(function () {
|
||||
const ta = document.querySelector('textarea[name="Form.Message"]');
|
||||
const counter = document.getElementById('msgCount');
|
||||
if (!ta || !counter) return;
|
||||
function update() { counter.textContent = ta.value.length + ' / 4000'; }
|
||||
ta.addEventListener('input', update);
|
||||
update();
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
@using PowderCoating.Web.Controllers
|
||||
@model List<PowderCoating.Core.Entities.ContactSubmission>
|
||||
@{
|
||||
ViewData["Title"] = "Contact Submissions";
|
||||
ViewData["PageIcon"] = "bi-envelope";
|
||||
var unread = Model.Count(s => !s.IsRead);
|
||||
}
|
||||
|
||||
<div class="d-flex align-items-center justify-content-between mb-4">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<h1 class="h3 mb-0"><i class="bi bi-envelope text-primary me-2"></i>Contact Submissions</h1>
|
||||
@if (unread > 0)
|
||||
{
|
||||
<span class="badge bg-danger">@unread unread</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (!Model.Any())
|
||||
{
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-body text-center py-5 text-muted">
|
||||
<i class="bi bi-inbox fs-1 mb-3 d-block opacity-25"></i>
|
||||
<p class="mb-0">No contact submissions yet.</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex flex-column gap-3">
|
||||
@foreach (var s in Model)
|
||||
{
|
||||
<div class="card border-0 shadow-sm @(s.IsRead ? "" : "border-start border-4 border-primary")">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-start justify-content-between gap-3 flex-wrap">
|
||||
<div class="flex-grow-1">
|
||||
<div class="d-flex align-items-center gap-2 mb-1 flex-wrap">
|
||||
@if (!s.IsRead)
|
||||
{
|
||||
<span class="badge bg-primary">New</span>
|
||||
}
|
||||
<span class="badge bg-secondary bg-opacity-10 text-secondary border">@s.Category</span>
|
||||
<span class="fw-semibold">@s.Subject</span>
|
||||
</div>
|
||||
<div class="small text-muted mb-2">
|
||||
<i class="bi bi-person me-1"></i>@s.SenderName
|
||||
·
|
||||
<a href="mailto:@s.SenderEmail">@s.SenderEmail</a>
|
||||
·
|
||||
<i class="bi bi-building me-1"></i>@s.CompanyName
|
||||
·
|
||||
<i class="bi bi-clock me-1"></i>@s.CreatedAt.Tz(ViewBag.CompanyTimeZone as string).ToString("MMM d, yyyy h:mm tt")
|
||||
</div>
|
||||
<p class="mb-0" style="white-space:pre-wrap;">@s.Message</p>
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(s.AdminNotes))
|
||||
{
|
||||
<div class="mt-2 p-2 rounded bg-warning bg-opacity-10 border border-warning border-opacity-25 small">
|
||||
<i class="bi bi-pencil me-1 text-warning"></i><strong>Admin note:</strong> @s.AdminNotes
|
||||
</div>
|
||||
}
|
||||
@if (s.IsRead && s.ReadAt.HasValue)
|
||||
{
|
||||
<div class="mt-2 small text-muted">
|
||||
<i class="bi bi-check2 me-1 text-success"></i>
|
||||
Marked read by @(s.ReadByUserName ?? "admin") on @s.ReadAt.Value.Tz(ViewBag.CompanyTimeZone as string).ToString("MMM d, yyyy h:mm tt")
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex-shrink-0">
|
||||
<div class="d-flex gap-2">
|
||||
<a href="mailto:@s.SenderEmail?subject=Re: @Uri.EscapeDataString(s.Subject)"
|
||||
class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-reply me-1"></i>Reply
|
||||
</a>
|
||||
@if (!s.IsRead)
|
||||
{
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary"
|
||||
data-bs-toggle="modal" data-bs-target="#markReadModal-@s.Id">
|
||||
<i class="bi bi-check2 me-1"></i>Mark Read
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Mark Read modal *@
|
||||
@if (!s.IsRead)
|
||||
{
|
||||
<div class="modal fade" id="markReadModal-@s.Id" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form asp-action="MarkRead" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="id" value="@s.Id" />
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Mark as Read</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="text-muted small mb-3">Optionally add an internal note before marking this submission as read.</p>
|
||||
<div class="mb-0">
|
||||
<label class="form-label fw-semibold">Admin Note <span class="text-muted fw-normal">(optional)</span></label>
|
||||
<textarea name="adminNotes" class="form-control" rows="3"
|
||||
placeholder="e.g. Replied via email, escalated to billing, resolved…"></textarea>
|
||||
</div>
|
||||
</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-success">
|
||||
<i class="bi bi-check2 me-1"></i>Mark as Read
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
Reference in New Issue
Block a user