Update templates/admin/custom_master.html
Browse files
templates/admin/custom_master.html
CHANGED
|
@@ -6,57 +6,50 @@
|
|
| 6 |
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 8 |
|
| 9 |
-
<!-- Memuat Bootstrap CSS dari Flask-Admin -->
|
| 10 |
{% block head_css %}
|
| 11 |
<link href="{{ url_for('admin.static', filename='bootstrap/bootstrap4/css/bootstrap.min.css') }}" rel="stylesheet">
|
| 12 |
<link href="{{ url_for('admin.static', filename='fa/css/font-awesome.min.css') }}" rel="stylesheet">
|
| 13 |
<link href="{{ url_for('admin.static', filename='css/main.css') }}" rel="stylesheet">
|
| 14 |
-
<!-- Font Awesome untuk ikon yang lebih modern -->
|
| 15 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 16 |
-
<!-- Font Poppins -->
|
| 17 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 18 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 19 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
| 20 |
-
<!-- CSS Desain Ulang Kustom kita -->
|
| 21 |
<link rel="stylesheet" href="{{ url_for('static', filename='css/admin_restyle.css') }}">
|
| 22 |
{% endblock %}
|
| 23 |
</head>
|
| 24 |
<body>
|
| 25 |
|
| 26 |
<div class="d-flex admin-layout">
|
| 27 |
-
<!-- Sidebar Navigasi -->
|
| 28 |
<nav class="sidebar">
|
| 29 |
<a href="{{ admin_view.get_url('.index') }}" class="sidebar-brand">
|
| 30 |
<img src="{{ get_setting('logo_url', url_for('static', filename='img/logo.png')) }}" alt="Logo">
|
| 31 |
<span>{{ get_setting('cafe_name', 'Bit & Bean') }}</span>
|
| 32 |
</a>
|
| 33 |
<ul class="nav flex-column">
|
| 34 |
-
<!--
|
| 35 |
-
{% for item in admin_view.menu %}
|
| 36 |
-
|
| 37 |
-
<
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
</
|
| 53 |
-
|
| 54 |
-
{% endfor %}
|
| 55 |
{% endfor %}
|
| 56 |
</ul>
|
| 57 |
</nav>
|
| 58 |
|
| 59 |
-
<!-- Konten Utama -->
|
| 60 |
<main class="content-wrapper">
|
| 61 |
<div class="d-flex justify-content-between align-items-center mb-4">
|
| 62 |
<h1 class="h3 mb-0 font-weight-bold">{{ admin_view.name }}</h1>
|
|
@@ -67,7 +60,6 @@
|
|
| 67 |
</div>
|
| 68 |
</div>
|
| 69 |
|
| 70 |
-
<!-- Flash Messages -->
|
| 71 |
{% with messages = get_flashed_messages(with_categories=True) %}
|
| 72 |
{% if messages %}
|
| 73 |
{% for category, message in messages %}
|
|
@@ -85,7 +77,6 @@
|
|
| 85 |
</main>
|
| 86 |
</div>
|
| 87 |
|
| 88 |
-
<!-- Memuat Javascript -->
|
| 89 |
{% block tail %}
|
| 90 |
<script src="{{ url_for('admin.static', filename='vendor/jquery.min.js') }}"></script>
|
| 91 |
<script src="{{ url_for('admin.static', filename='bootstrap/bootstrap4/js/bootstrap.bundle.min.js') }}"></script>
|
|
|
|
| 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 |
<link href="{{ url_for('admin.static', filename='bootstrap/bootstrap4/css/bootstrap.min.css') }}" rel="stylesheet">
|
| 11 |
<link href="{{ url_for('admin.static', filename='fa/css/font-awesome.min.css') }}" rel="stylesheet">
|
| 12 |
<link href="{{ url_for('admin.static', filename='css/main.css') }}" rel="stylesheet">
|
|
|
|
| 13 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
|
|
| 14 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 15 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 16 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
|
|
| 17 |
<link rel="stylesheet" href="{{ url_for('static', filename='css/admin_restyle.css') }}">
|
| 18 |
{% endblock %}
|
| 19 |
</head>
|
| 20 |
<body>
|
| 21 |
|
| 22 |
<div class="d-flex admin-layout">
|
|
|
|
| 23 |
<nav class="sidebar">
|
| 24 |
<a href="{{ admin_view.get_url('.index') }}" class="sidebar-brand">
|
| 25 |
<img src="{{ get_setting('logo_url', url_for('static', filename='img/logo.png')) }}" alt="Logo">
|
| 26 |
<span>{{ get_setting('cafe_name', 'Bit & Bean') }}</span>
|
| 27 |
</a>
|
| 28 |
<ul class="nav flex-column">
|
| 29 |
+
<!-- CARA YANG BENAR UNTUK ITERASI MENU -->
|
| 30 |
+
{% for item in admin_view.admin.menu() %}
|
| 31 |
+
{% if item.is_category() %}
|
| 32 |
+
<li class="nav-category">{{ item.name }}</li>
|
| 33 |
+
{% for child in item.get_children() %}
|
| 34 |
+
<li class="nav-item {{ 'active' if child.is_active(admin_view) else '' }}">
|
| 35 |
+
<a class="nav-link" href="{{ child.get_url() }}">
|
| 36 |
+
<i class="menu-icon {{ menu_icons.get(child.name, 'fa-solid fa-circle-question') }}"></i>
|
| 37 |
+
{{ child.name }}
|
| 38 |
+
</a>
|
| 39 |
+
</li>
|
| 40 |
+
{% endfor %}
|
| 41 |
+
{% else %}
|
| 42 |
+
<li class="nav-item {{ 'active' if item.is_active(admin_view) else '' }}">
|
| 43 |
+
<a class="nav-link" href="{{ item.get_url() }}">
|
| 44 |
+
<i class="menu-icon {{ menu_icons.get(item.name, 'fa-solid fa-circle-question') }}"></i>
|
| 45 |
+
{{ item.name }}
|
| 46 |
+
</a>
|
| 47 |
+
</li>
|
| 48 |
+
{% endif %}
|
|
|
|
| 49 |
{% endfor %}
|
| 50 |
</ul>
|
| 51 |
</nav>
|
| 52 |
|
|
|
|
| 53 |
<main class="content-wrapper">
|
| 54 |
<div class="d-flex justify-content-between align-items-center mb-4">
|
| 55 |
<h1 class="h3 mb-0 font-weight-bold">{{ admin_view.name }}</h1>
|
|
|
|
| 60 |
</div>
|
| 61 |
</div>
|
| 62 |
|
|
|
|
| 63 |
{% with messages = get_flashed_messages(with_categories=True) %}
|
| 64 |
{% if messages %}
|
| 65 |
{% for category, message in messages %}
|
|
|
|
| 77 |
</main>
|
| 78 |
</div>
|
| 79 |
|
|
|
|
| 80 |
{% block tail %}
|
| 81 |
<script src="{{ url_for('admin.static', filename='vendor/jquery.min.js') }}"></script>
|
| 82 |
<script src="{{ url_for('admin.static', filename='bootstrap/bootstrap4/js/bootstrap.bundle.min.js') }}"></script>
|