Commit ce14cb77 authored by alexandre's avatar alexandre

Reworked menu

parent 8fd3663a
......@@ -301,8 +301,23 @@ section.hidden { display: none; }
.main-header { width: 300px; }
.main-header.is-collapsed { margin-left: -300px; }
.main-header__content {
display: flex;
flex-direction: column;
min-height: 100%;
box-sizing: border-box;
}
.main-header__menu--primary {
flex-grow: 1;
}
.main-header a { text-decoration: none; }
.main-header a:hover { color: var(--background-color); filter: brightness(200%); }
.main-header__logo {
margin-top: 21px;
margin-bottom: 42px;
}
......@@ -1537,7 +1552,8 @@ ol {
/* #create { margin-top: 1em;} */
.create-form { display: none; }
#create:hover .create-form { display: flex; }
/* #create:hover .create-form { display: flex; } */
.create-form--active { display: flex; }
.create-form input[type="text"],
.create-form input[type="submit"] {
......
......@@ -7,7 +7,8 @@ window.W = window.W || {};
'use strict';
function is_external_link(el) {
return ('external' in el.dataset);
// data-external is used for attachments
return (el.host !== window.location.host) || ('external' in el.dataset);
}
W.ScoreApp = new Marionette.Application({
......
......@@ -2227,10 +2227,18 @@ window.W = window.W || {};
triggers: {
'click a': 'toggleForm',
'submit .create-form': 'create'
},
onToggleForm: function (event) {
this.$el.find('.create-form').toggleClass("create-form--active");
// this.$el.find('.create-form').focus();
},
onCreate: function (event) {
this.$el.find('.create-form').removeClass("create-form--active");
var title = this.$el.find('[name="title"]').val();
var myModel = new W.ScoreModel();
myModel.save({
......
<a href="#"><%- t('Créer une nouvelle partition') %></a>
<a href="#"><%- t('Créer une partition') %></a>
<form class="create-form" action="" method="post">
<input type="text" name="title" placeholder="<%- t('Titre') %>" required>
......
<div class="panel__toggle js-toggle">menu</div>
<div class="content">
<div class="main-header__content content">
<div class="main-header__logo logo">
<h1 class="logo__name"><a href="/" class="logo_link">Organon</a></h1>
<p class="logo__tagline"><%- t('Un logiciel pour noter l’action performée') %></p>
</div>
<nav class="main-header__menu main-header__menu--primary">
<ul>
<li><a href="/la-notation-w/"><%- t('La notation W') %></a></li>
<li><a href="/partitions/"><%- t('Repertoire de partitions') %></a></li>
<li id="create"></li>
</ul>
</nav>
<nav class="main-header__user">
<% if (username) { %>
<%- t('Bienvenue') %> <a href="/compte"><%- username %></a>
......@@ -15,19 +28,15 @@
</ul>
</nav>
<div class="main-header__logo logo">
<h1 class="logo__name"><a href="/" class="logo_link">Organon</a></h1>
<p class="logo__tagline"><%- t('Un logiciel pour noter l’action performée.') %></p>
</div>
<nav class="main-header__menu">
<nav class="main-header__menu main-header__menu--secondary">
<ul>
<li><a href="/la-notation-w/"><%- t('La notation W') %></a></li>
<li><a href="/partitions/"><%- t('Repertoire de partitions') %></a></li>
<li id="create"></li>
<li><a href="#" class="js-lang" data-lang="en">en</a> <a href="#" class="js-lang" data-lang="fr">fr</a></li>
<% if (W.config.lang === "fr") { %>
<li><a href="#" class="js-lang" data-lang="en">English</a></li>
<% } else { %>
<li><a href="#" class="js-lang" data-lang="fr">Français</a></li>
<% } %>
<li><a href="#"><%- t('Crédits') %></a></li>
<li><a href="#"><%- t('Site W') %></a></li>
<li><a href="http://1110111.org"><%- t('Site W') %></a></li>
</ul>
</nav>
</div>
<!-- Title -->
<label>
<span class="label-text"><%- t('Titre') %>:</span>
<input type="text" name="title" value="<%- title %>">
<input type="text" name="title" value="<%- title %>" required>
</label>
<!-- description -->
......
......@@ -121,4 +121,4 @@
<form></form>
</section>
</aside>
\ No newline at end of file
</aside>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment