removed bootstrap layout from MVC, bootstrap+backbone is where we should be going.

pull/3113/head
kay.one 12 years ago
parent 577d8adec4
commit 2806b34e59

@ -49,13 +49,6 @@ namespace NzbDrone.Web.Controllers
return View();
}
public ActionResult Bt()
{
return View();
}
public ActionResult AddNew()
{
ViewData["RootDirs"] = _rootFolderProvider.GetAll().Select(c => c.Path).OrderBy(e => e).ToList();
@ -103,7 +96,7 @@ namespace NzbDrone.Web.Controllers
result.ExistingSeries.Add(new Tuple<string, string, int>(folder, title, seriesId));
}
catch(Exception ex)
catch (Exception ex)
{
logger.WarnException("Failed to connect to TheTVDB to search for: " + foldername, ex);
return View();
@ -120,8 +113,8 @@ namespace NzbDrone.Web.Controllers
[JsonErrorFilter]
public JsonResult AddNewSeries(string path, string seriesName, int seriesId, int qualityProfileId, string startDate)
{
if (string.IsNullOrWhiteSpace(path) || String.Equals(path,"null",StringComparison.InvariantCultureIgnoreCase))
return JsonNotificationResult.Error("Couldn't add " + seriesName, "You need a valid root folder");
if (string.IsNullOrWhiteSpace(path) || String.Equals(path, "null", StringComparison.InvariantCultureIgnoreCase))
return JsonNotificationResult.Error("Couldn't add " + seriesName, "You need a valid root folder");
path = Path.Combine(path, MediaFileProvider.CleanFilename(seriesName));
@ -140,11 +133,11 @@ namespace NzbDrone.Web.Controllers
return JsonNotificationResult.Error("Add Existing series failed.", "Invalid Series information");
DateTime? date = null;
if (!String.IsNullOrWhiteSpace(startDate))
date = DateTime.Parse(startDate, null, DateTimeStyles.RoundtripKind);
_seriesProvider.AddSeries(seriesName,path, seriesId, qualityProfileId, date);
_seriesProvider.AddSeries(seriesName, path, seriesId, qualityProfileId, date);
_jobProvider.QueueJob(typeof(ImportNewSeriesJob));
return JsonNotificationResult.Info(seriesName, "Was added successfully");
@ -170,18 +163,18 @@ namespace NzbDrone.Web.Controllers
return Json(tvDbResults, JsonRequestBehavior.AllowGet);
}
catch(TvdbNotAvailableException ex)
catch (TvdbNotAvailableException ex)
{
logger.WarnException("Unable to lookup series on TheTVDB", ex);
return JsonNotificationResult.Info("Lookup Failed", "TheTVDB is not available at this time.");
}
catch(Exception ex)
catch (Exception ex)
{
logger.WarnException("Unknown Error when looking up series on TheTVDB", ex);
return JsonNotificationResult.Info("Lookup Failed", "Unknown error while connecting to TheTVDB");
}
}
public ActionResult RootList()

@ -1,56 +0,0 @@
@using Cassette.Stylesheets
@{
ViewBag.Title = "Add Series";
Layout = "~/Views/Shared/_Bootstrap.cshtml";
Bundles.Reference<StylesheetBundle>("AddSeries\\Views\\");
}
<div id="add-series-tmpl" class="row">
<ul class="nav nav-tabs" id="myTab">
<li class="active"><a href="#add-new">Add New Series</a></li>
<li><a href="#import-existing">Import Existing Series</a></li>
<li><a href="#root-folders">Root Folders</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="add-new">
<div class="input-prepend search">
<i class="add-on icon-search"></i>
<input type="text" class="span10" placeholder="Start typing the name of series you want to add ...">
</div>
</div>
<div class="tab-pane" id="import-existing">Import existing.</div>
<div class="tab-pane" id="root-folders">Manage root folders</div>
</div>
</div>
@*
@section Templates
{
}
<div id="add-existing-series">
<h1>Add Existing</h1>
<h2 id="single">Single Series</h2>
<h2 id="multiple">All of my series</h2>
</div>
<div id="add-new-series">
<h1>Add New</h1>
<div class="well">
<input type="text" id="series-search" name="series-search" placeholder="Search for a series to add ..." class="span12" autocomplete="off" />
</div>
</div>
<div id="add-existing-series-single">
<h1>single
</h1>
</div>
<div id="add-existing-series-multiple">
<h1>multiple</h1>
</div>
*@

