@model LayoutEditViewModel @using Orchard.Projections.Models; @using Orchard.Projections.ViewModels; @{ Layout.Title = T("Edit Layout - {0}", Model.Layout.Name); } @Html.ValidationSummary()

@Model.Layout.Name

@Model.Layout.Description @using (Html.BeginFormAntiForgeryPost()) { @Html.HiddenFor(m => m.QueryId) @Html.HiddenFor(m => m.Category) @Html.HiddenFor(m => m.Type)
@Html.LabelFor(m => m.Description, T("Description")) @Html.TextBoxFor(m => m.Description, new { @class = "textMedium" }) @T("You may optionally give a description to this layout, to be used in the dashboard screens.")

@T("Display mode")

@Html.RadioButton(Html.FieldNameFor(m => m.Display), (int)LayoutRecord.Displays.Content, Model.Display == (int)LayoutRecord.Displays.Content, new { id = "display-content-radio" })
@Html.RadioButton(Html.FieldNameFor(m => m.Display), (int)LayoutRecord.Displays.Properties, Model.Display == (int)LayoutRecord.Displays.Properties, new { id = "display-fields-radio" }) @T("You can choose to display each content item using specific properties only.")
@Html.TextBoxFor(m => m.DisplayType, new { @class = "textMedium" }) @T("The display type determines how the content item should be formatted. e.g., Summary, SummaryAdmin, Detail, ...")

@T("Properties")

@Html.ActionLink(T("Add a new Property").Text, "Add", new { controller = "Property", id = Model.Id }, new { @class = "button primaryAction" })
@foreach (var property in Model.Properties) { }
@T("Description")  
@(property.DisplayText) @Html.ActionLink(T("Edit").Text, "Edit", new { controller = "Property", id = Model.Id, category = property.Category, type = property.Type, propertyId = property.PropertyRecordId }) | @Html.ActionLink(T("Delete").Text, "Delete", new { controller = "Property", id = Model.Id, propertyId = property.PropertyRecordId }, new { itemprop = "RemoveUrl UnsafeUrl" }) @if (property != Model.Properties.First()) { | @Html.ActionLink(T("Up").Text, "Move", new { controller = "Property", id = property.PropertyRecordId, direction = "up", layoutId = Model.Id }) } @if (property != Model.Properties.Last()) { | @Html.ActionLink(T("Down").Text, "Move", new { controller = "Property", id = property.PropertyRecordId, direction = "down", layoutId = Model.Id }) }
@* Render a button at the bottom only if there are several fields in the table *@ if (Model.Properties.Count() > 5) {
@Html.ActionLink(T("Add a new Property").Text, "Add", new { controller = "Property", id = Model.Id }, new { @class = "button primaryAction" })
} @* Group property *@

@T("Grouping property")

if (Model.Properties.Any()) { @T("Optionally, select a property which will be used to group content items.") } else { @T("No properties are currently available in order to group this view.") } @* Render the dynamic form *@
@DisplayChildren(Model.Form)
@Display.TokenHint()
@Html.ActionLink(T("Close").Text, "Edit", "Admin", new { id = Model.QueryId }, new { @class = "primaryAction button" })
} @using (Script.Foot()) { }