@model WidgetsIndexViewModel @using Orchard.Widgets.Models; @using Orchard.Widgets.ViewModels; @{ Style.Require("WidgetsAdmin"); }

@Html.TitleForPage(T("Manage Widgets").ToString())

@Html.ActionLink(T("Add a layer").ToString(), "AddLayer", new { }, new { @class = "button primaryAction" })
@using(Html.BeginFormAntiForgeryPost()) { Html.ValidationSummary();

Available Widgets

@foreach (string widget in Model.WidgetTypes) { }
@T("Name")
@widget @Html.ActionLink(T("Add").ToString(), "AddWidget", new { layerId = Model.CurrentLayer.Id, widgetType = widget })

Widget Layers

    @foreach (string zone in Model.Zones) {
  • @zone
      @foreach (WidgetPart widget in Model.CurrentLayerWidgets.Where(widgetPart => widgetPart.Zone == zone).OrderBy(widgetPart => widgetPart.Position, new Orchard.UI.FlatPositionComparer())) {
    • @if (widget.Position != "1") { } @if (int.Parse(widget.Position) < Model.CurrentLayerWidgets.Where(widgetPart => widgetPart.Zone == zone).Count()) { } @Html.ActionLink(@widget.Title, "EditWidget", new { @widget.Id })
    • }
  • }
    @foreach (var layer in Model.Layers) { if (layer.Id == Model.CurrentLayer.Id) {
  • @Html.ActionLink(@layer.Name, "Index", new { @layer.Id })
  • } else {
  • @Html.ActionLink(@layer.Name, "Index", new { @layer.Id })
  • } }
}