Merge branch 'markus101'

pull/4/head
kay.one 14 years ago
commit 7330683a4a

@ -188,6 +188,30 @@ namespace NzbDrone.Core.Providers.Core
set { SetValue("BlackholeDirectory", value); }
}
public virtual bool SeriesName
{
get { return GetValueBoolean("Sorting_SeriesName", true); }
set { SetValue("Sorting_SeriesName", value); }
}
public virtual bool EpisodeName
{
get { return GetValueBoolean("Sorting_EpisodeName", true); }
set { SetValue("Sorting_EpisodeName", value); }
}
public virtual bool ReplaceSpaces
{
get { return GetValueBoolean("Sorting_ReplaceSpaces", true); }
set { SetValue("Sorting_ReplaceSpaces", value); }
}
public virtual bool AppendQuality
{
get { return GetValueBoolean("Sorting_AppendQaulity", true); }
set { SetValue("Sorting_AppendQaulity", value); }
}
public virtual bool UseSeasonFolder
{
get { return GetValueBoolean("Sorting_SeasonFolder", true); }
@ -195,6 +219,30 @@ namespace NzbDrone.Core.Providers.Core
set { SetValue("Sorting_SeasonFolder", value); }
}
public virtual string SeasonFolderFormat
{
get { return GetValue("Sorting_SeasonFolderFormat", "Season %s", false); }
set { SetValue("Sorting_SeasonFolderFormat", value); }
}
public virtual int SeparatorStyle
{
get { return GetValueInt("Sorting_SeparatorStyle"); }
set { SetValue("Sorting_SeparatorStyle", value); }
}
public virtual int NumberStyle
{
get { return GetValueInt("Sorting_NumberStyle", 2); }
set { SetValue("Sorting_NumberStyle", value); }
}
public virtual int MultiEpisodeStyle
{
get { return GetValueInt("Sorting_MultiEpisodeStyle"); }
set { SetValue("Sorting_MultiEpisodeStyle", value); }
}
public virtual int DefaultQualityProfile
{
get { return GetValueInt("DefaultQualityProfile", 1); }

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

@ -308,4 +308,30 @@ button, input[type="button"], input[type="submit"], input[type="reset"]
width: 435px;
display: block;
height: 25px;
}
}
/* Loading Bar */
.grid-container
{
position:relative;
margin:auto;
overflow:hidden;
}
.grid-loader
{
position: absolute;
width: 100%;
height: 100%;
top: 400px;
left: 0px;
letter-spacing: -1px;
color: white; font: 48px Berlin Sans FB, Sans-Serif;
background: #4A4D4A;
padding: 20px;
filter:alpha(opacity=80);
-moz-opacity:0.8;
-khtml-opacity: 0.8;
opacity: 0.8;
line-height: 90%
}

