1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Web/Views/Upcoming/Index.cshtml

174 lines
4.5 KiB
Plaintext
Raw Normal View History

@using NzbDrone.Web.Helpers
@model NzbDrone.Web.Models.UpcomingEpisodesModel
@{ViewBag.Title = "Upcoming";}
@section HeaderContent
{
@Html.IncludeCss("Grid.css")
<style>
.gridControls {
float: right;
padding: 0px 5px 25px 0px;
}
</style>
}
@section ActionMenu{
2011-12-01 08:25:01 +03:00
<ul class="sub-menu">
<li>@Ajax.ActionLink("Start RSS Sync", "RssSync", "Command", null, null)</li>
</ul>
}
2011-06-29 07:51:30 +03:00
<div class="gridControls">
@Html.CheckBox("hideDownloaded") Hide Downloaded
</div>
<table class="seriesTable">
<colgroup>
<col/>
2012-02-07 07:16:40 +03:00
<col style="width:90px" />
2012-02-07 07:22:00 +03:00
<col style="width:300px" />
<col style="width:160px" />
<col style="width:100px" />
</colgroup>
<thead>
<tr>
<th>Series Title</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Air Time</th>
@*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++)
{
var episode = Model.Yesterday[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">
Today
</td>
</tr>
@for (int i = 0; i < Model.Today.Count; i++)
{
var episode = Model.Today[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">
Tomorrow
</td>
@for (int i = 0; i < Model.Tomorrow.Count; i++)
{
var episode = Model.Tomorrow[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">
Future Forecast
</td>
</tr>
@for (int i = 0; i < Model.Week.Count; i++)
{
var episode = Model.Week[i];
if (i % 2 == 0)
{
Html.RenderPartial("UpcomingEpisode", episode);
}
else
{
Html.RenderPartial("UpcomingEpisode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
}
}
</tbody>
</table>
@section Scripts{
<script type="text/javascript">
$(document).ready(function () {
var cookieValue = $.cookie("hideDownloaded");
if (cookieValue == "true") {
$('#hideDownloaded').attr('checked', true);
toggleDownloaded(true);
}
else {
$('#hideDownloaded').attr('checked', false);
toggleDownloaded(false);
}
});
$('#hideDownloaded').on('change', function () {
var checked = $(this).attr('checked');
toggleDownloaded(checked);
toggleHideDownloadedCookie(checked);
});
function toggleDownloaded(hide) {
2012-02-22 19:37:44 +03:00
var ready = $('.statusImage[title="Ready"]');
ready.each(function () {
if (hide) {
$(this).parents('tr').hide();
}
else {
$(this).parents('tr').show();
}
});
}
function toggleHideDownloadedCookie(hide) {
if (hide)
$.cookie("hideDownloaded", true, { expires: 365 });
else
$.cookie("hideDownloaded", false, { expires: 365 });
}
</script>
}