frontend: dedicate a field in JSON to file hint

This commit is contained in:
nemunaire 2017-01-14 15:03:25 +01:00
parent b772a22705
commit 21e4b04c19
3 changed files with 28 additions and 28 deletions

View file

@ -30,18 +30,16 @@
<div class="panel-heading">
<div class="panel-title"><span class="glyphicon glyphicon-lamp" aria-hidden="true"></span> Indices</div>
</div>
<ul class="list-group">
<li class="list-group-item" ng-repeat="hint in my.exercices[current_exercice].hints">
<form class="pull-right" ng-show="!hint.unlocked" ng-submit="hsubmit(hint)">
<button type="submit" class="btn btn-info" ng-class="{disabled: hint.submitted}"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span> Débloquer</button>
</form>
<a class="btn btn-info pull-right" href="{{ hint.content | limitTo:999:6 }}" target="_self" ng-show="hint.content[0] == '$' && hint.content[1] == 'F' && hint.content[4] == 'E' && hint.content[5] == 'S'"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> Télécharger</a>
<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-show="!(hint.content || hint.file)" ng-class="{disabled: hint.submitted}"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span> Débloquer</button>
<h1 class="pull-left" style="margin: 5px 7px 5px -5px" ng-show="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-show="hint.unlocked && !(hint.content[0] == '$' && hint.content[1] == 'F' && hint.content[4] == 'E' && hint.content[5] == 'S')" ng-bind-html="hint.content"></p>
<p class="list-group-item-text" ng-show="hint.unlocked && (hint.content[0] == '$' && hint.content[1] == 'F' && hint.content[4] == 'E' && hint.content[5] == 'S')">Utilisez le bouton pour télécharger l'indice.</p>
<p class="list-group-item-text" ng-show="!hint.unlocked">Débloquer cet indice vous coûtera <ng-pluralize count="hint.cost" when="{'one': '{} point', 'other': '{} points'}"></ng-pluralize>.</p>
</li>
</ul>
<p class="list-group-item-text" ng-show="hint.content" ng-bind-html="hint.content"></p>
<p class="list-group-item-text" ng-show="hint.file">Cliquez ici pour télécharger l'indice.</p>
<p class="list-group-item-text" ng-show="!(hint.content || hint.file)">Débloquer cet indice vous coûtera <ng-pluralize count="hint.cost" when="{'one': '{} point', 'other': '{} points'}"></ng-pluralize>.</p>
</a>
</div>
</div>
<div class="panel panel-danger" ng-show="my.team_id && my.exercices[current_exercice] && !(my.exercices[current_exercice].solved)">