mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 03:40:56 +08:00
Including Orchard.Projections
--HG-- branch : 1.x
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
@model AdminIndexViewModel
|
||||
@using Orchard.Projections.Models;
|
||||
@using Orchard.Projections.ViewModels;
|
||||
|
||||
@{
|
||||
Style.Include("admin-projections.css");
|
||||
|
||||
var index = 0;
|
||||
|
||||
var pageSizes = new List<int?>() { 10, 50, 100 };
|
||||
var defaultPageSize = WorkContext.CurrentSite.PageSize;
|
||||
if(!pageSizes.Contains(defaultPageSize)) {
|
||||
pageSizes.Add(defaultPageSize);
|
||||
}
|
||||
}
|
||||
|
||||
<h1>@Html.TitleForPage(T("Manage Queries").ToString()) </h1>
|
||||
@using (Html.BeginFormAntiForgeryPost()) {
|
||||
@Html.ValidationSummary()
|
||||
<div class="manage">@Html.ActionLink(T("Add a new Query").ToString(), "Create", new { Area = "Contents", id = "Query", returnurl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })</div>
|
||||
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="publishActions">@T("Actions:")</label>
|
||||
<select id="publishActions" name="@Html.NameOf(m => m.Options.BulkAction)">
|
||||
@Html.SelectOption(Model.Options.BulkAction, QueriesBulkAction.None, T("Choose action...").ToString())
|
||||
@Html.SelectOption(Model.Options.BulkAction, QueriesBulkAction.Delete, T("Delete").ToString())
|
||||
</select>
|
||||
<button type="submit" name="submit.BulkEdit" value="@T("Apply")">@T("Apply")</button>
|
||||
</fieldset>
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="filterResults">@T("Sort by:")</label>
|
||||
<select id="filterResults" name="@Html.NameOf(m => m.Options.Order)">
|
||||
@Html.SelectOption(Model.Options.Order, QueriesOrder.Name, T("Name").ToString())
|
||||
</select>
|
||||
<input type="hidden" name="Page" value="1" />
|
||||
<label for="pageSize">@T("Show:")</label>
|
||||
<select id="pageSize" name="PageSize">
|
||||
@Html.SelectOption((int)Model.Pager.PageSize, 0, T("All").ToString())
|
||||
@foreach(int size in pageSizes.OrderBy(p => p)) {
|
||||
@Html.SelectOption((int)Model.Pager.PageSize, size, size.ToString())
|
||||
}
|
||||
</select>
|
||||
<button type="submit" name="submit.Filter" value="@T("Filter")">@T("Filter")</button>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="checkbox"> ↓</th>
|
||||
<th scope="col">@T("Name")</th>
|
||||
<th scope="col" class="actions"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (var entry in Model.Queries) {
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" value="@Model.Queries[index].QueryId" name="@Html.NameOf(m => m.Queries[index].QueryId)"/>
|
||||
<input type="checkbox" value="true" name="@Html.NameOf(m => m.Queries[index].IsChecked)"/>
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink(entry.Name, "Edit", new { id = entry.QueryId })
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink(T("Properties").ToString(), "Edit", new { Area = "Contents", id = entry.QueryId, returnurl = HttpContext.Current.Request.RawUrl }) |
|
||||
@Html.ActionLink(T("Edit").ToString(), "Edit", new { id = entry.QueryId }) |
|
||||
@Html.ActionLink(T("Delete").ToString(), "Delete", new { id = entry.QueryId }, new { itemprop = "RemoveUrl UnsafeUrl" }) |
|
||||
@Html.ActionLink(T("Preview").ToString(), "Preview", new { id = entry.QueryId })
|
||||
</td>
|
||||
</tr>
|
||||
index++;
|
||||
}
|
||||
</table>
|
||||
@Display(Model.Pager)
|
||||
</fieldset>
|
||||
}
|
||||
Reference in New Issue
Block a user