mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18210: Changing preview to pass a version through, this was layers are kicked in.
Work Item: 18210
This commit is contained in:
@@ -22,10 +22,13 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
public Localizer T { get; set; }
|
||||
|
||||
// /Contents/Item/Display/72
|
||||
public ActionResult Display(int? id) {
|
||||
public ActionResult Display(int? id, int? version) {
|
||||
if (id == null)
|
||||
return HttpNotFound();
|
||||
|
||||
if (version.HasValue)
|
||||
return Preview(id, version);
|
||||
|
||||
var contentItem = _contentManager.Get(id.Value, VersionOptions.Published);
|
||||
|
||||
if (contentItem == null)
|
||||
|
@@ -15,7 +15,7 @@
|
||||
@Html.Link(T("Publish Draft").Text, Url.Action("Publish", "Admin", new { area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "UnsafeUrl" })
|
||||
@T(" | ")
|
||||
|
||||
@Html.ActionLink(T("Preview").Text, "Preview", "Item", new {area = "Contents", id = ((ContentItem) Model.ContentPart.ContentItem).Id}, new {})
|
||||
@Html.ActionLink(T("Preview").Text, "Display", "Item", new {area = "Contents", id = ((ContentItem) Model.ContentPart.ContentItem, version = ((ContentItem)Model.ContentPart.ContentItem).Version).Id}, new {})
|
||||
@T(" | ")
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
} else {
|
||||
if ( contentPart.HasDraft() ) {
|
||||
@Html.ActionLink(T("Preview").Text, "Preview", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id }, new { })
|
||||
@Html.ActionLink(T("Preview").Text, "Display", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id, version = ((ContentItem)Model.ContentPart.ContentItem).Version }, new { })
|
||||
@T(" | ")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user