mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
SeasonEditor moved to Gird Editor.
This commit is contained in:
parent
b68784060b
commit
08b7b8c3e1
10 changed files with 90 additions and 83 deletions
|
@ -19,6 +19,10 @@ namespace NzbDrone.Web.Helpers
|
|||
string.Format("<input type=\"hidden\" name=\"{0}.index\" autocomplete=\"off\" value=\"{1}\" />",
|
||||
collectionName, itemIndex));
|
||||
|
||||
html.ViewContext.Writer.WriteLine(
|
||||
string.Format("<input type=\"hidden\" name=\"{0}_collection\" autocomplete=\"off\" value=\"{1}\" />",
|
||||
collectionName, itemIndex));
|
||||
|
||||
return BeginHtmlFieldPrefixScope(html, string.Format("{0}[{1}]", collectionName, itemIndex));
|
||||
}
|
||||
|
||||
|
|
27
NzbDrone.Web/Helpers/ValueExtension.cs
Normal file
27
NzbDrone.Web/Helpers/ValueExtension.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace NzbDrone.Web.Helpers
|
||||
{
|
||||
public static class ValueExtension
|
||||
{
|
||||
public static object ValueFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression)
|
||||
{
|
||||
var memberEx = expression.Body as MemberExpression;
|
||||
|
||||
if (memberEx == null)
|
||||
throw new ArgumentException("Body not a member-expression.");
|
||||
|
||||
string name = memberEx.Member.Name;
|
||||
var model = html.ViewData.Model;
|
||||
var value = model.GetType().GetProperty(name).GetValue(model, null);
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue