Adding Select all checkbox to all suitable admin lists, fixes #5026

This commit is contained in:
Zoltán Lehóczky
2015-05-14 00:36:31 +02:00
parent c73d6c0a91
commit f932cc394f
8 changed files with 11 additions and 4 deletions

View File

@@ -16,8 +16,10 @@
<div class="manage">
@Html.ActionLink(createLinkText.Text, "Create", new { Area = "Contents", Id = (string)Model.Options.SelectedFilter }, new { @class = "button primaryAction" })
</div>
@using (Html.BeginFormAntiForgeryPost()) {
<fieldset class="bulk-actions">
<label><input type="checkbox" class="check-all" />@T("Select all")</label>@T(" | ")
<label for="publishActions">@T("Actions:")</label>
<select id="publishActions" name="Options.BulkAction">
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.None, T("Choose action...").ToString())

View File

@@ -8,6 +8,7 @@
<div class="actions"><a class="add button primaryAction" href="@Url.BlogCreate()">@T("New Blog")</a></div>
using(Html.BeginFormAntiForgeryPost(Url.Action("List", "Admin", new { area = "Contents", id = "" }))) {
<fieldset class="bulk-actions">
<label><input type="checkbox" class="check-all" />@T("Select all")</label>@T(" | ")
<label for="publishActions">@T("Actions:")</label>
<select id="publishActions" name="Options.BulkAction">
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.None, T("Choose action...").ToString())

View File

@@ -3,6 +3,7 @@
@if (Model.ContentItems.Items.Count > 0) {
using (Html.BeginFormAntiForgeryPost(Url.Action("List", "Admin", new { area = "Contents", id = "" }))) {
<fieldset class="bulk-actions">
<label><input type="checkbox" class="check-all" />@T("Select all")</label>@T(" | ")
<label for="publishActions">@T("Actions:")</label>
<select id="publishActions" name="Options.BulkAction">
@Html.SelectOption(ContentsBulkAction.None, ContentsBulkAction.None, T("Choose action...").ToString())
@@ -17,6 +18,7 @@
@Display(Model.ContentItems)
</fieldset>
}
} else {
}
else {
<div class="info message">@T("There are no posts for this blog.")</div>
}

View File

@@ -7,6 +7,7 @@
Html.ValidationSummary();
<fieldset>
<legend>@T("Choose the types to include in the export file:")</legend>
<label><input type="checkbox" class="check-all" />@T("Select all")</label>
<ol>
@{var contentTypeIndex = 0;}
@foreach (var contentTypeEntry in Model.ContentTypes) {

View File

@@ -18,8 +18,8 @@
@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><input type="checkbox" class="check-all" />@T("Select all")</label>@T(" | ")
<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())

View File

@@ -30,7 +30,7 @@
</colgroup>
<thead>
<tr>
<th scope="col">@T("Name")</th>
<th scope="col"><input type="checkbox" class="check-all" /> @T("Name")</th>
<th scope="col"></th>
</tr>
</thead>

View File

@@ -16,6 +16,7 @@
</div>
@using (Html.BeginFormAntiForgeryPost()) {
<fieldset class="bulk-actions">
<label><input type="checkbox" class="check-all" />@T("Select all")</label>@T(" | ")
<label for="publishActions">@T("Actions:")</label>
<select id="publishActions" name="Options.BulkAction">
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.None, T("Choose action...").ToString())

View File

@@ -72,7 +72,7 @@
});
$(".check-all").change(function () {
$(this).parents("table.items").find(":checkbox:not(:disabled)").prop('checked', $(this).prop("checked"));
$("input[type=checkbox]:not(:disabled)").prop('checked', $(this).prop("checked"))
});
// Handle keypress events in bulk action fieldsets that are part of a single form.