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

Commit

Permalink
feat(tournaments): tournaments with no scores can be reconfigured
Browse files Browse the repository at this point in the history
closes #48
  • Loading branch information
seiyria committed Oct 15, 2015
1 parent 601ffce commit 06849c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/jade/partials/tournaments/in-progress.jade
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ script(type="text/ng-template", id="/tournaments/in-progress")
.text-center.md-title(flex)
span(ng-show="!ref.public && !hasAccess") Unavailable
span(ng-show="ref.public || hasAccess") {{tournamentName}}{{trn.isDone() ? ' (Complete)' : ' (' + matchesLeft() + ' matches left)'}}

.text-right.auto-vert-margin(flex, layout="row", layout-align="end center")
.hide-underline(ng-show="ref.public && hasAccess")
a.copy-url(data-clipboard-text="{{url}}")
Expand Down Expand Up @@ -53,13 +54,17 @@ script(type="text/ng-template", id="/tournaments/in-progress")

md-button.md-fab.md-primary(aria-label="menu or results", ng-click="doOrOpen($event)", ng-mouseenter="isOpen = true")
ng-md-icon(size="24", icon="{{isOpen && trn.isDone() ? 'assessment' : 'menu'}}", style="fill: white")
md-tooltip(md-direction="left", ng-if="isOpen && trn.isDone()") View results
md-tooltip(md-direction="left", ng-show="isOpen && trn.isDone()") View results

md-fab-actions(ng-if="isOpen")
md-button.md-fab.md-raised.md-accent(aria-label="toggle public", ng-click="ref.public = !ref.public; savePublicity()", ng-if="hasAccess")
ng-md-icon(size="24", icon="{{ref.public ? 'lock' : 'lock_open'}}", style="fill: white")
md-tooltip(md-direction="left") Make {{ref.public ? 'private' : 'public'}}

md-button.md-fab.md-raised.md-warn(aria-label="change options", ng-click="changeOptions()", ng-if="trn.state.length === 0")
ng-md-icon(size="24", icon="edit", style="fill: white")
md-tooltip(md-direction="left") Change tournament options

md-button.md-fab.md-raised.md-warn(aria-label="reset", ng-click="reset($event)", ng-if="hasAccess")
ng-md-icon(size="24", icon="history", style="fill: white")
md-tooltip(md-direction="left") Reset tournament
Expand Down
5 changes: 5 additions & 0 deletions src/js/controllers/tournaments/inProgressCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ site.controller('inProgressController', ($scope, $timeout, EnsureLoggedIn, Sideb
$scope.ref.$save();
};

$scope.changeOptions = () => {
console.log($scope.ref.$id);
$state.go('setupTournament', { tournamentId: $scope.ref.$id });
};

$scope.ref.$watch(() => $scope.loadTournament($scope.ref));

$scope.ref.$loaded().then(() => {
Expand Down

0 comments on commit 06849c8

Please sign in to comment.