1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-31 07:52:37 +01:00

Merge branch 'master' of git://github.com/kayone/NzbDrone

This commit is contained in:
Mark McDowall 2011-05-09 13:53:02 -07:00
commit 5c1c8466c1
2 changed files with 51 additions and 4 deletions

View File

@ -6,6 +6,7 @@ using System.Web.Mvc;
using NzbDrone.Core.Providers; using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Providers.Jobs; using NzbDrone.Core.Providers.Jobs;
using Telerik.Web.Mvc;
namespace NzbDrone.Web.Controllers namespace NzbDrone.Web.Controllers
{ {
@ -39,5 +40,27 @@ namespace NzbDrone.Web.Controllers
} }
[GridAction]
public ActionResult _SelectAjaxEditing()
{
return View(new GridModel(_configProvider.All()));
}
[AcceptVerbs(HttpVerbs.Post)]
[GridAction]
public ActionResult _SaveAjaxEditing(string key, string value)
{
_configProvider.SetValue(key, value);
return View(new GridModel(_configProvider.All()));
}
[AcceptVerbs(HttpVerbs.Post)]
[GridAction]
public ActionResult _InsertAjaxEditing(string key, string value)
{
_configProvider.SetValue(key, value);
return View(new GridModel(_configProvider.All()));
}
} }
} }

View File

@ -1,9 +1,33 @@
@model IEnumerable<NzbDrone.Core.Repository.Config> @model IEnumerable<NzbDrone.Core.Repository.Config>
@section TitleContent{ @section TitleContent{
Config Configuration
} }
@section MainContent{ @section MainContent{
@{Html.Telerik().Grid(Model).Name("Grid") @(Html.Telerik().Grid<NzbDrone.Core.Repository.Config>()
.TableHtmlAttributes(new { @class = "Grid" }) .Name("Grid")
.Render();} .TableHtmlAttributes(new { @class = "Grid" })
.DataKeys(keys =>
{
keys.Add(p => p.Key);
})
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image))
.DataBinding(dataBinding =>
{
dataBinding.Ajax()
.Select("_SelectAjaxEditing", "System")
.Insert("_InsertAjaxEditing", "System")
.Update("_SaveAjaxEditing", "System");
})
.Columns(columns =>
{
columns.Bound(p => p.Key);
columns.Bound(p => p.Value);
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Image);
}).Width(0).Title("Actions");
})
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Sortable()
)
} }