frontend: change exercice border coloration when solved or bonus are active
authorPierre-Olivier Mercier <nemunaire@nemunai.re>
Sun, 9 Dec 2018 23:28:34 +0000 (00:28 +0100)
committerPierre-Olivier Mercier <nemunaire@nemunai.re>
Sun, 9 Dec 2018 23:31:30 +0000 (00:31 +0100)
frontend/static/views/home.html
frontend/static/views/tag.html
frontend/static/views/theme.html

index 997928a..134052b 100644 (file)
 </div>
 
 <div class="card-columns">
-  <div class="card niceborder excard" ng-repeat="(k,theme) in themes" ng-click="goTheme()">
+  <div class="card niceborder excard" ng-repeat="(k,theme) in themes" ng-click="goTheme()" ng-class="{'border-success': theme.solved > 0, 'border-warning': theme.exercice_coeff_max > 1}">
     <div class="card-img-top theme-card" ng-show="theme.image" style="background-image: url({{ theme.image }})"></div>
     <div class="card-body text-indent">
-      <h5 class="card-title clearfix">
+      <h5 class="card-title">
        <a ng-href="/{{ theme.urlid }}">{{ theme.name }}</a>
-       <a ng-href="/tags/{{tag}}" class="badge badge-pill badge-secondary ml-1 float-right">#tag</a>
       </h5>
       <p class="card-text text-justify" ng-bind-html="theme.headline"></p>
     </div>
index 1b8f473..6f606d2 100644 (file)
@@ -1,13 +1,16 @@
 <div class="card-columns">
-  <div class="card niceborder excard" ng-repeat="ex in exercices" ng-click="goDefi()">
+  <div class="card niceborder excard" ng-repeat="ex in exercices" ng-click="goDefi()" ng-class="{'border-success': ex.exercice.solved, 'border-secondary': !my.exercices[ex.eid], 'border-warning': ex.exercice.curcoeff > 1.0}">
     <div class="card-img-top theme-card" ng-show="ex.theme.image" style="background-image: url({{ ex.theme.image }})"></div>
     <div class="card-body">
-      <h6 class="card-title clearfix">
+      <h6 class="card-title">
        <a ng-href="/{{ex.theme.urlid}}">{{ex.theme.name}}</a> &gt;
        <a ng-href="/{{ex.theme.urlid}}/{{ex.exercice.urlid}}">{{ex.exercice.title}}</a>
-       <a ng-href="/tags/{{tag}}" class="badge badge-pill badge-secondary mr-2 float-right" ng-repeat="tag in themes[ex.tid].exercices[ex.eid].tags">#{{ tag }}</a>
+       <span class="glyphicon glyphicon-gift" aria-hidden="true" ng-if="ex.exercice.curcoeff > 1.0" title="Un bonus est actuellement appliqué lors de la résolution de ce défi"></span>
       </h6>
-      <p class="card-text text-justify" ng-bind-html="ex.exercice.headline"></p>
+      <div class="clearfix mb-2">
+       <a ng-href="/tags/{{tag}}" class="badge badge-pill badge-secondary mr-2 float-right" ng-repeat="tag in themes[ex.tid].exercices[ex.eid].tags">#{{ tag }}</a>
+      </div>
+      <p class="card-text text-justify text-indent" ng-bind-html="ex.exercice.headline"></p>
     </div>
   </div>
 </div>
index 83d6098..c4597c3 100644 (file)
@@ -11,8 +11,8 @@
          {{ exercice.title }}
        </a>
        <span ng-if="!my.exercices[k]">
-         {{ exercice.title }}
          <span class="glyphicon glyphicon-lock" aria-hidden="true" title="Vous n'avez pas encore accès à ce défi"></span>
+         {{ exercice.title }}
        </span>
        <a ng-href="/tags/{{tag}}" class="badge badge-pill badge-secondary ml-1 float-right" ng-repeat="tag in themes[current_theme].exercices[k].tags">#{{tag}}</a>
        <span class="glyphicon glyphicon-ok" aria-hidden="true" ng-if="(my.team_id && my.exercices[k].solved)"></span>