69 lines
3.1 KiB
Plaintext
69 lines
3.1 KiB
Plaintext
@model TightWiki.Models.ViewModels.Admin.OrphanedPageAttachmentsViewModel
|
|
@using TightWiki.Library
|
|
@using TightWiki.Models
|
|
@{
|
|
Layout = "/Views/Shared/_Layout.cshtml";
|
|
var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
|
|
}
|
|
|
|
<h3>
|
|
Orphaned Page Attachments
|
|
</h3>
|
|
|
|
<p>
|
|
These are all of the page attachments that are no longer attached to any page revision.<br /><br />
|
|
</p>
|
|
|
|
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
|
{
|
|
<div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
|
|
}
|
|
@if (!string.IsNullOrEmpty(Model.SuccessMessage))
|
|
{
|
|
<div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
|
|
}
|
|
|
|
@Html.Raw(TightWiki.Library.ConfirmActionHelper.GenerateDangerLink(GlobalConfiguration.BasePath,
|
|
"This will permanently purge all orphaned page attachments. Continue?",
|
|
"Purge Orphaned Attachments", "/Admin/PurgeOrphanedAttachments", Context.Request.Path.Value))
|
|
<br />
|
|
<br />
|
|
|
|
@using (Html.BeginForm(null, null, FormMethod.Get, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" }))
|
|
{
|
|
@if (Model.Files.Count > 0)
|
|
{
|
|
<table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
|
|
<tr>
|
|
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Page")">Page</a></strong></td>
|
|
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "File")">File</a></strong></td>
|
|
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Size")">Size</a></strong></td>
|
|
<td><strong><a href="?@QueryStringConverter.OrderHelper(sessionState, "Revision")">Revision</a></strong></td>
|
|
<td><strong>Action</strong></td>
|
|
</tr>
|
|
|
|
@foreach (var p in Model.Files)
|
|
{
|
|
<tr>
|
|
<td>
|
|
@if (string.IsNullOrEmpty(@p.Namespace) == false)
|
|
{
|
|
<text><a href="@GlobalConfiguration.BasePath/Admin/Namespace/@p.Namespace">@p.Namespace</a> :: </text>
|
|
} <a href="@GlobalConfiguration.BasePath/@p.PageNavigation">@p.PageTitle</a>
|
|
</td>
|
|
<td><a href="@GlobalConfiguration.BasePath/File/Binary/@p.PageNavigation/@p.FileNavigation/@p.FileRevision">@p.FileName</a></td>
|
|
<td>@NTDLS.Helpers.Formatters.FileSize((long)@p.Size)</td>
|
|
<td>@p.FileRevision</td>
|
|
<td>
|
|
@Html.Raw(TightWiki.Library.ConfirmActionHelper.GenerateDangerLink(GlobalConfiguration.BasePath,
|
|
"This will permanently delete the specified attachment. Continue?",
|
|
"Delete", $"/Admin/PurgeOrphanedAttachment/{@p.PageFileId}/{@p.FileRevision}", Context.Request.Path.Value))
|
|
</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
|
|
@Html.Raw(TightWiki.Library.PageSelectorGenerator.Generate(Context.Request.QueryString, Model.PaginationPageCount))
|
|
}
|
|
}
|