/
score.coffee
63 lines (51 loc) · 2.5 KB
/
score.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
###
# Copyright 2015-2017 ppy Pty. Ltd.
#
# This file is part of osu!web. osu!web is distributed with the hope of
# attracting more community contributions to the core ecosystem of osu!.
#
# osu!web is free software: you can redistribute it and/or modify
# it under the terms of the Affero GNU General Public License version 3
# as published by the Free Software Foundation.
#
# osu!web is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with osu!web. If not, see <http://www.gnu.org/licenses/>.
###
{div, a} = ReactDOMFactories
el = React.createElement
BeatmapsetPage.Score = (props) ->
hits = Hits.generate score: props.score, playmode: props.playmode
div className: 'beatmapset-score',
div className: 'beatmapset-score__element beatmapset-score__element--position',
"##{props.position}"
div className: 'beatmapset-score__element beatmapset-score__element--flag',
if props.score.user.country_code
el FlagCountry,
country: props.countries[props.score.user.country_code]
classModifiers: ['scoreboard']
div className: 'beatmapset-score__element beatmapset-score__element--player',
a
href: laroute.route 'users.show', user: props.score.user.id
props.score.user.username
div className: 'beatmapset-score__element beatmapset-score__element--mods',
el Mods,
mods: props.score.mods
modifiers: ['small', 'reversed']
div className: 'beatmapset-score__element beatmapset-score__element--rank',
div className: "badge-rank badge-rank--#{props.score.rank}"
div className: 'beatmapset-score__stat beatmapset-score__stat--score',
props.score.score.toLocaleString()
div className: 'beatmapset-score__stat beatmapset-score__stat--accuracy hidden-xs',
"#{_.round props.score.accuracy * 100, 2}%"
div className: 'beatmapset-score__stat beatmapset-score__stat--combo hidden-xs',
"#{props.score.max_combo.toLocaleString()}x"
div className: 'beatmapset-score__stat beatmapset-score__stat--hits hidden-xs',
hits.values
div className: 'beatmapset-score__stat beatmapset-score__stat--miss hidden-xs',
if props.score.statistics.count_miss > 0
osu.trans 'beatmapsets.show.scoreboard.miss_count',
count: props.score.statistics.count_miss