frontend: inside public interface, hide hints
This commit is contained in:
parent
e2370c9511
commit
c402d28056
2 changed files with 10 additions and 2 deletions
|
|
@ -135,6 +135,13 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
}
|
||||
});
|
||||
actMenu();
|
||||
if (my.team_id == 0) {
|
||||
angular.forEach($scope.my.exercices, function(exercice, eid) {
|
||||
angular.forEach(exercice.hints, function(hint, hid) {
|
||||
$scope.my.exercices[eid].hints[hid].hidden = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log("refresh!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,11 +33,12 @@
|
|||
<div class="list-group">
|
||||
<a target="_self" class="list-group-item" ng-repeat="hint in my.exercices[current_exercice].hints" ng-href="{{ hint.file }}">
|
||||
<button ng-click="hsubmit(hint)" class="pull-right btn btn-info" ng-if="!(hint.content || hint.file)" ng-class="{disabled: hint.submitted}"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span> Débloquer</button>
|
||||
<button ng-click="hint.hidden = false;" class="pull-right btn btn-info" ng-if="hint.content && hint.hidden"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span> Afficher</button>
|
||||
<h1 class="pull-left" style="margin: 5px 7px 5px -5px" ng-if="hint.file"><span class="glyphicon glyphicon-download" aria-hidden="true"></span></h1>
|
||||
<h4 class="list-group-item-heading">{{ hint.title }}</h4>
|
||||
<p class="list-group-item-text" ng-if="hint.content" ng-bind-html="hint.content"></p>
|
||||
<p class="list-group-item-text" ng-if="hint.content && !hint.hidden" ng-bind-html="hint.content"></p>
|
||||
<p class="list-group-item-text" ng-if="hint.file">Cliquez ici pour télécharger l'indice.</p>
|
||||
<p class="list-group-item-text" ng-if="!(hint.content || hint.file)">Débloquer cet indice vous coûtera <ng-pluralize count="hint.cost" when="{'one': '{} point', 'other': '{} points'}"></ng-pluralize>.</p>
|
||||
<p class="list-group-item-text" ng-if="!(hint.content || hint.file) || (hint.content && hint.hidden)">Débloquer cet indice vous coûtera <ng-pluralize count="hint.cost" when="{'one': '{} point', 'other': '{} points'}"></ng-pluralize>.</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Reference in a new issue