admin: Add ability to append element to exercice history
This commit is contained in:
parent
ae5068f8b8
commit
977caccc1f
6 changed files with 237 additions and 3 deletions
|
|
@ -82,9 +82,12 @@
|
|||
</div>
|
||||
<div class="col-4" ng-controller="ExerciceFlagChoicesController">
|
||||
<div class="btn-toolbar justify-content-end mb-2" role="toolbar">
|
||||
<div class="btn-group" role="group">
|
||||
<div class="btn-group mx-2" role="group">
|
||||
<button type="button" ng-click="addChoice()" class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter choix</button>
|
||||
</div>
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-sm btn-dark" data-toggle="modal" data-target="#validationModal" data-flag="{{ flag.label }}" data-flagid="{{ flag.id }}" data-kind="flag_found"><span class="glyphicon glyphicon-check" aria-hidden="true"></span> Valider pour </button>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-repeat="choice in choices" ng-if="choices.length > 0">
|
||||
<div class="row">
|
||||
|
|
@ -170,3 +173,56 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="validationModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Valider ce flag pour une équipe</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form ng-submit="validateForTeam()">
|
||||
<div class="modal-body">
|
||||
<div class="form-group row">
|
||||
<label for="labelflag" class="col-md-3 col-form-label">Flag</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" readonly class="form-control-plaintext" id="labelflag">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="tteam" class="col-md-3 col-form-label">Équipe</label>
|
||||
<div class="col-md-9" ng-controller="TeamsListController">
|
||||
<select class="custom-select custom-select-sm" id="tteam" ng-model="selectedTeam" ng-options="t.id as t.name for t in teams"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
|
||||
<button type="submit" class="btn btn-primary">Enregistrer</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#validationModal').on('shown.bs.modal', function (event) {
|
||||
$('#tteam').trigger('focus');
|
||||
|
||||
var button = $(event.relatedTarget);
|
||||
var flag = button.data('flag');
|
||||
var flagid = button.data('flagid');
|
||||
var kind = button.data('kind');
|
||||
|
||||
var modal = $(this);
|
||||
|
||||
modal.data('kind', kind);
|
||||
modal.data('flagid', flagid);
|
||||
modal.data('flag', flag);
|
||||
if (modal.data('flag')) {
|
||||
$("#labelflag").val(modal.data('flag'))
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Reference in a new issue