mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +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")
|
builder.Describe("Items_Widget")
|
||||||
.Configure(descriptor => {
|
.Configure(descriptor => {
|
||||||
// todo: have "alternates" for chrome
|
// 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_ControlWrapper");
|
||||||
|
descriptor.Wrappers.Add("Widget_Wrapper");
|
||||||
})
|
})
|
||||||
.OnCreated(created => {
|
.OnCreated(created => {
|
||||||
var widget = created.Shape;
|
var widget = created.Shape;
|
||||||
widget.Main.Add(created.New.PlaceChildContent(Source: widget));
|
widget.Main.Add(created.New.PlaceChildContent(Source: widget));
|
||||||
})
|
})
|
||||||
.OnDisplaying(displaying => {
|
.OnDisplaying(displaying => {
|
||||||
var widget = displaying.Shape;
|
ContentItem contentItem = displaying.Shape.ContentItem;
|
||||||
widget.Classes.Add("widget");
|
|
||||||
ContentItem contentItem = widget.ContentItem;
|
|
||||||
if (contentItem != null) {
|
if (contentItem != null) {
|
||||||
var zoneName = contentItem.As<WidgetPart>().Zone;
|
var zoneName = contentItem.As<WidgetPart>().Zone;
|
||||||
displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + contentItem.ContentType);
|
displaying.ShapeMetadata.Alternates.Add("Items_Widget__" + contentItem.ContentType);
|
||||||
|
@@ -1,14 +1,11 @@
|
|||||||
@using Orchard.ContentManagement;
|
@using Orchard.ContentManagement;
|
||||||
@using Orchard.Widgets;
|
@using Orchard.Widgets;
|
||||||
@{
|
@if (AuthorizedFor(Permissions.ManageWidgets)) {
|
||||||
if (AuthorizedFor(Permissions.ManageWidgets)) {
|
<div class="widget-control">
|
||||||
Model.Classes.Add("widget-manage");
|
<div class="manage-actions">@Html.ItemEditLinkWithReturnUrl(T("Edit").Text, (ContentItem)Model.ContentItem)</div>
|
||||||
}
|
|
||||||
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)
|
@Display(Model.Main)
|
||||||
@tag.EndElement
|
</div>
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
@Display(Model.Main)
|
||||||
|
}
|
@@ -1,14 +1,3 @@
|
|||||||
@using Orchard.ContentManagement;
|
<div class="widget">
|
||||||
@using Orchard.Widgets;
|
@Display.PlaceChildContent(Source: Model)
|
||||||
@{
|
</div>
|
||||||
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
|
|
Reference in New Issue
Block a user