added settings view to mvc project

This commit is contained in:
kay.one 2010-09-23 22:21:45 -07:00
parent 941d516e42
commit d7bae9135c
15 changed files with 89 additions and 148 deletions

View file

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NzbDrone.Core.Controllers;
using NzbDrone.Web.Models;
namespace NzbDrone.Web.Controllers
{
@ -10,10 +12,27 @@ namespace NzbDrone.Web.Controllers
{
//
// GET: /Settings/
private IConfigController _configController;
public SettingsController(IConfigController configController)
{
_configController = configController;
}
public ActionResult Index()
{
return View();
return View(new SettingsModel() { RootPath = _configController.SeriesRoot });
}
[HttpPost]
public ActionResult Save(SettingsModel model)
{
if (ModelState.IsValid)
{
_configController.SeriesRoot = model.RootPath;
}
return RedirectToAction("index");
}
}