Bintang Fajar Julio
add pwa
a309d98
raw
history blame
No virus
13 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{% block title %}{% endblock title %}</title>
<link
rel="shortcut icon"
href="{{ url_for('static', filename='images/favicon.png') }}"
/>
<script
defer
src="{{ url_for('static', filename='plugins/fontawesome/js/all.min.js') }}"
></script>
<link
id="theme-style"
rel="stylesheet"
href="{{ url_for('static', filename='css/portal.css') }}"
/>
<link
rel="manifest"
href="{{ url_for('static', filename='manifest.json') }}"
/>
{% block style %} {% endblock style %}
</head>
<body class="app">
<div class="overlay d-none"></div>
<div class="spinner d-none"></div>
<header class="app-header fixed-top">
<div class="app-header-inner">
<div class="container-fluid py-2">
<div class="app-header-content">
<div class="row justify-content-between align-items-center">
<div class="col-auto">
<a
id="sidepanel-toggler"
class="sidepanel-toggler d-inline-block d-xl-none"
href="#"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="30"
height="30"
viewBox="0 0 30 30"
role="img"
>
<title>Menu</title>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-miterlimit="10"
stroke-width="2"
d="M4 7h22M4 15h22M4 23h22"
></path>
</svg>
</a>
</div>
<div class="app-utilities col-auto mt-2">
<div class="app-utility-item app-user-dropdown dropdown">
<a
class="dropdown-toggle text-unmuted small"
id="user-dropdown-toggle"
data-bs-toggle="dropdown"
href=""
role="button"
aria-expanded="false"
>
<b>{{ current_user.nama }}</b>
</a>
<ul
class="dropdown-menu"
aria-labelledby="user-dropdown-toggle"
>
<li>
<a
class="dropdown-item"
href="{{ url_for('auth.sign_out') }}"
>Log Out</a
>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="app-sidepanel" class="app-sidepanel">
<div id="sidepanel-drop" class="sidepanel-drop"></div>
<div class="sidepanel-inner d-flex flex-column">
<a href="" id="sidepanel-close" class="sidepanel-close d-xl-none"
>&times;</a
>
<div class="app-branding text-center">
<a class="app-logo" href=""
><img
class="logo-icon"
style="width: 90px"
src="{{ url_for('static', filename='images/logotik.png') }}"
alt="logo"
/></a>
</div>
<div class="text-center mb-3">
<span
class="badge px-2 text-capitalize"
style="background-color: #128c9b"
>{{ current_user.role }}</span
>
</div>
<nav id="app-nav-main" class="app-nav app-nav-main flex-grow-1">
<ul class="app-menu list-unstyled accordion" id="menu-accordion">
<li class="nav-item d-none" id="menu-lecturer">
<a
class="nav-link"
id="lecturer"
href="{{ url_for('dashboard.lecturer') }}"
>
<span class="nav-icon">
<svg
width="1em"
height="1em"
viewBox="0 0 16 16"
class="bi bi-file-person"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M12 1H4a1 1 0 0 0-1 1v10.755S4 11 8 11s5 1.755 5 1.755V2a1 1 0 0 0-1-1zM4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4z"
/>
<path
fill-rule="evenodd"
d="M8 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"
/>
</svg>
</span>
<span class="nav-link-text">Dosen</span>
</a>
</li>
<li class="nav-item d-none" id="menu-user">
<a
class="nav-link"
id="user"
href="{{ url_for('dashboard.user') }}"
>
<span class="nav-icon">
<svg
width="1em"
height="1em"
viewBox="0 0 16 16"
class="bi bi-card-list"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M14.5 3h-13a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13z"
/>
<path
fill-rule="evenodd"
d="M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8zm0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5z"
/>
<circle cx="3.5" cy="5.5" r=".5" />
<circle cx="3.5" cy="8" r=".5" />
<circle cx="3.5" cy="10.5" r=".5" />
</svg>
</span>
<span class="nav-link-text">Pengguna</span>
</a>
</li>
<li class="nav-item d-none" id="menu-classifier">
<a
class="nav-link"
id="classifier"
href="{{ url_for('dashboard.classifier') }}"
>
<span class="nav-icon">
<svg
width="1em"
height="1em"
viewBox="0 0 16 16"
class="bi bi-files"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M4 2h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm0 1a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H4z"
></path>
<path
d="M6 0h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1H4a2 2 0 0 1 2-2z"
></path>
</svg>
</span>
<span class="nav-link-text">Klasifikasi</span>
</a>
</li>
<li class="nav-item d-none" id="menu-history">
<a
class="nav-link"
id="history"
href="{{ url_for('dashboard.history', id=current_user.id) }}"
>
<span class="nav-icon">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-clock-history"
viewBox="0 0 16 16"
>
<path
d="M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022zm2.004.45a7 7 0 0 0-.985-.299l.219-.976q.576.129 1.126.342zm1.37.71a7 7 0 0 0-.439-.27l.493-.87a8 8 0 0 1 .979.654l-.615.789a7 7 0 0 0-.418-.302zm1.834 1.79a7 7 0 0 0-.653-.796l.724-.69q.406.429.747.91zm.744 1.352a7 7 0 0 0-.214-.468l.893-.45a8 8 0 0 1 .45 1.088l-.95.313a7 7 0 0 0-.179-.483m.53 2.507a7 7 0 0 0-.1-1.025l.985-.17q.1.58.116 1.17zm-.131 1.538q.05-.254.081-.51l.993.123a8 8 0 0 1-.23 1.155l-.964-.267q.069-.247.12-.501m-.952 2.379q.276-.436.486-.908l.914.405q-.24.54-.555 1.038zm-.964 1.205q.183-.183.35-.378l.758.653a8 8 0 0 1-.401.432z"
/>
<path
d="M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0z"
/>
<path
d="M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5"
/>
</svg>
</span>
<span class="nav-link-text">Riwayat</span>
</a>
</li>
<li class="nav-item d-none" id="menu-file">
<a
class="nav-link"
id="file"
href="{{ url_for('dashboard.file') }}"
>
<span class="nav-icon"
><svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-file-earmark"
viewBox="0 0 16 16"
>
<path
d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z"
/>
</svg>
</span>
<span class="nav-link-text">Berkas</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</header>
<div class="app-wrapper">
<div class="app-content pt-3 p-md-3 p-lg-4">
<div class="container-xl">
{% block content %}{% endblock content %}
</div>
</div>
</div>
{% block modal %}{% endblock modal %}
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="{{ url_for('static', filename='plugins/popper.min.js') }}"></script>
<script src="{{ url_for('static', filename='plugins/bootstrap/js/bootstrap.min.js') }}"></script>
<script>
var menu;
if ("{{ current_user.role }}" === "admin") {
menu = ["lecturer", "user"];
} else if ("{{ current_user.role }}" === "pengguna") {
menu = ["classifier", "history", "file"];
}
$.each(menu, function (index, value) {
$(`#menu-${value}`).removeClass("d-none");
});
$("#{{ page }}").addClass("active");
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, (title, message) in messages %}
Swal.fire({
title: '{{ title }}',
text: '{{ message }}',
icon: '{{ category }}',
confirmButtonText: 'Baik, saya mengerti',
customClass: {
confirmButton: 'swt-alert-btn'
}
})
{% endfor %}
{% endif %}
{% endwith %}
function alertMessage(title, message, category){
Swal.fire({
title: title,
text: message,
icon: category,
confirmButtonText: 'Baik, saya mengerti',
customClass: {
confirmButton: 'swt-alert-btn'
}
})
}
</script>
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register("{{ url_for('static', filename='service-worker.js') }}")
.then((registration) => {
console.log(
"Service Worker registered with scope:",
registration.scope
);
})
.catch((error) => {
console.error("Service Worker registration failed:", error);
});
}
</script>
{% block script %}{% endblock script %}
</body>
</html>