maatma: publish progression on frontpage

This commit is contained in:
nemunaire 2021-03-05 15:11:14 +01:00
parent f47eb68505
commit 8712e33c5a
3 changed files with 18 additions and 15 deletions

View File

@ -111,6 +111,8 @@ angular.module("AdLinApp")
}) })
.controller("ProgressionController", function($scope, $interval, $http) { .controller("ProgressionController", function($scope, $interval, $http) {
$scope.tuto_progress = tuto_progress;
$scope.mychallenges = {}; $scope.mychallenges = {};
var refreshChal = function() { var refreshChal = function() {
$http.get("api/students/" + $scope.student.id + "/progress").then(function(response) { $http.get("api/students/" + $scope.student.id + "/progress").then(function(response) {

View File

@ -46,6 +46,7 @@
<script src="js/angular-resource.min.js"></script> <script src="js/angular-resource.min.js"></script>
<script src="js/angular-route.min.js"></script> <script src="js/angular-route.min.js"></script>
<script src="js/angular-sanitize.min.js"></script> <script src="js/angular-sanitize.min.js"></script>
<script src="js/adlin-common.js"></script>
<script src="js/adlin-main.js"></script> <script src="js/adlin-main.js"></script>
</body> </body>
</html> </html>

View File

@ -10,26 +10,26 @@
Connectez-vous&nbsp;! Connectez-vous&nbsp;!
</h2> </h2>
<h2 ng-if="isLogged"> <h2 ng-if="isLogged" class="mb-4">
Qu'allons-nous faire aujourd'hui&nbsp;? <a href="/dashboard/{{ isLogged.login }}" class="text-muted">Voir l'avancement...</a> Qu'allons-nous faire aujourd'hui&nbsp;? <a href="/dashboard/{{ isLogged.login }}" class="text-muted">Voir l'avancement...</a>
</h2> </h2>
<div ng-controller="ProgressionController" class="row" ng-if="isLogged"> <div ng-controller="ProgressionController" ng-if="isLogged">
<div class="col"> <div ng-repeat="(tutoid,tuto) in tuto_progress" class="mb-2">
<strong>TP 2&nbsp;</strong> <strong class="mr-2">TP {{tutoid+1}}</strong>
<span class="badge" ng-class="{'badge-success': mychallenges[100], 'badge-danger': !mychallenges[100]}">HTTP</span> <span class="badge mr-1" ng-repeat="(ch,t) in tuto_progress[tutoid]" ng-class="{'badge-success': mychallenges[ch], 'badge-danger': !mychallenges[ch]}" title="{{ t.title }} @ {{ mychallenges[ch].time | date: 'medium' }} {{ mychallenges[ch].recent }}" ng-bind="t.label"></span>
<span class="badge" ng-class="{'badge-success': mychallenges[101], 'badge-danger': !mychallenges[101]}">HTTPS</span>
<span class="badge" ng-class="{'badge-success': mychallenges[102], 'badge-danger': !mychallenges[102]}">DNS</span>
<span class="badge" ng-class="{'badge-success': mychallenges[103], 'badge-danger': !mychallenges[103]}">Matrix</span>
</div>
<div class="col">
<strong>TP 3&nbsp;</strong>
<span class="badge" ng-class="{'badge-success': mychallenges[200], 'badge-danger': !mychallenges[200]}">HTTP</span>
<span class="badge" ng-class="{'badge-success': mychallenges[201], 'badge-danger': !mychallenges[201]}">HTTPS</span>
<span class="badge" ng-class="{'badge-success': mychallenges[202], 'badge-danger': !mychallenges[202]}">DNS</span>
<span class="badge" ng-class="{'badge-success': mychallenges[203], 'badge-danger': !mychallenges[203]}">Matrix</span>
</div> </div>
</div> </div>
<h2 class="mt-4 mb-2" ng-if="isLogged">
Besoin d'aide&nbsp;?
</h2>
<p ng-if="isLogged">
Rejoignez-nous sur notre canal
<a href="https://matrix.to/#/#maatma:nemunai.re" target="_blank"><img src="https://matrix.to/images/matrix-logo-3303998978.svg" alt="Rejoingnez-nous sur notre canal Matrix"></a>
</p>
</div> </div>
<div class="card-deck"> <div class="card-deck">