diff --git a/NzbDrone.Web/Content/Grid.css b/NzbDrone.Web/Content/Grid.css index 26963de2c..9da4882d8 100644 --- a/NzbDrone.Web/Content/Grid.css +++ b/NzbDrone.Web/Content/Grid.css @@ -1,4 +1,4 @@ -.gridImage, .gridAction +.gridImage, .gridAction, .grid-icon { width: 18px; height: 18px; @@ -6,6 +6,10 @@ margin: 0px; vertical-align: middle; border: none; + display: inline !important; + text-decoration: none !important; + color: #000000; + font-size: 20px; } .gridAction:hover @@ -112,3 +116,8 @@ table.dataTable thead th.sorting_desc, table.dataTable thead th.sorting_asc, tab { opacity: 1; } + +/* Icon color when ignored */ +.ignored { + color: gray !important; +} \ No newline at end of file diff --git a/NzbDrone.Web/Content/NzbDrone.css b/NzbDrone.Web/Content/NzbDrone.css index 84401e1fd..91782ee1d 100644 --- a/NzbDrone.Web/Content/NzbDrone.css +++ b/NzbDrone.Web/Content/NzbDrone.css @@ -238,11 +238,8 @@ button span, input[type="button"] span, input[type="submit"] span, input[type="r padding-top: 15px; } + +/* Font-Awesome */ i[class*="icon-"]:not(.gridAction):hover { cursor: default; -} - -table i[class*="icon-"] { - color: #000000; - font-size: 18px; } \ No newline at end of file diff --git a/NzbDrone.Web/Helpers/LinkHelper.cs b/NzbDrone.Web/Helpers/LinkHelper.cs index af1438715..0fb6d3637 100644 --- a/NzbDrone.Web/Helpers/LinkHelper.cs +++ b/NzbDrone.Web/Helpers/LinkHelper.cs @@ -40,5 +40,25 @@ namespace NzbDrone.Web.Helpers var link = helper.ActionLink("[replaceme]", actionName, controllerName, routeValues, htmlAttributes).ToHtmlString(); return new MvcHtmlString(link.Replace("[replaceme]", builder.ToString(TagRenderMode.SelfClosing))); } + + public static MvcHtmlString IconActionLink(this AjaxHelper helper, string icon, string text, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) + { + var linkText = String.IsNullOrWhiteSpace(text) ? "" : " " + text; + + var builder = new TagBuilder("i"); + builder.MergeAttribute("class", icon); + var link = helper.ActionLink("[replaceme]" + linkText, actionName, controllerName, routeValues, ajaxOptions, htmlAttributes).ToHtmlString(); + return new MvcHtmlString(link.Replace("[replaceme]", builder.ToString())); + } + + public static MvcHtmlString IconActionLink(this HtmlHelper helper, string icon, string text, string actionName, string controllerName, object routeValues, object htmlAttributes) + { + var linkText = String.IsNullOrWhiteSpace(text) ? "" : " " + text; + + var builder = new TagBuilder("i"); + builder.MergeAttribute("class", icon); + var link = helper.ActionLink("[replaceme]" + linkText, actionName, controllerName, routeValues, htmlAttributes).ToHtmlString(); + return new MvcHtmlString(link.Replace("[replaceme]", builder.ToString())); + } } } \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/NzbDrone/AutoBind.js b/NzbDrone.Web/Scripts/NzbDrone/AutoBind.js index 4e61a1f6d..bb75b7b86 100644 --- a/NzbDrone.Web/Scripts/NzbDrone/AutoBind.js +++ b/NzbDrone.Web/Scripts/NzbDrone/AutoBind.js @@ -53,4 +53,32 @@ dateFormat: "yy-mm-dd" }); }); + + $('[data-status]').livequery(function () { + var status = $(this).attr('data-status'); + + $(this).removeClass(function (index, css) { + return (css.match(/\bicon-\S+/g) || []).join(' '); + }); + + if (status == 'Downloading') { + $(this).addClass('icon-download-alt'); + } + + if (status == 'Ready') { + $(this).addClass('icon-play'); + } + + if (status == 'AirsToday') { + $(this).addClass('icon-time'); + } + + if (status == 'NotAired') { + $(this).addClass('icon-calendar'); + } + + if (status == 'Missing') { + $(this).addClass('icon-sign-blank'); + } + }); }); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/NzbDrone/seriesDetails.js b/NzbDrone.Web/Scripts/NzbDrone/seriesDetails.js index 9bf6447a6..239b495d5 100644 --- a/NzbDrone.Web/Scripts/NzbDrone/seriesDetails.js +++ b/NzbDrone.Web/Scripts/NzbDrone/seriesDetails.js @@ -1,10 +1,4 @@ -var notIgnoredImage = '../../Content/Images/notIgnored.png'; -var ignoredImage = '../../Content/Images/ignored.png'; -var notAiredImage = '../../Content/Images/NotAired.png'; -var readyImage = '../../Content/Images/Ready.png'; -var downloadingImage = '../../Content/Images/Downloading.png'; - -var seriesId = 0; +var seriesId = 0; var saveSeasonIgnoreUrl = '../Command/SaveSeasonIgnore'; var saveEpisodeIgnoreUrl = '../Command/SaveEpisodeIgnore'; @@ -20,13 +14,11 @@ $(".ignoreEpisode").live("click", function () { if (ignored) { toggle.removeClass('ignored'); - toggle.attr('src', notIgnoredImage); toggleCellColour(toggle, false); } else { toggle.addClass('ignored'); - toggle.attr('src', ignoredImage); toggleCellColour(toggle, true); } @@ -51,12 +43,11 @@ $(".ignoreEpisode").live("click", function () { }); function toggleChildren(seasonNumber, ignored) { - var ignoreEpisodes = $('[data-season="' + seasonNumber + '"]'); + var ignoreEpisodes = $('[data-season="' + seasonNumber + '"]:not(table)'); if (ignored) { ignoreEpisodes.each(function (index) { $(this).addClass('ignored'); - $(this).attr('src', ignoredImage); toggleCellColour($(this), true); }); } @@ -64,7 +55,6 @@ function toggleChildren(seasonNumber, ignored) { else { ignoreEpisodes.each(function (index) { $(this).removeClass('ignored'); - $(this).attr('src', notIgnoredImage); toggleCellColour($(this), false); }); @@ -78,14 +68,12 @@ function toggleMasters(seasonNumber, ignored) { if (ignored) { masters.each(function (index) { $(this).addClass('ignored'); - $(this).attr('src', ignoredImage); }); } else { masters.each(function (index) { $(this).removeClass('ignored'); - $(this).attr('src', notIgnoredImage); }); } } diff --git a/NzbDrone.Web/Views/Series/Details.cshtml b/NzbDrone.Web/Views/Series/Details.cshtml index 06e14ae2b..e6e7b8e7a 100644 --- a/NzbDrone.Web/Views/Series/Details.cshtml +++ b/NzbDrone.Web/Views/Series/Details.cshtml @@ -29,6 +29,7 @@ margin-left: 5px; color: black; text-decoration: none; + vertical-align: middle; } .seasonToggleLabel:hover { @@ -88,10 +89,10 @@ @foreach (var season in Model.Seasons.OrderBy(s => s.SeasonNumber)) {
- + data-season="@season.SeasonNumber"> @(season.SeasonNumber == 0 ? "Specials" : "Season " + season.SeasonNumber)
} diff --git a/NzbDrone.Web/Views/Series/Episode.cshtml b/NzbDrone.Web/Views/Series/Episode.cshtml index 74fd4880a..f118d558a 100644 --- a/NzbDrone.Web/Views/Series/Episode.cshtml +++ b/NzbDrone.Web/Views/Series/Episode.cshtml @@ -23,10 +23,10 @@ @*Commands Column*@ - - @Ajax.ImageActionLink("../../Content/Images/Search.png", new { Alt = "Search", Title = "Search for episode", @class = "gridAction" }, "Search", "Episode", new { episodeId = Model.EpisodeId }, null, null) - - @Model.Status + + @Ajax.IconActionLink("icon-search gridAction", "", "Search", "Episode", new { SeriesId = Model.EpisodeId }, null, new { title = "Search for episode" }) + + diff --git a/NzbDrone.Web/Views/Series/Index.cshtml b/NzbDrone.Web/Views/Series/Index.cshtml index 2345f80fa..e8a2f55d8 100644 --- a/NzbDrone.Web/Views/Series/Index.cshtml +++ b/NzbDrone.Web/Views/Series/Index.cshtml @@ -100,9 +100,9 @@