Skip to content

Commit

Permalink
Fix nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Oct 12, 2024
1 parent 96d317e commit 440b71b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Behaviour.specify("#recurse", "ListView", 0, function (e) {
var nestedElements = document.querySelectorAll("SPAN.nested");
// SPAN.nested is kept for backwards compatability
var nestedElements = document.querySelectorAll(".listview-jobs--nested, SPAN.nested");
e.onclick = function () {
nestedElements.forEach(function (el) {
el.style.display = e.checked ? "" : "none";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,27 @@ THE SOFTWARE.
<f:checkbox title="${%Recurse in subfolders}" id="recurse" />
</f:entry>

<d:taglib uri="local">
<d:tag name="checkbox">
<f:checkbox name="item_${job.getRelativeNameFromGroup(it.ownerItemGroup)}"
checked="${it.jobNamesContains(job)}"
title="${job.displayName}"
tooltip="${!job.fullName.equals(job.displayName) ? job.fullName : null}"
json="true" />
<j:if test="${job.getItems().size() gt 0}">
<div class="listview-jobs listview-jobs--nested" style="${it.recurse ? '' : 'display: none'}">
<j:forEach var="job" items="${job.getItems()}">
<local:checkbox xmlns:local="local" job="${job}" />
</j:forEach>
</div>
</j:if>
</d:tag>
</d:taglib>

<f:entry>
<div class="listview-jobs">
<j:forEach var="job" items="${h.getAllTopLevelItems(it.ownerItemGroup)}">
<j:set var="spanClass" value="notnested"/>
<j:set var="spanStyle" value=""/>
<j:if test="${job.parent!=it.ownerItemGroup}">
<j:set var="spanClass" value="nested"/>
<j:set var="spanStyle" value="${it.recurse?'':'display:none'}"/>
</j:if>
<span class="${spanClass}" style="${spanStyle}">
<f:checkbox name="item_${job.getRelativeNameFromGroup(it.ownerItemGroup)}" checked="${it.jobNamesContains(job)}" title="${h.getRelativeDisplayNameFrom(job,it.ownerItemGroup)}" tooltip="${job.fullName}" json="true"/>
</span>
<div class="listview-jobs" xmlns:local="local">
<j:forEach var="job" items="${it.ownerItemGroup.getItems()}">
<local:checkbox job="${job}" />
</j:forEach>
</div>
</f:entry>
Expand Down
23 changes: 0 additions & 23 deletions war/src/main/scss/base/_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -406,29 +406,6 @@ img.icon-help {
vertical-align: text-top;
}

/* ============================ list view entries ======================== */
div.listview-jobs {
display: flex;
flex-direction: column;
gap: 0.3rem;

.nested,
.notnested {
display: flex;
}

.nested {
border-left: 2px solid color-mix(in sRGB, var(--input-border), transparent);
margin-left: 10px;
padding-left: 22px;

& + .nested {
margin-top: -0.3rem;
padding-top: 0.3rem;
}
}
}

/* ============================ health report hover ========================== */

.healthReport a {
Expand Down
14 changes: 14 additions & 0 deletions war/src/main/scss/pages/_dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,17 @@ $min-button-size: 36px;
height: 1rem;
}
}

div.listview-jobs {
display: flex;
flex-direction: column;
gap: 0.3rem;

&--nested {
display: flex;
flex-direction: column;
border-left: 2px solid color-mix(in sRGB, var(--input-border), transparent);
margin-left: 10px;
padding-left: 22px;
}
}

0 comments on commit 440b71b

Please sign in to comment.