@ -182,16 +182,15 @@ namespace NzbDrone.Web.Controllers
var model = new EpisodeSortingModel();
model.ShowName = Convert.ToBoolean(_configProvider.GetValue("Sorting_ShowName", true, true));
model.EpisodeName = Convert.ToBoolean(_configProvider.GetValue("Sorting_EpisodeName", true, true));
model.ReplaceSpaces = Convert.ToBoolean(_configProvider.GetValue("Sorting_ReplaceSpaces", false, true));
model.AppendQuality = Convert.ToBoolean(_configProvider.GetValue("Sorting_AppendQuality", false, true));
model.UseAirByDate = Convert.ToBoolean(_configProvider.GetValue("Sorting_UseAirByDate", true, true));
model.SeriesName = _configProvider.SeriesName;
model.EpisodeName = _configProvider.EpisodeName;
model.ReplaceSpaces = _configProvider.ReplaceSpaces;
model.AppendQuality = _configProvider.AppendQuality;
model.SeasonFolders = _configProvider.UseSeasonFolder;
model.SeasonFolderFormat = _configProvider.GetValue("Sorting_SeasonFolderFormat", "Season %s", true);
model.SeparatorStyle = Convert.ToInt32(_configProvider.GetValue("Sorting_SeparatorStyle", 0, true));
model.NumberStyle = Convert.ToInt32(_configProvider.GetValue("Sorting_NumberStyle", 2, true));
model.MultiEpisodeStyle = Convert.ToInt32(_configProvider.GetValue("Sorting_MultiEpisodeStyle", 0, true));
model.SeasonFolderFormat = _configProvider.SeasonFolderFormat;
model.SeparatorStyle = _configProvider.SeparatorStyle;
model.NumberStyle = _configProvider.NumberStyle;
model.MultiEpisodeStyle = _configProvider.MultiEpisodeStyle;
model.SeparatorStyles = new SelectList(EpisodeSortingHelper.GetSeparatorStyles(), "Id", "Name");
model.NumberStyles = new SelectList(EpisodeSortingHelper.GetNumberStyles(), "Id", "Name");
@ -535,16 +534,15 @@ namespace NzbDrone.Web.Controllers
if (ModelState.IsValid)
{
_configProvider.SetValue("Sorting_ShowName", data.ShowName.ToString());
_configProvider.SetValue("Sorting_EpisodeName", data.EpisodeName.ToString());
_configProvider.SetValue("Sorting_ReplaceSpaces", data.ReplaceSpaces.ToString());
_configProvider.SetValue("Sorting_AppendQuality", data.AppendQuality.ToString());
_configProvider.SetValue("Sorting_UseAirByDate", data.UseAirByDate.ToString());
_configProvider.SetValue("Sorting_SeasonFolder", data.SeasonFolders.ToString());
_configProvider.SetValue("Sorting_SeasonFolderFormat", data.SeasonFolderFormat);
_configProvider.SetValue("Sorting_SeparatorStyle", data.SeparatorStyle.ToString());
_configProvider.SetValue("Sorting_NumberStyle", data.NumberStyle.ToString());
_configProvider.SetValue("Sorting_MultiEpisodeStyle", data.MultiEpisodeStyle.ToString());
_configProvider.SeriesName = data.SeriesName;
_configProvider.EpisodeName = data.EpisodeName;
_configProvider.ReplaceSpaces = data.ReplaceSpaces;
_configProvider.AppendQuality = data.AppendQuality;
_configProvider.UseSeasonFolder = data.SeasonFolders;
_configProvider.SeasonFolderFormat = data.SeasonFolderFormat;
_configProvider.SeparatorStyle = data.SeparatorStyle;
_configProvider.NumberStyle = data.NumberStyle;
_configProvider.MultiEpisodeStyle = data.MultiEpisodeStyle;
basicNotification.Title = SETTINGS_SAVED;
_notificationProvider.Register(basicNotification);

@ -6,36 +6,41 @@ namespace NzbDrone.Web.Models
{
public class EpisodeSortingModel
{
[DisplayName("Show Name")]
public bool ShowName { get; set; }
[DisplayName("Series Name")]
[Description("Should filenames contain the series name when renamed?")]
public bool SeriesName { get; set; }
[DisplayName("Episode Name")]
[Description("Should filenames contain the episode name when renamed?")]
public bool EpisodeName { get; set; }
[DisplayName("Replace Spaces")]
[Description("Do you want to replace spaces in the filename with periods?")]
public bool ReplaceSpaces { get; set; }
[DisplayName("Append Quality")]
[Description("Should filenames have the quality appended to the end?")]
public bool AppendQuality { get; set; }
[DisplayName("Use Air By Date")]
public bool UseAirByDate { get; set; }
[DisplayName("Use Season Folders")]
[Description("Should files be stored in season folders?")]
public bool SeasonFolders { get; set; }
[DisplayName("Season Folder Format")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
[Display(Description = "This is a Description")]
[Description("How should season folders be named? (Use %0s to pad to two digits)")]
public string SeasonFolderFormat { get; set; }
[DisplayName("Separator Style")]
[Description("How should NzbDrone separate sections of the filename?")]
public int SeparatorStyle { get; set; }
[DisplayName("Numbering Style")]
[Description("What numbering style do you want?")]
public int NumberStyle { get; set; }
[DisplayName("Multi-Episode Style")]
[Description("How will multi-episode files be named?")]
public int MultiEpisodeStyle { get; set; }
public SelectList SeparatorStyles { get; set; }

@ -1,7 +1,7 @@
@using NzbDrone.Core.Repository;
@using NzbDrone.Web.Models;
@model IEnumerable<NzbDrone.Core.Repository.Series>
@section TitleContent{
Series
}
@ -11,38 +11,43 @@
}
@section MainContent{
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
.TableHtmlAttributes(new { @class = "Grid" })
.DataKeys(keys => keys.Add(p => p.SeriesId))
.DataBinding(data => data.Ajax()
.Select("_AjaxSeriesGrid", "Series")
.Update("_SaveAjaxSeriesEditing", "Series")
.Delete("_DeleteAjaxSeriesEditing", "Series"))
.Columns(columns =>
{
columns.Bound(o => o.Title)
.ClientTemplate("<a href=" +
Url.Action("Details", "Series", new {seriesId = "<#= SeriesId #>"}) +
"><#= Title #></a>");
columns.Bound(o => o.SeasonsCount).Title("Seasons")
.ClientTemplate("<a href=# onclick=\"openSeasonEditor(<#= SeriesId #>, \'<#= Title #>\'); return false;\"><#= SeasonsCount #></a>");
columns.Bound(o => o.QualityProfileName).Title("Quality");
columns.Bound(o => o.Status);
columns.Bound(o => o.AirsDayOfWeek);
columns.Bound(o => o.Path);
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Image);
commands.Delete().ButtonType(GridButtonType.Image);
}).Title("Actions").Width(80);
<div class="grid-container">
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
.TableHtmlAttributes(new { @class = "Grid" })
.DataKeys(keys => keys.Add(p => p.SeriesId))
.DataBinding(data => data.Ajax()
.Select("_AjaxSeriesGrid", "Series")
.Update("_SaveAjaxSeriesEditing", "Series")
.Delete("_DeleteAjaxSeriesEditing", "Series"))
.Columns(columns =>
{
columns.Bound(o => o.Title)
.ClientTemplate("<a href=" +
Url.Action("Details", "Series", new {seriesId = "<#= SeriesId #>"}) +
"><#= Title #></a>");
columns.Bound(o => o.SeasonsCount).Title("Seasons")
.ClientTemplate("<a href=# onclick=\"openSeasonEditor(<#= SeriesId #>, \'<#= Title #>\'); return false;\"><#= SeasonsCount #></a>");
columns.Bound(o => o.QualityProfileName).Title("Quality");
columns.Bound(o => o.Status);
columns.Bound(o => o.AirsDayOfWeek);
columns.Bound(o => o.Path);
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Image);
commands.Delete().ButtonType(GridButtonType.Image);
}).Title("Actions").Width(80);
})
.Editable(editor => editor.Mode(GridEditMode.PopUp))
.Sortable(sort => sort.OrderBy(order => order.Add(o => o.Title).Ascending()).Enabled(true))
.DetailView(detailView => detailView.ClientTemplate("<div style=\"width:95%\"><#= Overview #></div>"))
.ClientEvents(clientEvents => clientEvents.OnEdit("grid_edit"))
.Render();}
})
.Editable(editor => editor.Mode(GridEditMode.PopUp))
.Sortable(sort => sort.OrderBy(order => order.Add(o => o.Title).Ascending()).Enabled(true))
.DetailView(detailView => detailView.ClientTemplate("<div style=\"width:95%\"><#= Overview #></div>"))
.ClientEvents(clientEvents => { clientEvents.OnEdit("grid_edit");
clientEvents.OnDataBinding("grid_bind");
clientEvents.OnDataBound("grid_bound");
})
.Render();}
<span class="grid-loader"><img src="@Url.Content( "~/Content/Images/Loading.gif" )" alt="Loading"/> Loading...</span>
</div>
}
<script type="text/javascript">
@ -55,6 +60,14 @@
.center();
}
function grid_bind(args) {
$('.grid-container').children('.grid-loader').stop().css("top", "0px").fadeIn('slow');
}
function grid_bound(args) {
$('.grid-container').children('.grid-loader').stop().fadeOut('slow');
}
function openSeasonEditor(seriesId, seriesName) {
windowElement = null;
windowElement = $.telerik.window.create({

@ -1,4 +1,5 @@
@model NzbDrone.Web.Models.EpisodeSortingModel
@using NzbDrone.Web.Helpers
@model NzbDrone.Web.Models.EpisodeSortingModel
<script type="text/javascript">
$(document).ready(function () {
@ -30,59 +31,60 @@
<fieldset>
<legend>Episode Sorting</legend>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.ShowName)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.ShowName)</div>
<div class="config-title">@Html.LabelFor(m => m.SeriesName)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.SeriesName)</div>
</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeriesName)</div>
<div class="config-description">@Html.DescriptionFor(m => m.SeriesName)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.ShowName)</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.EpisodeName)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.EpisodeName)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.EpisodeName)</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.EpisodeName)</div>
<div class="config-description">@Html.DescriptionFor(m => m.EpisodeName)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.ReplaceSpaces)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.ReplaceSpaces)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.ReplaceSpaces)</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.ReplaceSpaces)</div>
<div class="config-description">@Html.DescriptionFor(m => m.ReplaceSpaces)</div>
</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.AppendQuality)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.AppendQuality)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.AppendQuality)</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.UseAirByDate)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.UseAirByDate)</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.AppendQuality)</div>
<div class="config-description">@Html.DescriptionFor(m => m.AppendQuality)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.UseAirByDate)</div>
</div>
<div class="config-section">
<div class="config-group">
<div class="config-title">@Html.LabelFor(m => m.SeasonFolders)</div>
<div class="config-value">@Html.CheckBoxFor(m => m.SeasonFolders)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeasonFolders)</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeasonFolders)</div>
<div class="config-description">@Html.DescriptionFor(m => m.SeasonFolders)</div>
</div>
</div>
<div class="config-section">
@ -90,7 +92,10 @@
<div class="config-title">@Html.LabelFor(m => m.SeasonFolderFormat)</div>
<div class="config-value">@Html.TextBoxFor(m => m.SeasonFolderFormat)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeasonFolderFormat)</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeasonFolderFormat)</div>
<div class="config-description">@Html.DescriptionFor(m => m.SeasonFolderFormat)</div>
</div>
</div>
<div class="config-section">
@ -98,7 +103,10 @@
<div class="config-title">@Html.LabelFor(m => m.SeparatorStyle)</div>
<div class="config-value">@Html.DropDownListFor(m => m.SeparatorStyle, Model.SeparatorStyles)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeparatorStyle)</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.SeparatorStyle)</div>
<div class="config-description">@Html.DescriptionFor(m => m.SeparatorStyle)</div>
</div>
</div>
<div class="config-section">
@ -106,7 +114,10 @@
<div class="config-title">@Html.LabelFor(m => m.NumberStyle)</div>
<div class="config-value">@Html.DropDownListFor(m => m.NumberStyle, Model.NumberStyles)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.NumberStyle)</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.NumberStyle)</div>
<div class="config-description">@Html.DescriptionFor(m => m.NumberStyle)</div>
</div>
</div>
<div class="config-section">
@ -114,7 +125,10 @@
<div class="config-title">@Html.LabelFor(m => m.MultiEpisodeStyle)</div>
<div class="config-value">@Html.DropDownListFor(m => m.MultiEpisodeStyle, Model.MultiEpisodeStyles)</div>
</div>
<div class="config-validation">@Html.ValidationMessageFor(m => m.MultiEpisodeStyle)</div>
<div class="config-group2">
<div class="config-validation">@Html.ValidationMessageFor(m => m.MultiEpisodeStyle)</div>
<div class="config-description">@Html.DescriptionFor(m => m.MultiEpisodeStyle)</div>
</div>
</div>
<div id="singleEpisodeExample"></div>

