Skip to content

Commit 4ab438f

Browse files
niklaciveluca93
authored andcommitted
Ranking: add user id column
1 parent 2b58bac commit 4ab438f

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

cmsranking/static/Ranking.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ abbr {
385385
width: 48px;
386386
}
387387

388+
#Scoreboard_cols col.user_id {
389+
width: 48px;
390+
}
391+
388392
#Scoreboard_cols col.team {
389393
/* This is the minimum width needed to contain a flag */
390394
width: 42px;
@@ -430,6 +434,7 @@ abbr {
430434
text-align: center;
431435
}
432436

437+
#Scoreboard_body tr td.user_id,
433438
#Scoreboard_body tr td.f_name,
434439
#Scoreboard_body tr td.l_name {
435440
text-align: left;
@@ -447,13 +452,15 @@ abbr {
447452
cursor: pointer;
448453
}
449454

455+
#Scoreboard_body tr:hover td.user_id,
450456
#Scoreboard_body tr:hover td.f_name,
451457
#Scoreboard_body tr:hover td.l_name,
452458
#Scoreboard_body tr:hover td.team {
453459
background-color: rgba(200,200,200,0.35);
454460
border-radius: 5px;
455461
}
456462

463+
#Scoreboard_body tr.selected td.user_id,
457464
#Scoreboard_body tr.selected td.f_name,
458465
#Scoreboard_body tr.selected td.l_name {
459466
font-weight: bold;

cmsranking/static/Scoreboard.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ var Scoreboard = new function () {
9494
});
9595

9696
// Create callbacks for UserPanel
97-
self.tbody_el.on("click", "td.f_name, td.l_name", function () {
97+
self.tbody_el.on("click", "td.f_name, td.l_name, td.user_id", function () {
9898
UserDetail.show($(this).parent().data("user"));
9999
});
100100

@@ -155,6 +155,7 @@ var Scoreboard = new function () {
155155
<col class=\"rank\"/> \
156156
<col class=\"f_name\"/> <col/><col/><col/><col/><col/><col/><col/><col/><col/> \
157157
<col class=\"l_name\"/> <col/><col/><col/><col/><col/><col/><col/><col/><col/> \
158+
<col class=\"user_id\"/> \
158159
<col class=\"team\"/>";
159160

160161
var contests = DataStore.contest_list;
@@ -190,6 +191,7 @@ var Scoreboard = new function () {
190191
<th class=\"rank\">Rank</th> \
191192
<th colspan=\"10\" class=\"f_name\">First Name</th> \
192193
<th colspan=\"10\" class=\"l_name\">Last Name</th> \
194+
<th class=\"user_id\">ID</th> \
193195
<th class=\"team\">Team</th>";
194196

195197
var contests = DataStore.contest_list;
@@ -236,7 +238,8 @@ var Scoreboard = new function () {
236238
<td class=\"sel\"></td> \
237239
<td class=\"rank\">" + user["rank"] + "</td> \
238240
<td colspan=\"10\" class=\"f_name\">" + escapeHTML(user["f_name"]) + "</td> \
239-
<td colspan=\"10\" class=\"l_name\">" + escapeHTML(user["l_name"]) + "</td>";
241+
<td colspan=\"10\" class=\"l_name\">" + escapeHTML(user["l_name"]) + "</td> \
242+
<td class=\"user_id\">" + user["key"] + "</td>";
240243

241244
if (user['team']) {
242245
result += " \

0 commit comments

Comments
 (0)