@ -1,78 +0,0 @@
@using Cassette.Scripts
@using Cassette.Stylesheets
@using NzbDrone.Web
@using NzbDrone.Web.Backbone.NzbDrone
@using NzbDrone.Web.Helpers
@{
Bundles.Reference<StylesheetBundle>(CassetteBundleConfiguration.BASE_STYLE);
Bundles.Reference<ScriptBundle>(CassetteBundleConfiguration.BACKBONE);
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>@ViewBag.Title - NzbDrone</title>
<link rel="SHORTCUT ICON" href="../../favicon.ico" />
<!-- Standard iPhone -->
<link rel="apple-touch-icon" sizes="57x57" href="../../Content/Images/apple-touch-icon-114.png" />
<!-- Retina iPhone -->
<link rel="apple-touch-icon" sizes="114x114" href="../../Content/Images/apple-touch-icon-114.png" />
<!-- Standard iPad -->
<link rel="apple-touch-icon" sizes="72x72" href="../../Content/Images/apple-touch-icon-144.png" />
<!-- Retina iPad -->
<link rel="apple-touch-icon" sizes="144x144" href="../../Content/Images/apple-touch-icon-144.png" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
@Bundles.RenderStylesheets()
</head>
<body>
@RenderBody()
<div class="container">
<div id="menu" class="row">
<div class="span20">
<ul>
@MvcHtmlString.Create(Html.CurrentControllerLink("Series", "Index", "Series"))
@MvcHtmlString.Create(Html.CurrentControllerLink("Upcoming", "Index", "Upcoming"))
@MvcHtmlString.Create(Html.CurrentControllerLink("History", "Index", "History"))
@MvcHtmlString.Create(Html.CurrentControllerLink("Missing", "Index", "Missing"))
@MvcHtmlString.Create(Html.CurrentControllerLink("Settings", "Index", "Settings"))
@MvcHtmlString.Create(Html.CurrentControllerLink("System", "Index", "System"))
<li id="donate" title="Donate to support the development of NzbDrone">
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KRTE52U3XJDSQ" target="_blank">Donate</a>
</li>
</ul>
<input id="localSeriesLookup" type="text" class="pull-right" placeholder="Search..." />
</div>
</div>
<div id="logo" class="row">
<div class="span18 offset2">
@ViewBag.Title
</div>
</div>
<div id="content" class="row">
<div class="span20">
<div class="row sub-menu">
@RenderSection("ActionMenu", required: false)
</div>
<div class="row">
<div id="main-region" class="span20 nz-center"></div>
</div>
</div>
</div>
<div id="footer" class="row nz-center">
<div class="span20">
@{Html.RenderAction("Footer", "Shared");}
</div>
</div>
</div>
@Bundles.RenderScripts()
<script type="text/javascript">
NzbDrone.start();
</script>
</body>
</html>

@ -1,7 +1,6 @@
@using NzbDrone.Web.Helpers
@{
ViewBag.Title = "System";
Layout = "~/Views/Shared/_Bootstrap.cshtml";
}

@ -2,10 +2,13 @@
loadTemplate: function (templateId) {
var template;
console.log("Loading template '" + templateId + "'");
jQuery.ajax({
url: 'Backbone.NzbDrone//' + templateId + '.html',
url: '_backboneApp//' + templateId + '.html',
async: false
}).done(function (data) {

Loading…
Cancel
Save