diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Tags/Controllers/AdminController.cs index f739d7a8e..a63154956 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/Controllers/AdminController.cs @@ -111,6 +111,24 @@ namespace Orchard.Tags.Controllers { return RedirectToAction("Index"); } + [HttpPost] + public ActionResult Remove(int id, string returnUrl) { + if (!Services.Authorizer.Authorize(Permissions.ManageTags, T("Couldn't remove tag"))) + return new HttpUnauthorizedResult(); + + Tag tag = _tagService.GetTag(id); + + if (tag == null) + return new HttpNotFoundResult(); + + _tagService.DeleteTag(id); + + if (!string.IsNullOrWhiteSpace(returnUrl)) + return Redirect(returnUrl); + + return RedirectToAction("Index"); + } + public ActionResult Search(int id) { Tag tag = _tagService.GetTag(id); diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Tags/Views/Admin/Index.cshtml index f16c3fb52..46df12f8b 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Tags/Views/Admin/Index.cshtml @@ -1,11 +1,13 @@ @model Orchard.Tags.ViewModels.TagsAdminIndexViewModel - @using Orchard.Tags.ViewModels; +@using Orchard.Utility.Extensions; +@{ + Script.Require("ShapesBase"); +}