mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
78 lines
4.9 KiB
Plaintext
78 lines
4.9 KiB
Plaintext
@using Orchard.AuditTrail.ViewModels
|
|
@using Orchard.ContentManagement
|
|
@using Orchard.Core.Common.Models
|
|
@using Orchard.Localization.Services
|
|
@model RecycleBinViewModel
|
|
@{
|
|
Style.Include("audittrail-recycle-bin.css");
|
|
Script.Require("ShapesBase");
|
|
Script.Include(("audittrail-recyclebin.js"));
|
|
Layout.Title = T("Audit Trail");
|
|
|
|
var contentItems = Model.ContentItems;
|
|
var dateLocalizationServices = WorkContext.Resolve<IDateLocalizationServices>();
|
|
}
|
|
<div id="recycle-bin">
|
|
@Html.ValidationSummary()
|
|
@using (Html.BeginFormAntiForgeryPost()) {
|
|
<fieldset class="bulk-actions">
|
|
<label>@T("Actions:")</label>
|
|
<select name="RecycleBinCommand">
|
|
<option></option>
|
|
<option value="@RecycleBinCommand.Restore" data-unsafe-action="@T("Are you sure you want to restore the selected items?")" @if(Model.RecycleBinCommand == RecycleBinCommand.Restore){<text>selected="selected"</text>}>@T("Restore")</option>
|
|
@**TODO: Decide wether or not to allow users to permanently delete items. Commented out for now.*@
|
|
@*<option value="@RecycleBinCommand.Destroy" data-unsafe-action="@T("WARNING: This will PERMANENTLY delete the selected content items, including related content part records, never to be seen again. Are you sure you want to do this?")" @if (Model.RecycleBinCommand == RecycleBinCommand.Destroy) { <text> selected="selected" </text> }>@T("Remove Permanently ☠")</option>*@
|
|
</select>
|
|
</fieldset>
|
|
<div class="bulk-actions">
|
|
<button type="submit" class="filter-apply-button" name="ExecuteActionButton" value="ExecuteActionButton">@T("Execute")</button>
|
|
</div>
|
|
<section class="recycle-bin-list-section">
|
|
@if (!contentItems.Any()) {
|
|
<p class="info">@T("There are no records to display.")</p>
|
|
}
|
|
else {
|
|
<table class="items">
|
|
<thead>
|
|
<tr>
|
|
<th class="content-checkbox"><input type="checkbox" class="check-all" /></th>
|
|
<th class="content-column">@T("Content Item")</th>
|
|
<th class="content-removed-column">@T("Removed")</th>
|
|
<th class="actions-column"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@{
|
|
var index = 0;
|
|
foreach (var contentItem in contentItems) {
|
|
var isSelected = Model.SelectedContentItems.Where(x => x.Id == contentItem.Id && x.Selected).Select(x => x.Id).Any();
|
|
var commonPart = contentItem.As<CommonPart>();
|
|
var removedText = commonPart != null ? dateLocalizationServices.ConvertToLocalizedString(commonPart.VersionModifiedUtc) : T("-").Text;
|
|
var contentDisplayTextHtmlString = Html.ItemDisplayText(contentItem);
|
|
var contentDisplayText = contentDisplayTextHtmlString != null ? contentDisplayTextHtmlString.ToString() : contentItem.ContentType;
|
|
var contentDisplayUrl = Url.Action("Detail", "Content", new {id = contentItem.Id, version = contentItem.Version, area = "Orchard.AuditTrail"});
|
|
<tr>
|
|
<td>
|
|
<input type="hidden" name="SelectedContentItems[@index].Id" value="@contentItem.Id" />
|
|
<input type="checkbox" name="SelectedContentItems[@index].Selected" value="true" @if(isSelected){<text>checked="checked"</text>} />
|
|
</td>
|
|
<td class="content-column"><a href="@contentDisplayUrl">@contentDisplayText</a></td>
|
|
<td class="content-removed-column">@removedText</td>
|
|
<td class="actions-column">
|
|
<a href="@contentDisplayUrl">@T("View")</a> @T(" | ")
|
|
@Html.ActionLink(T("View Audit Trail").Text, "Index", "Admin", new {content = contentItem.Id, area = "Orchard.AuditTrail"}, null) @T(" | ")
|
|
<a href="@Url.Action("Restore", "RecycleBin", new {id = contentItem.Id, area = "Orchard.AuditTrail"})" data-unsafe-url="@T("Are you sure you want to restore this item?")">@T("Restore")</a>
|
|
</td>
|
|
</tr>
|
|
index++;
|
|
}
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
</section>
|
|
<section class="pager">
|
|
@Display(Model.Pager)
|
|
</section>
|
|
}
|
|
</div> |