Improve bootstrap 4 support

This commit is contained in:
nemunaire 2017-12-17 16:07:04 +01:00
parent 6329f44d42
commit e630bc3d75
17 changed files with 181 additions and 139 deletions

View File

@ -474,10 +474,14 @@ angular.module("FICApp")
$scope.event = Event.get({ eventId: $routeParams.eventId });
$scope.fields = ["kind", "txt", "time"];
$scope.kinds = {
"alert-secondary": "Par défaut",
"alert-primary": "Mise en valeur",
"alert-info": "Info",
"alert-warning": "Warning",
"alert-success": "Success",
"alert-danger": "Danger",
"alert-light": "Clair",
"alert-dark": "Foncé",
};
$scope.saveEvent = function() {

View File

@ -1,8 +1,12 @@
<h2>&Eacute;vénements<a ng-click="clearEvents()" class="pull-right btn btn-danger"><span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> Vider la liste</a><a ng-click="show('new')" class="pull-right btn btn-primary" style="margin-right: 10px"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter un événement</a></h2>
<h2>
&Eacute;vénements
<button ng-click="clearEvents()" class="float-right btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> Vider la liste</button>
<button ng-click="show('new')" class="float-right btn btn-sm btn-primary" style="margin-right: 10px"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter un événement</button>
</h2>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<table class="table table-hover table-bordered">
<thead>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>
<th ng-repeat="field in fields">
{{ field }}

View File

@ -1,18 +1,18 @@
<h2>&Eacute;vénement</h2>
<form ng-submit="saveEvent()" class="form-horizontal">
<div class="form-group" ng-repeat="field in fields">
<label for="{{ field }}" class="col-sm-1 control-label">{{ field | capitalize }}</label>
<form ng-submit="saveEvent()">
<div class="form-group row" ng-repeat="field in fields">
<label for="{{ field }}" class="col-sm-1 col-form-label">{{ field | capitalize }}</label>
<div class="col-sm-11">
<input type="text" class="form-control" id="{{ field }}" ng-model="event[field]" ng-show="field != 'kind' && field != 'time'">
<input type="datetime" class="form-control" id="{{ field }}" ng-model="event[field]" ng-show="field == 'time' && event.id">
<select class="form-control" id="{{ field }}" ng-model="event[field]" ng-options="k as v for (k, v) in kinds" ng-show="field == 'kind'">
<select class="custom-select" id="{{ field }}" ng-model="event[field]" ng-options="k as v for (k, v) in kinds" ng-show="field == 'kind'">
</select>
</div>
</div>
<div class="text-right" ng-show="event.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
<a class="btn btn-danger" ng-click="deleteEvent()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</a>
<button class="btn btn-danger" ng-click="deleteEvent()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</button>
</div>
<div class="text-right" ng-show="!event.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter l'événement</button>

View File

@ -1,9 +1,9 @@
<h2>Exercices
<a ng-click="syncFull()" ng-class="{'disabled': inSync}" class="pull-right btn btn-default"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroner</a>
<button ng-click="syncFull()" ng-class="{'disabled': inSync}" class="float-right btn btn-sm btn-secondary"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroniser</button>
<small style="height: 0px;">
<div class="checkbox pull-right"><label><input type="checkbox" ng-model="syncFiles"> Fichiers</label></div>
<div class="checkbox pull-right"><label><input type="checkbox" ng-model="syncHints"> Indices</label></div>
<div class="checkbox pull-right"><label><input type="checkbox" ng-model="syncKeys"> Flags</label></div>
<div class="checkbox float-right"><label><input type="checkbox" ng-model="syncFiles"> Fichiers</label></div>
<div class="checkbox float-right"><label><input type="checkbox" ng-model="syncHints"> Indices</label></div>
<div class="checkbox float-right"><label><input type="checkbox" ng-model="syncKeys"> Flags</label></div>
</small>
</h2>
@ -13,8 +13,8 @@
<div>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<table class="table table-hover table-bordered">
<thead>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>
<th ng-repeat="field in fields">
{{ field }}

View File

@ -1,21 +1,21 @@
<h2>{{exercice.title}}</h2>
<form class="form-horizontal" ng-submit="saveExercice()">
<div class="form-group" ng-repeat="field in fields">
<label for="{{ field }}" class="col-xs-1 control-label">{{ field | capitalize }}</label>
<div class="col-xs-11">
<input type="text" class="form-control" id="{{ field }}" ng-model="exercice[field]" ng-show="field != 'statement' && field != 'overview' && field != 'depend' && field != 'gain' && field != 'coefficient'">
<input type="text" class="form-control" id="{{ field }}" ng-model="exercice[field]" ng-show="field == 'gain'" integer>
<input type="text" class="form-control" id="{{ field }}" ng-model="exercice[field]" ng-show="field == 'coefficient'" float>
<textarea class="form-control" id="{{field}}" ng-model="exercice[field]" ng-show="field == 'statement' || field == 'overview'"></textarea>
<select class="form-control" id="{{field}}" ng-model="exercice[field]" ng-options="ex.id as ex.title for ex in exercices" ng-show="field == 'depend'">
<form ng-submit="saveExercice()">
<div class="form-group row" ng-repeat="field in fields">
<label for="{{ field }}" class="col-sm-1 col-form-label-sm">{{ field | capitalize }}</label>
<div class="col-sm-11">
<input type="text" class="form-control form-control-sm" id="{{ field }}" ng-model="exercice[field]" ng-show="field != 'statement' && field != 'overview' && field != 'depend' && field != 'gain' && field != 'coefficient'">
<input type="text" class="form-control form-control-sm" id="{{ field }}" ng-model="exercice[field]" ng-show="field == 'gain'" integer>
<input type="text" class="form-control form-control-sm" id="{{ field }}" ng-model="exercice[field]" ng-show="field == 'coefficient'" float>
<textarea class="form-control form-control-sm" id="{{field}}" ng-model="exercice[field]" ng-show="field == 'statement' || field == 'overview'"></textarea>
<select class="form-control form-control-sm" id="{{field}}" ng-model="exercice[field]" ng-options="ex.id as ex.title for ex in exercices" ng-show="field == 'depend'">
<option value="">Aucune</option>
</select>
</div>
</div>
<div class="text-right" ng-show="exercice.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
<a class="btn btn-danger" ng-click="deleteExercice()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</a>
<button class="btn btn-danger" ng-click="deleteExercice()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</button>
</div>
<div class="text-right" ng-show="!exercice.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create exercice</button>
@ -27,26 +27,28 @@
<div class="row" ng-show="exercice.id">
<div class="col-md-4" ng-controller="ExerciceHintsController">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Indices<a ng-click="syncHints()" class="pull-right btn btn-xs btn-default" style="margin-left: 7px"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></a><a ng-click="addHint()" class="pull-right btn btn-xs btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></h3>
<div class="card border-info">
<div class="card-header">
<button ng-click="addHint()" class="float-right btn btn-sm btn-primary" style="margin-left: 7px"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
<button ng-click="syncHints()" class="float-right btn btn-sm btn-light"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>
<h4 style="margin:0">Indices</h4>
</div>
<div class="list-group">
<form ng-submit="saveHint()" class="list-group-item form-horizontal" ng-repeat="hint in hints">
<div class="form-group">
<label for="htitle{{hint.id}}" class="col-xs-2 control-label">Titre</label>
<label for="htitle{{hint.id}}" class="col-xs-2 col-form-label">Titre</label>
<div class="col-xs-10">
<input type="text" id="htitle{{hint.id}}" ng-model="hint.title" class="form-control">
</div>
</div>
<div class="form-group">
<label for="hcnt{{hint.id}}" class="col-xs-2 control-label">Contenu</label>
<label for="hcnt{{hint.id}}" class="col-xs-2 col-form-label">Contenu</label>
<div class="col-xs-10">
<textarea class="form-control" id="hcnt{{hint.id}}" ng-model="hint.content"></textarea>
</div>
</div>
<div class="form-group">
<label for="hcost{{hint.id}}" class="col-xs-2 control-label">Coût</label>
<label for="hcost{{hint.id}}" class="col-xs-2 col-form-label">Coût</label>
<div class="col-xs-10">
<input type="text" id="hcost{{hint.id}}" ng-model="hint.cost" class="form-control" integer>
</div>
@ -59,9 +61,11 @@
</div>
<div class="col-md-4" ng-controller="ExerciceFilesController">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Téléchargements<a ng-click="syncFiles()" class="pull-right btn btn-xs btn-default" style="margin-left: 7px"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></a><a ng-click="addFile()" class="pull-right btn btn-xs btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></h3>
<div class="card border-secondary">
<div class="card-header">
<button ng-click="addFile()" class="float-right btn btn-sm btn-primary" style="margin-left: 7px"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
<button ng-click="syncFiles()" class="float-right btn btn-sm btn-light"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>
<h4 style="margin:0">Téléchargements</h4>
</div>
<div class="list-group">
<form ng-submit="saveFile()" class="list-group-item form" ng-repeat="file in files">
@ -77,14 +81,16 @@
</div>
<div class="col-md-4" ng-controller="ExerciceKeysController">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Drapeaux<a ng-click="syncKeys()" class="pull-right btn btn-xs btn-default" style="margin-left: 7px"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></a><a ng-click="addKey()" class="pull-right btn btn-xs btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></h3>
<div class="card border-success">
<div class="card-header">
<button ng-click="addKey()" class="float-right btn btn-sm btn-primary" style="margin-left: 7px"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
<button ng-click="syncKeys()" class="float-right btn btn-sm btn-light"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span></button>
<h4>Drapeaux</h4>
</div>
<div class="list-group">
<form ng-submit="saveKey()" class="list-group-item form-horizontal" ng-repeat="key in keys">
<div class="form-group" id="key-{{key.id}}">
<label for="klabel{{key.id}}" class="col-xs-2 control-label">Intitulé</label>
<label for="klabel{{key.id}}" class="col-xs-2 col-form-label">Intitulé</label>
<div class="col-xs-8">
<input type="text" id="klabel{{key.id}}" ng-model="key.type" class="form-control">
</div>
@ -93,7 +99,7 @@
</div>
</div>
<div class="form-group" ng-show="key.id">
<label for="kvalue{{key.id}}" class="col-xs-2 control-label">Hash</label>
<label for="kvalue{{key.id}}" class="col-xs-2 col-form-label">Hash</label>
<div class="col-xs-8">
<input type="text" id="kvalue{{key.id}}" ng-model="key.value" class="form-control">
</div>
@ -102,7 +108,7 @@
</div>
</div>
<div class="form-group" ng-show="!key.id">
<label for="kvalue{{key.id}}" class="col-xs-2 control-label">Clef brute</label>
<label for="kvalue{{key.id}}" class="col-xs-2 col-form-label">Clef brute</label>
<div class="col-xs-8">
<input type="text" id="kvalue{{key.id}}" ng-model="key.key" class="form-control">
</div>

View File

@ -72,32 +72,42 @@
<div class="col-sm-10">
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" ng-model="config.allowRegistration"> Activer les inscriptions
<label class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" ng-model="config.allowRegistration">
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Activer les inscriptions</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" ng-model="config.denyNameChange"> Interdire les changements de nom d'équipe
<label class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" ng-model="config.denyNameChange">
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Interdire les changements de nom d'équipe</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" ng-model="config.enableResolutionRoute"> Activer la route montrant les solutions
<label class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" ng-model="config.enableResolutionRoute">
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Activer la route montrant les solutions</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" ng-model="config.partialValidation"> Activer la validation partielle des challenges
<label class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" ng-model="config.partialValidation">
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Activer la validation partielle des challenges</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" ng-model="config.enableExerciceDepend"> Activer les dépendances des exercices
<label class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" ng-model="config.enableExerciceDepend">
<span class="custom-control-indicator"></span>
<span class="custom-control-description">Activer les dépendances des exercices</span>
</label>
</div>
@ -113,12 +123,12 @@
</div>
<div class="text-right">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Propager ces paramètres</button>
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Propager ces paramètres</button>
</div>
</form>
</div>
<div class="card-deck">
<div class="card-deck" style="margin-bottom: 35px">
<div class="card">
<button ng-click="reset('challenges')" class="btn btn-secondary" type="button"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Effacer les challenges et les thèmes</button>
</div>

View File

@ -1,37 +1,37 @@
<h1>
{{ team.name }}
<span ng-show="team.name != team.initialName"> ({{ team.initialName}})</span>
<a ng-click="showStats()" class="pull-right btn btn-primary" style="margin-right: 10px" ng-if="team.id">
<button ng-click="showStats()" class="float-right btn btn- btn-primary" style="margin-right: 10px" ng-if="team.id">
<span class="glyphicon glyphicon-list" aria-hidden="true"></span>
Statistiques
</a>
</button>
</h1>
<div class="col-lg-8">
<form ng-submit="saveTeam()" class="form-horizontal">
<div class="form-group" ng-if="team.id">
<label for="idTeam" class="col-sm-2 control-label">Identifiant</label>
<form ng-submit="saveTeam()">
<div class="form-group row" ng-if="team.id">
<label for="idTeam" class="col-sm-2 col-form-label-sm">Identifiant</label>
<div class="col-sm-10">
{{ team.id }}
<input type="text" readonly class="form-control-sm form-control-plaintext text-light" ng-model="team.id">
</div>
</div>
<div class="form-group" ng-if="team.id">
<label for="initialName" class="col-sm-2 control-label">Nom initial</label>
<div class="form-group row" ng-if="team.id">
<label for="initialName" class="col-sm-2 col-form-label-sm">Nom initial</label>
<div class="col-sm-10">
{{ team.initialName }}
<input type="text" readonly class="form-control-sm form-control-plaintext text-light" ng-model="team.initialName">
</div>
</div>
<div class="form-group" ng-repeat="field in fields">
<label for="{{ field }}" class="col-sm-2 control-label">{{ field | capitalize }}</label>
<div class="form-group row" ng-repeat="field in fields">
<label for="{{ field }}" class="col-sm-2 col-form-label-sm">{{ field | capitalize }}</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="{{ field }}" ng-model="team[field]" ng-if="field != 'color'">
<input type="color" class="form-control" id="{{ field }}{{ member.id }}" ng-model="team[field]" ng-if="field == 'color'" color>
<input type="text" class="form-control form-control-sm" id="{{ field }}" ng-model="team[field]" ng-if="field != 'color'">
<input type="color" class="form-control form-control-sm" id="{{ field }}{{ member.id }}" ng-model="team[field]" ng-if="field == 'color'" color>
</div>
</div>
<div class="text-right" ng-show="team.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
<a class="btn btn-danger" ng-click="deleteTeam()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</a>
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
<button class="btn btn-danger" ng-click="deleteTeam()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</button>
</div>
<div class="text-right" ng-show="!team.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create team</button>
@ -40,51 +40,48 @@
<hr>
<form ng-submit="saveTeamMembers()" class="col-md-7 form-horizontal" ng-if="team.id" ng-controller="TeamMembersController">
<div class="panel panel-default">
<div class="panel-heading">
<div class="card-deck">
<form ng-submit="saveTeamMembers()" class="card" ng-if="team.id" ng-controller="TeamMembersController">
<div class="card-header">
<div class="panel-title">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span> Membres
<button type="submit" class="pull-right btn btn-xs btn-primary" style="margin-left: 10px">
<span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save members</button>
<a ng-click="newMember()" class="pull-right btn btn-xs btn-default">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add member</a>
<button type="submit" class="float-right btn btn-sm btn-primary" style="margin-left: 10px">
<span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
<button ng-click="newMember()" class="float-right btn btn-sm btn-secondary">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
</div>
</div>
<div class="panel-body" ng-if="members.length == 0">
<div class="card-body" ng-if="members.length == 0">
This team has no member!
</div>
<div class="list-group-item" ng-repeat="member in members">
<div class="form-group" ng-repeat="field in fields">
<label for="{{ field }}{{ member.id }}" class="col-sm-3 control-label">{{ field | capitalize }}</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="{{ field }}{{ member.id }}" ng-model="member[field]">
<div class="form-group row" ng-repeat="field in fields">
<label for="{{ field }}{{ member.id }}" class="col-sm-4 col-form-label-sm">{{ field | capitalize }}</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="{{ field }}{{ member.id }}" ng-model="member[field]">
</div>
<div class="col-sm-1" ng-if="$first">
<a ng-click="removeMember(member)" class="pull-right btn btn-primary"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a>
<div class="col-sm-2" ng-if="$first">
<button ng-click="removeMember(member)" class="float-right btn btn-sm btn-primary"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>
</div>
</div>
</div>
</div>
</form>
</form>
<div class="col-md-5" ng-if="team.id">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="panel-title">
<div class="card">
<div class="card-header">
<span class="glyphicon glyphicon-certificate" aria-hidden="true"></span>
Certificate
<span class="label label-success" ng-if="hasCertificate">Generated</span>
<span class="label label-danger" ng-if="!hasCertificate">Not found</span>
</div>
</div>
<div class="panel-body">
<a ng-click="generateCertificate()" class="btn btn-success" ng-if="!hasCertificate">
<span class="glyphicon glyphicon-certificate" aria-hidden="true"></span> Generate certificate</a>
<a ng-click="revokeCertificate()" class="btn btn-danger" ng-if="hasCertificate">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Revoke certificate</a>
<span class="badge badge-success" ng-if="hasCertificate">Generated</span>
<span class="badge badge-danger" ng-if="!hasCertificate">Not found</span>
</div>
<div class="card-body">
<button ng-click="generateCertificate()" class="btn btn-success" ng-if="!hasCertificate">
<span class="glyphicon glyphicon-certificate" aria-hidden="true"></span> Generate certificate</button>
<button ng-click="revokeCertificate()" class="btn btn-danger" ng-if="hasCertificate">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Revoke certificate</button>
</div>
</div>
</div>
</div>

View File

@ -1,12 +1,12 @@
<h2>
&Eacute;quipes
<a ng-click="show('new')" class="pull-right btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter une équipe</a>
<a ng-click="show('print')" class="pull-right btn btn-default" style="margin-right: 10px;"><span class="glyphicon glyphicon-print" aria-hidden="true"></span> Imprimer les équipes</a>
<button ng-click="show('new')" class="float-right btn btn-sm btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter une équipe</button>
<button ng-click="show('print')" class="float-right btn btn-sm btn-secondary" style="margin-right: 10px;"><span class="glyphicon glyphicon-print" aria-hidden="true"></span> Imprimer les équipes</button>
</h2>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<table class="table table-hover table-bordered">
<thead>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>
<th ng-repeat="field in fields">
{{ field }}

View File

@ -26,7 +26,7 @@
<div ng-if="team.name != team.initialName">{{ team.initialName }}</div>
</td>
<td ng-controller="TeamMembersController" style="padding: 0;">
<table class="table table-hover table-condensed" style="margin: 0;">
<table class="table table-hover table-sm" style="margin: 0;">
<tr class="row" ng-repeat="member in members">
<td class="col-sm-3" ng-repeat="field in fields">
{{ member[field] }}

View File

@ -9,9 +9,15 @@
.RdYlGn .q7-8{fill:rgb(70,80,80)}
</style>
<h1>{{ team.name }}<span ng-if="team.name != team.initialName"> ({{ team.initialName}})</span> <small><span ng-repeat="member in members"><span ng-if="$last && !$first"> et </span><span ng-if="$middle">, </span>{{ member.firstname | capitalize }} <em ng-if="member.nickname">{{ member.nickname }}</em> {{ member.lastname | capitalize }}</span></small></h1>
<h1>
{{ team.name }}
<span ng-if="team.name != team.initialName"> ({{ team.initialName}})</span>
<small>
<span ng-repeat="member in members"><span ng-if="$last && !$first"> et </span><span ng-if="$middle">, </span>{{ member.firstname | capitalize }} <em ng-if="member.nickname">{{ member.nickname }}</em> {{ member.lastname | capitalize }}</span>
</small>
</h1>
<div ng-controller="TeamExercicesController">
<div ng-controller="TeamExercicesController" class="bg-light text-dark">
<dl class="dl-horizontal">
<dt>Points</dt>
@ -40,8 +46,7 @@
<div class="clearfix"></div>
<div class="container" ng-controller="TeamStatsController">
<div class="row">
<div class="row" ng-controller="TeamStatsController">
<div class="col-sm-6" id="pieLevels">
<h4 class="text-center">Tentatives par niveaux</h4>
</div>
@ -49,6 +54,5 @@
<h4 class="text-center">Tentatives par thèmes</h4>
</div>
</div>
</div>
</div>

View File

@ -1,8 +1,12 @@
<h2>Thèmes<a ng-click="sync()" ng-class="{'disabled': inSync}" class="pull-right btn btn-default"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroniser</a> <a ng-click="show('new')" class="pull-right btn btn-primary" style="margin-right: 10px;"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter un thème</a></h2>
<h2>
Thèmes
<button ng-click="show('new')" class="float-right btn btn-sm btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter un thème</button>
<button ng-click="sync()" ng-class="{'disabled': inSync}" class="float-right btn btn-sm btn-secondary" style="margin-right: 10px;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroniser</button>
</h2>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<table class="table table-hover table-bordered">
<thead>
<table class="table table-hover table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th ng-repeat="field in fields">
{{ field }}

View File

@ -1,27 +1,33 @@
<h2>{{theme.name}} <small>{{theme.authors}}</small></h2>
<form ng-submit="saveTheme()" class="form-horizontal">
<div class="form-group" ng-repeat="field in fields">
<label for="{{ field }}" class="col-sm-1 control-label">{{ field | capitalize }}</label>
<form ng-submit="saveTheme()">
<div class="form-group row" ng-repeat="field in fields">
<label for="{{ field }}" class="col-sm-1 col-form-label-sm">{{ field | capitalize }}</label>
<div class="col-sm-11">
<input type="text" class="form-control" id="{{ field }}" ng-model="theme[field]">
<input type="text" class="form-control form-control-sm" id="{{ field }}" ng-model="theme[field]">
</div>
</div>
<div class="text-right" ng-show="theme.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
<a class="btn btn-danger" ng-click="deleteTheme()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</a>
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
<button class="btn btn-danger" ng-click="deleteTheme()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</button>
</div>
<div class="text-right" ng-show="!theme.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create theme</button>
</div>
</form>
<hr>
<div ng-show="theme.id" ng-controller="ExercicesListController">
<h3>Exercices<a ng-click="syncExo()" ng-class="{'disabled': inSync}" class="pull-right btn btn-sm btn-default"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroniser</a> <a ng-click="show('new')" class="pull-right btn btn-sm btn-primary" style="margin-right: 10px;"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter un exercice</a></h3>
<h3>
Exercices
<button ng-click="show('new')" class="float-right btn btn-sm btn-primary" style="margin-left: 10px;"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter un exercice</button>
<button ng-click="syncExo()" ng-class="{'disabled': inSync}" class="float-right btn btn-sm btn-light"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroniser</button>
</h3>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<table class="table table-hover table-bordered">
<thead>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>
<th ng-repeat="field in fields">
{{ field }}

View File

@ -68,15 +68,12 @@ body {
.point {
text-shadow: 0 0 20px #0055ff;
}
.navbar-inverse .point {
.bg-dark .point {
text-shadow: 0 0 12px #0055ff;
}
.end .point {
text-shadow: 0 0 20px #ff5500;
}
.navbar-inverse .end .point {
text-shadow: 0 0 12px #ff5500;
}
@-webkit-keyframes clockanim {
0% { opacity: 1.0; }
50% { opacity: 0; }
@ -96,7 +93,7 @@ keyframes clockanim {
samp.cksum {
overflow-x: hidden;
text-overflow: ellipsis;
max-width: 20vw;
max-width: 16vw;
display: inline-block;
vertical-align: middle;
}
@ -111,10 +108,16 @@ h1 small.authors {
font-style: italic;
}
a.badge:hover {
text-decoration: none;
}
.teamname {
-webkit-filter: invert(100%);
filter: invert(100%);
}
a:hover .teamname {
text-shadow: 0px 0px 10px #888888;
}
.heading {
font-style: italic;
@ -162,7 +165,7 @@ h1 small.authors {
.carousel .table {
margin-bottom: 0;
}
.carousel .table-condensed td {
.carousel .table-sm td {
padding: 2px;
}

View File

@ -74,12 +74,12 @@
</button>
<div class="collapse navbar-collapse" id="themesMenu">
<ul class="navbar-nav mr-auto">
<li ng-repeat="(k,theme) in themes"><a ng-class="{active: k == current_theme}" class="nav-link" ng-href="/{{ k }}" 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 ng-repeat="(k,theme) in themes" ng-class="{active: k == current_theme}" class="nav-item"><a class="nav-link" ng-href="/{{ k }}" 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>
</ul>
</div>
<span class="navbar-text text-light" ng-show="(my.team_id)" ng-cloak>
<a tabindex="0" 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='btn btn-sm btn-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>">
{{ my.name }}
<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>
</span>
</nav>

View File

@ -22,7 +22,7 @@
</div>
</noscript>
<div ng-repeat="(k,s) in scene" class="repeatedd-item">
<div ng-repeat="(k,s) in scene" class="repeatedd-item" style="margin-bottom: 15px;">
<div class="card" ng-if="s.type == 'welcome' && !s.params.hide && s.params.kind == 'init'">
<div class="card-body">
@ -105,7 +105,7 @@
</div>
<div class="card" ng-if="s.type == 'table' && !s.params.hide">
<table class="table table-bordered table-striped table-condensed">
<table class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th class="frotated"></th>
@ -149,7 +149,7 @@
</div>
<div class="card" ng-if="s.type == 'rank' && !s.params.hide">
<table class="table table-bordered table-striped table-condensed">
<table class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th class="text-right">Place</th>
@ -180,7 +180,7 @@
</div>
</div>
<div style="box-shadow: 0px -5px 5px 5px #e9ecef; position: fixed; bottom: calc(14vh - 1px); right: 0; width: 33vw;" class="navbar navbar-inverse" ng-controller="TimeController">
<div style="box-shadow: 0px -5px 5px 5px #e9ecef; position: fixed; bottom: calc(14vh - 1px); right: 0; width: 33vw;" class="navbar bg-light" ng-controller="TimeController">
<div class="text-center" ng-if="time.hours === 0 || time.hours" style="margin-top: -5px;">
<div id="clock" ng-class="{expired: time.expired, end: time.end}" style="font-size: 50px" ng-cloak>
<span id="hours">{{ time.hours | time }}</span>
@ -253,7 +253,7 @@
</div>
<div class="carousel-item">
<div class="carousel-caption" style="padding: 3px 25px; width: 32vw;">
<table class="table table-bordered table-condensed table-striped">
<table class="table table-bordered table-sm table-striped">
<tbody>
<tr>
<td>11&nbsp;h</td>

View File

@ -1,14 +1,16 @@
<nav role="navigation">
<ol class="breadcrumb">
<li ng-repeat="(k,exercice) in themes[current_theme].exercices" class="breadcrumb-item" ng-class="{active: k == current_exercice, disabled: !my.exercices[k]}"><a ng-if="(!my.exercices[k])">{{ exercice.title }}</a><a ng-href="/{{ current_theme }}/{{ k }}" ng-if="(my.exercices[k])">{{ exercice.title }} <span class="glyphicon glyphicon-gift" aria-hidden="true" ng-if="themes[current_theme].exercices[k].curcoeff > 1.0"></span> <span class="glyphicon glyphicon-ok" aria-hidden="true" ng-if="(my.team_id && my.exercices[k].solved)"></span></a></li>
<li ng-repeat="(k,exercice) in themes[current_theme].exercices" class="breadcrumb-item" ng-class="{active: k == current_exercice, disabled: !my.exercices[k]}"><a ng-if="(k != current_exercice && !my.exercices[k])">{{ exercice.title }}</a><a ng-href="/{{ current_theme }}/{{ k }}" ng-if="(k != current_exercice && my.exercices[k])">{{ exercice.title }} <span class="glyphicon glyphicon-gift" aria-hidden="true" ng-if="themes[current_theme].exercices[k].curcoeff > 1.0"></span> <span class="glyphicon glyphicon-ok" aria-hidden="true" ng-if="(my.team_id && my.exercices[k].solved)"></span></a><em ng-if="k == current_exercice">{{ exercice.title }}</em></li>
</ol>
</nav>
<div class="alert alert-warning" style="margin-top:15px;" ng-if="!(my.exercices[current_exercice])">
Vous n'avez pas encore accès à cet exercice.
</div>
<div class="jumbotron" style="margin-top: 15px" class="well well-lg" ng-if="(my.exercices[current_exercice])">
<p ng-bind-html="my.exercices[current_exercice].statement"></p>
<div class="jumbotron text-indent" style="margin-top: 15px" class="well well-lg" ng-if="(my.exercices[current_exercice])">
<h3 class="display-4">{{ themes[current_theme].exercices[current_exercice].title }}</h3>
<p class="lead text-justify" ng-bind-html="my.exercices[current_exercice].statement"></p>
<hr class="my-3">
<ul>
<li><strong>Gain&nbsp;:</strong> <ng-pluralize count="themes[current_theme].exercices[current_exercice].gain" when="{'one': '{} point', 'other': '{} points'}"></ng-pluralize> <em ng-if="themes[current_theme].exercices[current_exercice].solved < 1">{{ 1 + settings.firstBlood | coeff }} prem's</em> <em ng-if="themes[current_theme].exercices[current_exercice].curcoeff != 1.0">{{ themes[current_theme].exercices[current_exercice].curcoeff | coeff }} bonus</em></li>
<li><strong>Résolu par&nbsp;:</strong> <ng-pluralize count="themes[current_theme].exercices[current_exercice].solved" when="{'0': 'aucune équipe', 'one': '{} équipe', 'other': '{} équipes'}"></ng-pluralize>.</li>
@ -62,9 +64,9 @@
</ul>
<div class="card-body" ng-if="!my.exercices[current_exercice].submitted || sberr">
<form ng-controller="SubmissionController" ng-submit="ssubmit()">
<div class="form-group" ng-repeat="key in flags" ng-class="{'has-success': key.found, 'has-feedback': key.found}">
<div class="form-group" ng-repeat="key in flags">
<label for="sol_{{ key.id }}">{{ key.name }}&nbsp;:</label>
<input type="text" class="form-control" id="sol_{{ key.id }}" name="sol_{{ key.id }}" ng-model="key.value" ng-disabled="key.found">
<input type="text" class="form-control" id="sol_{{ key.id }}" name="sol_{{ key.id }}" ng-model="key.value" ng-disabled="key.found" ng-class="{'is-valid': key.found}">
<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true" ng-if="key.found"></span>
</div>
@ -90,7 +92,9 @@
<span class="glyphicon glyphicon-flag" aria-hidden="true"></span> Challenge réussi !
</div>
<div class="card-body">
<p class="card-text">
Vous êtes la {{ my.exercices[current_exercice].solved_rank }}<sup><ng-pluralize count="my.exercices[current_exercice].solved_rank" when="{'one': 're', 'other': 'e'}"></ng-pluralize></sup> équipe à avoir résolu ce challenge à {{ my.exercices[current_exercice].solved_time | date:"mediumTime" }}. Vous avez marqué <ng-pluralize count="my.exercices[current_exercice].gain" when="{'one': '{} point', 'other': '{} points'}"></ng-pluralize> !
</p>
</div>
</div>

View File

@ -49,7 +49,7 @@ func DBCreate() error {
CREATE TABLE IF NOT EXISTS events(
id_event INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
txt VARCHAR(255) NOT NULL UNIQUE,
kind ENUM('alert-default', 'alert-primary', 'alert-info', 'alert-warning', 'alert-danger', 'alert-success') NOT NULL,
kind ENUM('alert-primary', 'alert-secondary', 'alert-success', 'alert-danger', 'alert-warning', 'alert-info', 'alert-light', 'alert-dark') NOT NULL,
time TIMESTAMP NOT NULL
);
`); err != nil {