aded favicon and fixed ui issues
1672
bambu_run/static/bambu_run/vendors/coreui-icons-free.svg
vendored
Normal file
|
After Width: | Height: | Size: 410 KiB |
@@ -4,6 +4,14 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- Apply saved theme immediately to prevent flash -->
|
||||
<script>
|
||||
(function(){
|
||||
var t = localStorage.getItem('bambu-run-theme') || 'dark';
|
||||
if (t === 'auto') t = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
document.documentElement.setAttribute('data-coreui-theme', t);
|
||||
})();
|
||||
</script>
|
||||
<title>{% block title %}Bambu Run{% endblock %}</title>
|
||||
<!-- CoreUI 5.3 CSS CDN -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/@coreui/coreui@5.3.0/dist/css/coreui.min.css" rel="stylesheet">
|
||||
@@ -11,6 +19,7 @@
|
||||
<!-- Bootstrap Icons (for bi-vinyl filament icon) -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
{% block extra_css %}{% endblock %}
|
||||
{% block extra_head %}{% endblock %}
|
||||
<style>
|
||||
/* Sidebar brand sizing and padding */
|
||||
.sidebar-brand {
|
||||
@@ -26,6 +35,10 @@
|
||||
.sidebar-narrow-unfoldable:not(:hover) .sidebar-brand-text {
|
||||
display: none;
|
||||
}
|
||||
/* Gap between brand icon and text */
|
||||
.sidebar-brand img + .sidebar-brand-text {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
/* Sidebar collapse layout — standalone only */
|
||||
.wrapper { transition: margin-left 0.15s ease-out; }
|
||||
@media (min-width: 992px) {
|
||||
@@ -36,11 +49,15 @@
|
||||
@media (max-width: 991.98px) {
|
||||
.sidebar ~ .wrapper { margin-left: 0; }
|
||||
}
|
||||
/* Theme toggle icon visibility — driven by data-coreui-theme on <html> */
|
||||
[data-coreui-theme="dark"] .theme-icon-light { display: none; }
|
||||
[data-coreui-theme="light"] .theme-icon-dark { display: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="sidebar sidebar-dark sidebar-fixed" id="sidebar">
|
||||
<div class="sidebar-brand d-none d-md-flex">
|
||||
{% block sidebar_brand_icon %}{% endblock %}
|
||||
<span class="sidebar-brand-text">Bambu Run</span>
|
||||
</div>
|
||||
<ul class="sidebar-nav" data-coreui="navigation">
|
||||
@@ -70,16 +87,15 @@
|
||||
<svg class="icon icon-lg"><use href="{% static 'bambu_run/vendors/coreui-icons-free.svg' %}#cil-menu"></use></svg>
|
||||
</button>
|
||||
<ul class="header-nav ms-auto">
|
||||
{% block theme_toggle %}
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" id="themeToggle" type="button">
|
||||
<svg class="icon icon-lg"><use href="{% static 'bambu_run/vendors/coreui-icons-free.svg' %}#cil-moon"></use></svg>
|
||||
<svg class="icon icon-lg theme-icon-dark"><use href="{% static 'bambu_run/vendors/coreui-icons-free.svg' %}#cil-moon"></use></svg>
|
||||
<svg class="icon icon-lg theme-icon-light"><use href="{% static 'bambu_run/vendors/coreui-icons-free.svg' %}#cil-sun"></use></svg>
|
||||
</button>
|
||||
</li>
|
||||
{% if user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'logout' %}">Logout</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block logout_nav %}{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
@@ -115,11 +131,8 @@
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
// Theme toggle
|
||||
// Simple 2-state theme toggle (standalone default)
|
||||
const themeToggle = document.getElementById('themeToggle');
|
||||
const savedTheme = localStorage.getItem('bambu-run-theme') || 'dark';
|
||||
document.documentElement.setAttribute('data-coreui-theme', savedTheme);
|
||||
|
||||
if (themeToggle) {
|
||||
themeToggle.addEventListener('click', function() {
|
||||
const current = document.documentElement.getAttribute('data-coreui-theme');
|
||||
|
||||
BIN
docs/BambuRun.png
Normal file
|
After Width: | Height: | Size: 1.5 MiB |
@@ -91,6 +91,7 @@ USE_TZ = True
|
||||
# Static files
|
||||
STATIC_URL = "static/"
|
||||
STATIC_ROOT = BASE_DIR / "staticfiles"
|
||||
STATICFILES_DIRS = [BASE_DIR / "standalone" / "static"]
|
||||
STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage"
|
||||
|
||||
# Default primary key field type
|
||||
@@ -103,7 +104,7 @@ LOGOUT_REDIRECT_URL = "/accounts/login/"
|
||||
|
||||
# Bambu Run settings
|
||||
BAMBU_RUN_TIMEZONE = os.environ.get("TIMEZONE", "UTC")
|
||||
BAMBU_RUN_BASE_TEMPLATE = "bambu_run/base.html"
|
||||
BAMBU_RUN_BASE_TEMPLATE = "standalone_base.html"
|
||||
|
||||
# Printer connection — read from environment
|
||||
PRINTER_IP = os.environ.get("PRINTER_IP", "")
|
||||
|
||||
BIN
standalone/static/favicon-128.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
standalone/static/favicon-16.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
standalone/static/favicon-32.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
standalone/static/favicon-48.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
standalone/static/favicon-64.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
standalone/static/favicon_original.png
Normal file
|
After Width: | Height: | Size: 260 KiB |
21
standalone/templates/standalone_base.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{% extends "bambu_run/base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block extra_head %}
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-32.png' %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar_brand_icon %}
|
||||
<img src="{% static 'favicon-64.png' %}" alt="Bambu Run" width="32" height="32" style="flex-shrink:0;">
|
||||
{% endblock %}
|
||||
|
||||
{% block logout_nav %}
|
||||
{% if user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<form method="post" action="{% url 'logout' %}" style="margin:0;">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="nav-link">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||