mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -80,6 +80,7 @@
|
||||
<Content Include="Content\Admin\images\movedown.gif" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\images\arrows.png" />
|
||||
<Content Include="Styles\images\eye.png" />
|
||||
<Content Include="Styles\images\menu.widgets.png" />
|
||||
<Content Include="Styles\menu.widgets-admin.css" />
|
||||
<Content Include="Styles\orchard-widgets-admin.css" />
|
||||
@@ -127,11 +128,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Content-WidgetPage.cshtml" />
|
||||
<Content Include="Views\Widget.cshtml" />
|
||||
<Content Include="Views\Widget.Edit.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\EditorTemplates\Parts.Widgets.LayerPart.cshtml" />
|
||||
<Content Include="Views\EditorTemplates\Parts.Widgets.WidgetPart.cshtml" />
|
||||
@@ -145,6 +141,18 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Admin\ChooseWidget.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\WidgetLayersControl.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\WidgetPlacement.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\WidgetSimplePreview.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\WidgetLayerVisibility.cshtml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
BIN
src/Orchard.Web/Modules/Orchard.Widgets/Styles/images/eye.png
Normal file
BIN
src/Orchard.Web/Modules/Orchard.Widgets/Styles/images/eye.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 442 B |
@@ -2,7 +2,6 @@
|
||||
float:left;
|
||||
width:65%;
|
||||
}
|
||||
#widgets-placement { }
|
||||
#layout-widgets-assistance {
|
||||
float:right;
|
||||
width:35%;
|
||||
@@ -42,7 +41,7 @@ margin:5px 0;
|
||||
padding:0 10px;
|
||||
position:relative;
|
||||
}
|
||||
#widgets-zones li:hover {
|
||||
#widgets-zones li:hover, #widgets-zones li.on {
|
||||
border-color:#bfd3a7;
|
||||
}
|
||||
#widgets-zones h2 {
|
||||
@@ -51,20 +50,23 @@ font-size:1.077em;
|
||||
#widgets-available h2 {
|
||||
font-size:1.231em;
|
||||
}
|
||||
#widgets-zones h2, #widgets-zones li li {
|
||||
#widgets-zones h2, #widgets-zones li li, #widgets-layer-visibility li {
|
||||
color:#333;
|
||||
}
|
||||
#widgets-zones li li {
|
||||
#widgets-zones li li, #widgets-layer-visibility li {
|
||||
background:#F3F4F5;
|
||||
border:0;
|
||||
border-left:3px solid #EAEAEA;
|
||||
margin:10px 0;
|
||||
padding:5px 100px 5px 25px;
|
||||
}
|
||||
#widgets-zones li li.widgets-this-layer {
|
||||
#widgets-layer-visibility li {
|
||||
margin:1px 0 0;
|
||||
}
|
||||
#widgets-zones li li.widgets-this-layer, #widgets-layer-visibility li.widgets-this-layer, #widgets-layer-visibility li.widgets-this-layer:hover {
|
||||
border-color:#898989;
|
||||
}
|
||||
#widgets-zones li li.widgets-this-layer:hover {
|
||||
#widgets-zones li li.widgets-this-layer:hover, #widgets-layer-visibility li:hover {
|
||||
border-color:#bfd3a7;
|
||||
}
|
||||
#widgets-zones .widgets-mover {
|
||||
@@ -140,6 +142,19 @@ color:#333;
|
||||
margin-top:5px;
|
||||
}
|
||||
|
||||
#widgets-layer-visibility {
|
||||
margin-top:20px;
|
||||
}
|
||||
#widgets-layer-visibility .widgets-other-layer {
|
||||
background-image:url(images/eye.png);
|
||||
background-position:5px 11px;
|
||||
background-repeat:no-repeat;
|
||||
cursor:pointer;
|
||||
}
|
||||
#widgets-layer-visibility .widgets-other-layer.off, #widgets-layer-visibility .widgets-other-layer.off:hover {
|
||||
background-position:5px -17px;
|
||||
}
|
||||
|
||||
/* begin: switchable tweaks for admin/widgets */
|
||||
#widgets-placement .switch-for-switchable {
|
||||
margin:-32px 10px -2px 0;
|
||||
|
@@ -1,86 +1,18 @@
|
||||
@using Orchard.Utility.Extensions;
|
||||
@using Orchard.Widgets.Models;
|
||||
@{
|
||||
@{
|
||||
Style.Require("WidgetsAdmin");
|
||||
Script.Require("Switchable");
|
||||
Style.Require("Switchable");
|
||||
Layout.Title = T("Manage Widgets").ToString();
|
||||
IEnumerable<LayerPart> layers = Model.Layers;
|
||||
IEnumerable<WidgetPart> widgets = Model.Widgets;
|
||||
IEnumerable<string> zones = Model.Zones;
|
||||
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||
}
|
||||
|
||||
<div id="widgets" class="group">
|
||||
<div id="widgets-layers-control" class="widgets-container">
|
||||
@if (layers.Count() > 0) {
|
||||
using (Html.BeginForm("index", "admin", FormMethod.Get, new {area = "Orchard.Widgets"})) {
|
||||
<fieldset class="bulk-actions-auto">
|
||||
<label for="layerId">@T("Current Layer:")</label>
|
||||
<select id="layerId" name="layerId">
|
||||
@foreach (var layer in Model.Layers) {
|
||||
@Html.SelectOption((int)Model.CurrentLayer.Id, (int)layer.Id, (string)layer.Name)
|
||||
}
|
||||
</select>
|
||||
<button type="submit" class="apply-bulk-actions-auto">@T("Show")</button>
|
||||
@Html.Link(T("Edit").Text, Url.Action("EditLayer", "Admin", new { area = "Orchard.Widgets", id = Model.CurrentLayer.Id, returnUrl }), new { @class = "button" })
|
||||
</fieldset>
|
||||
}
|
||||
}
|
||||
@Html.Link(T("Add a new layer...").Text, Url.Action("AddLayer", "Admin", new { area = "Orchard.Widgets", returnUrl }))
|
||||
</div>
|
||||
@Display.WidgetLayersControl(Layers: Model.Layers, CurrentLayer: Model.CurrentLayer)
|
||||
<div id="layout-widgets-placement">
|
||||
<div id="widgets-placement">
|
||||
<div id="widgets-layers" class="widgets-container detail-view switchable">
|
||||
<div id="widgets-zones">
|
||||
@using (Html.BeginFormAntiForgeryPost()) {
|
||||
<ol>
|
||||
@foreach (string zone in zones) {
|
||||
int count = widgets.Where(w => w.Zone == zone).Count();
|
||||
MvcHtmlString classAttr = null;
|
||||
if (count == 0) {
|
||||
classAttr = new MvcHtmlString(" class=\"widgets-none\"");
|
||||
}
|
||||
<li@(classAttr)>
|
||||
<h2>@zone</h2>
|
||||
<div class="widgets-actions">@Html.ActionLink(T("Add").Text, "ChooseWidget", new { layerId = Model.CurrentLayer.Id, zone, returnUrl }, new { @class = "button" })</div>
|
||||
<ul class="widgets-zone-widgets">
|
||||
@if (count > 0) {
|
||||
int i = 0;
|
||||
foreach (WidgetPart widget in widgets.Where(w => w.Zone == zone).OrderBy(w => w.Position, new Orchard.UI.FlatPositionComparer())) {
|
||||
<li class="widgets-@(widget.LayerId == Model.CurrentLayer.Id ? "this" : "other")-layer">
|
||||
<h3>@Html.ActionLink(HasText(widget.Title) ? widget.Title : widget.TypeDefinition.DisplayName, "EditWidget", new { @widget.Id, returnUrl })</h3>
|
||||
<div class="widgets-actions">
|
||||
@if (widget.LayerId != Model.CurrentLayer.Id) {
|
||||
<button name="moveHere" value="@widget.Id" class="link" type="submit">@T("Move to current layer")</button>
|
||||
}
|
||||
else { /* it could be useful to remove the widget regardless of the layer it's on but there's no place in the current UI for this and "Move to current layer" */
|
||||
<button name="moveOut" value="@widget.Id" class="link" type="submit">@T("Remove")</button>
|
||||
}
|
||||
</div>
|
||||
<div class="widgets-move-somewhere">
|
||||
<button name="moveUp" value="@widget.Id" @(i == 0 ? "disabled='disabled'" : "") class="widgets-move widgets-move-up" type="submit" title="@T("Move up")">@T("Move up")</button>
|
||||
<button name="moveDown" value="@widget.Id" @(++i == count ? "disabled='disabled'" : "") class="widgets-move widgets-move-down" type="submit" title="@T("Move down")">@T("Move down")</button>
|
||||
@Html.Hidden("returnUrl", returnUrl)
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
}
|
||||
</ol>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@Display.WidgetPlacement(Widgets: Model.Widgets, Zones: Model.Zones, CurrentLayer: Model.CurrentLayer)
|
||||
</div>
|
||||
<div id="layout-widgets-assistance">
|
||||
<div id="widgets-assistance">
|
||||
<div class="widgets-container">
|
||||
<p>[theme preview image]</p>
|
||||
<p>[layer visibility]</p>
|
||||
@Display.WidgetSimplePreview()
|
||||
@Display.WidgetLayerVisibility(Layers: Model.Layers, CurrentLayer: Model.CurrentLayer)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,53 @@
|
||||
@using Orchard.Widgets.Models;
|
||||
@{
|
||||
Style.Require("WidgetsAdmin");
|
||||
Script.Require("jQuery");
|
||||
IEnumerable<LayerPart> layers = Model.Layers;
|
||||
}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
document.write("<div id=\"widgets-layer-visibility\"><h5>Hide widgets in other layers:</h5></div>");
|
||||
//]]>
|
||||
</script>
|
||||
@using(Script.Foot()) {
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
(function ($) {
|
||||
var currentLayerId = @Model.CurrentLayer.Id;
|
||||
var layers = [
|
||||
@foreach (var layer in layers) {
|
||||
<text>{"name":"@layer.Name","id":@layer.Id}@(layer != layers.Last() ? "," : "")</text>
|
||||
}
|
||||
];
|
||||
var visWrapper = $("#widgets-layer-visibility");
|
||||
var visContainer = $("<ul></ul>");
|
||||
|
||||
var widgetPlacement = $("#widgets-zones");
|
||||
for (var i = 0; i < layers.length; i++) {
|
||||
var layersWidgets = widgetPlacement.find(".widgets-layer-" + layers[i].id);
|
||||
if (layersWidgets.length > 0) {
|
||||
var layer = $("<li class=\"widgets-" + ((layers[i].id == currentLayerId && "this") || "other") + "-layer\">" + layers[i].name + "</li>");
|
||||
layer.data("widgets", layersWidgets);
|
||||
visContainer.append(layer);
|
||||
}
|
||||
}
|
||||
|
||||
$("#widgets-layer-visibility .widgets-other-layer").live("click", function() {
|
||||
var _this = $(this);
|
||||
_this.toggleClass("off");
|
||||
if (_this.hasClass("off")) {
|
||||
_this.data("widgets").hide();
|
||||
}
|
||||
else {
|
||||
_this.data("widgets").show();
|
||||
}
|
||||
});
|
||||
$("#widgets-layer-visibility .widgets-other-layer").live("hover", function() {
|
||||
$(this).data("widgets").toggleClass("on");
|
||||
});
|
||||
|
||||
visWrapper.append(visContainer);
|
||||
})(jQuery);
|
||||
//]]>
|
||||
</script>
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
@using Orchard.Utility.Extensions;
|
||||
@using Orchard.Widgets.Models;
|
||||
@{
|
||||
Style.Require("WidgetsAdmin");
|
||||
Script.Require("Switchable");
|
||||
Style.Require("Switchable");
|
||||
IEnumerable<LayerPart> layers = Model.Layers;
|
||||
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||
}
|
||||
<div id="widgets-layers-control" class="widgets-container">
|
||||
@if (layers.Count() > 0) {
|
||||
using (Html.BeginForm("index", "admin", FormMethod.Get, new {area = "Orchard.Widgets"})) {
|
||||
<fieldset class="bulk-actions-auto">
|
||||
<label for="layerId">@T("Current Layer:")</label>
|
||||
<select id="layerId" name="layerId">
|
||||
@foreach (var layer in layers) {
|
||||
@Html.SelectOption((int)Model.CurrentLayer.Id, (int)layer.Id, (string)layer.Name)
|
||||
}
|
||||
</select>
|
||||
<button type="submit" class="apply-bulk-actions-auto">@T("Show")</button>
|
||||
@Html.Link(T("Edit").Text, Url.Action("EditLayer", "Admin", new { area = "Orchard.Widgets", id = Model.CurrentLayer.Id, returnUrl }), new { @class = "button" })
|
||||
</fieldset>
|
||||
}
|
||||
}
|
||||
@Html.Link(T("Add a new layer...").Text, Url.Action("AddLayer", "Admin", new { area = "Orchard.Widgets", returnUrl }))
|
||||
</div>
|
@@ -0,0 +1,52 @@
|
||||
@using Orchard.Utility.Extensions;
|
||||
@using Orchard.Widgets.Models;
|
||||
@{
|
||||
Style.Require("WidgetsAdmin");
|
||||
IEnumerable<WidgetPart> widgets = Model.Widgets;
|
||||
IEnumerable<string> zones = Model.Zones;
|
||||
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||
}
|
||||
<div id="widgets-placement">
|
||||
<div id="widgets-layers" class="widgets-container detail-view switchable">
|
||||
<div id="widgets-zones">
|
||||
@using (Html.BeginFormAntiForgeryPost()) {
|
||||
<ol>
|
||||
@foreach (string zone in zones) {
|
||||
int count = widgets.Where(w => w.Zone == zone).Count();
|
||||
MvcHtmlString classAttr = null;
|
||||
if (count == 0) {
|
||||
classAttr = new MvcHtmlString(" class=\"widgets-none\"");
|
||||
}
|
||||
<li@(classAttr)>
|
||||
<h2>@zone</h2>
|
||||
<div class="widgets-actions">@Html.ActionLink(T("Add").Text, "ChooseWidget", new { layerId = Model.CurrentLayer.Id, zone, returnUrl }, new { @class = "button" })</div>
|
||||
<ul class="widgets-zone-widgets">
|
||||
@if (count > 0) {
|
||||
int i = 0;
|
||||
foreach (WidgetPart widget in widgets.Where(w => w.Zone == zone).OrderBy(w => w.Position, new Orchard.UI.FlatPositionComparer())) {
|
||||
<li class="widgets-@(widget.LayerId == Model.CurrentLayer.Id ? "this" : "other")-layer widgets-layer-@widget.LayerId">
|
||||
<h3>@Html.ActionLink(HasText(widget.Title) ? widget.Title : widget.TypeDefinition.DisplayName, "EditWidget", new { @widget.Id, returnUrl })</h3>
|
||||
<div class="widgets-actions">
|
||||
@if (widget.LayerId != Model.CurrentLayer.Id) {
|
||||
<button name="moveHere" value="@widget.Id" class="link" type="submit">@T("Move to current layer")</button>
|
||||
}
|
||||
else { /* it could be useful to remove the widget regardless of the layer it's on but there's no place in the current UI for this and "Move to current layer" */
|
||||
<button name="moveOut" value="@widget.Id" class="link" type="submit">@T("Remove")</button>
|
||||
}
|
||||
</div>
|
||||
<div class="widgets-move-somewhere">
|
||||
<button name="moveUp" value="@widget.Id" @(i == 0 ? "disabled='disabled'" : "") class="widgets-move widgets-move-up" type="submit" title="@T("Move up")">@T("Move up")</button>
|
||||
<button name="moveDown" value="@widget.Id" @(++i == count ? "disabled='disabled'" : "") class="widgets-move widgets-move-down" type="submit" title="@T("Move down")">@T("Move down")</button>
|
||||
@Html.Hidden("returnUrl", returnUrl)
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
}
|
||||
</ol>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1 @@
|
||||
<p>[[theme preview image]]</p>
|
Reference in New Issue
Block a user