diff --git a/modules/user.js b/modules/user.js index 72ee33d..287ffc9 100644 --- a/modules/user.js +++ b/modules/user.js @@ -109,15 +109,14 @@ app.get('/user/:id', async (req, res) => { const ratingHistoryValues = await RatingHistory.query(null, { user_id: user.id }, [['rating_calculation_id', 'asc']]); const ratingHistories = [{ - name: "初始积分", + contestName: "初始积分", value: syzoj.config.default.user.rating, delta: null, rank: null }]; - ratingHistories.reverse(); for (const history of ratingHistoryValues) { - const contest = await Contest.fromId((await RatingCalculation.fromID(history.rating_calculation_id)).contest_id); + const contest = await Contest.fromID((await RatingCalculation.fromID(history.rating_calculation_id)).contest_id); ratingHistories.push({ contestName: contest.title, value: history.rating_after, @@ -126,6 +125,7 @@ app.get('/user/:id', async (req, res) => { participants: await ContestPlayer.count({ contest_id: contest.id }) }); } + ratingHistories.reverse(); res.render('user', { show_user: user, diff --git a/static/style.css b/static/style.css index c8ece35..f8a5cb8 100644 --- a/static/style.css +++ b/static/style.css @@ -499,6 +499,14 @@ body > .ui.page.dimmer { text-shadow: 0 0 0.1px; } +.rating_up { + color: #dd4b39; +} + +.rating_down { + color: #3d9400; +} + /* code tag */ :not(pre) > code { background-color: rgba(0, 0, 0, 0.08); diff --git a/views/user.ejs b/views/user.ejs index 9bd5455..f5bc718 100644 --- a/views/user.ejs +++ b/views/user.ejs @@ -137,7 +137,7 @@