[admin] Add exercices related pages
This commit is contained in:
parent
f9c053397a
commit
f0f39e4905
3 changed files with 233 additions and 9 deletions
21
admin/static/views/exercice-list.html
Normal file
21
admin/static/views/exercice-list.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<h2>Exercices</h2>
|
||||
|
||||
<div>
|
||||
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
|
||||
<table class="table table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th ng-repeat="field in fields">
|
||||
{{ field }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="exercice in exercices | filter: query" ng-click="show(exercice.id)">
|
||||
<td ng-repeat="field in fields">
|
||||
{{ exercice[field] }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
98
admin/static/views/exercice.html
Normal file
98
admin/static/views/exercice.html
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<h2>{{exercice.title}}</h2>
|
||||
|
||||
<form class="form 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 != 'depend'">
|
||||
<textarea class="form-control" id="hcnt{{hint.id}}" ng-bind-html="exercice[field]" ng-show="field == 'statement'"></textarea>
|
||||
<select class="form-control" id="hcnt{{hint.id}}" 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">
|
||||
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
|
||||
<button class="btn btn-danger" ng-click="deleteExercice()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<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="addHint()" class="pull-right btn btn-xs btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></h3>
|
||||
</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>
|
||||
<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>
|
||||
<div class="col-xs-10">
|
||||
<textarea class="form-control" id="hcnt{{hint.id}}" ng-bind-html="hint.content"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="hcost{{hint.id}}" class="col-xs-2 control-label">Coût</label>
|
||||
<div class="col-xs-10">
|
||||
<input type="text" id="hcost{{hint.id}}" ng-model="hint.cost" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></button>
|
||||
<button class="btn btn-danger"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</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="addFile()" class="pull-right btn btn-xs btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></h3>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<form ng-submit="saveFile()" class="list-group-item form" ng-repeat="file in files">
|
||||
<input type="text" ng-model="file.name">
|
||||
<a href="{{file.path}}" class="btn btn-default"><span class="glyphicon glyphicon-download" aria-hidden="true"></span></a>
|
||||
<a ng-click="deleteFile()" class="btn btn-danger"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a>
|
||||
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></button><br>
|
||||
Taille : <span title="{{ file.size }} octets">{{ file.size | size }}</span><br>
|
||||
SHA-1 : <samp>{{ file.checksum | cksum }}</samp>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</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="addKey()" class="pull-right btn btn-xs btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></h3>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<form ng-submit="saveKey()" class="list-group-item form-horizontal" ng-repeat="key in keys">
|
||||
<div class="form-group">
|
||||
<label for="ktype{{key.id}}" class="col-xs-2 control-label">Intitulé</label>
|
||||
<div class="col-xs-10">
|
||||
<input type="text" id="ktype{{key.id}}" ng-model="key.type" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="kvalue{{key.id}}" class="col-xs-2 control-label">Hash</label>
|
||||
<div class="col-xs-10">
|
||||
<input type="text" id="kvalue{{key.id}}" ng-model="key.value" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in a new issue