Show email and SMS notification status on customer list and details
Added notification preference indicators to both views so staff can see at a glance whether a customer has email/SMS enabled without opening edit mode. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -168,6 +168,8 @@ public class CustomerListDto
|
||||
public decimal CurrentBalance { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public DateTime? LastContactDate { get; set; }
|
||||
public bool NotifyByEmail { get; set; }
|
||||
public bool NotifyBySms { get; set; }
|
||||
}
|
||||
|
||||
public class AddCreditDto
|
||||
|
||||
@@ -132,6 +132,35 @@
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="text-muted small mb-1">Notifications</label>
|
||||
<div class="d-flex gap-2">
|
||||
@if (Model.NotifyByEmail)
|
||||
{
|
||||
<span class="badge bg-success bg-opacity-10 text-success border border-success border-opacity-25">
|
||||
<i class="bi bi-envelope-fill me-1"></i>Email on
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="badge bg-secondary bg-opacity-10 text-secondary border border-secondary border-opacity-25">
|
||||
<i class="bi bi-envelope-slash me-1"></i>Email off
|
||||
</span>
|
||||
}
|
||||
@if (Model.NotifyBySms)
|
||||
{
|
||||
<span class="badge bg-success bg-opacity-10 text-success border border-success border-opacity-25">
|
||||
<i class="bi bi-chat-fill me-1"></i>SMS on
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="badge bg-secondary bg-opacity-10 text-secondary border border-secondary border-opacity-25">
|
||||
<i class="bi bi-chat-slash me-1"></i>SMS off
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
<th>Type</th>
|
||||
<th sortable="CurrentBalance" current-sort="@ViewBag.SortColumn" current-direction="@ViewBag.SortDirection">Balance</th>
|
||||
<th sortable="IsActive" current-sort="@ViewBag.SortColumn" current-direction="@ViewBag.SortDirection">Status</th>
|
||||
<th>Notifications</th>
|
||||
<th class="text-end pe-4">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -152,6 +153,14 @@
|
||||
<td>
|
||||
@await Html.PartialAsync("_StatusChip", (Kind: StatusChipHelper.Active(customer.IsActive), Text: customer.IsActive ? "Active" : "Inactive"))
|
||||
</td>
|
||||
<td>
|
||||
<span title="@(customer.NotifyByEmail ? "Email notifications on" : "Email notifications off")">
|
||||
<i class="bi @(customer.NotifyByEmail ? "bi-envelope-fill text-success" : "bi-envelope-slash text-secondary opacity-50")"></i>
|
||||
</span>
|
||||
<span class="ms-2" title="@(customer.NotifyBySms ? "SMS notifications on" : "SMS notifications off")">
|
||||
<i class="bi @(customer.NotifyBySms ? "bi-chat-fill text-success" : "bi-chat-slash text-secondary opacity-50")"></i>
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-end pe-4">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a asp-action="Details" asp-route-id="@customer.Id" class="btn btn-outline-primary" title="View Details">
|
||||
|
||||
Reference in New Issue
Block a user