aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/admin/handler.go1
-rw-r--r--backend/admin/templates/online_qualifying_ranking.html9
-rw-r--r--backend/db/query.sql.go3
-rw-r--r--backend/query.sql1
4 files changed, 11 insertions, 3 deletions
diff --git a/backend/admin/handler.go b/backend/admin/handler.go
index 161f85c..c0ddd43 100644
--- a/backend/admin/handler.go
+++ b/backend/admin/handler.go
@@ -413,6 +413,7 @@ func (h *Handler) getOnlineQualifyingRanking(c echo.Context) error {
entries[i] = echo.Map{
"Rank": i + 1,
"Username": r.Username,
+ "UserLabel": r.UserLabel,
"Score1": r.CodeSize1,
"Score2": r.CodeSize2,
"TotalScore": r.TotalCodeSize,
diff --git a/backend/admin/templates/online_qualifying_ranking.html b/backend/admin/templates/online_qualifying_ranking.html
index 3b00046..039687e 100644
--- a/backend/admin/templates/online_qualifying_ranking.html
+++ b/backend/admin/templates/online_qualifying_ranking.html
@@ -10,15 +10,18 @@
<tr>
<th scope="col">順位</th>
<th scope="col">プレイヤー</th>
- <th scope="col">スコア</th>
- <th scope="col">提出時刻</th>
+ <th scope="col">スコア1</th>
+ <th scope="col">スコア2</th>
+ <th scope="col">合計スコア</th>
+ <th scope="col">提出時刻1</th>
+ <th scope="col">提出時刻2</th>
</tr>
</thead>
<tbody>
{{ range .Entries }}
<tr>
<td>{{ .Rank }}</td>
- <td>{{ .Username }}</td>
+ <td>{{ .Username }}{{ if .UserLabel }} ({{ .UserLabel }}){{ end }}</td>
<td>{{ .Score1 }}</td>
<td>{{ .Score2 }}</td>
<td>{{ .TotalScore }}</td>
diff --git a/backend/db/query.sql.go b/backend/db/query.sql.go
index a478b69..abf2631 100644
--- a/backend/db/query.sql.go
+++ b/backend/db/query.sql.go
@@ -276,6 +276,7 @@ func (q *Queries) GetLatestStatesOfMainPlayers(ctx context.Context, gameID int32
const getQualifyingRanking = `-- name: GetQualifyingRanking :many
SELECT
u.username AS username,
+ u.label AS user_label,
s1.code_size AS code_size_1,
s2.code_size AS code_size_2,
(s1.code_size + s2.code_size) AS total_code_size,
@@ -297,6 +298,7 @@ type GetQualifyingRankingParams struct {
type GetQualifyingRankingRow struct {
Username string
+ UserLabel *string
CodeSize1 int32
CodeSize2 int32
TotalCodeSize int32
@@ -315,6 +317,7 @@ func (q *Queries) GetQualifyingRanking(ctx context.Context, arg GetQualifyingRan
var i GetQualifyingRankingRow
if err := rows.Scan(
&i.Username,
+ &i.UserLabel,
&i.CodeSize1,
&i.CodeSize2,
&i.TotalCodeSize,
diff --git a/backend/query.sql b/backend/query.sql
index 4707eff..c052718 100644
--- a/backend/query.sql
+++ b/backend/query.sql
@@ -135,6 +135,7 @@ ORDER BY submissions.code_size ASC, submissions.created_at ASC;
-- name: GetQualifyingRanking :many
SELECT
u.username AS username,
+ u.label AS user_label,
s1.code_size AS code_size_1,
s2.code_size AS code_size_2,
(s1.code_size + s2.code_size) AS total_code_size,