mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-03 12:47:51 +02:00
224 lines
9.9 KiB
HTML
224 lines
9.9 KiB
HTML
{% load static %}
|
|
{% load solo_tags %}
|
|
{% load show_menu %}
|
|
{% get_solo 'portal.SiteConfiguration' as site_conf %}
|
|
|
|
<!doctype html>
|
|
<html lang="en" data-bs-theme="auto">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="color-scheme" content="light dark">
|
|
<meta name="description" content="{{ site_conf.about}}">
|
|
<meta name="author" content="{{ site_conf.site_author }}">
|
|
<meta name="generator" content="Django Framework">
|
|
<title>{% block title %}{{ title }}{% endblock %} - {{ site_conf.site_name }}</title>
|
|
<link rel="icon" href="{% static "favicon.png" %}" sizes="any">
|
|
<link rel="icon" href="{% static "favicon.svg" %}" type="image/svg+xml">
|
|
{% if site_conf.use_cdn %}
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.css" rel="stylesheet">
|
|
{% else %}
|
|
<link href="{% static "bootstrap@5.3.6/dist/css/bootstrap.min.css" %}" rel="stylesheet">
|
|
<link href="{% static "bootstrap-icons@1.13.1/font/bootstrap-icons.css" %}" rel="stylesheet">
|
|
{% endif %}
|
|
<link href="{% static "css/main.css" %}?v={{ site_conf.version }}" rel="stylesheet">
|
|
<style>
|
|
.bd-placeholder-img {
|
|
font-size: 1.125rem;
|
|
text-anchor: middle;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
user-select: none;
|
|
}
|
|
@media (min-width: 768px) {
|
|
.bd-placeholder-img-lg {
|
|
font-size: 3.5rem;
|
|
}
|
|
}
|
|
</style>
|
|
<script>
|
|
/*!
|
|
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
|
|
* Copyright 2011-2023 The Bootstrap Authors
|
|
* Licensed under the Creative Commons Attribution 3.0 Unported License.
|
|
*/
|
|
|
|
(() => {
|
|
'use strict'
|
|
|
|
const getStoredTheme = () => localStorage.getItem('theme')
|
|
const setStoredTheme = theme => localStorage.setItem('theme', theme)
|
|
|
|
const getPreferredTheme = () => {
|
|
const storedTheme = getStoredTheme()
|
|
if (storedTheme) {
|
|
return storedTheme
|
|
}
|
|
|
|
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
|
|
}
|
|
|
|
const setTheme = theme => {
|
|
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
document.documentElement.setAttribute('data-bs-theme', 'dark')
|
|
} else {
|
|
document.documentElement.setAttribute('data-bs-theme', theme)
|
|
}
|
|
}
|
|
|
|
setTheme(getPreferredTheme())
|
|
|
|
const showActiveTheme = (theme, focus = false) => {
|
|
const themeSwitcher = document.querySelector('#bd-theme')
|
|
|
|
if (!themeSwitcher) {
|
|
return
|
|
}
|
|
|
|
const activeThemeIcon = document.querySelector('.theme-icon-active i')
|
|
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
|
|
const biOfActiveBtn = btnToActive.querySelector('.theme-icon i').getAttribute('class')
|
|
|
|
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
|
|
element.classList.remove('active')
|
|
element.setAttribute('aria-pressed', 'false')
|
|
})
|
|
|
|
btnToActive.classList.add('active')
|
|
btnToActive.setAttribute('aria-pressed', 'true')
|
|
activeThemeIcon.setAttribute('class', biOfActiveBtn)
|
|
|
|
if (focus) {
|
|
themeSwitcher.focus()
|
|
}
|
|
}
|
|
|
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
|
const storedTheme = getStoredTheme()
|
|
if (storedTheme !== 'light' && storedTheme !== 'dark') {
|
|
setTheme(getPreferredTheme())
|
|
}
|
|
})
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
showActiveTheme(getPreferredTheme())
|
|
document.querySelectorAll('[data-bs-theme-value]')
|
|
.forEach(toggle => {
|
|
toggle.addEventListener('click', () => {
|
|
const theme = toggle.getAttribute('data-bs-theme-value')
|
|
setStoredTheme(theme)
|
|
setTheme(theme)
|
|
showActiveTheme(theme, true)
|
|
})
|
|
})
|
|
})
|
|
})()
|
|
</script>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
var selectElement = document.getElementById('tabSelector');
|
|
try {
|
|
selectElement.addEventListener('change', function () {
|
|
var selectedTabId = this.value;
|
|
var tabs = document.querySelectorAll('.tab-pane');
|
|
tabs.forEach(function (tab) {
|
|
tab.classList.remove('show', 'active');
|
|
});
|
|
document.getElementById(selectedTabId).classList.add('show', 'active');
|
|
});
|
|
} catch (TypeError) { /* pass */ }
|
|
});
|
|
</script>
|
|
{% block extra_head %}
|
|
{{ site_conf.extra_head | safe }}
|
|
{% endblock %}
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<nav class="navbar navbar-expand-sm bg-body-tertiary shadow-sm">
|
|
<div class="container d-flex">
|
|
<div class="me-auto">
|
|
<a href="{% url 'index' %}" class="navbar-brand d-flex align-items-center">
|
|
<svg class="me-2" width="32" height="16" version="1.0" viewBox="0 0 24 12" xmlns="http://www.w3.org/2000/svg">
|
|
<g transform="matrix(.0039261 0 0 -.0039261 -1.4249 18.53)">
|
|
<path d="m813 4723-103-4v-309h-355l14-330h369l6-42c39-273 39-1414 0-1659l-7-39h-368l-14-330h355v-318l41-7c23-4 126-7 229-7s206 3 229 7l41 7v318h670v-318l41-7c23-4 126-7 229-7s206 3 229 7l41 7v318h670v-318l37-7c48-9 432-9 472 0l31 7v318h680v-318l31-7c39-9 423-9 469 0l35 6v314l338 3 337 2v-318l38-7c48-9 416-9 465 0l37 7v318h335v2400h-335v307l-135 6c-74 3-196 3-270 0l-135-6v-307l-337 2-338 3v302l-132 6c-73 3-194 3-268 0l-135-6v-307h-680v307l-135 6c-74 3-196 3-270 0l-135-6v-307h-670v307l-135 6c-74 3-196 3-270 0l-135-6v-307h-670v310h-63c-35 0-111 2-168 4s-150 1-206-1zm1141-666c3-12 11-97 18-187 24-309 11-1402-18-1507l-6-23h-725l-7 32c-39 197-39 1454 0 1676l6 32h726zm1218-42c20-182 30-569 25-940-6-371-21-707-33-727-3-4-169-8-368-8h-363l-7 48c-38 277-38 1365 1 1647l6 45 366-2 366-3zm1203 53c39-103 45-1264 9-1660l-7-68h-735l-6 68c-35 381-35 1263 0 1610l6 62h364c283 0 366-3 369-12zm1219-42c37-316 37-1287 0-1628l-7-58h-734l-6 73c-37 424-31 1544 8 1655 3 9 86 12 368 12h364zm841-1686c-336 0-363 1-370 18-3 9-13 152-22 317-21 431-7 1292 23 1388 5 16 31 17 369 17z"/>
|
|
</g>
|
|
</svg>
|
|
<strong>{{ site_conf.site_name }}</strong>
|
|
</a>
|
|
</div>
|
|
{% include 'includes/login.html' %}
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
<main>
|
|
<div class="container py-2">
|
|
<nav class="navbar navbar-expand-lg">
|
|
<div class="container-fluid g-0">
|
|
<a class="navbar-brand" href="{% url 'index' %}">Home</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{% url 'roster' %}">Roster</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{% url 'consists' %}">Consists</a>
|
|
</li>
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle" href="#" id="filterDropdownMenu" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
Search by
|
|
</a>
|
|
<ul class="dropdown-menu" aria-labelledby="filterDropdownMenu">
|
|
<li class="ps-2 text-secondary">Model</li>
|
|
<li><a class="dropdown-item" href="{% url 'scales' %}">Scale</a></li>
|
|
<li><a class="dropdown-item" href="{% url 'manufacturers' category='model' %}">Manufacturer</a></li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li class="ps-2 text-secondary">Prototype</li>
|
|
<li><a class="dropdown-item" href="{% url 'rolling_stock_types' %}">Type</a></li>
|
|
<li><a class="dropdown-item" href="{% url 'companies' %}">Company</a></li>
|
|
<li><a class="dropdown-item" href="{% url 'manufacturers' category='real' %}">Manufacturer</a></li>
|
|
</ul>
|
|
</li>
|
|
{% show_bookshelf_menu %}
|
|
{% show_flatpages_menu user %}
|
|
</ul>
|
|
{% include 'includes/search.html' %}
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
<section class="py-4 text-center container">
|
|
<div class="row">
|
|
<div class="mx-auto">
|
|
<h1 class="fw-light">{{ title }}</h1>
|
|
{% block header %}
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<div class="album py-4 bg-body-tertiary">
|
|
<div class="container">
|
|
{% block carousel %}
|
|
{% endblock %}
|
|
<a id="main-content"></a>
|
|
{% block cards_layout %}
|
|
{% endblock %}
|
|
</div>
|
|
<div class="container">{% block pagination %}{% endblock %}</div>
|
|
</div>
|
|
{% block extra_content %}{% endblock %}
|
|
{% include 'includes/symbols.html' %}
|
|
</main>
|
|
{% include 'includes/footer.html' %}
|
|
{% if site_conf.use_cdn %}
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.bundle.min.js"></script>
|
|
{% else %}
|
|
<script src="{% static "bootstrap@5.3.6/dist/js/bootstrap.bundle.min.js" %}"></script>
|
|
{% endif %}
|
|
</body>
|
|
</html>
|