Implement flag arrays
This commit is contained in:
parent
3056a19d09
commit
dbf1985d25
6 changed files with 90 additions and 8 deletions
|
|
@ -88,15 +88,20 @@
|
|||
<div class="form-group" ng-repeat="(kid,key) in my.exercices[current_exercice].flags">
|
||||
<label for="sol_{{ kid }}">{{ key.label }} :</label>
|
||||
<span ng-if="key.found && key.value" ng-bind="key.value"></span>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="sol_{{ kid }}" autocomplete="off" name="sol_{{ kid }}" ng-model="key.value" ng-if="!key.found && !key.choices">
|
||||
<select class="custom-select" id="sol_{{ kid }}" name="sol_{{ kid }}" ng-model="key.value" ng-if="!key.found && key.choices" ng-options="l as v for (l, v) in key.choices"></select>
|
||||
<div class="input-group" ng-repeat="v in key.values track by $index" ng-class="{'mt-1': !$first}" ng-if="!key.found">
|
||||
<input type="text" class="form-control" id="sol_{{ kid }}_{{ $index }}" autocomplete="off" name="sol_{{ kid }}" ng-model="key.values[$index]" ng-if="!key.choices">
|
||||
<select class="custom-select" id="sol_{{ kid }}" name="sol_{{ kid }}" ng-model="key.values[$index]" ng-if="key.choices" ng-options="l as v for (l, v) in key.choices"></select>
|
||||
<div class="input-group-append" ng-if="key.choices_cost">
|
||||
<button class="btn btn-success" type="button" ng-click="wantchoices(kid)" ng-class="{disabled: key.wcsubmitted}" title="Cliquez pour échanger ce champ de texte par une liste de choix. L'opération vous coûtera {{ key.choices_cost }} points.">
|
||||
<span class="glyphicon glyphicon-tasks" aria-hidden="true"></span>
|
||||
Liste de propositions ({{ key.choices_cost }} points)
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group-append" ng-if="key.separator && $last">
|
||||
<button class="btn btn-success" type="button" ng-click="additem(key)" title="Ajouter un élément.">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<small class="form-text text-muted" ng-if="!key.found && key.help.length > 0" ng-bind="key.help"></small>
|
||||
<span class="glyphicon glyphicon-ok form-control-feedback text-success" aria-hidden="true" ng-if="key.found" title="Flag trouvé à {{ key.found | date:'mediumTime'}}"></span>
|
||||
|
|
|
|||
Reference in a new issue