diff --git a/src/Orchard.Web/Modules/Orchard.Indexing/Orchard.Indexing.csproj b/src/Orchard.Web/Modules/Orchard.Indexing/Orchard.Indexing.csproj index 63d1f7a76..4a1b81845 100644 --- a/src/Orchard.Web/Modules/Orchard.Indexing/Orchard.Indexing.csproj +++ b/src/Orchard.Web/Modules/Orchard.Indexing/Orchard.Indexing.csproj @@ -59,7 +59,6 @@ - @@ -100,6 +99,7 @@ + diff --git a/src/Orchard.Web/Modules/Orchard.Indexing/ResourceManifest.cs b/src/Orchard.Web/Modules/Orchard.Indexing/ResourceManifest.cs deleted file mode 100644 index f6bcc7f69..000000000 --- a/src/Orchard.Web/Modules/Orchard.Indexing/ResourceManifest.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Orchard.UI.Resources; - -namespace Orchard.Indexing { - public class ResourceManifest : IResourceManifestProvider { - public void BuildManifests(ResourceManifestBuilder builder) { - builder.Add().DefineStyle("IndexingAdmin").SetUrl("admin.css"); // todo: this does not exist - } - } -} diff --git a/src/Orchard.Web/Modules/Orchard.Indexing/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Indexing/Views/Admin/Index.cshtml index 21272c6f5..89c56cb3f 100644 --- a/src/Orchard.Web/Modules/Orchard.Indexing/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Indexing/Views/Admin/Index.cshtml @@ -1,5 +1,4 @@ @model Orchard.Indexing.ViewModels.IndexViewModel -@{ Style.Require("IndexingAdmin"); }

@Html.TitleForPage(T("Search Index Management").ToString())

@using (Html.BeginForm("update", "admin", FormMethod.Post, new {area = "Orchard.Indexing"})) { diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Roles/Controllers/AdminController.cs index e48956f79..e611021c6 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Roles/Controllers/AdminController.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; +using Orchard.Core.Contents.Controllers; using Orchard.Localization; using Orchard.Roles.Models; using Orchard.Roles.Services; @@ -98,9 +99,9 @@ namespace Orchard.Roles.Controllers { var role = _roleService.GetRole(id); if (role == null) { - //TODO: Error message - throw new HttpException(404, "page with id " + id + " was not found"); + return HttpNotFound(); } + var model = new RoleEditViewModel { Name = role.Name, Id = role.Id, RoleCategoryPermissions = _roleService.GetInstalledPermissions(), CurrentPermissions = _roleService.GetPermissionsForRole(id)}; @@ -117,7 +118,8 @@ namespace Orchard.Roles.Controllers { } [HttpPost, ActionName("Edit")] - public ActionResult EditPOST() { + [FormValueRequired("submit.Save")] + public ActionResult EditSavePOST(int id) { if (!Services.Authorizer.Authorize(Permissions.ManageRoles, T("Not authorized to manage roles"))) return new HttpUnauthorizedResult(); @@ -125,24 +127,38 @@ namespace Orchard.Roles.Controllers { try { UpdateModel(viewModel); // Save - if (!String.IsNullOrEmpty(HttpContext.Request.Form["submit.Save"])) { - List rolePermissions = new List(); - foreach (string key in Request.Form.Keys) { - if (key.StartsWith("Checkbox.") && Request.Form[key] == "true") { - string permissionName = key.Substring("Checkbox.".Length); - rolePermissions.Add(permissionName); - } + List rolePermissions = new List(); + foreach (string key in Request.Form.Keys) { + if (key.StartsWith("Checkbox.") && Request.Form[key] == "true") { + string permissionName = key.Substring("Checkbox.".Length); + rolePermissions.Add(permissionName); } - _roleService.UpdateRole(viewModel.Id, viewModel.Name, rolePermissions); } - else if (!String.IsNullOrEmpty(HttpContext.Request.Form["submit.Delete"])) { - _roleService.DeleteRole(viewModel.Id); - } - return RedirectToAction("Edit", new { viewModel.Id }); + _roleService.UpdateRole(viewModel.Id, viewModel.Name, rolePermissions); + + Services.Notifier.Information(T("Your Role has been saved.")); + return RedirectToAction("Edit", new { id }); } catch (Exception exception) { Services.Notifier.Error(T("Editing Role failed: {0}", exception.Message)); - return RedirectToAction("Edit", viewModel.Id); + return RedirectToAction("Edit", id); + } + } + + [HttpPost, ActionName("Edit")] + [FormValueRequired("submit.Delete")] + public ActionResult EditDeletePOST(int id) { + if (!Services.Authorizer.Authorize(Permissions.ManageRoles, T("Not authorized to manage roles"))) + return new HttpUnauthorizedResult(); + + try { + _roleService.DeleteRole(id); + + Services.Notifier.Information(T("Role was successfully deleted.")); + return RedirectToAction("Index"); + } catch (Exception exception) { + Services.Notifier.Error(T("Editing Role failed: {0}", exception.Message)); + return RedirectToAction("Edit", id); } } } diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj b/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj index cd9fb5214..5276d0806 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj +++ b/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj @@ -103,6 +103,10 @@ {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} Orchard.Framework + + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + Orchard.Core +
diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Roles/Views/Admin/Index.cshtml index 16fc00388..44aa8971f 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Roles/Views/Admin/Index.cshtml @@ -9,24 +9,24 @@ - - + +
@Html.ActionLink(T("Add a role").ToString(), "Create", new { }, new { @class = "button primaryAction" })
- - - - - - - - - - - @foreach (var row in Model.Rows) { + + + + + + + + + + + @foreach (var row in Model.Rows) { @@ -34,7 +34,5 @@ }
 ↓@T("Name")
 ↓@T("Name")
@row.Name
-
- } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs index 5560ea0fc..2a7dd5851 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs @@ -44,9 +44,10 @@ namespace Orchard.Widgets.Controllers { layers.First() : layers.FirstOrDefault(layer => layer.Id == id); - if (currentLayer == null) { + if (currentLayer == null && + id != null) { // Incorrect layer id passed - Services.Notifier.Error(T("Layer not found: {1}", id)); + Services.Notifier.Error(T("Layer not found: {0}", id)); return RedirectToAction("Index"); } @@ -254,7 +255,7 @@ namespace Orchard.Widgets.Controllers { try { widgetPart = _widgetsService.GetWidget(id); if (widgetPart == null) { - Services.Notifier.Error(T("Widget not found: {1}", id)); + Services.Notifier.Error(T("Widget not found: {0}", id)); return RedirectToAction("Index"); }