Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions docs/_assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ h1 {
list-style: none;
}

#noThumbnailsMessage h1{
text-align: center;
}

.thumbnailbox {
grid-column: span 3;
height: fit-content;
Expand Down
18 changes: 18 additions & 0 deletions docs/_assets/js/listing.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,21 @@ if (language) {
isFilterSelected += ", .resourcenavlanguageunknown";
}
dynamicStyle.innerHTML += `${isFilterSelected} { display: block; }`;


document.addEventListener('DOMContentLoaded', function () {
// Check if all thumbnailbox elements are hidden
var thumbnailBoxes = document.querySelectorAll('.thumbnailbox');
var allHidden = true;

thumbnailBoxes.forEach(function (box) {
if (window.getComputedStyle(box).display !== 'none') {
allHidden = false;
}
});

// Show the message if all thumbnailbox elements are hidden
if (allHidden) {
document.getElementById('noThumbnailsMessage').style.display = 'block';
}
});
5 changes: 4 additions & 1 deletion docs/_layouts/listing.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ <h1>Resources</h1>

<!-- This is the section that shows all the resource cards in the site.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This documentation should be shifted to just before the #thumbnaillist, and a different descriptive comment should be added here related to the noThumbnailsMessage

The homepage shows upto 16 'featured' items ordered (1) to (16 or lesser) -->
<div id="noThumbnailsMessage" style="display: none;">
<h1>No resources matched the selected filters.</h1>
</div>
<ul id="thumbnaillist">
{% for i in (1..16) %} {% for page in site.pages %} {% if page.layout
=='resource' %} {% if page.featured == i %}
Expand Down Expand Up @@ -91,7 +94,7 @@ <h3 class="thumbnailtitle">
{% endif %} {% endunless %} {% endif %} {% endif %} {% endfor %} {%
endfor %} {% endunless %}
</ul>
</main>
</main>

<!-- The standard CC footer, located at docs/_includes/footer.html -->
{% include footer.html %}
Expand Down