Skip to content

Commit

Permalink
Set leaderboard visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
yeojoey committed Apr 4, 2017
1 parent 8f6fefb commit be6981c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion public/javascripts/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@ angular.module("dashboardApp").controller ('moduleCtrl', function ($scope, $http
$scope.tuts = tuts;
});

$scope.leaderboardIsVisible = false;

$scope.redirect = function(tut) {
$('#form').attr('action', 'lobby/'+tut.coursecode+'/'+tut.name)
}

$scope.getLeaderboard = function(tut) {
$scope.toggleLeaderboard = function(tut) {
$scope.leaderboardIsVisible = !$scope.leaderboardIsVisible;
}

});
Expand Down
6 changes: 4 additions & 2 deletions source/view/dashboard.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@
</div>
<div class="row">
<button class="btn btn-primary lobby-button" ng-click="redirect(t)" name="tut-id" value="{{t.id}}"> Join Class </button>
<button class="btn btn-primary" ng-click="showLeaderboard(t)"> View Leaderboard </button>
<button class="btn btn-primary" ng-click="toggleLeaderboard()"> View Leaderboard </button>
</div>
<div class="row">
<table class="table">
<table class="table" ng-repeat="s in students" ng-Show="leaderboardIsVisible">
<th>Name</th>
<th>Level</th>
</table>
</div>
</div>
Expand Down

0 comments on commit be6981c

Please sign in to comment.