Merge branch 'develop' into feature/2fa

This commit is contained in:
slawkens
2026-01-31 19:28:43 +01:00
2 changed files with 33 additions and 2 deletions

View File

@@ -152,9 +152,10 @@ class Settings implements \ArrayAccess
} }
if ($setting['type'] === 'category') { if ($setting['type'] === 'category') {
$title = strtolower(str_replace(' ', '', $setting['title']));
?> ?>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link<?= ($i === 0 ? ' active' : ''); ?>" id="home-tab-<?= $i++; ?>" data-toggle="tab" href="#tab-<?= str_replace(' ', '', $setting['title']); ?>" type="button"><?= $setting['title']; ?></a> <a class="nav-link<?= ($i === 0 ? ' active' : ''); ?>" id="home-tab-<?= $i++; ?>" data-toggle="tab" href="#tab-<?= $title; ?>" type="button"><?= $setting['title']; ?></a>
</li> </li>
<?php <?php
} }
@@ -175,8 +176,10 @@ class Settings implements \ArrayAccess
if ($j++ !== 0) { // close previous category if ($j++ !== 0) { // close previous category
echo '</tbody></table></div>'; echo '</tbody></table></div>';
} }
$title = strtolower(str_replace(' ', '', $setting['title']));
?> ?>
<div class="tab-pane fade show<?= ($j === 1 ? ' active' : ''); ?>" id="tab-<?= str_replace(' ', '', $setting['title']); ?>"> <div class="tab-pane fade show<?= ($j === 1 ? ' active' : ''); ?>" id="tab-<?= $title; ?>">
<?php <?php
continue; continue;
} }

View File

@@ -165,3 +165,31 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</script> </script>
<script>
$(function () {
if ($('.tab-content').length) {
let url = window.location.href;
let activeTab = url.substring(url.indexOf("#") + 1);
let $selector = $('[href="#' + activeTab + '"]')
if ($selector.length) {
$selector.tab('show');
}
}
let url = location.href.replace(/\/$/, "");
$('a[data-toggle="tab"]').on("click", function() {
let newUrl;
const hash = $(this).attr("href");
if(hash === "#home") {
newUrl = url.split("#")[0];
} else {
newUrl = url.split("#")[0] + hash;
}
history.replaceState(null, null, newUrl);
});
});
</script>