2011-12-12 22:52:29 +01:00
|
|
|
@using NzbDrone.Web.Helpers
|
2011-05-10 08:32:33 +02:00
|
|
|
@using NzbDrone.Web.Models;
|
|
|
|
@model IEnumerable<NzbDrone.Core.Repository.Series>
|
2011-12-10 06:05:17 +01:00
|
|
|
@{ViewBag.Title = "NzbDrone";}
|
2011-12-12 22:52:29 +01:00
|
|
|
|
|
|
|
@section HeaderContent
|
|
|
|
{
|
|
|
|
@Html.IncludeCss("Settings.css")
|
|
|
|
}
|
2011-06-02 05:36:30 +02:00
|
|
|
<style>
|
2011-06-25 03:20:52 +02:00
|
|
|
/* progress bar container */
|
|
|
|
.progressbar
|
|
|
|
{
|
|
|
|
border: 1px solid #065EFE;
|
|
|
|
width: 125px;
|
|
|
|
height: 20px;
|
|
|
|
position: relative;
|
|
|
|
color: black;
|
|
|
|
}
|
2011-06-02 06:40:06 +02:00
|
|
|
|
2011-06-25 03:20:52 +02:00
|
|
|
|
|
|
|
/* color bar */
|
|
|
|
.progressbar div.progress
|
|
|
|
{
|
|
|
|
position: absolute;
|
|
|
|
width: 0;
|
|
|
|
height: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
background-color: #065EFE;
|
|
|
|
}
|
|
|
|
/* text on bar */
|
|
|
|
.progressbar div.progress .progressText
|
|
|
|
{
|
|
|
|
position: absolute;
|
|
|
|
text-align: center;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
/* text off bar */
|
|
|
|
.progressbar div.progressText
|
|
|
|
{
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
text-align: center;
|
|
|
|
}
|
2011-07-03 21:02:33 +02:00
|
|
|
|
|
|
|
.t-grid .t-alt
|
|
|
|
{
|
|
|
|
background: #E5ECF9;
|
|
|
|
}
|
2011-06-02 05:36:30 +02:00
|
|
|
</style>
|
2011-04-21 09:14:47 +02:00
|
|
|
@section ActionMenu{
|
2011-08-22 04:56:04 +02:00
|
|
|
<ul class="sub-menu">
|
2011-08-06 04:04:35 +02:00
|
|
|
<li>@Html.ActionLink("Add Series", "Index", "AddSeries")</li>
|
|
|
|
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null)</li>
|
|
|
|
</ul>
|
2011-04-21 09:14:47 +02:00
|
|
|
}
|
2011-12-04 00:44:48 +01:00
|
|
|
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
|
|
|
|
.DataKeys(keys => keys.Add(p => p.SeriesId))
|
2011-05-19 05:37:26 +02:00
|
|
|
.DataBinding(data => data.Ajax()
|
|
|
|
.Select("_AjaxSeriesGrid", "Series")
|
|
|
|
.Update("_SaveAjaxSeriesEditing", "Series")
|
|
|
|
.Delete("_DeleteAjaxSeriesEditing", "Series"))
|
|
|
|
.Columns(columns =>
|
|
|
|
{
|
|
|
|
columns.Bound(o => o.Title)
|
|
|
|
.ClientTemplate("<a href=" +
|
2011-06-25 03:20:52 +02:00
|
|
|
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
|
2011-05-19 05:37:26 +02:00
|
|
|
"><#= Title #></a>");
|
2011-06-05 07:23:50 +02:00
|
|
|
columns.Bound(o => o.SeasonsCount).Title("Seasons");
|
2011-05-19 05:37:26 +02:00
|
|
|
columns.Bound(o => o.QualityProfileName).Title("Quality");
|
|
|
|
columns.Bound(o => o.Status);
|
2011-09-28 19:56:30 +02:00
|
|
|
//columns.Bound(o => o.AirsDayOfWeek);
|
|
|
|
columns.Bound(o => o.NextAiring);
|
2011-06-02 05:36:30 +02:00
|
|
|
columns.Bound(o => o.Episodes).Title("Episodes").Width(125)
|
|
|
|
.ClientTemplate("<div id=\"progressbar_<#= SeriesId #>\" class=\"progressbar\">" +
|
2011-06-25 03:20:52 +02:00
|
|
|
"<div class=\"progressText\"></div>" +
|
2011-06-02 05:36:30 +02:00
|
|
|
"<div class=\"progress\">" +
|
|
|
|
"<span class=\"progressText\" style=\"width: 125px;\"></span>" +
|
|
|
|
"</div>" +
|
|
|
|
"</div>");
|
2011-06-29 06:51:30 +02:00
|
|
|
columns.Command(commands =>
|
|
|
|
{
|
|
|
|
commands.Edit().ButtonType(GridButtonType.Image);
|
|
|
|
commands.Delete().ButtonType(GridButtonType.Image);
|
2011-11-24 01:39:21 +01:00
|
|
|
}).Title("Actions").Width(90);
|
2011-06-28 03:23:22 +02:00
|
|
|
|
2011-05-19 05:37:26 +02:00
|
|
|
})
|
|
|
|
.Editable(editor => editor.Mode(GridEditMode.PopUp))
|
2011-09-28 19:56:30 +02:00
|
|
|
.DetailView(detailView => detailView.ClientTemplate(
|
|
|
|
"<b>Airs Day of Week:</b> " + "<#= AirsDayOfWeek #>" +
|
|
|
|
"<br />" +
|
|
|
|
"<b>Overview:</b> " +
|
|
|
|
"<#= Overview #>"
|
|
|
|
))
|
2011-06-25 03:20:52 +02:00
|
|
|
.ClientEvents(clientEvents =>
|
|
|
|
{
|
|
|
|
clientEvents.OnEdit("grid_edit");
|
|
|
|
clientEvents.OnSave("grid_save");
|
|
|
|
clientEvents.OnRowDataBound("grid_rowBound");
|
|
|
|
})
|
2011-05-19 05:37:26 +02:00
|
|
|
.Render();}
|
2011-06-28 03:23:22 +02:00
|
|
|
@section Scripts{
|
|
|
|
<script type="text/javascript">
|
|
|
|
var windowElement;
|
2011-06-30 08:15:06 +02:00
|
|
|
|
2011-06-28 03:23:22 +02:00
|
|
|
function grid_edit(args) {
|
|
|
|
$(args.form)
|
2011-06-02 05:36:30 +02:00
|
|
|
.closest(".t-window")
|
|
|
|
.data("tWindow")
|
|
|
|
.center();
|
2011-06-28 03:23:22 +02:00
|
|
|
}
|
2011-06-05 08:56:05 +02:00
|
|
|
|
2011-06-28 03:23:22 +02:00
|
|
|
function grid_save(e) {
|
|
|
|
$('#ajaxSaveWheel').show();
|
|
|
|
}
|
2011-06-02 05:36:30 +02:00
|
|
|
|
2011-06-28 03:23:22 +02:00
|
|
|
function grid_rowBound(e) {
|
|
|
|
var dataItem = e.dataItem;
|
|
|
|
var seriesId = dataItem.SeriesId;
|
|
|
|
var episodeCount = dataItem.EpisodeCount;
|
|
|
|
var episodeFileCount = dataItem.EpisodeFileCount;
|
2011-06-02 09:23:38 +02:00
|
|
|
|
2011-06-28 03:23:22 +02:00
|
|
|
$("#progressbar_" + seriesId).episodeProgress(episodeFileCount, episodeCount);
|
|
|
|
}
|
2011-12-01 06:25:01 +01:00
|
|
|
|
2011-06-28 03:23:22 +02:00
|
|
|
(function ($) {
|
|
|
|
$.fn.episodeProgress = function (episodes, totalEpisodes) {
|
|
|
|
return this.each(
|
2011-06-23 08:56:17 +02:00
|
|
|
function () {
|
|
|
|
var div = $(this);
|
|
|
|
var progressBar = div.find(".progress");
|
|
|
|
|
|
|
|
var width = Math.round(episodes / totalEpisodes * 100);
|
|
|
|
|
|
|
|
progressBar.css("width", width + "%");
|
|
|
|
div.find(".progressText").html(episodes + " / " + totalEpisodes);
|
|
|
|
});
|
2011-06-28 03:23:22 +02:00
|
|
|
};
|
|
|
|
})(jQuery);
|
|
|
|
</script>
|
|
|
|
}
|