mirror of https://github.com/lidarr/Lidarr
Grid colouring for ignored and missing.
This commit is contained in:
parent
a96ff2519a
commit
a83dbbb16f
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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) {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
@Html.IncludeCss("Grid.css")
|
||||
}
|
||||
@{ ViewBag.Title = Model.Title; }
|
||||
<style>
|
||||
<style>
|
||||
.seasonToggleTopGroup
|
||||
{
|
||||
overflow: hidden;
|
||||
|
|
|
@ -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>
|
||||
}
|
Loading…
Reference in New Issue