mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Refactored action results to use defaults
--HG-- branch : dev
This commit is contained in:
@@ -203,7 +203,7 @@ namespace Orchard.Core.Contents.Controllers {
|
|||||||
var viewModel = Shape.ViewModel()
|
var viewModel = Shape.ViewModel()
|
||||||
.ContentTypes(list);
|
.ContentTypes(list);
|
||||||
|
|
||||||
return View("CreatableTypeList", viewModel);
|
return View(viewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Create(string id) {
|
public ActionResult Create(string id) {
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</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>
|
<p>Your browser does not support iframes.</p>
|
||||||
</iframe>
|
</iframe>
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@ namespace Orchard.ContentTypes.Controllers {
|
|||||||
#region Types
|
#region Types
|
||||||
|
|
||||||
public ActionResult List() {
|
public ActionResult List() {
|
||||||
return View("List", new ListContentTypesViewModel {
|
return View(new ListContentTypesViewModel {
|
||||||
Types = _contentDefinitionService.GetTypes()
|
Types = _contentDefinitionService.GetTypes()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ namespace Orchard.Experimental.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Execute() {
|
public ActionResult Execute() {
|
||||||
return View("Execute", new CommandsExecuteViewModel());
|
return View(new CommandsExecuteViewModel());
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -37,7 +37,7 @@ namespace Orchard.Experimental.Controllers {
|
|||||||
.Distinct()
|
.Distinct()
|
||||||
.ToArray();
|
.ToArray();
|
||||||
model.Results = writer.ToString();
|
model.Results = writer.ToString();
|
||||||
return View("Execute", model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CommandParameters GetCommandParameters(string commandLine, StringWriter writer) {
|
private static CommandParameters GetCommandParameters(string commandLine, StringWriter writer) {
|
||||||
|
@@ -101,7 +101,7 @@ namespace Orchard.Experimental.Controllers {
|
|||||||
ViewModel.Page.Messages.Add(new HtmlString("<hr/>abuse<hr/>"));
|
ViewModel.Page.Messages.Add(new HtmlString("<hr/>abuse<hr/>"));
|
||||||
ViewModel.Page.Messages.Add("<hr/>encoded<hr/>");
|
ViewModel.Page.Messages.Add("<hr/>encoded<hr/>");
|
||||||
|
|
||||||
return View("UsingShapes", model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string Break(dynamic view) {
|
public static string Break(dynamic view) {
|
||||||
|
@@ -13,7 +13,7 @@ namespace Orchard.Experimental.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult ShapeTable(string themeName) {
|
public ActionResult ShapeTable(string themeName) {
|
||||||
return View("ShapeTable", _shapeTableManager.GetShapeTable(themeName));
|
return View(_shapeTableManager.GetShapeTable(themeName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -43,7 +43,7 @@ namespace Orchard.Packaging.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Sources() {
|
public ActionResult Sources() {
|
||||||
return View("Sources", new PackagingSourcesViewModel {
|
return View(new PackagingSourcesViewModel {
|
||||||
Sources = _packagingSourceManager.GetSources(),
|
Sources = _packagingSourceManager.GetSources(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ namespace Orchard.Packaging.Controllers {
|
|||||||
public ActionResult Modules(Guid? sourceId) {
|
public ActionResult Modules(Guid? sourceId) {
|
||||||
var selectedSource = _packagingSourceManager.GetSources().Where(s => s.Id == sourceId).FirstOrDefault();
|
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")),
|
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),
|
Sources = _packagingSourceManager.GetSources().OrderBy(s => s.FeedTitle),
|
||||||
SelectedSource = selectedSource
|
SelectedSource = selectedSource
|
||||||
@@ -117,7 +117,7 @@ namespace Orchard.Packaging.Controllers {
|
|||||||
public ActionResult Themes(Guid? sourceId) {
|
public ActionResult Themes(Guid? sourceId) {
|
||||||
var selectedSource = _packagingSourceManager.GetSources().Where(s => s.Id == sourceId).FirstOrDefault();
|
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")),
|
Modules = _packagingSourceManager.GetModuleList(selectedSource).Where(p => p.SyndicationItem.Categories.Any(c => c.Name == "Orchard Theme")),
|
||||||
Sources = _packagingSourceManager.GetSources().OrderBy(s => s.FeedTitle),
|
Sources = _packagingSourceManager.GetSources().OrderBy(s => s.FeedTitle),
|
||||||
SelectedSource = selectedSource
|
SelectedSource = selectedSource
|
||||||
@@ -131,7 +131,7 @@ namespace Orchard.Packaging.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Harvest(string extensionName, string feedUrl) {
|
public ActionResult Harvest(string extensionName, string feedUrl) {
|
||||||
return View("Harvest", new PackagingHarvestViewModel {
|
return View(new PackagingHarvestViewModel {
|
||||||
ExtensionName = extensionName,
|
ExtensionName = extensionName,
|
||||||
FeedUrl = feedUrl,
|
FeedUrl = feedUrl,
|
||||||
Sources = _packagingSourceManager.GetSources(),
|
Sources = _packagingSourceManager.GetSources(),
|
||||||
@@ -155,7 +155,7 @@ namespace Orchard.Packaging.Controllers {
|
|||||||
|
|
||||||
if (!model.Sources.Any(src => src.FeedUrl == model.FeedUrl)) {
|
if (!model.Sources.Any(src => src.FeedUrl == model.FeedUrl)) {
|
||||||
ModelState.AddModelError("FeedUrl", T("May only push directly to one of the configured sources.").ToString());
|
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);
|
_packageManager.Push(packageData, model.FeedUrl, model.User, model.Password);
|
||||||
|
@@ -56,7 +56,7 @@ namespace Orchard.Users.Controllers {
|
|||||||
if (_authenticationService.GetAuthenticatedUser() != null)
|
if (_authenticationService.GetAuthenticatedUser() != null)
|
||||||
return Redirect("~/");
|
return Redirect("~/");
|
||||||
|
|
||||||
return View("LogOn", new LogOnViewModel {Title = "Log On"});
|
return View(new LogOnViewModel {Title = "Log On"});
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -65,7 +65,7 @@ namespace Orchard.Users.Controllers {
|
|||||||
public ActionResult LogOn(string userNameOrEmail, string password, bool rememberMe, string returnUrl) {
|
public ActionResult LogOn(string userNameOrEmail, string password, bool rememberMe, string returnUrl) {
|
||||||
var user = ValidateLogOn(userNameOrEmail, password);
|
var user = ValidateLogOn(userNameOrEmail, password);
|
||||||
if (!ModelState.IsValid) {
|
if (!ModelState.IsValid) {
|
||||||
return View("LogOn", new LogOnViewModel {Title = "Log On"});
|
return View(new LogOnViewModel {Title = "Log On"});
|
||||||
}
|
}
|
||||||
|
|
||||||
_authenticationService.SignIn(user, rememberMe);
|
_authenticationService.SignIn(user, rememberMe);
|
||||||
|
Reference in New Issue
Block a user