Changing some method names, adding zone helpers for item editor template

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043117
This commit is contained in:
loudej
2009-12-03 22:35:45 +00:00
parent 9f81c16228
commit edcec5a480
46 changed files with 309 additions and 207 deletions

View File

@@ -49,7 +49,7 @@ namespace Orchard.Users.Controllers {
public ActionResult Create() {
var user = _contentManager.New("user");
var model = new UserCreateViewModel {
ItemView = _contentManager.GetEditors(user, null)
ItemView = _contentManager.GetEditorViewModel(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.ItemView = _contentManager.UpdateEditors(_contentManager.New("user"), null, this);
model.ItemView = _contentManager.UpdateEditorViewModel(_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.ItemView = _contentManager.UpdateEditors(user, null, this);
model.ItemView = _contentManager.UpdateEditorViewModel(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.ItemView = _contentManager.GetEditors(model.User.ContentItem, null);
model.ItemView = _contentManager.GetEditorViewModel(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.ItemView = _contentManager.UpdateEditors(model.User.ContentItem, null, this);
model.ItemView = _contentManager.UpdateEditorViewModel(model.User.ContentItem, null, this);
if (!TryUpdateModel(model, input.ToValueProvider())) {
return View(model);