Files
wizarr/app/templates/base.html
Matthieu B 187b8758c1 Refactor wizard templates and JavaScript controller
- Updated title block in frame.html for clarity.
- Improved localization for the "Next" button in steps.html.
- Refactored the WizardController JavaScript for better readability and organization.
- Added detailed comments to the wizard architecture for future reference.
- Enhanced button visibility and state management based on interaction requirements.
- Implemented swipe gesture handling for mobile navigation.
- Updated subproject commit to indicate a dirty state.
2025-10-07 14:01:16 +02:00

144 lines
6.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet"
href="{{ url_for('static',filename='css/main.css') }}" />
<link rel="stylesheet"
href="{{ url_for('static', filename='css/tiny-mde.min.css') }}" />
<link rel="stylesheet"
href="{{ url_for ('static', filename='node_modules/animate.css/animate.min.css') }}">
<script src="{{ url_for('static', filename='node_modules/htmx.org/dist/htmx.min.js') }}"></script>
<script src="{{ url_for('static', filename='node_modules/htmx-ext-preload/dist/preload.min.js') }}"></script>
<link rel="icon"
type="image/x-icon"
href="{{ url_for('static', filename='favicon.ico') }}">
<!-- PWA Manifest -->
<link rel="manifest"
href="{{ url_for('static', filename='manifest.json') }}">
<meta name="viewport"
content="initial-scale=1, width=device-width, viewport-fit=cover, user-scalable=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style"
content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Wizarr">
<meta name="HandheldFriendly" content="true" />
<!-- PWA Theme Color -->
<meta name="theme-color" content="#3b82f6">
<!-- Apple Touch Icons -->
<link rel="apple-touch-icon"
href="{{ url_for('static', filename='img/pwa-icons/icon-152x152.png') }}">
<link rel="apple-touch-icon"
sizes="72x72"
href="{{ url_for('static', filename='img/pwa-icons/icon-72x72.png') }}">
<link rel="apple-touch-icon"
sizes="96x96"
href="{{ url_for('static', filename='img/pwa-icons/icon-96x96.png') }}">
<link rel="apple-touch-icon"
sizes="128x128"
href="{{ url_for('static', filename='img/pwa-icons/icon-128x128.png') }}">
<link rel="apple-touch-icon"
sizes="144x144"
href="{{ url_for('static', filename='img/pwa-icons/icon-144x144.png') }}">
<link rel="apple-touch-icon"
sizes="152x152"
href="{{ url_for('static', filename='img/pwa-icons/icon-152x152.png') }}">
<link rel="apple-touch-icon"
sizes="192x192"
href="{{ url_for('static', filename='img/pwa-icons/icon-192x192.png') }}">
<link rel="apple-touch-icon"
sizes="384x384"
href="{{ url_for('static', filename='img/pwa-icons/icon-384x384.png') }}">
<link rel="apple-touch-icon"
sizes="512x512"
href="{{ url_for('static', filename='img/pwa-icons/icon-512x512.png') }}">
<meta name="robots" content="noindex">
<title>
{% block title %}
{% endblock title %}
- {{ _(server_name) }}</title>
<meta property="og:title"
content="{% block og_title %}
{% endblock og_title %}" />
<meta property="og:description"
content="{% block og_description %}
{% endblock og_description %}" />
<script>
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
if (localStorage.getItem('color-theme') === 'dark' || (!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
// Clipboard utility with fallback support for HTTP contexts
function copyToClipboard(text, callback) {
// Modern clipboard API (requires HTTPS or localhost)
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(text).then(() => {
if (callback) callback(true);
}).catch(err => {
console.warn('Clipboard API failed, trying fallback:', err);
fallbackCopy(text, callback);
});
} else {
// Fallback for HTTP contexts
fallbackCopy(text, callback);
}
}
function fallbackCopy(text, callback) {
// Create a temporary textarea element
const textarea = document.createElement('textarea');
textarea.value = text;
textarea.style.position = 'fixed';
textarea.style.opacity = '0';
textarea.style.left = '-9999px';
document.body.appendChild(textarea);
try {
// Select and copy the text
textarea.select();
textarea.setSelectionRange(0, 99999); // For mobile devices
const successful = document.execCommand('copy');
if (callback) callback(successful);
if (!successful) {
console.warn('Fallback copy failed');
// Last resort: show alert with text to copy manually
alert('Please copy this link manually:\n\n' + text);
}
} catch (err) {
console.error('All copy methods failed:', err);
if (callback) callback(false);
// Last resort: show alert with text to copy manually
alert('Please copy this link manually:\n\n' + text);
} finally {
document.body.removeChild(textarea);
}
}
</script>
</head>
<body class="bg-gray-50 dark:bg-gray-900">
{% block main %}
{% endblock main %}
<link rel="stylesheet"
href="{{ url_for('static',filename='css/main.css') }}" />
<script src="{{url_for('static', filename='node_modules/alpinejs/dist/cdn.min.js')}}"></script>
<script src="{{ url_for('static', filename='node_modules/flowbite/dist/flowbite.min.js') }}"></script>
<script src="{{url_for('static', filename='node_modules/@alpinejs/collapse/dist/cdn.min.js')}}"></script>
<script src="{{url_for('static', filename='js/dark-mode-switch.js')}}"></script>
<script src="{{ url_for('static', filename='js/tiny-mde.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/init-tinymde.js') }}"></script>
<script src="{{ url_for('static', filename='js/sortable.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/wizard-steps.js') }}"></script>
<script src="{{ url_for('static', filename='js/pwa-registration.js') }}"></script>
<!-- In-app browser escape -->
<script src="{{ url_for('static', filename='node_modules/bowser/bundled.js') }}"></script>
<script src="{{ url_for('static', filename='node_modules/inapp-spy/dist/index.global.js') }}"></script>
<script src="{{ url_for('static', filename='js/in-app-escape.js') }}"></script>
</body>
</html>