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

Commit

Permalink
feat(tournaments): tournament headers can now be edited to display cu…
Browse files Browse the repository at this point in the history
…stom round titles

closes #101
  • Loading branch information
seiyria committed Nov 23, 2015
1 parent d6fe5f3 commit d1416d3
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ dist
bin-build
bin-cache
bin-release

issues/
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"jspdf": "~1.1.135",
"lodash": "~3.10.1",
"svg-morpheus": "~0.1.8",
"tournament": "~3.0.3"
"tournament": "~3.0.3",
"ng-inline-edit": "~0.7.0"
},
"resolutions": {
"tournament": "~3.0.2",
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@
"./node_modules/ngstorage/ngStorage.min.js",
"./node_modules/angularfire/dist/angularfire.min.js",
"./bower_components/angular-sortable-view/src/angular-sortable-view.min.js",
"./node_modules/angular-sanitize/angular-sanitize.min.js"
"./node_modules/angular-sanitize/angular-sanitize.min.js",
"./bower_components/ng-inline-edit/dist/ng-inline-edit.min.js"
],
"libcss": [
"./node_modules/angular-material/angular-material.css",
"./node_modules/angular-material-data-table/dist/md-data-table.min.css"
"./node_modules/angular-material-data-table/dist/md-data-table.min.css",
"./bower_components/ng-inline-edit/dist/ng-inline-edit.min.css"
],
"root": [
"CNAME",
Expand Down
14 changes: 13 additions & 1 deletion src/jade/partials/tournaments/types/duel.jade
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
script(type="text/ng-template", id="tournament-duel")

.match-column-container.margin-bottom-10(layout="row")
.match-column.round-header.md-subhead.subhead(ng-repeat="match in maxMatches track by $index", scroll-observe="{{$index}}") Round {{$index+1}}
.match-column.round-header.md-subhead.subhead(ng-repeat="match in maxMatches track by $index", scroll-observe="{{$index}}")
span(ng-if="!hasAccess") {{ref.headers[$index] || 'Round '+($index+1)}}
span(
ng-if="hasAccess",
inline-edit="ref.headers[$index]",
inline-edit-placeholder="Round {{$index+1}}",
inline-edit-callback="saveRoundHeader()",
inline-edit-on-blur="save",
inline-edit-btn-edit="&nbsp;<ng-md-icon icon='edit' size='16'></ng-md-icon>",
inline-edit-btn-save="<ng-md-icon icon='check' size='20'></ng-md-icon>",
inline-edit-btn-cancel="<ng-md-icon icon='close' size='20'></ng-md-icon>",
inline-edit-on-click
)

.match-area(layout="row")

Expand Down
2 changes: 1 addition & 1 deletion src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
export default angular.module('openchallenge', [
'ngAria', 'ngAnimate', 'ngMaterial', 'ngMdIcons', 'ngStorage',
'ui.router', 'firebase', 'md.data.table', 'angular-sortable-view',
'ngSanitize'
'ngSanitize', 'angularInlineEdit'
]);
5 changes: 5 additions & 0 deletions src/js/controllers/tournaments/inProgressCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ site.controller('inProgressController', ($scope, $timeout, EnsureLoggedIn, Sideb
window.open(services[service]+$scope.url, '_blank');
};

$scope.saveRoundHeader = () => {
$timeout($scope.save, 0);
};

const determineTemplate = (options) => {
const hash = { singles: 'duel', doubles: 'duel', groupstage: 'groupstage', ffa: 'ffa', masters: 'masters' };
if(!options.type && options.last) return 'duel';
Expand All @@ -70,6 +74,7 @@ site.controller('inProgressController', ($scope, $timeout, EnsureLoggedIn, Sideb

$scope.loadTournament = (ref, makeNew = false) => {
$scope.tournamentName = $scope.ref.name;
$scope.ref.headers = $scope.ref.headers || [];

$scope.bucket = ref.players;

Expand Down
6 changes: 6 additions & 0 deletions src/scss/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@ md-data-table-toolbar > form > input:focus {
color: #fff!important;
}

.ng-inline-edit__input {
font-weight: 500;
border-bottom: 1px dashed #000;
}


$paddings: top bottom left right;

@for $size from 0 to 11 {
Expand Down

0 comments on commit d1416d3

Please sign in to comment.