2012-02-10 08:11:56 +01:00
|
|
|
@model string
|
2011-06-08 08:15:35 +02:00
|
|
|
@using NzbDrone.Web.Models
|
2011-12-10 06:05:17 +01:00
|
|
|
@{ViewBag.Title = "Pending Processing";}
|
2012-02-10 08:11:56 +01:00
|
|
|
|
2011-12-01 06:25:01 +01:00
|
|
|
<div class="grid-container">
|
2012-02-10 08:11:56 +01:00
|
|
|
<table id="pendingProcessingGrid" class="dataTablesGrid hidden-grid">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Creation Date</th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2011-12-01 06:25:01 +01:00
|
|
|
</div>
|
2011-06-08 08:15:35 +02:00
|
|
|
|
2012-02-10 08:11:56 +01:00
|
|
|
@section Scripts
|
|
|
|
{
|
|
|
|
<script type="text/javascript">
|
|
|
|
var renamePendingUrl = '@Url.Action("RenamePendingProcessing", "System")';
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#pendingProcessingGrid').removeClass('hidden-grid');
|
|
|
|
|
|
|
|
oTable = $('.dataTablesGrid').dataTable({
|
|
|
|
"bShowAll": false,
|
|
|
|
"aaData": @Html.Raw(Model),
|
|
|
|
"bPaginate": false,
|
|
|
|
"bLengthChange": false,
|
|
|
|
"bFilter": false,
|
|
|
|
"bSort": false,
|
|
|
|
"bInfo": false,
|
|
|
|
"bAutoWidth": false,
|
|
|
|
"iDisplayLength": 20,
|
|
|
|
"sPaginationType": "four_button",
|
|
|
|
"aoColumns": [
|
|
|
|
{ sWidth: 'auto', "mDataProp": "Name"}, //Name
|
|
|
|
{ sWidth: '250px', "mDataProp": "Created"}, //CreationDate
|
|
|
|
{ sWidth: '40px', "mDataProp": "Actions", "bSortable": false, "fnRender": function (row) {
|
|
|
|
return "<a href='#Rename' onClick=\"renamePending('" + row.aData["Path"] + "'); return false;\">Rename</a>";
|
|
|
|
}
|
|
|
|
}, //Actions
|
|
|
|
{
|
|
|
|
sWidth: 'auto',
|
|
|
|
"mDataProp": "Details",
|
|
|
|
"bSortable": false,
|
|
|
|
"bVisible": false,
|
|
|
|
"fnRender": function(row) {
|
|
|
|
var result = "<div>" + row.aData["Files"] + "</div>";
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
} //Details
|
|
|
|
]
|
|
|
|
});
|
2011-06-08 08:15:35 +02:00
|
|
|
});
|
2012-02-10 08:11:56 +01:00
|
|
|
|
|
|
|
function renamePending(path) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: renamePendingUrl,
|
|
|
|
data: jQuery.param({ path: path }),
|
|
|
|
error: function (req, status, error) {
|
|
|
|
alert("Sorry! We could rename " + name + " at this time. " + error);
|
|
|
|
},
|
|
|
|
success: function (data, textStatus, jqXHR) {
|
|
|
|
if (data == "ok") {
|
|
|
|
var grid = $('#PendingProcessingGrid').data('tGrid');
|
|
|
|
grid.ajaxRequest();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
}
|