Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all action bars #12429

Merged
merged 1 commit into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,38 @@
<input type="submit" name="submit.Filter" id="submitFilter" class="visually-hidden" />
<input asp-for="Options.BulkAction" type="hidden" />
<input type="submit" name="submit.BulkAction" class="visually-hidden" />

<div class="card mb-3 position-sticky action-bar">
<div class="card-body bg-primary p-3">
<div class="mb-0">
<div class="input-group input-group-sm w-sm-50 w-25 d-inline-flex has-search">
<i class="fa fa-search form-control-feedback" aria-hidden="true"></i>
<input asp-for="Options.Search" class="form-control" placeholder="@T["Search"]" type="search" autofocus />

<div class="card mb-3 bg-primary position-sticky action-bar">
<div class="card-body">
<div class="row gx-3">
<div class="col">
<div class="has-search">
<i class="fa fa-search form-control-feedback" aria-hidden="true"></i>
<input asp-for="Options.Search" class="form-control" placeholder="@T["Search"]" type="search" autofocus />
</div>
</div>
<div class="btn-group float-end">
<a asp-route-action="Create" class="btn btn-sm btn-secondary float-end create" role="button">@T["Add Admin Menu"]</a>
<div class="col-auto">
<a asp-route-action="Create" class="btn btn-secondary create" role="button">@T["Add Admin Menu"]</a>
</div>
</div>
</div>
</div>

<ul class="list-group with-checkbox">
@if (Model.AdminMenu.Any())
{
<li class="list-group-item bg-primary">
<div class="row">
<div class="col mb-1">
<div class="form-check mt-2 me-n2">
<div class="row gx-3">
<div class="col">
<div class="form-check my-1">
<input type="checkbox" class="form-check-input" id="select-all">
<label class="form-check-label" for="select-all" id="select-all-label" title="@T["Select All"]"></label>
<label id="items" for="select-all">@T.Plural(Model.AdminMenu.Count, "1 item", "{0} items")<span class="text-muted" title="@T["Items {0} to {1}", startIndex, endIndex]">@T.Plural((int)Model.Pager.TotalItemCount, " / {0} item in total", " / {0} items in total")</span></label>
<label id="selected-items" class="text-muted" for="select-all"></label>
</div>
</div>
<div class="col-2 mb-1" style="display:none" id="actions">
<div class="dropdown float-end mt-1">
<div class="col col-md-auto text-end">
<div class="dropdown" style="display:none" id="actions">
<button class="btn btn-sm btn-light dropdown-toggle" type="button" id="bulk-action-menu-button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@T["Actions"]
</button>
Expand All @@ -67,16 +70,14 @@
<a asp-controller="Node" asp-action="List" asp-route-id="@entry.AdminMenu.Id" class="btn btn-secondary btn-sm">@T["Edit Nodes"]</a>
<a asp-action="Edit" asp-route-id="@entry.AdminMenu.Id" class="btn btn-primary btn-sm">@T["Edit"]</a>
<div class="btn-group btn-group-sm">
<a asp-action="Delete"
asp-route-id="@entry.AdminMenu.Id"
class="btn btn-danger" data-url-af="RemoveUrl UnsafeUrl">@T["Delete"]</a>
<a asp-action="Delete" asp-route-id="@entry.AdminMenu.Id" class="btn btn-danger" data-url-af="RemoveUrl UnsafeUrl">@T["Delete"]</a>
<button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-reference="parent" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="visually-hidden">@T["Toggle Dropdown"]</span>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a asp-action="Toggle"
asp-route-id="@entry.AdminMenu.Id"
class="dropdown-item btn-sm" data-url-af="UnsafeUrl">@(entry.AdminMenu.Enabled ? T["Disable"] : T["Enable"])</a></li>
<li>
<a asp-action="Toggle" asp-route-id="@entry.AdminMenu.Id" class="dropdown-item btn-sm" data-url-af="UnsafeUrl">@(entry.AdminMenu.Enabled ? T["Disable"] : T["Enable"])</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -121,21 +122,23 @@
}
}

