Basic feature implemented, very basic poc

This commit is contained in:
David Schärer 2024-07-16 20:22:59 +02:00
parent 216089a3e7
commit 48c0067076
118 changed files with 2113 additions and 20 deletions

View file

@ -0,0 +1,16 @@
<% if flash[:alert] || flash[:notice] %>
<div class="container mt-3 mb-3">
<% if flash[:alert] %>
<div class="alert alert-danger" role="alert">
<%= flash[:alert] %><% flash.delete(:alert) %>
</div>
<% end %>
<% if flash[:notice] %>
<div class="alert alert-info" role="alert">
<%= flash[:notice] %>
<% flash.delete(:notice) %>
</div>
<% end %>
</div>
<% end %>

View file

@ -9,7 +9,12 @@
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<% @navbar_items.each do |navbar_item| %>
<li class="nav-item">
<a class="nav-link <%= current_page?(navbar_item[:path]) && "active" %>" <%= current_page?(navbar_item[:path]) && "aria-current=\"page\"" %> href="<%= url_for(navbar_item[:path]) %>"><%= navbar_item[:label] %></a>
<a class="nav-link <%= @nav_path.to_s == navbar_item[:path].to_s && "active" %>" <%= @nav_path.to_s == navbar_item[:path].to_s && "aria-current=\"page\"" %> href="<%= url_for(navbar_item[:path]) %>">
<% if navbar_item[:icon] %>
<span aria-hidden="true" class="bi-<%= navbar_item[:icon] %>"></span>
<% end %>
<%= navbar_item[:label] %>
</a>
</li>
<% end %>
<%# <li class="nav-item">
@ -39,6 +44,19 @@
<button class="btn btn-outline-success" type="submit" name="<%= @search_name || "q" %>"><%= @search_placeholder || "Suchen" %></button>
</form>
<% end %>
<ul class="navbar-nav flex-row flex-wrap ms-md-auto">
<li class="nav-item">
<button class="btn btn-link nav-link py-2 px-0 px-lg-2 d-flex align-items-center"
data-controller="theme-switcher"
data-action="theme-switcher#switch"
id="bd-theme"
type="button"
data-bs-display="static"
aria-label="Toggle theme (auto)">
<i class="bi <%= cookies[:modeTheme] == "dark" ? "bi-moon-stars-fill" : "bi-sun-fill" %> my-1"></i>
</button>
</li>
</ul>
</div>
</div>
</nav>

View file

@ -12,13 +12,11 @@
</head>
<body class="">
<%= render partial: "layouts/sidebar" %>
<%= render partial: "layouts/navigation" %>
<main class="">
<%= render partial: "layouts/sidebar" %>
<div class="p-3">
<%= yield %>
</div>
<%= render partial: "layouts/flash" %>
<main class="p-3">
<%= yield %>
</main>
</body>
</html>