Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
fix(consistency): all pages alert you if you do not own the player se…
Browse files Browse the repository at this point in the history
…t now

ref #69
  • Loading branch information
seiyria committed Oct 19, 2015
1 parent 202c4e8 commit 916ab22
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/jade/partials/managers/event-manage.jade
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ script(type="text/ng-template", id="/event-manage")

md-card
md-data-table-toolbar(ng-hide="selected.length || filter.show")
h2.md-title Event Management {{showArchived ? '(archived)' : ''}}
h2.md-title
ng-md-icon(size="24", icon="warning", ng-if="!isMine")
md-tooltip This set was not made by you
| Event Management {{showArchived ? '(archived)' : ''}}
div(flex)

md-button.md-icon-button(ng-click="filter.show = true", aria-label="search")
Expand Down
5 changes: 4 additions & 1 deletion src/jade/partials/managers/tournament-manage.jade
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ script(type="text/ng-template", id="/tournament-manage")

md-card
md-data-table-toolbar(ng-hide="selected.length || filter.show")
h2.md-title Tournament Management {{showArchived ? '(archived)' : ''}}
h2.md-title
ng-md-icon(size="24", icon="warning", ng-if="!isMine")
md-tooltip This set was not made by you
| Tournament Management {{showArchived ? '(archived)' : ''}}
div(flex)

md-button.md-icon-button(ng-click="filter.show = true", aria-label="search")
Expand Down
8 changes: 6 additions & 2 deletions src/js/controllers/managers/eventManageCtrl.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import site from '../../app';

site.controller('eventManageController', ($scope, SidebarManagement, EnsureLoggedIn, EventManagement, CurrentEvents, CurrentTournaments) => {
site.controller('eventManageController', ($scope, SidebarManagement, EnsureLoggedIn, UserStatus, EventManagement, CurrentEvents, CurrentTournaments) => {
SidebarManagement.hasSidebar = true;
EnsureLoggedIn.check();
const authData = EnsureLoggedIn.check();

$scope.events = [];
$scope.visibleEvents = [];
Expand Down Expand Up @@ -103,6 +103,10 @@ site.controller('eventManageController', ($scope, SidebarManagement, EnsureLogge
$scope.events.$watch($scope.getEvents);
};

UserStatus.firebase.$loaded(() => {
$scope.isMine = UserStatus.firebase.playerSetUid === authData.uid;
});

CurrentEvents.watch.then(null, null, () => {
$scope.loadEvents();
});
Expand Down
6 changes: 5 additions & 1 deletion src/js/controllers/managers/tournamentManageCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import site from '../../app';

site.controller('tournamentManageController', ($scope, $state, ShareToken, SidebarManagement, EnsureLoggedIn, TournamentManagement, CurrentTournaments, CurrentPlayerBucket, TournamentStatus, UserStatus) => {
SidebarManagement.hasSidebar = true;
EnsureLoggedIn.check();
const authData = EnsureLoggedIn.check();

$scope.playersAvailable = CurrentPlayerBucket.get().length;

Expand Down Expand Up @@ -108,6 +108,10 @@ site.controller('tournamentManageController', ($scope, $state, ShareToken, Sideb
$scope.tournaments.$watch($scope.getTournaments);
};

UserStatus.firebase.$loaded(() => {
$scope.isMine = UserStatus.firebase.playerSetUid === authData.uid;
});

CurrentTournaments.watch.then(null, null, () => {
$scope.loadTournaments();
});
Expand Down

0 comments on commit 916ab22

Please sign in to comment.