Refactored action results to use defaults

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-10-14 14:51:41 -07:00
parent 284576a62a
commit 477405bd3c
8 changed files with 14 additions and 14 deletions

View File

@@ -203,7 +203,7 @@ namespace Orchard.Core.Contents.Controllers {
var viewModel = Shape.ViewModel()
.ContentTypes(list);
return View("CreatableTypeList", viewModel);
return View(viewModel);
}
public ActionResult Create(string id) {

View File

@@ -11,7 +11,7 @@
}
</script>
<iframe id="advisory" src="http://localhost:30320/OrchardLocal/Advisory.aspx" frameborder="0" height="0" width="100%" >
<iframe id="advisory" src="http://www.orchardproject.net/advisory" frameborder="0" height="0" width="100%" >
<p>Your browser does not support iframes.</p>
</iframe>

View File

@@ -27,7 +27,7 @@ namespace Orchard.ContentTypes.Controllers {
#region Types
public ActionResult List() {
return View("List", new ListContentTypesViewModel {
return View(new ListContentTypesViewModel {
Types = _contentDefinitionService.GetTypes()
});
}

View File

@@ -22,7 +22,7 @@ namespace Orchard.Experimental.Controllers {
}
public ActionResult Execute() {
return View("Execute", new CommandsExecuteViewModel());
return View(new CommandsExecuteViewModel());
}
[HttpPost]
@@ -37,7 +37,7 @@ namespace Orchard.Experimental.Controllers {
.Distinct()
.ToArray();
model.Results = writer.ToString();
return View("Execute", model);
return View(model);
}
private static CommandParameters GetCommandParameters(string commandLine, StringWriter writer) {

View File

@@ -101,7 +101,7 @@ namespace Orchard.Experimental.Controllers {
ViewModel.Page.Messages.Add(new HtmlString("<hr/>abuse<hr/>"));
ViewModel.Page.Messages.Add("<hr/>encoded<hr/>");
return View("UsingShapes", model);
return View(model);
}
public static string Break(dynamic view) {

View File

@@ -13,7 +13,7 @@ namespace Orchard.Experimental.Controllers {
}
public ActionResult ShapeTable(string themeName) {
return View("ShapeTable", _shapeTableManager.GetShapeTable(themeName));
return View(_shapeTableManager.GetShapeTable(themeName));
}
}
}

View File

@@ -43,7 +43,7 @@ namespace Orchard.Packaging.Controllers {
}
public ActionResult Sources() {
return View("Sources", new PackagingSourcesViewModel {
return View(new PackagingSourcesViewModel {
Sources = _packagingSourceManager.GetSources(),
});
}
@@ -107,7 +107,7 @@ namespace Orchard.Packaging.Controllers {
public ActionResult Modules(Guid? sourceId) {
var selectedSource = _packagingSourceManager.GetSources().Where(s => s.Id == sourceId).FirstOrDefault();
return View("Modules", new PackagingModulesViewModel {
return View(new PackagingModulesViewModel {
Modules = _packagingSourceManager.GetModuleList(selectedSource).Where(p => p.SyndicationItem.Categories.All(c => c.Name == "Orchard Module" || c.Name != "Orchard Theme")),
Sources = _packagingSourceManager.GetSources().OrderBy(s => s.FeedTitle),
SelectedSource = selectedSource
@@ -117,7 +117,7 @@ namespace Orchard.Packaging.Controllers {
public ActionResult Themes(Guid? sourceId) {
var selectedSource = _packagingSourceManager.GetSources().Where(s => s.Id == sourceId).FirstOrDefault();
return View("Themes", new PackagingModulesViewModel {
return View(new PackagingModulesViewModel {
Modules = _packagingSourceManager.GetModuleList(selectedSource).Where(p => p.SyndicationItem.Categories.Any(c => c.Name == "Orchard Theme")),
Sources = _packagingSourceManager.GetSources().OrderBy(s => s.FeedTitle),
SelectedSource = selectedSource
@@ -131,7 +131,7 @@ namespace Orchard.Packaging.Controllers {
}
public ActionResult Harvest(string extensionName, string feedUrl) {
return View("Harvest", new PackagingHarvestViewModel {
return View(new PackagingHarvestViewModel {
ExtensionName = extensionName,
FeedUrl = feedUrl,
Sources = _packagingSourceManager.GetSources(),
@@ -155,7 +155,7 @@ namespace Orchard.Packaging.Controllers {
if (!model.Sources.Any(src => src.FeedUrl == model.FeedUrl)) {
ModelState.AddModelError("FeedUrl", T("May only push directly to one of the configured sources.").ToString());
return View("Harvest", model);
return View(model);
}
_packageManager.Push(packageData, model.FeedUrl, model.User, model.Password);

View File

@@ -56,7 +56,7 @@ namespace Orchard.Users.Controllers {
if (_authenticationService.GetAuthenticatedUser() != null)
return Redirect("~/");
return View("LogOn", new LogOnViewModel {Title = "Log On"});
return View(new LogOnViewModel {Title = "Log On"});
}
[HttpPost]
@@ -65,7 +65,7 @@ namespace Orchard.Users.Controllers {
public ActionResult LogOn(string userNameOrEmail, string password, bool rememberMe, string returnUrl) {
var user = ValidateLogOn(userNameOrEmail, password);
if (!ModelState.IsValid) {
return View("LogOn", new LogOnViewModel {Title = "Log On"});
return View(new LogOnViewModel {Title = "Log On"});
}
_authenticationService.SignIn(user, rememberMe);