fix tournament UI bugs
This commit is contained in:
parent
c1f75703d1
commit
a223d96a69
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 : ''
|
||||
])
|
||||
])
|
||||
]);
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue