|
|
@ -1,78 +0,0 @@ |
|
|
<nav class="navbar is-dark" role="navigation" aria-label="main navigation"> |
|
|
|
|
|
<div class="navbar-brand"> |
|
|
|
|
|
<img src="{{ url_for('static', filename='bruce.jpeg') }}" class="image is-48x48"/> |
|
|
|
|
|
<a class="navbar-item" href="/">Libros</a> |
|
|
|
|
|
<div class="navbar-burger" role="button" data-target="navMenu"> |
|
|
|
|
|
|
|
|
|
|
|
<span></span> |
|
|
|
|
|
{% if current_user.is_authenticated %} |
|
|
|
|
|
<span></span> |
|
|
|
|
|
<span></span> |
|
|
|
|
|
{% else %} |
|
|
|
|
|
<span></span> |
|
|
|
|
|
<span></span> |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="navbar-menu" id="navMenu"> |
|
|
|
|
|
<div class="navbar-end"> |
|
|
|
|
|
<a class="navbar-item" href="{{ url_for('paginas.index') }}" > |
|
|
|
|
|
Inicio |
|
|
|
|
|
</a> |
|
|
|
|
|
<div class="navbar-item"> |
|
|
|
|
|
<!-- <div class="buttons">--> |
|
|
|
|
|
{% if current_user.is_authenticated %} |
|
|
|
|
|
<a class="navbar-item" href="{{ url_for('paginas.add_libro') }}">Añadir libro</a> |
|
|
|
|
|
<a class="navbar-item" href="{{ url_for('paginas.add_autor') }}">Añadir autor</a> |
|
|
|
|
|
|
|
|
|
|
|
<div class="navbar-item has-dropdown is-hoverable"> |
|
|
|
|
|
<a class="navbar-link"> |
|
|
|
|
|
{{ current_user.username }} |
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
<div class="navbar-dropdown"> |
|
|
|
|
|
<a href="{{ url_for('paginas.index') }}" class="navbar-item">Perfil</a> |
|
|
|
|
|
|
|
|
|
|
|
<a href="{{ url_for('auth.logout') }}" class="navbar-item">Salir</a> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
{% else %} |
|
|
|
|
|
<a href="{{ url_for('auth.login') }}" class="button is-primary">Entrar</a> |
|
|
|
|
|
<a href="{{ url_for('auth.signup') }}" class="button is-light">Registrarse</a> |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
<!--</div>--> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function () { |
|
|
|
|
|
|
|
|
|
|
|
// Get all "navbar-burger" elements |
|
|
|
|
|
var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); |
|
|
|
|
|
|
|
|
|
|
|
// Check if there are any navbar burgers |
|
|
|
|
|
if ($navbarBurgers.length > 0) { |
|
|
|
|
|
|
|
|
|
|
|
// Add a click event on each of them |
|
|
|
|
|
$navbarBurgers.forEach(function ($el) { |
|
|
|
|
|
$el.addEventListener('click', function () { |
|
|
|
|
|
|
|
|
|
|
|
// Get the target from the "data-target" attribute |
|
|
|
|
|
var target = $el.dataset.target; |
|
|
|
|
|
var $target = document.getElementById(target); |
|
|
|
|
|
|
|
|
|
|
|
// Toggle the class on both the "navbar-burger" and the "navbar-menu" |
|
|
|
|
|
$el.classList.toggle('is-active'); |
|
|
|
|
|
$target.classList.toggle('is-active'); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
</nav> |
|
|
|