MusicTopus/views/index.ejs

181 lines
7.4 KiB
Text
Raw Normal View History

2022-02-15 11:03:20 +01:00
<!doctype html>
<html lang="fr">
2022-02-15 16:45:14 +01:00
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><% if (page.title) { %><%= page.title %> <% } else { %> DarKou - My Music Library <% } %></title>
2022-02-16 15:42:02 +01:00
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
2022-02-15 11:03:20 +01:00
2022-02-15 16:45:14 +01:00
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
rel="stylesheet"
/>
<link href="/css/main.css" rel="stylesheet" />
<script src="/libs/axios/axios.min.js"></script>
<script src="/libs/vue/vue.global.prod.js"></script>
<script>
function showToastr(message) {
var x = document.getElementById("toastr");
if ( message ) {
x.getElementsByTagName("SPAN")[0].innerHTML = message;
}
x.className = `${x.className} show`;
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
};
document.addEventListener('DOMContentLoaded', () => {
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
if ($navbarBurgers.length > 0) {
$navbarBurgers.forEach( el => {
el.addEventListener('click', () => {
const target = el.dataset.target;
const $target = document.getElementById(target);
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
}
});
</script>
</head>
2022-02-18 08:14:34 +01:00
<body>
<nav class="navbar" role="navigation" aria-label="main navigation">
2022-02-15 16:45:14 +01:00
<div class="navbar-brand">
<a class="navbar-item" href="/">
<img src="/logo.png" alt="Logo">
2022-02-18 08:14:34 +01:00
<span>My Music Library</span>
2022-02-15 16:45:14 +01:00
</a>
2022-02-18 08:14:34 +01:00
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbar">
2022-02-15 16:45:14 +01:00
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
2022-02-18 08:14:34 +01:00
<div id="navbar" class="navbar-menu">
2022-02-15 16:45:14 +01:00
<% if ( user ) { %>
<div class="navbar-start">
2022-02-16 15:42:02 +01:00
<div class="navbar-item">
2022-02-18 08:14:34 +01:00
<div class="buttons">
2022-02-16 15:42:02 +01:00
<a class="button is-link" href="/ajouter-un-album">
<span class="icon">
<i class="fa-solid fa-plus"></i>
</span>
<span>
Ajouter un album
</span>
</a>
2022-02-18 08:14:34 +01:00
</div>
2022-02-16 15:42:02 +01:00
</div>
</div>
<% } %>
2022-02-15 16:45:14 +01:00
2022-02-16 15:42:02 +01:00
<div class="navbar-end">
<% if ( user ) { %>
2022-02-18 08:14:34 +01:00
<div class="navbar-item has-dropdown">
2022-02-15 16:45:14 +01:00
<a class="navbar-link">
<span class="icon">
<i class="fa-solid fa-user"></i>
</span>
<span>
<%= user.username %>
</span>
2022-02-15 16:45:14 +01:00
</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="/ma-collection">
Ma collection
</a>
</div>
</div>
2022-02-16 15:42:02 +01:00
<% } %>
2022-02-15 16:45:14 +01:00
<div class="navbar-item">
<div class="buttons">
<% if ( !user ) { %>
<a class="button is-link" href="/connexion">
<strong>Connexion</strong>
</a>
<% } else { %>
<a class="button is-danger" href="/se-deconnecter">
Déconnexion
</a>
<% } %>
</div>
</div>
</div>
</div>
</nav>
2022-02-18 08:14:34 +01:00
<!-- <div id="toastr" class="notification is-danger">
2022-02-15 16:45:14 +01:00
<button class="delete"></button>
<span></span>
2022-02-18 08:14:34 +01:00
</div> -->
2022-02-15 11:03:20 +01:00
2022-02-18 08:14:34 +01:00
<!-- <main class="layout-maxed">
2022-02-15 16:45:14 +01:00
<% if ( page.failureFlash || (error && error.length > 0 ) ) {%>
<div class="columns is-mobile">
<div class="
column
is-10-mobile is-offset-1-mobile
is-8-tablet is-offset-2-tablet
is-6-desktop is-offset-3-desktop
is-4-widescreen is-offset-4-widescreen
">
<% if ( page.failureFlash ) {%>
<article class="message is-danger">
<div class="message-header">
<p>Erreur</p>
</div>
<div class="message-body">
<%= page.failureFlash %>
</div>
</article>
<% } %>
<%
if (error && error.length > 0) {
for( let i = 0 ; i < error.length ; i += 1 ) {
%>
<article class="message is-danger">
<div class="message-header">
<p>Erreur</p>
<button class="delete" aria-label="delete"></button>
</div>
<div class="message-body">
<%= error %>
</div>
</article>
<%
}
}
%>
</div>
2022-02-15 11:03:20 +01:00
</div>
<% } %>
2022-02-18 08:14:34 +01:00
</main> -->
2022-02-18 09:15:48 +01:00
<%- include(viewname) %>
2022-02-18 08:14:34 +01:00
<footer class="footer layout-hero">
<p>
<strong title="Merci Brunus ! 😜">My Music Library</strong> par <a href="https://www.darkou.fr">Damien Broqua</a>.
Fait avec ❤ à Bordeaux.
Le code source est sous licence <a href="https://www.gnu.org/licenses/gpl-3.0-standalone.html">GNU GPL-3.0-or-later</a>.
</p>
2022-02-16 15:42:02 +01:00
</footer>
2022-02-15 11:03:20 +01:00
</body>
</html>