fix tournament UI bugs

This commit is contained in:
Thibault Duplessis 2015-01-06 02:22:58 +01:00
parent c1f75703d1
commit a223d96a69
5 changed files with 8 additions and 6 deletions

View file

@ -131,6 +131,7 @@ ol.scheduled_tournaments a:hover {
width: 0;
background: #759900;
opacity: 0.5;
transition: width 0.5s;
}
#tournament button.right {
float: right;

View file

@ -18,7 +18,7 @@ module.exports = function(ctrl) {
class: pov.isMyTurn ? 'my_turn' : ''
}, [
m('span', {
class: 'mini_board mini_board_' + pov.id + ' parse_fen is2d',
class: 'mini_board live_' + pov.id + ' parse_fen is2d',
'data-color': pov.color,
'data-fen': pov.fen,
'data-lastmove': pov.lastMove,

View file

@ -6,7 +6,7 @@ module.exports = {
},
containsMe: function(ctrl) {
return ctrl.userId && ctrl.data.players.filter(function(p) {
return p.id === ctrl.userId;
return p.id === ctrl.userId && !p.withdraw;
}).length > 0;
},
myCurrentPairing: function(ctrl) {

View file

@ -8,7 +8,7 @@ function miniGame(game) {
m('a', {
key: game.id,
href: '/' + game.id,
class: 'mini_board mini_board_' + game.id + ' live live_' + game.id + ' parse_fen is2d',
class: 'mini_board live_' + game.id + ' parse_fen is2d',
'data-color': game.color,
'data-fen': game.fen,
'data-lastmove': game.lastMove,
@ -24,10 +24,10 @@ function miniGame(game) {
game.user1.rating
]),
m('div.right', [
game.user1.name,
game.user2.name,
m('br'),
game.user1.rating,
game.user1.title ? ' ' + game.user1.title : ''
game.user2.rating,
game.user2.title ? ' ' + game.user2.title : ''
])
])
]);

View file

@ -13,6 +13,7 @@ function tourAction(action, ctrl) {
url: '/tournament/' + ctrl.data.id + '/' + action,
config: xhrConfig
}).then(null, function() {
// when the tournament no longer exists
location.reload();
});
}