91 lines
3.9 KiB
Plaintext
91 lines
3.9 KiB
Plaintext
@model PrivateMessageListModel
|
|
<div class="private-messages-box">
|
|
<script asp-location="Footer">
|
|
$(function() {
|
|
|
|
$('#selectall-sent').on('click', function () {
|
|
$('#pm-sent-table .rowcheckbox').prop('checked', $(this).is(':checked')).trigger('change');
|
|
});
|
|
|
|
$('#pm-sent-table .rowcheckbox').on('change', function (e) {
|
|
var numChkBoxes = $('#pm-sent-table .rowcheckbox').length;
|
|
var numChkBoxesChecked = $('#pm-sent-table .rowcheckbox:checked').length;
|
|
$('#selectall-sent').prop('checked', numChkBoxes == numChkBoxesChecked && numChkBoxes > 0);
|
|
});
|
|
});
|
|
</script>
|
|
@if (Model.Messages.Count > 0)
|
|
{
|
|
<form asp-route="PrivateMessagesSent" method="post">
|
|
<div class="table-wrapper">
|
|
<table class="data-table" id="pm-sent-table">
|
|
<colgroup>
|
|
<col width="1" />
|
|
<col />
|
|
<col />
|
|
<col width="1" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th class="select">
|
|
<input type="checkbox" id="selectall-sent" />
|
|
</th>
|
|
<th class="to">
|
|
@T("PrivateMessages.Inbox.ToColumn")
|
|
</th>
|
|
<th class="subject">
|
|
@T("PrivateMessages.Inbox.SubjectColumn")
|
|
</th>
|
|
<th class="date">
|
|
@T("PrivateMessages.Inbox.DateColumn")
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@for (var i = 0; i < Model.Messages.Count; i++)
|
|
{
|
|
var item = Model.Messages[i];
|
|
<tr @(i % 2 == 0 ? Html.Raw(" class=\"odd\"") : Html.Raw(" class=\"even\""))>
|
|
<td class="select">
|
|
<input type="checkbox" name="si@(item.Id)" class="rowcheckbox" />
|
|
</td>
|
|
<td class="to">
|
|
@if (item.AllowViewingToProfile)
|
|
{
|
|
@Html.RouteLink(item.CustomerToName, "CustomerProfile", new { Id = item.ToCustomerId })
|
|
}
|
|
else
|
|
{
|
|
@item.CustomerToName
|
|
}
|
|
</td>
|
|
<td class="subject">
|
|
@Html.RouteLink(item.Subject, "ViewPM", new { privateMessageId = item.Id }, new { @class = "pm-read" })
|
|
</td>
|
|
<td class="date">
|
|
@item.CreatedOn
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@{
|
|
var pager = await Html.PagerAsync(Model.PagerModel);
|
|
}
|
|
@if (!string.IsNullOrEmpty(await pager.RenderHtmlContentAsync()))
|
|
{
|
|
<div class="pager">
|
|
@pager
|
|
</div>
|
|
}
|
|
<div class="buttons">
|
|
<button type="submit" name="delete-sent" class="button-1 delete-selected-pm-button">@T("PrivateMessages.Inbox.DeleteSelected")</button>
|
|
</div>
|
|
</form>
|
|
}
|
|
else
|
|
{
|
|
<div class="no-items">@T("PrivateMessages.Sent.NoItems")</div>
|
|
}
|
|
</div> |