New series ignore editor on Series/Details.

Styling works, backend saving not yet implemented.
pull/6/head
Mark McDowall 13 years ago
parent ec78c5be3e
commit c32346e6ea

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

@ -227,8 +227,6 @@ namespace NzbDrone.Web.Controllers
var episodePath = String.Empty;
var episodeQuality = String.Empty;
if (e.EpisodeFile != null)
{
episodePath = e.EpisodeFile.Path;
@ -252,7 +250,8 @@ namespace NzbDrone.Web.Controllers
Path = episodePath,
EpisodeFileId = episodeFileId,
Status = e.Status.ToString(),
Quality = episodeQuality
Quality = episodeQuality,
Ignored = e.Ignored
});
}

@ -15,5 +15,6 @@ namespace NzbDrone.Web.Models
public String Status { get; set; }
public string AirDate { get; set; }
public String Quality { get; set; }
public bool Ignored { get; set; }
}
}

@ -183,6 +183,8 @@
<Content Include="Content\Blueprint\ie.css" />
<Content Include="Content\Blueprint\screen.css" />
<Content Include="Content\Blueprint\liquid.css" />
<Content Include="Content\Images\ignored.png" />
<Content Include="Content\Images\notIgnored.png" />
<Content Include="Content\Images\x_16.png" />
<Content Include="Content\jQueryUI\images\ui-bg_diagonals-thick_30_a32d00_40x40.png" />
<Content Include="Content\jQueryUI\images\ui-bg_flat_0_065efe_40x100.png" />
@ -250,6 +252,7 @@
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
<Content Include="Scripts\AutoComplete.js" />
<Content Include="Scripts\seriesDetails.js" />
<Content Include="Scripts\Plugins\jquery.livequery.js" />
<Content Include="Scripts\settingsForm.js" />
<Content Include="Scripts\Plugins\doTimeout.js" />

@ -0,0 +1,83 @@
var notIgnoredImage = '../../Content/Images/notIgnored.png';
var ignoredImage = '../../Content/Images/ignored.png';
$(".ignoreEpisode").live("click", function () {
var toggle = $(this);
var ignored = toggle.hasClass('ignored');
if (ignored) {
toggle.removeClass('ignored');
toggle.attr('src', notIgnoredImage);
}
else {
toggle.addClass('ignored');
toggle.attr('src', ignoredImage);
}
if (toggle.hasClass('ignoredEpisodesMaster')) {
var seasonNumber = toggle.attr('id').replace('master_', '');
toggleChildren(seasonNumber, ignored);
}
});
function toggleChildren(seasonNumber, ignored) {
var ignoreEpisodes = $('.ignoreEpisode_' + seasonNumber);
if (!ignored) {
ignoreEpisodes.each(function (index) {
$(this).addClass('ignored');
$(this).attr('src', ignoredImage);
});
}
else {
ignoreEpisodes.each(function (index) {
$(this).removeClass('ignored');
$(this).attr('src', notIgnoredImage);
});
}
}
function grid_rowBound(e) {
var dataItem = e.dataItem;
var ignored = dataItem.Ignored;
var episodeId = dataItem.EpisodeId;
var ignoredIcon = $('#' + episodeId);
if (ignored) {
ignoredIcon.attr('src', ignoredImage);
}
else {
ignoredIcon.attr('src', notIgnoredImage);
ignoredIcon.removeClass('ignored');
}
}
function grid_dataBound(e) {
var id = $(this).attr('id');
var seasonNumber = id.replace('seasons_', '');
var ignoreEpisodes = $('.ignoreEpisode_' + seasonNumber);
var master = $('#master_' + seasonNumber);
var count = ignoreEpisodes.length;
var ignoredCount = 0;
ignoreEpisodes.each(function (index) {
if ($(this).hasClass('ignored')) {
ignoredCount++;
}
});
if (ignoredCount == count) {
master.attr('src', ignoredImage);
master.addClass('ignored');
}
else {
master.attr('src', notIgnoredImage);
master.removeClass('ignored');
}
}

