mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2025-09-10 11:47:10 +02:00
Optimized menus
This commit is contained in:
43
app/templates/moduls/base.html.j2
Normal file
43
app/templates/moduls/base.html.j2
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{company.titel}}</title>
|
||||
<meta charset="utf-8" >
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
<!-- Bootstrap CSS only -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
|
||||
<!-- Bootstrap JavaScript Bundle with Popper -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
|
||||
<!-- Fontawesome -->
|
||||
<script src="https://kit.fontawesome.com/56f96da298.js" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="static/css/default.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header class="header">
|
||||
<img src="{{company.logo}}" alt="logo"/>
|
||||
<h1>{{company.titel}}</h1>
|
||||
<h2>{{company.subtitel}}</h2>
|
||||
<br />
|
||||
</header>
|
||||
{% set menu_type = "header" %}
|
||||
{% include "moduls/navigation.html.j2"%}
|
||||
{% block content %}{% endblock %}
|
||||
{% set menu_type = "footer" %}
|
||||
{% include "moduls/navigation.html.j2" %}
|
||||
<footer class="footer">
|
||||
<div itemscope itemtype="http://schema.org/LocalBusiness" class="small">
|
||||
<p itemprop="name">{{ company.titel }} <br />
|
||||
{{ company.subtitel }}</p>
|
||||
<span><i class="fa-solid fa-location-dot"></i> {{ company.address.values() | join(", ") }}</span>
|
||||
<p><a href="{{company.imprint_url}}"><i class="fa-solid fa-scale-balanced"></i> Imprint</a></p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<!-- Include modal -->
|
||||
{% include "moduls/modal.html.j2" %}
|
||||
<script src="{{ url_for('static', filename='js/dynamic-modal.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
13
app/templates/moduls/card.html.j2
Normal file
13
app/templates/moduls/card.html.j2
Normal file
@@ -0,0 +1,13 @@
|
||||
<div class="card-column col-lg-3 col-md-6 col-12">
|
||||
<div class="card h-100 d-flex flex-column">
|
||||
<div class="card-body d-flex flex-column">
|
||||
<div class="card-img-top">
|
||||
<img src="{{ card.icon }}" alt="{{ card.title }}" style="width: 100px; height: auto;">
|
||||
</div>
|
||||
<hr />
|
||||
<h3 class="card-title">{{ card.title }}</h3>
|
||||
<p class="card-text">{{ card.text }}</p>
|
||||
<a href="{{ card.link }}" class="mt-auto btn btn-light stretched-link" ><i class="fa-solid fa-globe"></i> {{ card.link_text }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
20
app/templates/moduls/modal.html.j2
Normal file
20
app/templates/moduls/modal.html.j2
Normal file
@@ -0,0 +1,20 @@
|
||||
<!-- Universal Modal Structure -->
|
||||
<div class="modal fade" id="dynamicModal" tabindex="-1" aria-labelledby="dynamicModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="dynamicModalLabel"></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="input-group">
|
||||
<input type="text" id="dynamicModalContent" class="form-control" readonly>
|
||||
<button class="btn btn-outline-secondary" type="button" id="dynamicCopyButton">Copy</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
63
app/templates/moduls/navigation.html.j2
Normal file
63
app/templates/moduls/navigation.html.j2
Normal file
@@ -0,0 +1,63 @@
|
||||
<!-- Template for Subitems -->
|
||||
{% macro render_subitems(subitems) %}
|
||||
{% for subitem in subitems %}
|
||||
{% if subitems.subitems %}
|
||||
<li class="dropdown-submenu">
|
||||
<a class="dropdown-item dropdown-toggle" href="#">
|
||||
<i class="{{ subitem.icon_class }}"></i> {{ subitem.name }}
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
{{ render_subitems(subitem.subitems) }}
|
||||
</ul>
|
||||
</li>
|
||||
{% elif subitem.popup %}
|
||||
<li>
|
||||
<a class="dropdown-item" onclick='openDynamicPopup({{subitem|tojson|safe}})''>
|
||||
<i class="{{ subitem.icon_class }}"></i> {{ subitem.name }}
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{ subitem.href }}" {% if subitem.target %} target="{{subitem.target}}" {% endif %}>
|
||||
<i class="{{ subitem.icon_class }}"></i> {{ subitem.name }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
<!-- Navigation Bar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<!--
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
-->
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav {% if menu_type == 'header' %}ms-auto{% endif %}">
|
||||
{% for item in navigation[menu_type] %}
|
||||
{% if item.href %}
|
||||
<!-- Single Item -->
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ item.href }}">
|
||||
<i class="{{ item.icon_class }}"></i> {{ item.name }}
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<!-- Dropdown Menu -->
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown{{ loop.index }}" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="{{ item.icon_class }}"></i> {{ item.name }}
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown{{ loop.index }}">
|
||||
{{ render_subitems(item.subitems) }}
|
||||
</ul>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
Reference in New Issue
Block a user