Affichage de l'année courante et màj dynamique

This commit is contained in:
xdrm-brackets 2015-12-01 19:45:00 +01:00
parent 39e06d22b5
commit f62e14c45a
4 changed files with 29 additions and 3 deletions

View File

@ -73,7 +73,7 @@
#MENU span{ #MENU span[data-link]{
/* position */ /* position */
display: block; display: block;
position: relative; position: relative;
@ -145,3 +145,17 @@
/* affichage de l'année de visualisation (en cours) */
#MENU #CURRENTYEAR{
/* position */
position: absolute;
bottom: 1em;
width: 100%;
/* foreground */
color: #92a6b0;
font-family: 'Ubuntu';
text-align: center;
}

View File

@ -64,6 +64,8 @@ $notifNotifNum = 5;
<span data-link='modules' >Modules </span> <span data-link='modules' >Modules </span>
<span data-link='career' >Notes </span> <span data-link='career' >Notes </span>
<span data-link='settings'>Paramètres </span> <span data-link='settings'>Paramètres </span>
<div id="CURRENTYEAR">Année scolaire en cours<br><span><?php echo anneeScolaire($_SESSION['annee']); ?></span></div>
<?php } ?> <?php } ?>
</nav> </nav>

View File

@ -44,6 +44,7 @@ var DOM = {
DRAGNDROP : document.querySelector('#DRAGNDROP'), DRAGNDROP : document.querySelector('#DRAGNDROP'),
WRAPPER : document.querySelector('#WRAPPER'), WRAPPER : document.querySelector('#WRAPPER'),
MENU : document.querySelector('#MENU'), MENU : document.querySelector('#MENU'),
CURRENTYEAR: document.querySelector('#MENU > #CURRENTYEAR'),
HEADER : document.querySelector('#HEADER'), HEADER : document.querySelector('#HEADER'),
SUBHEADER : document.querySelector('#SUBHEADER'), SUBHEADER : document.querySelector('#SUBHEADER'),
SUBSECTIONS : document.querySelector("#HEADER > nav.subsections"), SUBSECTIONS : document.querySelector("#HEADER > nav.subsections"),
@ -393,5 +394,11 @@ if( DOM.NOTIFBTN != null )
}, false); }, false);
// modification de l'année scolaire en cours
function updateCurrentYear(y){
y = parseInt(y);
var anneeScolaire = y+' - '+(y+1);
DOM.CURRENTYEAR.children[1].innerHTML = anneeScolaire;;
}

View File

@ -317,7 +317,10 @@ if( changeYear.select != null && changeYear.button != null ){
// on envoie la requête à l'API // on envoie la requête à l'API
API.send(request, function(answer){ API.send(request, function(answer){
if( answer.request == 'success' ) reload(); if( answer.request == 'success' ){
reload(); // on recharge la page
updateCurrentYear(request.year);
}
}); });
}, false); }, false);