mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Making the zones view "switchable".
It could use some more relevant icons but what is there by default is fine for now. --HG-- branch : dev
This commit is contained in:
@@ -29,9 +29,11 @@ background:#F3F4F5;
|
||||
border:1px solid #E4E5E6;
|
||||
padding:0 5px;
|
||||
}
|
||||
/* The number seems slightly meaningless. Leaving it out for now. * /
|
||||
#widgets-zones ol {
|
||||
list-style:decimal inside;
|
||||
}
|
||||
*/
|
||||
#widgets-zones li, #widgets-available li {
|
||||
background:#FFF;
|
||||
color:#AEC3CE;
|
||||
@@ -85,3 +87,12 @@ color:#333;
|
||||
#widgets-available a p {
|
||||
margin-top:5px;
|
||||
}
|
||||
|
||||
/* begin: switchable tweaks for admin/widgets */
|
||||
#widgets-placement .switch-for-switchable {
|
||||
margin:-32px 10px -2px 0;
|
||||
}
|
||||
#widgets-placement .summary-view .widgets-none {
|
||||
display:none;
|
||||
}
|
||||
/* end: switchable tweaks */
|
@@ -2,6 +2,8 @@
|
||||
@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;
|
||||
@@ -29,28 +31,32 @@
|
||||
</div>
|
||||
<div id="layout-widgets-placement">
|
||||
<div id="widgets-placement">
|
||||
<div id="widgets-layers" class="widgets-container">
|
||||
<div id="widgets-layers" class="widgets-container detail-view switchable">
|
||||
<div id="widgets-zones">
|
||||
<ol>
|
||||
@foreach (string zone in zones) {
|
||||
<li>
|
||||
int count = widgets.Where(w => w.Zone == zone).Count();
|
||||
MvcHtmlString classA = null;
|
||||
if (count == 0) {
|
||||
classA = new MvcHtmlString(" class=\"widgets-none\"");
|
||||
}
|
||||
<li@(classA)>
|
||||
<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">
|
||||
@{
|
||||
int count = widgets.Where(w => w.Zone == zone).Count() - 1;
|
||||
@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>
|
||||
@if (i > 0) {
|
||||
<input class="widgets-mover" type="image" name="submit.MoveUp.@widget.Id" src="@Url.Content("~/modules/orchard.widgets/Content/Admin/images/moveup.gif")" alt="Move up" value="@widget.Id" />
|
||||
}
|
||||
@if (i++ < count) {
|
||||
<input class="widgets-mover" type="image" name="submit.MoveDown.@widget.Id" src="@Url.Content("~/modules/orchard.widgets/Content/Admin/images/movedown.gif")" alt="Move down" value="@widget.Id" />
|
||||
}
|
||||
@Html.ActionLink(HasText(widget.Title) ? widget.Title : widget.TypeDefinition.DisplayName, "EditWidget", new { @widget.Id })
|
||||
</li>
|
||||
foreach (WidgetPart widget in widgets.Where(w => w.Zone == zone).OrderBy(w => w.Position, new Orchard.UI.FlatPositionComparer())) {
|
||||
<li>
|
||||
@if (i > 0) {
|
||||
<input class="widgets-mover" type="image" name="submit.MoveUp.@widget.Id" src="@Url.Content("~/modules/orchard.widgets/Content/Admin/images/moveup.gif")" alt="Move up" value="@widget.Id" />
|
||||
}
|
||||
@if (++i < count) {
|
||||
<input class="widgets-mover" type="image" name="submit.MoveDown.@widget.Id" src="@Url.Content("~/modules/orchard.widgets/Content/Admin/images/movedown.gif")" alt="Move down" value="@widget.Id" />
|
||||
}
|
||||
@Html.ActionLink(HasText(widget.Title) ? widget.Title : widget.TypeDefinition.DisplayName, "EditWidget", new { @widget.Id })
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user