swiss/tour UI tweaks
parent
2709217eb0
commit
22ce418a6e
|
@ -51,16 +51,13 @@ export const ratio2percent = (r: number) => Math.round(100 * r) + '%';
|
|||
export const userName = (u: LightUser) => u.title ? [h('span.title', u.title), ' ' + u.name] : [u.name];
|
||||
|
||||
export function player(p: Player, asLink: boolean, withRating: boolean) {
|
||||
|
||||
const fullName = userName(p.user);
|
||||
|
||||
return h('a.ulpt.user-link' + (((p.user.title || '') + p.user.name).length > 15 ? '.long' : ''), {
|
||||
attrs: asLink ? { href: '/@/' + p.user.name } : { 'data-href': '/@/' + p.user.name },
|
||||
hook: {
|
||||
destroy: vnode => $.powerTip.destroy(vnode.elm as HTMLElement)
|
||||
}
|
||||
}, [
|
||||
h('span.name', fullName),
|
||||
h('span.name', userName(p.user)),
|
||||
withRating ? h('span.rating', ' ' + p.rating + (p.provisional ? '?' : '')) : null
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -55,10 +55,7 @@ export function playerName(p) {
|
|||
}
|
||||
|
||||
export function player(p, asLink: boolean, withRating: boolean, defender: boolean = false, leader: boolean = false) {
|
||||
|
||||
const fullName = playerName(p);
|
||||
|
||||
return h('a.ulpt.user-link' + (fullName.length > 15 ? '.long' : ''), {
|
||||
return h('a.ulpt.user-link' + (((p.user.title || '') + p.user.name).length > 15 ? '.long' : ''), {
|
||||
attrs: asLink ? { href: '/@/' + p.name } : { 'data-href': '/@/' + p.name },
|
||||
hook: {
|
||||
destroy: vnode => $.powerTip.destroy(vnode.elm as HTMLElement)
|
||||
|
@ -68,7 +65,7 @@ export function player(p, asLink: boolean, withRating: boolean, defender: boolea
|
|||
'span.name' + (defender ? '.defender' : (leader ? '.leader' : '')),
|
||||
defender ? { attrs: dataIcon('5') } : (
|
||||
leader ? { attrs: dataIcon('8') } : {}
|
||||
), fullName),
|
||||
), playerName(p)),
|
||||
withRating ? h('span.rating', ' ' + p.rating + (p.provisional ? '?' : '')) : null
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue