EricSSartorius / Judging-System

U-Judge: Universal Judging System using Angular Meteor (OLD)
http://www.universaljudge.com/
1 stars 1 forks source link

Show leaderboard scores if the author is equal to the current user. I… #43

Closed felicedeNigris closed 8 years ago

felicedeNigris commented 8 years ago

I added two one liners.

In leaderboard.ng.js on line 3. I added $scope.currentUser which is equal to the current userId of the person logged in. I use currentUser to compare it to user.author which is created when an event is made. In leaderboard.ng.html on line 4. I added a ng-show="event.author === currentUser" This shows the leaderboard to the user who created it by comparing if event.author id is equal to currenUser id.

Hope this makes sense?

felicedeNigris commented 8 years ago

One more thing I left out.

In leaderboard.ng.js on line 5 , in the if statement i appended with && to see if the currentUser === event.author so that "No event currently running shows" instead of dissapearing with no visual cue.