Skip to content

Commit

Permalink
Fix Show/Hide Search deployment UI (OrchardCMS#17289)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored Dec 31, 2024
1 parent b784d0e commit 0397597
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<div class="col">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="IncludeAll" data-reverseToggle=".idxsel" />
<input class="form-check-input" asp-for="IncludeAll" data-bs-toggle="collapse" role="button" data-bs-target=".idxsel" aria-expanded="false" aria-controls="idxsel" />
@T["Include all search indexes."]
</label>
</div>
</div>
</div>
</div>

<div class="idxsel mb-3 mt-4 mb-5 @(Model.IncludeAll ? "collapse" : "show")">
<div class="idxsel mb-3 mt-4 mb-5 collapse@(Model.IncludeAll ? string.Empty : " show")">
<div class="row">
<div class="col-small col-12 col-sm-9 col-md-6 col-lg-3 col-xl-3">
<span class="hint">@T["The search indexes to add as part of the plan."]</span>
Expand All @@ -48,16 +48,3 @@
</div>
</div>
</div>

<script at="Foot">
$(function () {
$("[data-reversetoggle]").on("click", function () {
var state = this.checked;
if (state) {
$($(this).attr("data-reversetoggle")).collapse('hide');
} else {
$($(this).attr("data-reversetoggle")).collapse('show');
}
});
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@if (includeAll)
{
<span class="badge badge-success">@T["All"]</span>
<span class="badge text-bg-success">@T["All"]</span>
}
else if (indexNames?.Length > 0)
{
Expand All @@ -23,5 +23,5 @@ else if (indexNames?.Length > 0)
}
else
{
<span class="badge badge-warning">@T["No index selected."]</span>
<span class="badge text-bg-warning">@T["No index selected."]</span>
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="col">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="IncludeAll" data-element-id-to-collapse="indexes-list" />
<input class="form-check-input" asp-for="IncludeAll" data-bs-toggle="collapse" role="button" data-bs-target="#indexes-list" aria-expanded="false" aria-controls="indexes-list" />
@T["Include all Azure AI Search indices."]
</label>
</div>
Expand Down Expand Up @@ -43,11 +43,3 @@
</div>
</div>
</div>

<script at="Foot">
(function () {
document.getElementById('@Html.IdFor(x => x.IncludeAll)').addEventListener('change', (e) => {
new bootstrap.Collapse(document.getElementById(e.target.dataset.elementIdToCollapse));
});
})();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<div class="col">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="IncludeAll" data-element-id-to-collapse="indexes-list" />
<input class="form-check-input" asp-for="IncludeAll" data-bs-toggle="collapse" role="button" data-bs-target="#indexes-list" aria-expanded="false" aria-controls="indexes-list" />
@T["Include all Azure AI Search indices."]
</label>
</div>
</div>
</div>
</div>

<div id="indexes-list" class="mt-4 mb-5 collapse @(Model.IncludeAll ? string.Empty : "show")">
<div id="indexes-list" class="mt-4 mb-5 collapse@(Model.IncludeAll ? string.Empty : " show")">
<div class="row">
<div class="col-small col-12 col-sm-9 col-md-6 col-lg-3 col-xl-3">
<span class="hint">@T["The Azure AI Search Indices to reset as part of the plan."]</span>
Expand All @@ -43,11 +43,3 @@
</div>
</div>
</div>

<script at="Foot">
(function () {
document.getElementById('@Html.IdFor(x => x.IncludeAll)').addEventListener('change', (e) => {
new bootstrap.Collapse(document.getElementById(e.target.dataset.elementIdToCollapse));
});
})();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@if (includeAll)
{
<span class="badge bg-success">@T["All"]</span>
<span class="badge text-bg-success">@T["All"]</span>
}
else if (indices?.Length > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<div class="col">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="IncludeAll" data-reverseToggle=".idxsel" />
<input class="form-check-input" asp-for="IncludeAll" data-bs-toggle="collapse" role="button" data-bs-target=".idxsel" aria-expanded="false" aria-controls="idxsel" />
@T["Include all search indexes."]
</label>
</div>
</div>
</div>
</div>

<div class="idxsel mb-3 mt-4 mb-5 @(Model.IncludeAll ? "collapse" : "show")">
<div class="idxsel mb-3 mt-4 mb-5 collapse@(Model.IncludeAll ? string.Empty : " show")">
<div class="row">
<div class="col-small col-12 col-sm-9 col-md-6 col-lg-3 col-xl-3">
<span class="hint">@T["The search indexes to add as part of the plan."]</span>
Expand All @@ -31,12 +31,12 @@
<ul class="list-group">
@foreach (var indexName in allIndexNames)
{
var checkd = indexNames?.Contains(indexName);
var isChecked = indexNames?.Contains(indexName);

<li class="list-group-item">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="@Html.NameFor(m => m.IndexNames)" value="@indexName" checked="@checkd">
<input class="form-check-input" type="checkbox" name="@Html.NameFor(m => m.IndexNames)" value="@indexName" checked="@isChecked">
@indexName
</label>
</div>
Expand All @@ -46,16 +46,3 @@
</div>
</div>
</div>

<script at="Foot">
$(function () {
$("[data-reversetoggle]").on("click", function () {
var state = this.checked;
if (state) {
$($(this).attr("data-reversetoggle")).collapse('hide');
} else {
$($(this).attr("data-reversetoggle")).collapse('show');
}
});
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@if (includeAll)
{
<span class="badge badge-success">@T["All"]</span>
<span class="badge text-bg-success">@T["All"]</span>
}
else if (indexNames?.Length > 0)
{
Expand All @@ -23,5 +23,5 @@ else if (indexNames?.Length > 0)
}
else
{
<span class="badge badge-warning">@T["No index selected."]</span>
<span class="badge text-bg-warning">@T["No index selected."]</span>
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<div class="col">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="IncludeAll" data-element-id-to-collapse="indexes-list"/>
<input class="form-check-input" asp-for="IncludeAll" data-bs-toggle="collapse" role="button" data-bs-target="#indexes-list" aria-expanded="false" aria-controls="indexes-list" />
@T["Include all Elasticsearch indices."]
</label>
</div>
</div>
</div>
</div>

<div id="indexes-list" class="mt-4 mb-5 collapse @(Model.IncludeAll ? "" : "show")">
<div id="indexes-list" class="mt-4 mb-5 collapse @(Model.IncludeAll ? string.Empty : "show")">
<div class="row">
<div class="col-small col-12 col-sm-9 col-md-6 col-lg-3 col-xl-3">
<span class="hint">@T["The Elasticsearch indices to rebuild as part of the plan."]</span>
Expand All @@ -41,11 +41,3 @@
</div>
</div>
</div>

<script at="Foot">
(function () {
document.getElementById('@Html.IdFor(x => x.IncludeAll)').addEventListener('change', (e) => {
new bootstrap.Collapse(document.getElementById(e.target.dataset.elementIdToCollapse));
});
})();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<div class="col">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="IncludeAll" data-element-id-to-collapse="indexes-list" />
<input class="form-check-input" asp-for="IncludeAll" data-bs-toggle="collapse" role="button" data-bs-target="#indexes-list" aria-expanded="false" aria-controls="indexes-list" />
@T["Include all Elasticsearch indices."]
</label>
</div>
</div>
</div>
</div>

<div id="indexes-list" class="mt-4 mb-5 collapse @(Model.IncludeAll ? "" : "show")">
<div id="indexes-list" class="mt-4 mb-5 collapse@(Model.IncludeAll ? string.Empty : " show")">
<div class="row">
<div class="col-small col-12 col-sm-9 col-md-6 col-lg-3 col-xl-3">
<span class="hint">@T["The Elasticsearch Indices to reset as part of the plan."]</span>
Expand All @@ -41,11 +41,3 @@
</div>
</div>
</div>

<script at="Foot">
(function () {
document.getElementById('@Html.IdFor(x => x.IncludeAll)').addEventListener('change', (e) => {
new bootstrap.Collapse(document.getElementById(e.target.dataset.elementIdToCollapse));
});
})();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@if (includeAll)
{
<span class="badge bg-success">@T["All"]</span>
<span class="badge text-bg-success">@T["All"]</span>
}
else if (indices?.Length > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
<div class="col">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="IncludeAll"
data-reverseToggle=".idxsel" />
<input class="form-check-input" asp-for="IncludeAll" data-bs-toggle="collapse" role="button" data-bs-target=".idxsel" aria-expanded="false" aria-controls="idxsel" />
@T["Include all search indexes."]
</label>
</div>
</div>
</div>
</div>

<div class="idxsel mt-4 mb-5 @(Model.IncludeAll ? "collapse" : "show")">
<div class="idxsel mb-3 mt-4 mb-5 collapse@(Model.IncludeAll ? string.Empty : " show")">
<div class="row">
<div class="col-small col-12 col-sm-9 col-md-6 col-lg-3 col-xl-3">
<span class="hint">@T["The search indexes to add as part of the plan."]</span>
Expand All @@ -47,16 +46,3 @@
</div>
</div>
</div>

<script at="Foot">
$(function () {
$("[data-reversetoggle]").on("click", function () {
var state = this.checked;
if (state) {
$($(this).attr("data-reversetoggle")).collapse('hide');
} else {
$($(this).attr("data-reversetoggle")).collapse('show');
}
});
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<div class="col">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="IncludeAll" data-element-id-to-collapse="indexes-list"/>
<input class="form-check-input" asp-for="IncludeAll" data-bs-toggle="collapse" role="button" data-bs-target="#indexes-list" aria-expanded="false" aria-controls="indexes-list" />
@T["Include all Lucene search indices."]
</label>
</div>
</div>
</div>
</div>

<div id="indexes-list" class="mt-4 mb-5 collapse @(Model.IncludeAll ? "" : "show")">
<div id="indexes-list" class="mt-4 mb-5 collapse @(Model.IncludeAll ? string.Empty : "show")">
<div class="row">
<div class="col-small col-12 col-sm-9 col-md-6 col-lg-3 col-xl-3">
<span class="hint">@T["The Lucene search indices to rebuild as part of the plan."]</span>
Expand All @@ -41,11 +41,3 @@
</div>
</div>
</div>

<script at="Foot">
(function () {
document.getElementById('@Html.IdFor(x => x.IncludeAll)').addEventListener('change', (e) => {
new bootstrap.Collapse(document.getElementById(e.target.dataset.elementIdToCollapse));
});
})();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<div class="col">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" asp-for="IncludeAll" data-element-id-to-collapse="indexes-list" />
<input class="form-check-input" asp-for="IncludeAll" data-bs-toggle="collapse" role="button" data-bs-target="#indexes-list" aria-expanded="false" aria-controls="indexes-list" />
@T["Include all Lucene search indices."]
</label>
</div>
</div>
</div>
</div>

<div id="indexes-list" class="mt-4 mb-5 collapse @(Model.IncludeAll ? "" : "show")">
<div id="indexes-list" class="mt-4 mb-5 collapse @(Model.IncludeAll ? string.Empty : "show")">
<div class="row">
<div class="col-small col-12 col-sm-9 col-md-6 col-lg-3 col-xl-3">
<span class="hint">@T["The Lucene Search Indices to reset as part of the plan."]</span>
Expand All @@ -41,11 +41,3 @@
</div>
</div>
</div>

<script at="Foot">
(function () {
document.getElementById('@Html.IdFor(x => x.IncludeAll)').addEventListener('change', (e) => {
new bootstrap.Collapse(document.getElementById(e.target.dataset.elementIdToCollapse));
});
})();
</script>

0 comments on commit 0397597

Please sign in to comment.