109 lines
4.8 KiB
HTML
109 lines
4.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-TW">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
<title>{% block title %}EwoooC{% endblock %}</title>
|
|
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700;800&family=Noto+Sans+TC:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/ewoooc-tokens.css') }}">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/ewoooc-shell.css') }}">
|
|
{% block extra_css %}{% endblock %}
|
|
</head>
|
|
<body class="momo-v2-body">
|
|
<div class="momo-app momo-shell" id="momo-shell">
|
|
{% include 'components/_ewoooc_shell.html' %}
|
|
|
|
{% set _next_run = next_run|default(None) %}
|
|
{% set _session_username = session.get('username') if session is defined else None %}
|
|
{% set _session_role = session.get('role') if session is defined else None %}
|
|
{% set _is_logged_in = session.get('logged_in') if session is defined else false %}
|
|
|
|
<section class="momo-main-shell">
|
|
<header class="momo-topbar">
|
|
<button class="momo-mobile-menu-button" type="button" data-momo-sidebar-toggle aria-label="開啟主選單">
|
|
<i class="fas fa-bars"></i>
|
|
</button>
|
|
|
|
<form class="momo-search-box" role="search" method="GET" action="/">
|
|
<i class="fas fa-search" aria-hidden="true"></i>
|
|
<input class="momo-search-input momo-mono" type="search" name="q" value="{{ search_query|default('') }}" placeholder="搜尋商品名稱、編號、品牌...">
|
|
<kbd class="momo-shortcut momo-mono">⌘K</kbd>
|
|
</form>
|
|
|
|
<div class="momo-topbar-spacer"></div>
|
|
|
|
{% if _next_run %}
|
|
<div class="momo-topbar-pill momo-mono">
|
|
<span class="momo-live-dot"></span>
|
|
<span>下次排程</span>
|
|
<strong>{{ _next_run }}</strong>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<button class="momo-icon-button" type="button" title="說明">
|
|
<i class="fas fa-circle-question"></i>
|
|
</button>
|
|
<button class="momo-icon-button" type="button" title="通知">
|
|
<i class="fas fa-bell"></i>
|
|
</button>
|
|
|
|
{% if _is_logged_in %}
|
|
<button class="momo-user-chip" type="button">
|
|
<span class="momo-avatar">{{ (_session_username or '已')[:1] }}</span>
|
|
<span class="momo-user-meta">
|
|
<span class="momo-user-name">{{ _session_username or '已登入' }}</span>
|
|
{% if _session_role %}
|
|
<span class="momo-user-role">{{ _session_role }}</span>
|
|
{% endif %}
|
|
</span>
|
|
<i class="fas fa-chevron-down" aria-hidden="true"></i>
|
|
</button>
|
|
{% endif %}
|
|
</header>
|
|
|
|
<main class="momo-content">
|
|
{% block ewooo_content %}{% endblock %}
|
|
</main>
|
|
</section>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
|
|
|
|
const fetchWithCSRF = (url, options = {}) => {
|
|
options.headers = {
|
|
...options.headers,
|
|
'X-CSRFToken': csrfToken
|
|
};
|
|
return fetch(url, options);
|
|
};
|
|
|
|
(function () {
|
|
const shell = document.getElementById('momo-shell');
|
|
const toggle = document.querySelector('[data-momo-sidebar-toggle]');
|
|
const close = document.querySelector('[data-momo-sidebar-close]');
|
|
|
|
if (!shell || !toggle) return;
|
|
|
|
toggle.addEventListener('click', function () {
|
|
shell.classList.toggle('is-sidebar-open');
|
|
});
|
|
|
|
if (close) {
|
|
close.addEventListener('click', function () {
|
|
shell.classList.remove('is-sidebar-open');
|
|
});
|
|
}
|
|
})();
|
|
</script>
|
|
{% block extra_js %}{% endblock %}
|
|
</body>
|
|
</html>
|