mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Adding an "Edit" link for content on the front
--HG-- branch : dev
This commit is contained in:
@@ -5,6 +5,11 @@ namespace Orchard.Core.Contents {
|
||||
public class Shapes : IShapeTableProvider {
|
||||
public void Discover(ShapeTableBuilder builder) {
|
||||
builder.Describe("Content")
|
||||
.Configure(descriptor => descriptor.Wrappers.Add("Content_ControlWrapper"))
|
||||
.OnCreated(created => {
|
||||
var content = created.Shape;
|
||||
content.Main.Add(created.New.PlaceChildContent(Source: content));
|
||||
})
|
||||
.OnDisplaying(displaying => {
|
||||
ContentItem contentItem = displaying.Shape.ContentItem;
|
||||
if (contentItem != null) {
|
||||
|
@@ -0,0 +1,11 @@
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Core.Contents;
|
||||
@if (AuthorizedFor(Permissions.EditContent)) {
|
||||
<div class="content-control">
|
||||
<div class="manage-actions">@Html.ItemEditLinkWithReturnUrl(T("Edit").Text, (ContentItem)Model.ContentItem)</div>
|
||||
@Display(Model.Main)
|
||||
</div>
|
||||
}
|
||||
else {
|
||||
@Display(Model.Main)
|
||||
}
|
@@ -394,6 +394,7 @@
|
||||
<Content Include="Dashboard\Views\Helper\Index.cshtml" />
|
||||
<None Include="Common\Placement.info" />
|
||||
<None Include="Contents\Placement.info" />
|
||||
<None Include="Contents\Views\Content.ControlWrapper.cshtml" />
|
||||
<None Include="Localization\Placement.info" />
|
||||
<None Include="PublishLater\Placement.info" />
|
||||
<None Include="Routable\Views\Parts\RoutableTitle.cshtml" />
|
||||
|
Reference in New Issue
Block a user