Fixed: Fixed styling for add series dropdown

Fixed: Adding a series is now blocked unless a valid root folder is provided
This commit is contained in:
kay.one 2012-02-26 19:25:57 -08:00
parent a4c433c5b2
commit 9669869c9b
6 changed files with 14 additions and 23 deletions

View File

@ -119,7 +119,7 @@ hr
background: url(images/logo.png) no-repeat left top;
background-color: #065EFE;
font-size: 110px;
color: rgb(249, 249, 249);
color: white;
/**color: rgb(40, 40, 40);**/
text-transform: lowercase;
letter-spacing: -1px;

View File

@ -105,6 +105,9 @@ namespace NzbDrone.Web.Controllers
[HttpPost]
public JsonResult AddNewSeries(string path, string seriesName, int seriesId, int qualityProfileId)
{
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));
//Create the folder for the new series
@ -174,8 +177,10 @@ namespace NzbDrone.Web.Controllers
var tvDbResults = _tvDbProvider.SearchSeries(term).Select(r => new TvDbSearchResultModel
{
Id = r.Id,
Title = r.SeriesName,
FirstAired = r.FirstAired.ToShortDateString()
Title = r.FirstAired.Year > 1900
?string.Format("{0} ({1})", r.SeriesName, r.FirstAired.Year)
:r.SeriesName,
Banner = r.Banner.BannerPath
}).ToList();
return Json(tvDbResults, JsonRequestBehavior.AllowGet);

View File

@ -49,14 +49,6 @@ namespace NzbDrone.Web.Controllers
_seriesProvider = seriesProvider;
}
public JsonResult TestResults(string q)
{
var results = new List<TvDbSearchResultModel>();
results.Add(new TvDbSearchResultModel { Id = 1, Title = "30 Rock", FirstAired = DateTime.Today.ToShortDateString() });
results.Add(new TvDbSearchResultModel { Id = 2, Title = "The Office", FirstAired = DateTime.Today.AddDays(-1).ToShortDateString() });
return Json(results, JsonRequestBehavior.AllowGet);
}
public ActionResult Index()
{

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Linq;
namespace NzbDrone.Web.Models
{
@ -9,6 +6,6 @@ namespace NzbDrone.Web.Models
{
public int Id { get; set; }
public string Title { get; set; }
public string FirstAired { get; set; }
public string Banner { get; set; }
}
}

View File

@ -65,7 +65,7 @@ function bindSeriesAutoComplete(selector) {
.data("autocomplete")._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a><div class=seriesLookupTitle>" + item.Title + "</div><div class=seriesLookupFirstAired>" + item.FirstAired + "</div></a>")
.append("<a><div class=seriesLookupTitle>" + item.Title + "</div></a>")
.appendTo(ul);
};
});

View File

@ -42,15 +42,12 @@
background-size: 18px 18px
}
.ui-autocomplete .seriesLookupTitle {
.ui-autocomplete .seriesLookupTitle{
font-size: 110%;
font-family: "Segoe UI Light", "Open Sans", "Segoe UI", sans-serif;
font-family: "Segoe UI", "Open Sans", "Segoe UI", sans-serif;
color: lightgrey;
}
.ui-autocomplete .seriesLookupFirstAired {
font-family: "Segoe UI Light", "Open Sans", "Segoe UI", sans-serif;
}
</style>
}