$(".dropdown-menu .dropdown-item").filter(function() {
$(".dropdown-menu .dropdown-item").filter(function () {
return $(this).data("action");
}).on("click", function () {
if ($(":checkbox[name='itemIds']:checked").length > 1) {
var $this = $(this);
confirmDialog({...$this.data(), callback: function(r) {
if (r) {
$("[name='Options.BulkAction']").val($this.data("action"));
$("[name='submit.BulkAction']").click();
confirmDialog({
...$this.data(), callback: function (r) {
if (r) {
$("[name='Options.BulkAction']").val($this.data("action"));
$("[name='submit.BulkAction']").click();
}
}
}});
});
}
});

selectAllCtrl.click(function(){
selectAllCtrl.click(function () {
itemsCheckboxes.not(this).prop("checked", this.checked);
selectedItems.text($(":checkbox[name='itemIds']:checked").length + ' @T["selected"]');
displayActionsOrFilters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@

<!-- Hidden submit button do not remove -->
<input type="submit" name="submit.Filter" id="submitFilter" class="sr-only" />


<div class="card mb-3 position-sticky action-bar">
<div class="card-body bg-primary p-3">
<div class="mb-n1">
@await DisplayAsync(Model.Header.Search)
<div class="card mb-3 bg-primary position-sticky action-bar">
<div class="card-body">
<div class="row gx-3">
<div class="col">
@await DisplayAsync(Model.Header.Search)
</div>
</div>
</div>
</div>

<ul class="list-group with-checkbox">
<li class="list-group-item bg-primary">
<div class="row">
<div class="row gx-3">
<div class="col">
@await DisplayAsync(Model.Header.Summary)
</div>
<div class="col d-flex justify-content-start flex-row-reverse">
<div class="col col-md-auto text-end">
@await DisplayAsync(Model.Header.Actions)
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
@model AuditTrailIndexOptions

<div class="mb-n1 filter">
<div class="btn-group mt-1">
<div class="filter">
<div class="btn-group">

<select asp-for="Date" asp-items="@Model.AuditTrailDates" class="selectpicker dates-selectpicker show-tick" data-header="@T["Date"]" data-width="fit" data-selected-text-format="static" data-dropdown-align-right="true" title="@T["Date"]" data-style="btn-sm"></select>
@if (!Model.CorrelationIdFromRoute)
{
<select asp-for="Category" asp-items="Model.Categories" class="selectpicker categories-selectpicker show-tick me-2" data-header="@T["Filter by category"]" data-live-search="true" data-selected-text-format="static" data-width="fit" title="@T["Category"]" data-style="btn-sm" data-dropdown-align-right="auto"></select>
}
@if (Model.Events.Any())
@if (Model.Events.Count > 0)
{
<select asp-for="Event" asp-items="@Model.Events" class="selectpicker events-selectpicker show-tick me-2" data-header="@T["Filter by event"]" data-selected-text-format="static" data-width="fit" data-dropdown-align-right="auto" title="@T["Events"]" data-style="btn-sm"></select>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,39 @@
@{
var syntaxThumbnail = await DisplayManager.BuildDisplayAsync(Model, null, "Thumbnail");
var categories = AuditTrailManager.DescribeCategories();
var dropdownClassList = new List<string>()
{
"dropdown-menu"
};

if (CultureInfo.CurrentUICulture.IsRightToLeft())
{
dropdownClassList.Add("dropdown-menu-start");
}
}

<div class="input-group input-group-sm w-50 d-inline-flex has-filter">
<div class="input-group-prepend">
<button class="btn btn-sm dropdown-toggle" style="border:1px solid lightgrey" type="button"
data-bs-toggle="dropdown" id="filter-dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-filter" title="@T["Filters"]" aria-hidden="true"></i>
</button>
<ul class="dropdown-menu @if(CultureInfo.CurrentUICulture.IsRightToLeft()){<text>dropdown-menu-start</text>}"
aria-labelledby="filter-dropdown">
@foreach(var category in categories)
{
<li><a class="dropdown-item" href="?q=category:@category.Name">@category.LocalizedName(Context.RequestServices)</a></li>
}
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#modalAuditTrailIndexOptionsFilterSyntax">@T["Filter syntax"]</a></li>
</ul>
</div>
<input asp-for="OriginalSearchText" type="hidden"></input>
<div class="input-group has-filter">
<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" id="filter-dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-filter" title="@T["Filters"]" aria-hidden="true"></i>
</button>
<ul class="@String.Join(' ', dropdownClassList)" aria-labelledby="filter-dropdown">
@foreach (var category in categories)
{
<li><a class="dropdown-item" href="?q=category:@category.Name">@category.LocalizedName(Context.RequestServices)</a></li>
}
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#modalAuditTrailIndexOptionsFilterSyntax">@T["Filter syntax"]</a></li>
</ul>
<input asp-for="OriginalSearchText" type="hidden" />

<label asp-for="SearchText" class="sr-only">@T["Search"]</label>
<i class="fa fa-search form-control-feedback" aria-hidden="true"></i>
<input asp-for="SearchText" class="form-control" placeholder="@T["Search"]" inputmode="search" type="search"
autofocus />
<input asp-for="SearchText" class="form-control" placeholder="@T["Search"]" inputmode="search" type="search" autofocus />
</div>


<zone name="Footer">
<div class="modal fade" id="modalAuditTrailIndexOptionsFilterSyntax" tabindex="-1" role="dialog"
aria-labelledby="audittrail-filters-syntax-title" aria-hidden="true">
aria-labelledby="audittrail-filters-syntax-title" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
Expand Down Expand Up @@ -85,7 +89,7 @@
<li>
<span class="hint">" ... "</span>
<span class="hint">@T["Escape operators, e.g. {0}", "text:\"foo bar\""]</span>
</li>
</li>
</ul>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@model AuditTrailIndexOptions

<div class="mb-n1 text-nowrap">
<label class="mt-2 ms-2" id="items" for="select-all">@T.Plural(Model.EventsCount, "1 item", "{0} items")<span class="text-muted" title="@T["Items {0} to {1}", Model.StartIndex, Model.EndIndex]">@T.Plural(Model.TotalItemCount, " / {0} item in total", " / {0} items in total")</span></label>
<div class="text-nowrap">
<label class="my-1" id="items" for="select-all">
@T.Plural(Model.EventsCount, "1 item", "{0} items")
<span class="text-muted" title="@T["Items {0} to {1}", Model.StartIndex, Model.EndIndex]">@T.Plural(Model.TotalItemCount, " / {0} item in total", " / {0} items in total")</span>
</label>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

<zone Name="Title"><h1>@RenderTitleSegments(T["Content Types"])</h1></zone>

<div class="card mb-3 position-sticky action-bar">
<div class="card-body bg-primary p-3">
<div class="input-group input-group-sm w-sm-50 w-25 d-inline-flex has-search">
<i class="fa fa-search form-control-feedback" aria-hidden="true"></i>
<input id="search-box" class="form-control" placeholder="@T["Search"]" type="search" autofocus />
<div class="card mb-3 bg-primary position-sticky action-bar">
<div class="card-body">
<div class="row gx-3">
<div class="col">
<div class="has-search">
<i class="fa fa-search form-control-feedback" aria-hidden="true"></i>
<input id="search-box" class="form-control" placeholder="@T["Search"]" type="search" autofocus />
</div>
</div>
<div class="col-auto">
<a asp-route-action="Create" id="btnCreate" class="btn btn-secondary create" role="button">@T["Create new type"]</a>
</div>
</div>
<a asp-route-action="Create" id="btnCreate" class="btn btn-sm btn-secondary d-inline-flex float-end create" role="button">@T["Create new type"]</a>
</div>
</div>

Expand Down Expand Up @@ -42,12 +48,10 @@
var text = $(this).data('filter-value').toLowerCase();
var found = text.indexOf(search) > -1;

if (found)
{
if (found) {
$(this).removeClass("d-none first-child-visible last-child-visible");
}
else
{
else {
$(this).addClass("d-none");
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

<zone Name="Title"><h1>@RenderTitleSegments(T["Content Parts"])</h1></zone>

<div class="card mb-3 position-sticky action-bar">
<div class="card-body bg-primary p-3">
<div class="input-group input-group-sm w-sm-50 w-25 d-inline-flex has-search">
<i class="fa fa-search form-control-feedback" aria-hidden="true"></i>
<input id="search-box" class="form-control" placeholder="@T["Search"]" type="search" autofocus />
<div class="card mb-3 bg-primary position-sticky action-bar">
<div class="card-body">
<div class="row gx-3">
<div class="col">
<div class="has-search">
<i class="fa fa-search form-control-feedback" aria-hidden="true"></i>
<input id="search-box" class="form-control" placeholder="@T["Search"]" type="search" autofocus />
</div>
</div>
<div class="col-auto">
<a asp-route-action="CreatePart" id="btnCreate" class="btn btn-secondary create" role="button">@T["Create new part"]</a>
</div>
</div>
<a asp-route-action="CreatePart" id="btnCreate" class="btn btn-sm btn-secondary d-inline-flex float-end create" role="button">@T["Create new part"]</a>
</div>
</div>

Expand Down Expand Up @@ -42,12 +48,10 @@
var text = $(this).data('filter-value').toLowerCase();
var found = text.indexOf(search) > -1;

if (found)
{
if (found) {
$(this).removeClass("d-none first-child-visible last-child-visible");
}
else
{
else {
$(this).addClass("d-none");
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
@model ContentOptionsViewModel
@inject OrchardCore.DisplayManagement.IDisplayManager<ContentOptionsViewModel> ContentOptionsDisplayManager

<div class="mb-0" style="display:none" id="actions">
<div class="dropdown mt-1">
<button class="btn btn-sm btn-light dropdown-toggle" type="button" id="bulk-action-menu-button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@T["Actions"]
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bulk-action-menu-button">
@{
dynamic bulkActions = await ContentOptionsDisplayManager.BuildDisplayAsync(Model, null, "BulkActions");
@await DisplayAsync(bulkActions.Content)
}
</ul>
</div>
<div class="dropdown" style="display: none" id="actions">
<button class="btn btn-sm btn-light dropdown-toggle" type="button" id="bulk-action-menu-button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@T["Actions"]
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bulk-action-menu-button">
@{
dynamic bulkActions = await ContentOptionsDisplayManager.BuildDisplayAsync(Model, null, "BulkActions");
@await DisplayAsync(bulkActions.Content)
}
</ul>
</div>
Loading