|
|
|
@ -1,85 +1,90 @@ |
|
|
|
<nav class="navbar is-primary" role="navigation" aria-label="main navigation"> |
|
|
|
<!-- |
|
|
|
Aquí podría ir un logo con su botón |
|
|
|
--> |
|
|
|
<nav class="navbar is-dark" role="navigation" aria-label="main navigation"> |
|
|
|
<div class="navbar-brand"> |
|
|
|
<a class="navbar-item" href="/">Devesa Park Padel</a> |
|
|
|
|
|
|
|
<a class="navbar-burger" role="button" aria-label="menu" aria-expanded="false"> |
|
|
|
<span aria-hidden="true"></span> |
|
|
|
<span aria-hidden="true"></span> |
|
|
|
<span aria-hidden="true"></span> |
|
|
|
<span aria-hidden="true"></span> |
|
|
|
</a> |
|
|
|
<div class="navbar-burger" role="button" data-target="navMenu"> |
|
|
|
|
|
|
|
<div id="navbarMenuHeroA" class="navbar-menu"> |
|
|
|
<div class="navbar-start"> |
|
|
|
<a class="navbar-item" href="{{ url_for('auth.index') }}" > |
|
|
|
Inicio |
|
|
|
</a> |
|
|
|
<span></span> |
|
|
|
{% if current_user.is_authenticated %} |
|
|
|
<span></span> |
|
|
|
<span></span> |
|
|
|
<span></span> |
|
|
|
{% else %} |
|
|
|
<span></span> |
|
|
|
<span></span> |
|
|
|
{% endif %} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="navbar-end"> |
|
|
|
<div class="navbar-item"> |
|
|
|
<div class="buttons"> |
|
|
|
{% if current_user.is_authenticated %} |
|
|
|
<!-- |
|
|
|
<a href="{{ url_for('paginas.inicio') }}" class="navbar-item"> |
|
|
|
Inicio |
|
|
|
</a> |
|
|
|
<a href="{{ url_for('paginas.acerca') }}" class="navbar-item"> |
|
|
|
Acerca de... |
|
|
|
</a> |
|
|
|
|
|
|
|
<a href="{{ url_for('reservas.misreservas') }}" class="navbar-item"> |
|
|
|
Mis reservas |
|
|
|
</a> |
|
|
|
--> |
|
|
|
<a href="{{ url_for('reservas.eligedia') }}" class="navbar-item"> |
|
|
|
Reservar |
|
|
|
<div class="navbar-menu" id="navMenu"> |
|
|
|
<div class="navbar-end"> |
|
|
|
<a class="navbar-item" href="{{ url_for('auth.index') }}" > |
|
|
|
Inicio |
|
|
|
</a> |
|
|
|
<div class="navbar-item"> |
|
|
|
<!-- <div class="buttons">--> |
|
|
|
{% if current_user.is_authenticated %} |
|
|
|
<!-- |
|
|
|
<a href="{{ url_for('paginas.inicio') }}" class="navbar-item"> |
|
|
|
Inicio |
|
|
|
</a> |
|
|
|
<a href="{{ url_for('paginas.acerca') }}" class="navbar-item"> |
|
|
|
Acerca de... |
|
|
|
</a> |
|
|
|
|
|
|
|
<div class="navbar-item has-dropdown is-hoverable"> |
|
|
|
<a class="navbar-link"> |
|
|
|
{{ current_user.name }} |
|
|
|
<a href="{{ url_for('reservas.misreservas') }}" class="navbar-item"> |
|
|
|
Mis reservas |
|
|
|
</a> |
|
|
|
--> |
|
|
|
<a href="{{ url_for('reservas.eligedia') }}" class="navbar-item"> |
|
|
|
Reservar |
|
|
|
</a> |
|
|
|
|
|
|
|
<div class="navbar-dropdown"> |
|
|
|
<a href="{{ url_for('auth.logout') }}" class="navbar-item">Salir</a> |
|
|
|
</div> |
|
|
|
<div class="navbar-item has-dropdown is-hoverable"> |
|
|
|
<a class="navbar-link"> |
|
|
|
{{ current_user.name }} |
|
|
|
</a> |
|
|
|
|
|
|
|
</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 class="navbar-dropdown"> |
|
|
|
<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> |
|
|
|
</div> |
|
|
|
</nav> |
|
|
|
<script> |
|
|
|
document.addEventListener('DOMContentLoaded', () => { |
|
|
|
|
|
|
|
// Get all "navbar-burger" elements |
|
|
|
const $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( el => { |
|
|
|
el.addEventListener('click', () => { |
|
|
|
|
|
|
|
// Get the target from the "data-target" attribute |
|
|
|
const target = el.dataset.target; |
|
|
|
const $target = document.getElementById(target); |
|
|
|
|
|
|
|
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu" |
|
|
|
el.classList.toggle('is-active'); |
|
|
|
$target.classList.toggle('is-active'); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
<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> |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
</script> |
|
|
|
|
|
|
|
</nav> |