mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Updating the tag management UI to link the tag name up with the tag edit page and added a remove action (button and controller action)
--HG-- branch : dev
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -1,11 +1,13 @@
|
||||
@model Orchard.Tags.ViewModels.TagsAdminIndexViewModel
|
||||
|
||||
@using Orchard.Tags.ViewModels;
|
||||
@using Orchard.Utility.Extensions;
|
||||
@{
|
||||
Script.Require("ShapesBase");
|
||||
}
|
||||
|
||||
<h1>@Html.TitleForPage(T("Manage Tags").ToString()) </h1>
|
||||
|
||||
@using(Html.BeginFormAntiForgeryPost()) {
|
||||
@Html.ValidationSummary()
|
||||
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="publishActions">@T("Actions:")</label>
|
||||
<select id="publishActions" name="@Html.NameOf(m => m.BulkAction)">
|
||||
@@ -14,7 +16,6 @@
|
||||
</select>
|
||||
<button type="submit"name="submit.BulkEdit" value="@T("Apply")">@T("Apply")</button>
|
||||
</fieldset>
|
||||
|
||||
<div class="manage">@Html.ActionLink(T("Add a tag").ToString(), "Create", new { }, new { @class = "button primaryAction" })</div>
|
||||
<fieldset>
|
||||
<table class="items" summary="@T("This is a table of the tags in your application")" >
|
||||
@@ -36,13 +37,15 @@
|
||||
<input type="checkbox" value="true" name="@Html.NameOf(m => m.Tags[tagIndex].IsChecked)"/>
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink(Html.Encode(tagEntry.Tag.TagName), "Search", new {id = tagEntry.Tag.Id})
|
||||
@Html.ActionLink(tagEntry.Tag.TagName, "Edit", new {id = tagEntry.Tag.Id})
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink(T("Edit").ToString(), "Edit", new {id = tagEntry.Tag.Id})
|
||||
@Html.ActionLink(T("Edit").ToString(), "Edit", new {id = tagEntry.Tag.Id}) @T(" | ")
|
||||
<a href="@Url.Action("Remove", new {tagEntry.Tag.Id, returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString()})" itemprop="RemoveUrl UnsafeUrl">@T("Remove")</a>
|
||||
</td>
|
||||
</tr>
|
||||
tagIndex = tagIndex + 1;
|
||||
}
|
||||
</table>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
}
|
Reference in New Issue
Block a user