From a9742bdf1a6d00e38acf6ba0254dfb3fc09f2717 Mon Sep 17 00:00:00 2001 From: Ashar Fuadi Date: Thu, 19 May 2022 21:24:07 +0700 Subject: [PATCH] Ranking: Replace team flags with usernames --- cmsranking/static/Ranking.css | 2 ++ cmsranking/static/Scoreboard.js | 9 ++++----- cmsranking/static/TeamSearch.js | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cmsranking/static/Ranking.css b/cmsranking/static/Ranking.css index 6e6a411c4..02d708540 100644 --- a/cmsranking/static/Ranking.css +++ b/cmsranking/static/Ranking.css @@ -926,6 +926,8 @@ abbr { #UserDetail_flag { bottom: 0; + max-width: 100px; + display: none; } #UserDetail_face { diff --git a/cmsranking/static/Scoreboard.js b/cmsranking/static/Scoreboard.js index 49cf0ba25..8b003af04 100644 --- a/cmsranking/static/Scoreboard.js +++ b/cmsranking/static/Scoreboard.js @@ -240,10 +240,10 @@ var Scoreboard = new function () { if (user['team']) { result += " \ - "; + " + user['key'] + ""; } else { result += " \ - "; + " + user['key'] + ""; } var contests = DataStore.contest_list; @@ -406,10 +406,9 @@ var Scoreboard = new function () { $row.children("td.f_name").text(user["f_name"]); $row.children("td.l_name").text(user["l_name"]); + $row.children(".team").text(user['key']); if (user["team"]) { - $row.children(".team").html(""); - } else { - $row.children(".team").text(""); + $row.children(".team").attr("title", DataStore.teams[user["team"]]["name"]); } }; diff --git a/cmsranking/static/TeamSearch.js b/cmsranking/static/TeamSearch.js index 5f71529ad..3161b919e 100644 --- a/cmsranking/static/TeamSearch.js +++ b/cmsranking/static/TeamSearch.js @@ -120,7 +120,7 @@ var TeamSearch = new function () {
\ \
"; } @@ -186,7 +186,7 @@ var TeamSearch = new function () { // (We would need another query to get the complementary set). for (var t_id in DataStore.teams) { var team = DataStore.teams[t_id]; - if (team["name"].toLowerCase().indexOf(search_text.toLowerCase()) == -1) { + if (team["name"].toLowerCase().indexOf(search_text.toLowerCase()) == -1 && t_id.toLowerCase().indexOf(search_text.toLowerCase()) == -1) { $("div.item[data-team=" + t_id + "]", self.body).addClass("hidden"); } else { $("div.item[data-team=" + t_id + "]", self.body).removeClass("hidden");