dashboard: refactor

This commit is contained in:
nemunaire 2019-03-25 23:14:53 +01:00
parent e17d467ee3
commit ddd8da6395
2 changed files with 24 additions and 14 deletions

View file

@ -32,7 +32,7 @@
</style>
<base href="/">
</head>
<body ng-controller="ChallengesController">
<body>
<div ng-controller="StudentsController" ng-cloak>
<div class="card float-left mt-1 student" ng-repeat="student in students">
<div class="card-img-top" style="background-image: url('https://photos.cri.epita.fr/thumb/{{ student.login | lowercase }}')"></div>
@ -46,17 +46,10 @@
Unreachable
</span>
</h5>
<div ng-controller="ProgressionController">
<span class="badge ml-1" ng-repeat="ch in chids" ng-class="{'badge-success': mychallenges[ch+1], 'badge-danger': !mychallenges[ch+1]}">
<span ng-if="ch == 0" title="Is alive">T1</span>
<span ng-if="ch == 1" title="DMZ reached">T2</span>
<span ng-if="ch == 2" title="HTTPS on + time">T3</span>
<span ng-if="ch == 3" title="DNS ok">T4</span>
<span ng-if="ch == 4" title="On Internet">T5</span>
<span ng-if="ch == 5" title="Bonus ICMP">B1</span>
<span ng-if="ch == 6" title="Bonus disk">B2</span>
<div ng-controller="ProgressionController">
<span class="badge ml-1" ng-repeat="(ch,t) in tuto_progress[1]" ng-class="{'badge-success': mychallenges[ch], 'badge-danger': !mychallenges[ch]}">
<span title="{{ t.title }}" ng-bind="t.label"></span>
</span>
<span class="badge" ng-controller="SSHController" ng-class="{'badge-success': SSH, 'badge-danger': !SSH}">SSH</span>
</div>
</div>
</div>