mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Changing around Widget wrappers a little more...
--HG-- branch : dev
This commit is contained in:
@@ -8,17 +8,16 @@ namespace Orchard.Widgets {
|
||||
builder.Describe("Items_Widget")
|
||||
.Configure(descriptor => {
|
||||
// todo: have "alternates" for chrome
|
||||
descriptor.Wrappers.Add("Widget_Wrapper");
|
||||
//todo: (heskew) something...this still doesn't feel right
|
||||
descriptor.Wrappers.Add("Widget_ControlWrapper");
|
||||
descriptor.Wrappers.Add("Widget_Wrapper");
|
||||
})
|
||||
.OnCreated(created => {
|
||||
var widget = created.Shape;
|
||||
widget.Main.Add(created.New.PlaceChildContent(Source: widget));
|
||||
})
|
||||
.OnDisplaying(displaying => {
|
||||
var widget = displaying.Shape;
|
||||
widget.Classes.Add("widget");
|
||||
ContentItem contentItem = widget.ContentItem;
|
||||
ContentItem contentItem = displaying.Shape.ContentItem;
|
||||
if (contentItem != null) {
|
||||
var zoneName = contentItem.As<WidgetPart>().Zone;
|
||||
displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + contentItem.ContentType);
|
||||
|
@@ -1,14 +1,11 @@
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Widgets;
|
||||
@{
|
||||
if (AuthorizedFor(Permissions.ManageWidgets)) {
|
||||
Model.Classes.Add("widget-manage");
|
||||
}
|
||||
var tag = Tag(Model, "div");
|
||||
}
|
||||
@tag.StartElement
|
||||
@if (AuthorizedFor(Permissions.ManageWidgets)) {
|
||||
<div class="manage-actions">@Html.ItemEditLinkWithReturnUrl(T("Edit").Text, (ContentItem)Model.ContentItem)</div>
|
||||
}
|
||||
@if (AuthorizedFor(Permissions.ManageWidgets)) {
|
||||
<div class="widget-control">
|
||||
<div class="manage-actions">@Html.ItemEditLinkWithReturnUrl(T("Edit").Text, (ContentItem)Model.ContentItem)</div>
|
||||
@Display(Model.Main)
|
||||
@tag.EndElement
|
||||
</div>
|
||||
}
|
||||
else {
|
||||
@Display(Model.Main)
|
||||
}
|
@@ -1,14 +1,3 @@
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Widgets;
|
||||
@{
|
||||
if (AuthorizedFor(Permissions.ManageWidgets)) {
|
||||
Model.Classes.Add("widget-manage");
|
||||
}
|
||||
var tag = Tag(Model, "div");
|
||||
}
|
||||
@tag.StartElement
|
||||
@if (AuthorizedFor(Permissions.ManageWidgets)) {
|
||||
<div class="manage-actions">@Html.ItemEditLinkWithReturnUrl(T("Edit").Text, (ContentItem)Model.ContentItem)</div>
|
||||
}
|
||||
@Display(Model.Main)
|
||||
@tag.EndElement
|
||||
<div class="widget">
|
||||
@Display.PlaceChildContent(Source: Model)
|
||||
</div>
|
Reference in New Issue
Block a user