2012-03-02 05:02:42 +00:00
|
|
|
@model NzbDrone.Web.Models.UpcomingEpisodesModel
|
2011-12-10 05:05:17 +00:00
|
|
|
@{ViewBag.Title = "Upcoming";}
|
2011-12-09 04:57:23 +00:00
|
|
|
@section HeaderContent
|
|
|
|
{
|
2012-02-22 16:12:12 +00:00
|
|
|
<style>
|
2012-02-25 19:41:48 +00:00
|
|
|
.gridControls
|
|
|
|
{
|
2012-02-22 16:12:12 +00:00
|
|
|
float: right;
|
2012-02-25 19:41:48 +00:00
|
|
|
padding-top: 10px;
|
2012-02-22 19:52:31 +00:00
|
|
|
visibility: hidden;
|
2012-02-22 16:12:12 +00:00
|
|
|
}
|
2012-02-25 19:41:48 +00:00
|
|
|
|
|
|
|
.sub-menu
|
|
|
|
{
|
|
|
|
float: left;
|
|
|
|
}
|
2012-02-22 16:12:12 +00:00
|
|
|
</style>
|
2011-12-09 04:57:23 +00:00
|
|
|
}
|
2011-04-21 06:18:28 +00:00
|
|
|
@section ActionMenu{
|
2011-12-01 05:25:01 +00:00
|
|
|
<ul class="sub-menu">
|
2012-03-13 21:04:42 +00:00
|
|
|
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null, null, new { Title = "Check for newly released downloads" })</li>
|
2011-08-06 02:04:35 +00:00
|
|
|
</ul>
|
2011-04-21 06:18:28 +00:00
|
|
|
}
|
2012-02-22 16:12:12 +00:00
|
|
|
<div class="gridControls">
|
2012-02-22 19:52:31 +00:00
|
|
|
@Html.CheckBox("showDownloaded", true)
|
2012-02-25 19:41:48 +00:00
|
|
|
<label for="showDownloaded">
|
|
|
|
Show Downloaded</label>
|
2012-02-22 16:12:12 +00:00
|
|
|
</div>
|
2012-02-07 01:22:17 +00:00
|
|
|
<table class="seriesTable">
|
|
|
|
<colgroup>
|
2012-02-25 19:41:48 +00:00
|
|
|
<col />
|
|
|
|
<col style="width: 90px" />
|
|
|
|
<col style="width: 300px" />
|
|
|
|
<col style="width: 160px" />
|
|
|
|
<col style="width: 100px" />
|
2012-02-07 01:22:17 +00:00
|
|
|
</colgroup>
|
2012-02-07 22:28:53 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2012-02-25 19:41:48 +00:00
|
|
|
<th>
|
|
|
|
Series Title
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Episode
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Episode Title
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Air Time
|
|
|
|
</th>
|
2012-02-07 22:28:53 +00:00
|
|
|
@*Commands/Status Column*@
|
|
|
|
<th>
|
|
|
|
Status
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr class="title-row">
|
|
|
|
<td colspan="6">
|
|
|
|
Yesterday
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@for (int i = 0; i < Model.Yesterday.Count; i++)
|
2012-02-07 01:22:17 +00:00
|
|
|
{
|
2012-02-07 22:28:53 +00:00
|
|
|
var episode = Model.Yesterday[i];
|
2012-02-25 19:41:48 +00:00
|
|
|
|
2012-02-07 22:28:53 +00:00
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode);
|
|
|
|
}
|
2012-01-30 06:14:46 +00:00
|
|
|
|
2012-02-07 22:28:53 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
2012-02-07 01:22:17 +00:00
|
|
|
}
|
2012-02-07 22:28:53 +00:00
|
|
|
<tr class="title-row">
|
|
|
|
<td colspan="6">
|
|
|
|
Today
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@for (int i = 0; i < Model.Today.Count; i++)
|
2012-02-07 01:22:17 +00:00
|
|
|
{
|
2012-02-07 22:28:53 +00:00
|
|
|
var episode = Model.Today[i];
|
2012-02-25 19:41:48 +00:00
|
|
|
|
2012-02-07 22:28:53 +00:00
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode);
|
|
|
|
}
|
2012-02-07 01:22:17 +00:00
|
|
|
|
2012-02-07 22:28:53 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
2012-02-07 01:22:17 +00:00
|
|
|
}
|
2012-02-07 22:28:53 +00:00
|
|
|
<tr class="title-row">
|
|
|
|
<td colspan="6">
|
|
|
|
Tomorrow
|
|
|
|
</td>
|
2012-02-25 19:41:48 +00:00
|
|
|
@for (int i = 0; i < Model.Tomorrow.Count; i++)
|
2012-02-07 22:28:53 +00:00
|
|
|
{
|
2012-02-25 19:41:48 +00:00
|
|
|
var episode = Model.Tomorrow[i];
|
2012-02-07 01:22:17 +00:00
|
|
|
|
2012-02-25 19:41:48 +00:00
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
2012-02-07 22:28:53 +00:00
|
|
|
}
|
2012-02-25 19:41:48 +00:00
|
|
|
<tr class="title-row">
|
|
|
|
<td colspan="6">
|
2012-05-18 01:14:44 +00:00
|
|
|
@DateTime.Today.AddDays(2).DayOfWeek
|
2012-02-25 19:41:48 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2012-05-18 01:14:44 +00:00
|
|
|
@for (int i = 0; i < Model.TwoDays.Count; i++)
|
|
|
|
{
|
|
|
|
var episode = Model.TwoDays[i];
|
2012-02-25 19:41:48 +00:00
|
|
|
|
2012-05-18 01:14:44 +00:00
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<tr class="title-row">
|
|
|
|
<td colspan="6">
|
|
|
|
@DateTime.Today.AddDays(3).DayOfWeek
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@for (int i = 0; i < Model.ThreeDays.Count; i++)
|
2012-02-07 22:28:53 +00:00
|
|
|
{
|
2012-05-18 01:14:44 +00:00
|
|
|
var episode = Model.ThreeDays[i];
|
|
|
|
|
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
2012-02-07 22:28:53 +00:00
|
|
|
}
|
2012-05-18 01:14:44 +00:00
|
|
|
<tr class="title-row">
|
|
|
|
<td colspan="6">
|
|
|
|
@DateTime.Today.AddDays(4).DayOfWeek
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@for (int i = 0; i < Model.FourDays.Count; i++)
|
|
|
|
{
|
|
|
|
var episode = Model.FourDays[i];
|
2012-02-07 01:22:17 +00:00
|
|
|
|
2012-05-18 01:14:44 +00:00
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<tr class="title-row">
|
|
|
|
<td colspan="6">
|
|
|
|
@DateTime.Today.AddDays(5).DayOfWeek
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@for (int i = 0; i < Model.FiveDays.Count; i++)
|
2012-02-07 22:28:53 +00:00
|
|
|
{
|
2012-05-18 01:14:44 +00:00
|
|
|
var episode = Model.FiveDays[i];
|
|
|
|
|
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<tr class="title-row">
|
|
|
|
<td colspan="6">
|
|
|
|
@DateTime.Today.AddDays(6).DayOfWeek
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@for (int i = 0; i < Model.SixDays.Count; i++)
|
|
|
|
{
|
|
|
|
var episode = Model.SixDays[i];
|
|
|
|
|
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<tr class="title-row">
|
|
|
|
<td colspan="6">
|
|
|
|
Later
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@for (int i = 0; i < Model.Later.Count; i++)
|
|
|
|
{
|
|
|
|
var episode = Model.Later[i];
|
|
|
|
|
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
|
|
|
|
}
|
2012-02-07 22:28:53 +00:00
|
|
|
}
|
|
|
|
</tbody>
|
2012-02-07 01:22:17 +00:00
|
|
|
</table>
|
|
|
|
@section Scripts{
|
2012-02-22 16:12:12 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
2012-02-22 19:52:31 +00:00
|
|
|
var cookieValue = $.cookie("showDownloaded");
|
2012-02-22 16:12:12 +00:00
|
|
|
|
2012-02-22 19:52:31 +00:00
|
|
|
if (cookieValue == "false") {
|
|
|
|
$('#showDownloaded').attr('checked', false);
|
|
|
|
toggleDownloaded(false);
|
2012-02-22 16:12:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
2012-02-22 19:52:31 +00:00
|
|
|
$('#showDownloaded').attr('checked', true);
|
|
|
|
toggleDownloaded(true);
|
2012-02-22 16:12:12 +00:00
|
|
|
}
|
2012-02-22 19:52:31 +00:00
|
|
|
|
|
|
|
$('#showDownloaded').button();
|
|
|
|
$('.gridControls').css('visibility', 'visible');
|
2012-02-22 16:12:12 +00:00
|
|
|
});
|
2012-02-07 01:22:17 +00:00
|
|
|
|
2012-02-22 19:52:31 +00:00
|
|
|
$('#showDownloaded').on('change', function () {
|
2012-02-22 16:12:12 +00:00
|
|
|
var checked = $(this).attr('checked');
|
|
|
|
toggleDownloaded(checked);
|
|
|
|
toggleHideDownloadedCookie(checked);
|
|
|
|
});
|
|
|
|
|
2012-02-22 19:52:31 +00:00
|
|
|
function toggleDownloaded(show) {
|
2012-02-22 16:37:44 +00:00
|
|
|
var ready = $('.statusImage[title="Ready"]');
|
2012-02-22 16:12:12 +00:00
|
|
|
|
|
|
|
ready.each(function () {
|
2012-02-22 19:52:31 +00:00
|
|
|
if (show) {
|
|
|
|
$(this).parents('tr').show();
|
2012-02-22 16:12:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
2012-02-22 19:52:31 +00:00
|
|
|
$(this).parents('tr').hide();
|
2012-02-22 16:12:12 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2012-02-22 19:52:31 +00:00
|
|
|
function toggleHideDownloadedCookie(show) {
|
|
|
|
if (show)
|
|
|
|
$.cookie("showDownloaded", true, { expires: 365 });
|
2012-02-25 19:41:48 +00:00
|
|
|
|
2012-02-22 16:12:12 +00:00
|
|
|
else
|
2012-02-22 19:52:31 +00:00
|
|
|
$.cookie("showDownloaded", false, { expires: 365 });
|
2012-02-22 16:12:12 +00:00
|
|
|
}
|
|
|
|
</script>
|
2012-02-25 19:41:48 +00:00
|
|
|
}
|