@ -4,6 +4,26 @@
@section TitleContent{
@Model.Title
}
<script src="../../Scripts/seriesDetails.js" type="text/javascript"></script>
<style>
.ignoreEpisode
{
width: 18px;
height: 18px;
padding-bottom: -6px;
}
.ignoredEpisodesMaster
{
width: 18px;
height: 18px;
padding-left: 18px;
padding-right: -18px;
}
</style>
@section ActionMenu{
@{Html.Telerik().Menu().Name("SeriesMenu").Items(items =>
{
@ -50,11 +70,11 @@
.TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns =>
{
columns.Bound(o => o.EpisodeId)
columns.Bound(o => o.Ignored)
.Title("<img src='../../Content/Images/ignored.png' class='ignoredEpisodesMaster ignoreEpisode' id='master_" + season + "' />")
.ClientTemplate(
"<input type='checkbox' name='checkedEpisodes' value='<#= EpisodeId #>' />")
.Title("")
.Width(1)
"<img src='../../Content/Images/ignored.png' class='ignoreEpisode ignoreEpisode_" + season + " ignored' id='<#= EpisodeId #>' />")
.Width(20)
.HtmlAttributes(new { style = "text-align:center" });
columns.Bound(c => c.EpisodeNumber).Width(0).Title("Episode");
@ -68,7 +88,7 @@
"<a href='#Rename' onClick=\"renameEpisode('<#= EpisodeFileId #>'); return false;\">Rename</a>");
})
.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #> </br><#= Path #> </div>"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(false))
.Footer(true)
.DataBinding(
d =>
@ -78,12 +98,16 @@
c =>
c.Custom().Text("Rename Season").Action("RenameSeason", "Series", new { seasonId = season })
.ButtonType(GridButtonType.Text))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
clientEvents.OnDataBound("grid_dataBound");
})
.Render();}
</div>
}
@if (Model.Seasons.Any(s => s == 0))
{
<br />
<h3>
Specials</h3>
@ -92,11 +116,11 @@
.TableHtmlAttributes(new { @class = "Grid" })
.Columns(columns =>
{
columns.Bound(o => o.EpisodeId)
columns.Bound(o => o.Ignored)
.Title("<img src='../../Content/Images/ignored.png' class='ignoredEpisodesMaster ignoreEpisode' id='master_0' />")
.ClientTemplate(
"<input type='checkbox' name='checkedEpisodes' value='<#= EpisodeId #>' />")
.Title("")
.Width(1)
"<img src='../../Content/Images/ignored.png' class='ignoreEpisode ignoreEpisode_0 ignored' id='<#= EpisodeId #>' />")
.Width(20)
.HtmlAttributes(new { style = "text-align:center" });
columns.Bound(c => c.EpisodeNumber).Width(10).Title("Episode");
@ -106,7 +130,7 @@
columns.Bound(c => c.Status).Width(10);
})
.DetailView(detailView => detailView.ClientTemplate("<div><#= Overview #> </br><#= Path #> </div>"))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(true))
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.EpisodeNumber).Descending()).Enabled(false))
.Footer(true)
.DataBinding(
d =>
@ -134,6 +158,8 @@
}
});
}
</script>
}

@ -1,94 +1,20 @@
<style>
/*body{
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
p, h1, form, button{border:0; margin:0; padding:0;}*/
.spacer{clear:both; height:1px;}
/* ----------- My Form ----------- */
.myform{
margin:0 auto;
width:400px;
padding:14px;
}
<div id="image" value="5">
<img src='../../Content/Images/watched.png' class='ignoreEpisode watched' value='5' />
</div>
/* ----------- stylized ----------- */
#stylized{
border:solid 2px #b7ddf2;
background:#ebf4fb;
}
#stylized h1 {
font-size:14px;
font-weight:bold;
margin-bottom:8px;
}
#stylized p{
font-size:11px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #b7ddf2;
padding-bottom:10px;
}
#stylized label{
display:block;
font-weight:bold;
text-align:right;
width:140px;
float:left;
}
#stylized .small{
color:#666666;
display:block;
font-size:11px;
font-weight:normal;
text-align:right;
width:140px;
}
#stylized input{
float:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}
#stylized button{
clear:both;
margin-left:150px;
width:125px;
height:31px;
background:#666666 url(img/button.png) no-repeat;
text-align:center;
line-height:31px;
color:#FFFFFF;
font-size:11px;
font-weight:bold;
}
</style>
<script type="text/javascript">
$(".ignoreEpisode").live("click", function () {
var toggle = $(this);
<div id="stylized" class="myform">
<form id="form" name="form" method="post">
<fieldset>
<h1>Sign-up form</h1>
<p>This is the basic look of my form without table</p>
if (toggle.hasClass('watched')) {
toggle.removeClass('watched');
toggle.attr('src', '../../Content/Images/unwatched.png');
}
<label>Name
<span class="small">Add your name</span>
</label>
<input type="text" name="name" id="name" />
else {
toggle.addClass('watched');
toggle.attr('src', '../../Content/Images/watched.png');
}
});
</script>
<label>Email
<span class="small">Add a valid address</span>
</label>
<input type="text" name="email" id="email" />
<label>Password
<span class="small">Min. size 6 chars</span>
</label>
<input type="text" name="password" id="password" />
<button type="submit">Sign-up</button>
<div class="spacer"></div>
</fieldset>
</form>
</div>
Loading…
Cancel
Save