customizable nav style + small changes

This commit is contained in:
mystie 2024-09-28 00:42:40 +03:00
parent f9a4f9ba64
commit 207c4dd842

View file

@ -13,7 +13,8 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='icons/favicon/apple-touch-icon.png') }}"> <link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='icons/favicon/apple-touch-icon.png') }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='icons/favicon/favicon-32x32.png') }}"> <link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='icons/favicon/favicon-32x32.png') }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='icons/favicon/favicon-16x16.png') }}"> <link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='icons/favicon/favicon-16x16.png') }}">
<link rel="mask-icon" href="{{ url_for('static', filename='icons/favicon/safari-pinned-tab.svg') }}" color="#5bbad5"> <link rel="icon" type="image/png" sizes="192x192" href="{{ url_for('static', filename='icons/favicon/android-chrome-192x192.png') }}">
<link rel="icon" type="image/png" sizes="512x512" href="{{ url_for('static', filename='icons/favicon/android-chrome-512x512.png') }}">
<link rel="shortcut icon" href="{{ url_for('static', filename='icons/favicon/favicon.ico') }}"> <link rel="shortcut icon" href="{{ url_for('static', filename='icons/favicon/favicon.ico') }}">
<!-- metadata --> <!-- metadata -->
@ -36,24 +37,39 @@
<meta property="twitter:image" content="{{ metadata.image }}" /> <meta property="twitter:image" content="{{ metadata.image }}" />
<script src="{{ url_for('static', filename='js/color-modes.js') }}"></script> <script src="{{ url_for('static', filename='js/color-modes.js') }}"></script>
{% if cfg.style.tintColors %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/tinted.css') }}">
{% endif %}
{% block additionalHeadItems %}{% endblock %} {% block additionalHeadItems %}{% endblock %}
<style>
[data-bs-theme=light] {
--bs-primary: {{ cfg.style.accentLight }} !important;
}
[data-bs-theme=dark] {
--bs-primary: {{ cfg.style.accentDark }} !important;
}
</style>
<script src="{{ url_for('static', filename='js/htmx.min.js') }}"></script>
<title>{% block title %}{% endblock %} | {{ cfg.instance.title }}</title> <title>{% block title %}{% endblock %} | {{ cfg.instance.title }}</title>
</head> </head>
<body class="ms-2 me-2 mb-2"> <body class="ms-2 me-2 mb-2">
<a class="visually-hidden-focusable" href="#main-content">Skip to content</a> <a class="visually-hidden-focusable btn" href="#main-content">Skip to content</a>
<div class="container-fluid"> <div class="container-fluid">
<div class="d-flex {% if logged_in %}justify-content-between {% endif %}align-items-center mt-3 {% if logged_in %}mb-3{% endif %}"> <div class="d-flex {% if logged_in %}justify-content-between {% endif %}align-items-center mt-3 {% if logged_in %}mb-3{% endif %}">
<ul class="nav nav-underline position-relative"> <ul class="nav nav-{{ cfg.style.navStyle }} position-relative">
<li class="nav-item d-flex align-items-center"><a href="{{ url_for('index') }}" aria-label="{{ cfg.instance.title }}'s icon"><img src="{{ url_for('static', filename='icons/catask.svg') }}" width="32" height="32" alt="{{ cfg.instance.title }}'s icon"></a></li> <li class="nav-item d-flex align-items-center {% if cfg.style.navStyle == 'pills' %}me-1{% endif %}"><a href="{{ url_for('index') }}" aria-label="{{ cfg.instance.title }}'s icon"><img src="{{ url_for('static', filename='icons/favicon/apple-touch-icon.png') }}" width="32" height="32" alt="{{ cfg.instance.title }}'s icon"></a></li>
<li class="nav-item"><a class="nav-link {{ homeLink }}" id="home-link" href="{{ url_for('index') }}">Home</a> <li class="nav-item d-flex align-items-center"><a class="nav-link {{ homeLink }}" id="home-link" href="{{ url_for('index') }}">Home</a></li>
{% if logged_in %} {% if logged_in %}
<li class="nav-item"><a class="nav-link {{ inboxLink }}" id="inbox-link" href="{{ url_for('inbox') }}">Inbox</a> <li class="nav-item d-flex align-items-center position-relative">
<a class="nav-link {{ inboxLink }}" id="inbox-link" href="{{ url_for('inbox') }}">
Inbox {# <span class="position-absolute start-100 translate-middle badge text-bg-primary rounded-pill">{{ questionCount }} <span class="visually-hidden">unanswered questions</span></span> #}
</a>
</li> </li>
<li class="nav-item"><a class="nav-link {{ adminLink }}" id="admin-link" href="{{ url_for('admin.index') }}">Admin</a></li> <li class="nav-item d-flex align-items-center"><a class="nav-link {{ adminLink }}" id="admin-link" href="{{ url_for('admin.index') }}">Admin</a></li>
{% endif %} {% endif %}
</ul> </ul>
{% if logged_in %} {% if logged_in %}
<ul class="nav nav-underline m-0"> <ul class="nav nav-{{ cfg.style.navStyle }} m-0">
<li><a class="nav-link" href="{{ url_for('admin.logout') }}">Logout</a></li> <li><a class="nav-link" href="{{ url_for('admin.logout') }}">Logout</a></li>
</ul> </ul>
{% endif %} {% endif %}
@ -71,14 +87,10 @@
<div id="main-content"> <div id="main-content">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
<script src="{{ url_for('static', filename='js/htmx.min.js') }}"></script> <footer class="py-3 my-4 d-flex justify-content-between align-items-center">
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/eruda" onload="eruda.init()"></script> -->
{% block scripts %}{% endblock %}
<footer class="py-3 my-4 text-center d-flex justify-content-between align-items-center">
<div class="row"> <div class="row">
<div class="dropdown bd-mode-toggle"> <div class="dropdown bd-mode-toggle">
<button class="btn py-2 dropdown-toggle fs-5" <button class="btn btn-outline-secondary py-2 dropdown-toggle"
id="bd-theme" id="bd-theme"
type="button" type="button"
aria-expanded="false" aria-expanded="false"
@ -110,10 +122,16 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="d-inline-block"> <div class="text-body-secondary text-end small">
<a href="https://git.gay/mst/catask" target="_blank" class="text-body-secondary text-decoration-none">{{ const.appName }} {{ version }}{{ version_id }}</a> <p class="text-decoration-none m-0 d-flex align-items-center gap-1">
<img src="{{ url_for('static', filename='icons/catask.svg') }}" width="20" height="20" alt="{{ const.appName }} logo">
{{ const.appName }} <span class="fw-medium">{{ version }}{{ version_id }}</span>
</p>
<a href="https://git.gay/mst/catask" class="icon-link text-decoration-none" target="_blank"><i class="bi bi-git"></i> Source code</a>
</div> </div>
</footer> </footer>
</div> </div>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
{% block scripts %}{% endblock %}
</body> </body>
</html> </html>