frontend: use a menu to group scenarii

This commit is contained in:
nemunaire 2018-11-25 01:19:34 +01:00
parent a5dbde7fb5
commit 168e7cd636
8 changed files with 43 additions and 35 deletions

View file

@ -73,7 +73,7 @@ const indextpl = `<!DOCTYPE html>
<div class="container" ng-view></div>
<script src="/js/jquery.min.js"></script>
<script src="/js/popper.min.js"></script>
<script src="{{.urlbase}}js/popper.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/angular.min.js"></script>
<script src="{{.urlbase}}js/angular-resource.min.js"></script>

View file

@ -71,7 +71,7 @@
<div class="container" ng-view></div>
<script src="/js/jquery.min.js"></script>
<script src="/js/popper.min.js"></script>
<script src="/admin/js/popper.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/angular.min.js"></script>
<script src="/admin/js/angular-resource.min.js"></script>

View file

@ -1 +0,0 @@
../../../frontend/static/js/popper.min.js

5
admin/static/js/popper.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -393,7 +393,6 @@
</div>
<script src="/js/jquery.min.js"></script>
<script src="/js/popper.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/angular-animate.min.js"></script>
<script src="/js/angular-route.min.js"></script>

View file

@ -1 +0,0 @@
../../../frontend/static/js/popper.min.js

View file

@ -70,18 +70,37 @@
<div ng-controller="DataController">
<nav class="navbar navbar-expand-lg bg-primary niceborder" ng-cloak>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#themesMenu" aria-controls="themesMenu" aria-expanded="false" aria-label="Toggle navigation">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#themesMenu" aria-controls="navMenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="themesMenu">
<div class="collapse navbar-collapse" id="navMenu">
<ul class="navbar-nav mr-auto">
<li ng-repeat="(k,theme) in themes" ng-class="{active: k == current_theme}" class="nav-item"><a class="nav-link" ng-href="/{{ theme.urlid }}" data-toggle="tab">{{ theme.name }} <span class="badge badge-light"><span class="glyphicon glyphicon-fire" aria-hidden="true" ng-if="max_solved > 1 && theme.solved == max_solved" alt="Déjà {{ theme.solved }} challenges résolus dans ce thème"></span> <span class="glyphicon glyphicon-gift" aria-hidden="true" ng-if="theme.exercice_coeff_max > 1" alt="Des bonus existent pour au moins un challenge de ce thème"></span> <span ng-if="(my.team_id)">{{ theme.exercice_solved }}/</span>{{ theme.exercice_count }}</span></a></li>
<li class="nav-item">
<a class="nav-link" href="/">Accueil</a>
</li>
<li class="nav-item dropdown" ng-class="{active: current_theme}">
<a class="nav-link dropdown-toogle" href="#" id="themesMenu" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Scénarii
</a>
<div class="dropdown-menu">
<a ng-repeat="(k,theme) in themes" ng-class="{active: k == current_theme}" class="dropdown-item" ng-href="/{{ theme.urlid }}">{{ theme.name }} <span class="badge badge-light"><span class="glyphicon glyphicon-fire" aria-hidden="true" ng-if="max_solved > 1 && theme.solved == max_solved" alt="Déjà {{ theme.solved }} challenges résolus dans ce thème"></span> <span class="glyphicon glyphicon-gift" aria-hidden="true" ng-if="theme.exercice_coeff_max > 1" alt="Des bonus existent pour au moins un challenge de ce thème"></span> <span ng-if="(my.team_id)">{{ theme.exercice_solved }}/</span>{{ theme.exercice_count }}</span></a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="/rank">Classement</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/rules">Aide</a>
</li>
</ul>
</div>
<span class="navbar-text text-light" ng-show="(my.team_id)" ng-cloak>
<a tabindex="0" href="#" class="badge" role="button" style="background-color: {{ teams[my.team_id].color }}; color: {{ teams[my.team_id].color }};" data-toggle="popover" data-trigger="focus" data-template="<div class='popover' role='tooltip'><div class='arrow'></div><h3 class='popover-header bg-light text-dark'></h3><div class='popover-body bg-secondary text-dark'></div></div>" title="{{ my.name }}<a class='badge badge-info float-right' href='/edit'>Édit.</a>" data-html="true" data-content="{{ teams[my.team_id].rank }}<sup>e</sup> sur {{ teams_count }} &ndash; {{ my.score }} points<br><div class='btn-group'><a class='btn btn-sm btn-primary' href='/rules'>Règles</a><a class='btn btn-sm btn-primary' href='/rank'>Classement</a></div>">
<span class="teamname">{{ my.name }}</span>
</a>
{{ my.score }} points <span ng-show="teams[my.team_id].rank">&ndash; {{ teams[my.team_id].rank }}<sup>e</sup> sur {{ teams_count }}</span>
<h4 style="display: inline">
<a tabindex="0" href="/edit" class="badge" role="button" style="background-color: {{ teams[my.team_id].color }}; color: {{ teams[my.team_id].color }};">
<span class="teamname">{{ my.name }}</span>
</a>
</h4>
</span>
<span class="navbar-text text-light" ng-show="!my.team_id && time.remaining === undefined" ng-cloak>
<a ng-href="/register" class="badge badge-warning" role="button">
@ -90,27 +109,21 @@
</span>
</nav>
<div class="container" style="margin-top: 5px;">
<div class="page-header text-primary" ng-cloak>
<h1 ng-if="(current_theme)">{{ themes[current_theme].name }} <small class="authors" ng-if="themes[current_theme].authors" ng-bind-html="themes[current_theme].authors"></small></h1>
<h1 ng-if="(!current_theme && title)" ng-cloak>{{ title }} <small class="authors" ng-if="authors">{{ authors }}</small></h1>
<h1 ng-if="(!current_theme && !title)">{{ settings.title }} <small class="authors">{{ settings.authors }}</small></h1>
</div>
<div style="clear: both"></div>
<div ng-view>
<noscript>
<div class="alert alert-danger">
<strong>Veuillez activer le JavaScript.</strong> Ce site requiert un navigateur interprêtant le JavaScript pour fonctionner. Veuillez l'activer ou en télécharger un supportant cette technologie.
</div>
</noscript>
</div>
<div class="container page-header text-primary" ng-cloak>
<h1 ng-if="(current_theme)">{{ themes[current_theme].name }} <small class="authors" ng-if="themes[current_theme].authors" ng-bind-html="themes[current_theme].authors"></small></h1>
<h1 ng-if="(!current_theme && title)" ng-cloak>{{ title }} <small class="authors" ng-if="authors">{{ authors }}</small></h1>
<h1 ng-if="(!current_theme && !title)">{{ settings.title }} <small class="authors">{{ settings.authors }}</small></h1>
</div>
<div class="container" ng-view>
<noscript>
<div class="alert alert-danger">
<strong>Veuillez activer le JavaScript.</strong> Ce site requiert un navigateur interprêtant le JavaScript pour fonctionner. Veuillez l'activer ou en télécharger un supportant cette technologie.
</div>
</noscript>
</div>
<script src="/js/jquery.min.js"></script>
<script src="/js/popper.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/angular-route.min.js"></script>
<script src="/js/angular-sanitize.min.js"></script>

View file

@ -43,8 +43,6 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
$rootScope.current_exercice = 0;
$rootScope.time = {};
$('[data-toggle="popover"]').popover();
$rootScope.recvTime = function(response) {
sessionStorage.userService = angular.toJson({
"cu": Math.floor(response.headers("x-fic-time") * 1000),

File diff suppressed because one or more lines are too long