Files

42 lines
1.1 KiB
Plaintext

{% include "header" %}
{% include "sub_navigation" %}
<main class="np-main np-learning-paths np-subpage-container np-max-width">
<div class="np-learning-paths-main">
<div class="heading">
{% t shared.learning_paths %}
</div>
<div class="np-resource-subtitle">
{% t .subtitle %}
</div>
{% include "learning_paths_index", items: learning_paths.available %}
</div>
</main>
{% include "footer" %}
<script>
function sortLearningPaths() {
const learningPaths = Array.from(document.querySelectorAll('.lp-card-container'));
learningPaths.sort((a, b) => {
const titleA = a.querySelector('.card-title').textContent.trim().toLowerCase();
const titleB = b.querySelector('.card-title').textContent.trim().toLowerCase();
return titleA.localeCompare(titleB);
});
learningPaths.forEach(learningPath => {
learningPath.remove();
});
const container = document.querySelector('.np-learning-paths-resources');
learningPaths.forEach(learningPath => {
container.appendChild(learningPath);
});
}
document.addEventListener('DOMContentLoaded', function() {
sortLearningPaths();
});
</script>