Update templates/admin/custom_master.html
Browse files
templates/admin/custom_master.html
CHANGED
|
@@ -1,101 +1,95 @@
|
|
| 1 |
-
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
<!--
|
| 6 |
-
<
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
<
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
<
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
<div class="card-body">
|
| 36 |
-
<div class="stat-icon" style="background-color: #8A5E2A;">
|
| 37 |
-
<i class="fas fa-calendar-day"></i>
|
| 38 |
-
</div>
|
| 39 |
-
<div>
|
| 40 |
-
<h3 class="stat-value">{{ stats.today_sales }}</h3>
|
| 41 |
-
<p class="stat-label mb-0">Transaksi Hari Ini</p>
|
| 42 |
-
</div>
|
| 43 |
-
</div>
|
| 44 |
-
</div>
|
| 45 |
-
</div>
|
| 46 |
-
</div>
|
| 47 |
|
| 48 |
-
<!--
|
| 49 |
-
<
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
<div
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
<canvas id="salesChart"></canvas>
|
| 57 |
</div>
|
| 58 |
</div>
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
</div>
|
| 61 |
|
| 62 |
-
<!-- Memuat
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
<script>
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
type: 'line',
|
| 73 |
-
data: {
|
| 74 |
-
labels: labels,
|
| 75 |
-
datasets: [{
|
| 76 |
-
label: 'Total Penjualan (Rp)',
|
| 77 |
-
data: data,
|
| 78 |
-
fill: true,
|
| 79 |
-
backgroundColor: 'rgba(46, 87, 43, 0.1)',
|
| 80 |
-
borderColor: '#2E572B',
|
| 81 |
-
tension: 0.3
|
| 82 |
-
}]
|
| 83 |
-
},
|
| 84 |
-
options: {
|
| 85 |
-
responsive: true,
|
| 86 |
-
maintainAspectRatio: false,
|
| 87 |
-
scales: {
|
| 88 |
-
y: {
|
| 89 |
-
beginAtZero: true
|
| 90 |
-
}
|
| 91 |
-
},
|
| 92 |
-
plugins: {
|
| 93 |
-
legend: {
|
| 94 |
-
display: false
|
| 95 |
-
}
|
| 96 |
-
}
|
| 97 |
-
}
|
| 98 |
-
});
|
| 99 |
-
});
|
| 100 |
-
</script>
|
| 101 |
-
{% endblock body %}
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<title>{{ get_setting('cafe_name', 'Bit & Bean') }} - {{ admin_view.name or 'Admin' }}</title>
|
| 5 |
+
<meta charset="utf-8">
|
| 6 |
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
| 7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 8 |
+
|
| 9 |
+
{% block head_css %}
|
| 10 |
+
<!-- Memuat CSS Bootstrap & Font Awesome bawaan Flask-Admin -->
|
| 11 |
+
<link href="{{ url_for('admin.static', filename='bootstrap/bootstrap4/css/bootstrap.min.css') }}" rel="stylesheet">
|
| 12 |
+
<!-- Font Awesome untuk ikon-ikon baru yang lebih modern -->
|
| 13 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 14 |
+
<!-- Memuat Font Google (Poppins) -->
|
| 15 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 16 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 17 |
+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 18 |
+
<!-- Memuat CSS kustom kita untuk desain ulang panel admin -->
|
| 19 |
+
<link rel="stylesheet" href="{{ url_for('static', filename='css/admin_restyle.css') }}">
|
| 20 |
+
{% endblock %}
|
| 21 |
+
</head>
|
| 22 |
+
<body>
|
| 23 |
|
| 24 |
+
<div class="d-flex admin-layout">
|
| 25 |
+
<!-- Sidebar Navigasi -->
|
| 26 |
+
<nav class="sidebar">
|
| 27 |
+
<a href="{{ url_for('admin.index') }}" class="sidebar-brand">
|
| 28 |
+
<img src="{{ get_setting('logo_url', url_for('static', filename='img/logo.png')) }}" alt="Logo">
|
| 29 |
+
<span>{{ get_setting('cafe_name', 'Bit & Bean') }}</span>
|
| 30 |
+
</a>
|
| 31 |
+
<ul class="nav flex-column">
|
| 32 |
+
<!-- Iterasi menu dan kategori secara dinamis -->
|
| 33 |
+
{% for item in admin_view.admin.menu() %}
|
| 34 |
+
{% if item.is_category() %}
|
| 35 |
+
<li class="nav-category">{{ item.name }}</li>
|
| 36 |
+
{% for child in item.get_children() %}
|
| 37 |
+
<li class="nav-item {{ 'active' if child.is_active(admin_view) else '' }}">
|
| 38 |
+
<a class="nav-link" href="{{ child.get_url() }}">
|
| 39 |
+
<i class="menu-icon {{ menu_icons.get(child.name, 'fa-solid fa-circle-question') }}"></i>
|
| 40 |
+
{{ child.name }}
|
| 41 |
+
</a>
|
| 42 |
+
</li>
|
| 43 |
+
{% endfor %}
|
| 44 |
+
{% else %}
|
| 45 |
+
<li class="nav-item {{ 'active' if item.is_active(admin_view) else '' }}">
|
| 46 |
+
<a class="nav-link" href="{{ item.get_url() }}">
|
| 47 |
+
<i class="menu-icon {{ menu_icons.get(item.name, 'fa-solid fa-circle-question') }}"></i>
|
| 48 |
+
{{ item.name }}
|
| 49 |
+
</a>
|
| 50 |
+
</li>
|
| 51 |
+
{% endif %}
|
| 52 |
+
{% endfor %}
|
| 53 |
+
</ul>
|
| 54 |
+
</nav>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
+
<!-- Konten Utama -->
|
| 57 |
+
<main class="content-wrapper">
|
| 58 |
+
<div class="d-flex justify-content-between align-items-center mb-4">
|
| 59 |
+
<h1 class="h3 mb-0 font-weight-bold">{{ admin_view.name }}</h1>
|
| 60 |
+
<div>
|
| 61 |
+
<a href="/" target="_blank" class="btn btn-outline-secondary btn-sm">
|
| 62 |
+
<i class="fas fa-external-link-alt mr-1"></i> Lihat Situs
|
| 63 |
+
</a>
|
|
|
|
| 64 |
</div>
|
| 65 |
</div>
|
| 66 |
+
|
| 67 |
+
<!-- Area untuk menampilkan pesan flash (misal: "Produk berhasil disimpan") -->
|
| 68 |
+
{% with messages = get_flashed_messages(with_categories=True) %}
|
| 69 |
+
{% if messages %}
|
| 70 |
+
{% for category, message in messages %}
|
| 71 |
+
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
|
| 72 |
+
{{ message }}
|
| 73 |
+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
| 74 |
+
<span aria-hidden="true">×</span>
|
| 75 |
+
</button>
|
| 76 |
+
</div>
|
| 77 |
+
{% endfor %}
|
| 78 |
+
{% endif %}
|
| 79 |
+
{% endwith %}
|
| 80 |
+
|
| 81 |
+
<!-- Ini adalah "slot" utama di mana konten dari halaman lain (seperti dashboard.html) akan disisipkan -->
|
| 82 |
+
{% block body %}{% endblock %}
|
| 83 |
+
</main>
|
| 84 |
</div>
|
| 85 |
|
| 86 |
+
<!-- Memuat file-file JavaScript yang diperlukan -->
|
| 87 |
+
{% block tail %}
|
| 88 |
+
<script src="{{ url_for('admin.static', filename='vendor/jquery.min.js') }}"></script>
|
| 89 |
+
<script src="{{ url_for('admin.static', filename='bootstrap/bootstrap4/js/bootstrap.bundle.min.js') }}"></script>
|
| 90 |
+
<script src="{{ url_for('admin.static', filename='vendor/moment.min.js') }}"></script>
|
| 91 |
+
<script src="{{ url_for('admin.static', filename='vendor/select2/select2.min.js') }}"></script>
|
| 92 |
+
{% endblock %}
|
| 93 |
|
| 94 |
+
</body>
|
| 95 |
+
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|