1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-24 08:44:46 +00:00

Grid colouring for ignored and missing.

This commit is contained in:
Mark McDowall 2012-01-29 22:14:46 -08:00
parent a96ff2519a
commit a83dbbb16f
5 changed files with 46 additions and 1 deletions

View file

@ -268,3 +268,14 @@ button span, input[type="button"] span, input[type="submit"] span, input[type="r
color: rgb(169, 169, 169);
padding: 4px;
}
/* Episode Grid Row Colouring */
.episodeIgnored
{
background-color: #F2F5A9;
}
.episodeMissing
{
background-color: #F5A9A9;
}

View file

@ -1,4 +1,23 @@
function grid_onError(e) {
//Suppress the alert
e.preventDefault();
}
//Highlight rows based on a number of details
function highlightRow(e) {
var row = e.row;
var dataItem = e.dataItem;
var ignored = dataItem.Ignored;
var status = dataItem.Status;
if (ignored) {
$(row).addClass('episodeIgnored');
return;
}
if (status == "Missing") {
$(row).addClass('episodeMissing');
return;
}
}

View file

@ -106,6 +106,7 @@ function toggleMasters(seasonNumber, ignored) {
//Functions called by the Telerik Season Grid
function grid_rowBound(e) {
var dataItem = e.dataItem;
var row = e.row;
var ignored = dataItem.Ignored;
var episodeId = dataItem.EpisodeId;
@ -122,6 +123,8 @@ function grid_rowBound(e) {
if (seriesId == 0)
seriesId = dataItem.SeriesId;
highlightRow(e);
}
function grid_dataBound(e) {

View file

@ -8,7 +8,7 @@
@Html.IncludeCss("Grid.css")
}
@{ ViewBag.Title = Model.Title; }
<style>
<style>
.seasonToggleTopGroup
{
overflow: hidden;

View file

@ -46,6 +46,7 @@
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDateTime).Ascending()).Enabled(true))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
if (EnviromentProvider.IsProduction)
clientEvents.OnError("grid_onError");
})
@ -86,6 +87,7 @@
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDateTime).Ascending()).Enabled(true))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
if (EnviromentProvider.IsProduction)
clientEvents.OnError("grid_onError");
})
@ -128,6 +130,7 @@
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDateTime).Ascending()).Enabled(true))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
if (EnviromentProvider.IsProduction)
clientEvents.OnError("grid_onError");
})
@ -169,9 +172,18 @@
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDateTime).Ascending()).Enabled(true))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
if (EnviromentProvider.IsProduction)
clientEvents.OnError("grid_onError");
})
.Render();}
</div>
</div>
@section Scripts{
<script type="text/javascript">
function grid_rowBound(e) {
highlightRow(e);
}
</script>
}