Improve navigation bar

This commit is contained in:
danielbroll
2022-08-15 14:23:43 +02:00
committed by Carsten Otto
parent 6567ea5555
commit bdce223125
3 changed files with 4 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ import java.util.Map;
public abstract class ThymeleafPage {
private static final String VIEW_KEY = "page";
private final Map<String, Object> modelAttributes = new HashMap<>();
public ThymeleafPage() {
@@ -24,6 +25,7 @@ public abstract class ThymeleafPage {
}
public String create(Model model) {
model.addAttribute(VIEW_KEY, getView());
model.addAllAttributes(getModelAttributes());
return getView();
}

View File

@@ -13,16 +13,8 @@ body {
*/
.sidebar {
position: fixed;
top: 0;
/* rtl:raw:
right: 0;
*/
bottom: 0;
/* rtl:remove */
left: 0;
z-index: 100; /* Behind the navbar */
padding: 48px 0 0; /* Height of navbar */
padding: 12px 0 0; /* Height of navbar */
box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

View File

@@ -3,7 +3,7 @@
<html xmlns:th="https://www.thymeleaf.org">
<nav th:fragment="left-side-bar" id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
<div class="position-sticky pt-3">
<div class="position-sticky">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" th:classappend="${page == 'dashboard' ? 'active' : ''}" href="/">