mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Preparing for display/editor content chrome structuring
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042906
This commit is contained in:
@@ -33,7 +33,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public ActionResult ListForAdmin() {
|
||||
return View(new BlogsViewModel {Blogs = _blogService.Get()});
|
||||
return View(new BlogsViewModel { Blogs = _blogService.Get() });
|
||||
}
|
||||
|
||||
//TODO: (erikpo) Should move the slug parameter and get call and null check up into a model binder
|
||||
@@ -45,7 +45,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
|
||||
IEnumerable<BlogPost> posts = _blogPostService.Get(blog);
|
||||
|
||||
return View(new BlogViewModel {Blog = blog, Posts = posts});
|
||||
return View(new BlogViewModel { Blog = blog, Posts = posts });
|
||||
}
|
||||
|
||||
public ActionResult Create() {
|
||||
@@ -58,7 +58,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
return View(model);
|
||||
|
||||
Blog blog = _blogService.Create(model.ToCreateBlogParams());
|
||||
|
||||
|
||||
//TEMP: (erikpo) ensure information has committed for this record
|
||||
var session = _sessionLocator.For(typeof(BlogRecord));
|
||||
session.Flush();
|
||||
@@ -74,7 +74,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
return new NotFoundResult();
|
||||
|
||||
var model = new BlogEditViewModel { Blog = blog };
|
||||
model.Editors = _contentManager.GetEditors(model.Blog.ContentItem);
|
||||
model.ItemView = _contentManager.GetEditors(model.Blog.ContentItem, "");
|
||||
return View(model);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
return new NotFoundResult();
|
||||
|
||||
var model = new BlogEditViewModel { Blog = blog };
|
||||
model.Editors = _contentManager.UpdateEditors(model.Blog.ContentItem, this);
|
||||
model.ItemView = _contentManager.UpdateEditors(model.Blog.ContentItem, "",this);
|
||||
|
||||
IValueProvider values = input.ToValueProvider();
|
||||
if (!TryUpdateModel(model, values))
|
||||
|
@@ -52,7 +52,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
if (post == null)
|
||||
return new NotFoundResult();
|
||||
|
||||
return View(new BlogPostViewModel {Blog = blog, Post = post, Displays = _contentManager.GetDisplays(post.ContentItem)});
|
||||
return View(new BlogPostViewModel { Blog = blog, Post = post, ItemView = _contentManager.GetDisplays(post.ContentItem, null, "detail") });
|
||||
}
|
||||
|
||||
public ActionResult Create(string blogSlug) {
|
||||
@@ -62,7 +62,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
if (blog == null)
|
||||
return new NotFoundResult();
|
||||
|
||||
return View(new CreateBlogPostViewModel {Blog = blog});
|
||||
return View(new CreateBlogPostViewModel { Blog = blog });
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
@@ -98,7 +98,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
return new NotFoundResult();
|
||||
|
||||
var model = new BlogPostEditViewModel { Blog = blog, Post = post };
|
||||
model.Editors = _contentManager.GetEditors(model.Post.ContentItem);
|
||||
model.ItemView = _contentManager.GetEditors(model.Post.ContentItem, null);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
return new NotFoundResult();
|
||||
|
||||
var model = new BlogPostEditViewModel { Blog = blog, Post = post };
|
||||
model.Editors = _contentManager.UpdateEditors(model.Post.ContentItem, this);
|
||||
model.ItemView = _contentManager.UpdateEditors(model.Post.ContentItem, null, this);
|
||||
|
||||
IValueProvider values = input.ToValueProvider();
|
||||
if (!TryUpdateModel(model, values))
|
||||
|
@@ -4,13 +4,13 @@ using System.Web.Mvc;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Models;
|
||||
using Orchard.Models.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.UI.Models;
|
||||
|
||||
namespace Orchard.Blogs.ViewModels {
|
||||
public class BlogEditViewModel : AdminViewModel {
|
||||
public Blog Blog { get; set; }
|
||||
public IEnumerable<ModelTemplate> Editors { get; set; }
|
||||
public ItemEditorViewModel ItemView { get; set; }
|
||||
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int Id {
|
||||
|
@@ -5,14 +5,14 @@ using System.Web.Mvc;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Models;
|
||||
using Orchard.Models.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.UI.Models;
|
||||
|
||||
namespace Orchard.Blogs.ViewModels {
|
||||
public class BlogPostEditViewModel : AdminViewModel {
|
||||
public Blog Blog { get; set; }
|
||||
public BlogPost Post { get; set; }
|
||||
public IEnumerable<ModelTemplate> Editors { get; set; }
|
||||
public ItemEditorViewModel ItemView { get; set; }
|
||||
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int Id {
|
||||
|
@@ -1,12 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.Models.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.UI.Models;
|
||||
|
||||
namespace Orchard.Blogs.ViewModels {
|
||||
public class BlogPostViewModel : BaseViewModel {
|
||||
public Blog Blog { get; set; }
|
||||
public BlogPost Post { get; set; }
|
||||
public IEnumerable<ModelTemplate> Displays { get; set; }
|
||||
public ItemDisplayViewModel ItemView { get; set; }
|
||||
}
|
||||
}
|
@@ -10,8 +10,10 @@
|
||||
<%=Html.EditorForModel() %>
|
||||
<fieldset><input class="button" type="submit" value="Save" /></fieldset>
|
||||
<% } %>
|
||||
<%foreach (var editor in Model.Editors) { %>
|
||||
<%foreach (var editor in Model.ItemView.Editors) { %>
|
||||
<%-- TODO: why is Body in editors? --%>
|
||||
<%-- TODO: because any content type using the body editor doesn't need
|
||||
to re-implement the rich editor, media extensions, format filter chain selection, etc --%>
|
||||
<% if (!String.Equals(editor.Prefix, "Body")) { %>
|
||||
<%=Html.EditorFor(m=>editor.Model, editor.TemplateName, editor.Prefix) %>
|
||||
<% } %>
|
||||
|
@@ -10,11 +10,13 @@
|
||||
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h1><%=Html.Encode(Model.Post.Title) %></h1>
|
||||
<div class="metadata">
|
||||
<div class="posted">Posted by <%=Html.Encode(Model.Post.Creator.UserName) %> <%=Html.Published(Model.Post) %></div>
|
||||
<%if (Model.Post.Creator != null) {%>
|
||||
<div class="posted">Posted by <%=Html.Encode(Model.Post.Creator.UserName)%> <%=Html.Published(Model.Post)%></div>
|
||||
<%}%>
|
||||
<div><a href="<%=Url.BlogPostEdit(Model.Blog.Slug, Model.Post.Slug) %>">(edit)</a></div>
|
||||
</div>
|
||||
|
||||
<%foreach (var display in Model.Displays) { %>
|
||||
<%foreach (var display in Model.ItemView.Displays) { %>
|
||||
<%=Html.DisplayFor(m=>display.Model, display.TemplateName, display.Prefix) %>
|
||||
<%} %>
|
||||
</asp:Content>
|
@@ -2,7 +2,7 @@
|
||||
using Orchard.Data;
|
||||
using Orchard.Models;
|
||||
using Orchard.Models.Driver;
|
||||
using Orchard.UI.Models;
|
||||
using Orchard.Models.ViewModels;
|
||||
|
||||
namespace Orchard.Comments.Models {
|
||||
public class HasCommentsProvider : ContentProvider {
|
||||
@@ -20,21 +20,21 @@ namespace Orchard.Comments.Models {
|
||||
if (context.ContentItem.Has<HasComments>() == false) {
|
||||
return;
|
||||
}
|
||||
context.Displays.Add(new ModelTemplate(context.ContentItem.Get<HasComments>()));
|
||||
context.AddDisplay(new TemplateViewModel(context.ContentItem.Get<HasComments>()));
|
||||
}
|
||||
|
||||
protected override void GetEditors(GetEditorsContext context) {
|
||||
if (context.ContentItem.Has<HasComments>() == false) {
|
||||
return;
|
||||
}
|
||||
context.Editors.Add(new ModelTemplate(context.ContentItem.Get<HasComments>()));
|
||||
context.AddEditor(new TemplateViewModel(context.ContentItem.Get<HasComments>()));
|
||||
}
|
||||
|
||||
protected override void UpdateEditors(UpdateContentContext context) {
|
||||
if (context.ContentItem.Has<HasComments>() == false) {
|
||||
return;
|
||||
}
|
||||
context.Editors.Add(new ModelTemplate(context.ContentItem.Get<HasComments>()));
|
||||
context.AddEditor(new TemplateViewModel(context.ContentItem.Get<HasComments>()));
|
||||
}
|
||||
|
||||
protected override void Loading(LoadContentContext context) {
|
||||
|
@@ -36,8 +36,8 @@ namespace Orchard.DevTools.Controllers {
|
||||
.Select(x => x.GetType())
|
||||
.SelectMany(x => AllTypes(x))
|
||||
.Distinct();
|
||||
model.Displays = _contentManager.GetDisplays(model.Item);
|
||||
model.Editors = _contentManager.GetEditors(model.Item);
|
||||
model.DisplayView = _contentManager.GetDisplays(model.Item, null, null);
|
||||
model.EditorView = _contentManager.GetEditors(model.Item, null);
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
@@ -1,13 +1,13 @@
|
||||
using Orchard.Models.Driver;
|
||||
using Orchard.UI.Models;
|
||||
using Orchard.Models.ViewModels;
|
||||
|
||||
namespace Orchard.DevTools.Models {
|
||||
public class DebugLinkProvider : ContentProvider {
|
||||
protected override void GetDisplays(GetDisplaysContext context) {
|
||||
context.Displays.Add(new ModelTemplate(new ShowDebugLink { ContentItem = context.ContentItem }) { Position = "10" });
|
||||
context.AddDisplay(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { Position = "10" });
|
||||
}
|
||||
protected override void GetEditors(GetEditorsContext context) {
|
||||
context.Editors.Add(new ModelTemplate(new ShowDebugLink { ContentItem = context.ContentItem }) { Position = "10" });
|
||||
context.AddEditor(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { Position = "10" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -4,8 +4,8 @@ using System.Linq;
|
||||
using System.Web;
|
||||
using Orchard.Models;
|
||||
using Orchard.Models.Records;
|
||||
using Orchard.Models.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.UI.Models;
|
||||
|
||||
namespace Orchard.DevTools.ViewModels {
|
||||
public class ContentDetailsViewModel : BaseViewModel {
|
||||
@@ -13,9 +13,13 @@ namespace Orchard.DevTools.ViewModels {
|
||||
|
||||
public IEnumerable<Type> PartTypes { get; set; }
|
||||
|
||||
public IEnumerable<ModelTemplate> Displays { get; set; }
|
||||
public ItemDisplayViewModel DisplayView { get; set; }
|
||||
|
||||
public IEnumerable<ModelTemplate> Editors { get; set; }
|
||||
public ItemEditorViewModel EditorView { get; set; }
|
||||
|
||||
public IEnumerable<TemplateViewModel> Displays { get { return DisplayView.Displays; } }
|
||||
|
||||
public IEnumerable<TemplateViewModel> Editors { get { return EditorView.Editors; } }
|
||||
|
||||
public object Locate(Type type) {
|
||||
return Item.ContentItem.Get(type);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
using Orchard.Models;
|
||||
using Orchard.Models.Driver;
|
||||
using Orchard.Models.Records;
|
||||
using Orchard.UI.Models;
|
||||
using Orchard.Models.ViewModels;
|
||||
|
||||
namespace Orchard.Media.Models {
|
||||
public class MediaSettings : ContentPart<MediaSettingsRecord> {
|
||||
@@ -28,7 +28,7 @@ namespace Orchard.Media.Models {
|
||||
if (model == null)
|
||||
return;
|
||||
|
||||
context.Editors.Add(new ModelTemplate(model.Record, "MediaSettings"));
|
||||
context.AddEditor(new TemplateViewModel(model.Record, "MediaSettings"));
|
||||
}
|
||||
|
||||
protected override void UpdateEditors(UpdateContentContext context) {
|
||||
@@ -37,7 +37,7 @@ namespace Orchard.Media.Models {
|
||||
return;
|
||||
|
||||
context.Updater.TryUpdateModel(model.Record, "MediaSettings", null, null);
|
||||
context.Editors.Add(new ModelTemplate(model.Record, "MediaSettings"));
|
||||
context.AddEditor(new TemplateViewModel(model.Record, "MediaSettings"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,12 +2,12 @@
|
||||
using Orchard.Data;
|
||||
using Orchard.Models;
|
||||
using Orchard.Models.Driver;
|
||||
using Orchard.Models.ViewModels;
|
||||
using Orchard.Roles.Models.NoRecord;
|
||||
using Orchard.Roles.Records;
|
||||
using Orchard.Roles.Services;
|
||||
using Orchard.Roles.ViewModels;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Models;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Roles.Models {
|
||||
@@ -46,7 +46,7 @@ namespace Orchard.Roles.Models {
|
||||
Roles = roles.ToList(),
|
||||
};
|
||||
|
||||
context.Editors.Add(new ModelTemplate(viewModel, "UserRoles"));
|
||||
context.AddEditor(new TemplateViewModel(viewModel, "UserRoles"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Orchard.Roles.Models {
|
||||
}
|
||||
|
||||
}
|
||||
context.Editors.Add(new ModelTemplate(viewModel, "UserRoles"));
|
||||
context.AddEditor(new TemplateViewModel(viewModel, "UserRoles"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ namespace Orchard.Sandbox.Controllers {
|
||||
var page = _contentManager.Get<SandboxPage>(id);
|
||||
var model = new PageShowViewModel {
|
||||
Page = page,
|
||||
Displays = _contentManager.GetDisplays(page)
|
||||
ItemView = _contentManager.GetDisplays(page, null, null)
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ namespace Orchard.Sandbox.Controllers {
|
||||
}
|
||||
|
||||
var model = new PageEditViewModel { Page = _contentManager.Get<SandboxPage>(id) };
|
||||
model.Editors = _contentManager.GetEditors(model.Page);
|
||||
model.ItemView = _contentManager.GetEditors(model.Page, null);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Orchard.Sandbox.Controllers {
|
||||
}
|
||||
|
||||
var model = new PageEditViewModel { Page = _contentManager.Get<SandboxPage>(id) };
|
||||
model.Editors = _contentManager.UpdateEditors(model.Page, this);
|
||||
model.ItemView = _contentManager.UpdateEditors(model.Page, null, this);
|
||||
if (!TryUpdateModel(model, input.ToValueProvider()))
|
||||
return View(model);
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Models.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Sandbox.Models;
|
||||
using Orchard.UI.Models;
|
||||
|
||||
namespace Orchard.Sandbox.ViewModels {
|
||||
public class PageEditViewModel : BaseViewModel {
|
||||
public SandboxPage Page { get; set; }
|
||||
public IEnumerable<ModelTemplate> Editors { get; set; }
|
||||
public ItemEditorViewModel ItemView { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Models.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.Sandbox.Models;
|
||||
using Orchard.UI.Models;
|
||||
|
||||
namespace Orchard.Sandbox.ViewModels {
|
||||
public class PageShowViewModel : BaseViewModel {
|
||||
public SandboxPage Page { get; set; }
|
||||
public IEnumerable<ModelTemplate> Displays { get; set; }
|
||||
public ItemDisplayViewModel ItemView { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@
|
||||
<ul>
|
||||
<li>
|
||||
<%=Html.LabelFor(x => x.Page.Record.Name)%><%=Html.EditorFor(x => x.Page.Record.Name)%></li>
|
||||
<%foreach (var x in Model.Editors) { %>
|
||||
<%foreach (var x in Model.ItemView.Editors) { %>
|
||||
<%=Html.EditorFor(m=>x.Model, x.TemplateName, x.Prefix) %>
|
||||
<%} %>
|
||||
<li>
|
||||
|
@@ -21,7 +21,7 @@
|
||||
<div id="main">
|
||||
<% Html.RenderPartial("Messages", Model.Messages); %>
|
||||
<h1><%=Html.Encode(Model.Page.Record.Name) %></h1>
|
||||
<%foreach (var display in Model.Displays) { %>
|
||||
<%foreach (var display in Model.ItemView.Displays) { %>
|
||||
<%=Html.DisplayFor(m=>display.Model, display.TemplateName, display.Prefix) %>
|
||||
<%} %>
|
||||
<p>
|
||||
|
@@ -3,7 +3,7 @@ using System.Linq;
|
||||
using Orchard.Data;
|
||||
using Orchard.Models;
|
||||
using Orchard.Models.Driver;
|
||||
using Orchard.UI.Models;
|
||||
using Orchard.Models.ViewModels;
|
||||
|
||||
namespace Orchard.Tags.Models {
|
||||
public class HasTags : ContentPart {
|
||||
@@ -27,8 +27,8 @@ namespace Orchard.Tags.Models {
|
||||
Filters.Add(new ActivatingFilter<HasTags>("blogpost"));
|
||||
|
||||
OnGetDisplays<HasTags>((context, hasTags) => {
|
||||
context.Displays.Add(new ModelTemplate(hasTags) { Position = "2", TemplateName = "HasTagsList" });
|
||||
context.Displays.Add(new ModelTemplate(hasTags) { Position = "5" });
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { Position = "2", TemplateName = "HasTagsList" });
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { Position = "5" });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace Orchard.Tags.Models {
|
||||
if (context.ContentItem.Has<HasTags>() == false) {
|
||||
return;
|
||||
}
|
||||
context.Editors.Add(new ModelTemplate(context.ContentItem.Get<HasTags>()));
|
||||
context.AddEditor(new TemplateViewModel(context.ContentItem.Get<HasTags>()));
|
||||
}
|
||||
|
||||
protected override void UpdateEditors(UpdateContentContext context) {
|
||||
if (context.ContentItem.Has<HasTags>() == false) {
|
||||
return;
|
||||
}
|
||||
context.Editors.Add(new ModelTemplate(context.ContentItem.Get<HasTags>()));
|
||||
context.AddEditor(new TemplateViewModel(context.ContentItem.Get<HasTags>()));
|
||||
}
|
||||
|
||||
protected override void Loading(LoadContentContext context) {
|
||||
|
@@ -49,7 +49,7 @@ namespace Orchard.Users.Controllers {
|
||||
public ActionResult Create() {
|
||||
var user = _contentManager.New("user");
|
||||
var model = new UserCreateViewModel {
|
||||
Editors = _contentManager.GetEditors(user)
|
||||
ItemView = _contentManager.GetEditors(user, null)
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace Orchard.Users.Controllers {
|
||||
ModelState.AddModelError("ConfirmPassword", T("Password confirmation must match").ToString());
|
||||
}
|
||||
if (ModelState.IsValid == false) {
|
||||
model.Editors = _contentManager.UpdateEditors(_contentManager.New("user"), this);
|
||||
model.ItemView = _contentManager.UpdateEditors(_contentManager.New("user"), null, this);
|
||||
return View(model);
|
||||
}
|
||||
var user = _membershipService.CreateUser(new CreateUserParams(
|
||||
@@ -69,7 +69,7 @@ namespace Orchard.Users.Controllers {
|
||||
model.Password,
|
||||
model.Email,
|
||||
null, null, true));
|
||||
model.Editors = _contentManager.UpdateEditors(user, this);
|
||||
model.ItemView = _contentManager.UpdateEditors(user, null, this);
|
||||
if (ModelState.IsValid == false) {
|
||||
//TODO: rollback transaction
|
||||
return View(model);
|
||||
@@ -80,14 +80,14 @@ namespace Orchard.Users.Controllers {
|
||||
|
||||
public ActionResult Edit(int id) {
|
||||
var model = new UserEditViewModel { User = _contentManager.Get<User>(id) };
|
||||
model.Editors = _contentManager.GetEditors(model.User.ContentItem);
|
||||
model.ItemView = _contentManager.GetEditors(model.User.ContentItem, null);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Edit(int id, FormCollection input) {
|
||||
var model = new UserEditViewModel { User = _contentManager.Get<User>(id) };
|
||||
model.Editors = _contentManager.UpdateEditors(model.User.ContentItem, this);
|
||||
model.ItemView = _contentManager.UpdateEditors(model.User.ContentItem, null, this);
|
||||
|
||||
if (!TryUpdateModel(model, input.ToValueProvider())) {
|
||||
return View(model);
|
||||
|
@@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Orchard.Models.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.UI.Models;
|
||||
|
||||
namespace Orchard.Users.ViewModels {
|
||||
public class UserCreateViewModel : AdminViewModel {
|
||||
@@ -17,7 +18,6 @@ namespace Orchard.Users.ViewModels {
|
||||
[Required, DataType(DataType.Password)]
|
||||
public string ConfirmPassword { get; set; }
|
||||
|
||||
public IEnumerable<ModelTemplate> Editors { get; set; }
|
||||
|
||||
public ItemEditorViewModel ItemView { get; set; }
|
||||
}
|
||||
}
|
@@ -1,15 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Models;
|
||||
using Orchard.Models.ViewModels;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
using Orchard.UI.Models;
|
||||
using Orchard.Users.Models;
|
||||
|
||||
namespace Orchard.Users.ViewModels {
|
||||
public class UserEditViewModel : AdminViewModel {
|
||||
public User User { get; set; }
|
||||
public IEnumerable<ModelTemplate> Editors { get; set; }
|
||||
public ItemEditorViewModel ItemView { get; set; }
|
||||
|
||||
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int Id {
|
||||
@@ -27,5 +29,6 @@ namespace Orchard.Users.ViewModels {
|
||||
get { return User.As<User>().Record.Email; }
|
||||
set { User.As<User>().Record.Email = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -8,6 +8,6 @@
|
||||
<%=Html.EditorFor(m=>m.ConfirmPassword, "inputPasswordLarge") %>
|
||||
</ol>
|
||||
|
||||
<% foreach(var e in Model.Editors) {%>
|
||||
<% foreach(var e in Model.ItemView.Editors) {%>
|
||||
<%=Html.EditorFor(m => e.Model, e.TemplateName, e.Prefix)%>
|
||||
<%} %>
|
||||
|
@@ -7,6 +7,6 @@
|
||||
<%=Html.EditorFor(m=>m.Email, "inputTextLarge") %>
|
||||
</ol>
|
||||
|
||||
<% foreach(var e in Model.Editors) {%>
|
||||
<% foreach(var e in Model.ItemView.Editors) {%>
|
||||
<%=Html.EditorFor(m => e.Model, e.TemplateName, e.Prefix)%>
|
||||
<%} %>
|
||||
|
Reference in New Issue
Block a user