@ -1,106 +1,58 @@
 <style type="text/css">
#feedback-open-button
{
height: 32px;
margin: 2em 0 4em;
}
#feedback-form
{
padding: 0 1em 1em;
}
#feedback-form label
{
display: block;
line-height: 25px;
margin-top: 1em;
}
#feedback-form input
{
width: 370px;
}
.form-actions
{
padding-top: 1em;
overflow: hidden;
}
.form-actions button
{
float: right;
}
.example .t-group
{
border-width: 1px;
border-style: solid;
padding: 0 1em 1em;
}
</style>
@{ Html.Telerik().Window()
.Name("Window")
.Title("Submit feedback")
.LoadContentFrom("TestPartial", "Settings")
.Width(400)
.Draggable(true)
.Modal(true)
.Visible(false)
.Render();
<style>
#container {
width: 850px;
margin: auto;
}
.back
{
position:absolute;
top:0;left:0;
}
.wrap
{
width:550px;
height:390px;
position:relative;
margin:auto;
overflow:hidden;
}
.comment
{
position: absolute;
width: 550px;
height: auto;
top: 400px;
left: 0px;
letter-spacing: -1px;
color: white; font: 24px/45px Berlin Sans FB, Sans-Serif;
background: #4A4D4A;
padding: 10px;
filter:alpha(opacity=60);
-moz-opacity:0.6;
-khtml-opacity: 0.6;
opacity: 0.6;
line-height: 90%
}
<button id="feedback-open-button" class="t-button t-state-default">Submit feedback...</button>
@if (ViewData["name"] != null || ViewData["email"] != null || ViewData["comment"] != null) {
<div class="t-group">
<h3>Feedback:</h3>
<p>
Name: @ViewData["name"] <br />
E-mail: @ViewData["email"] <br />
Comment: @ViewData["comment"]
</p>
</div>
}
@{ Html.Telerik().ScriptRegistrar()
.OnDocumentReady(@<text>
// open the initially hidden window when the button is clicked
</text>); }
</style>
<button onclick="overlay()">Click Me!</button>
<script type="text/javascript">
var windowElement;
$('#feedback-open-button')
.click(function (e) {
e.preventDefault();
<div class="wrap">
<img class="backer" src="../../Content/leopard.jpg" alt="image"/>
<span class="comment">
Loading...
</span>
</div>
windowElement = $.telerik.window.create({
title: "Season Edition: ",
contentUrl: '@Url.Action("SeasonEditor", "Series")' + '/?seriesId=10',
width: 400,
height: 500,
modal: true,
resizable: false,
draggable: true,
scrollable: false
});
windowElement.data('tWindow').center();
});
// add button hovers
$('.t-button').live('mouseenter', $.telerik.buttonHover)
.live('mouseleave', $.telerik.buttonLeave);
function closeWindow() {
var window = windowElement.data("tWindow");
window.close();
<script type="text/javascript">
function overlay() {
$('.wrap').children('.comment').stop().css("top", "0px");
}
</script>
Loading…
Cancel
Save