Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmsranking/static/DataStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,10 @@ var DataStore = new function () {
self.update_network_status(0);
});

self.team_create.add(function() {
$(document.body).removeClass("teams-hidden");
});


////// Sorted contest list

Expand Down
8 changes: 8 additions & 0 deletions cmsranking/static/Ranking.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ abbr {
outline: 0;
}

.teams-hidden #TeamSearch_input {
display: none;
}

#TeamSearch_bg {
display: none;
position: absolute;
Expand Down Expand Up @@ -404,6 +408,10 @@ abbr {
width: calc(2em + 20px);
}

.teams-hidden #Scoreboard .team {
display: none;
}

#Scoreboard_head tr {
height: 2.5em;
}
Expand Down
2 changes: 1 addition & 1 deletion cmsranking/static/Ranking.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<script src="Ranking.js"></script>
<title>Ranking</title>
</head>
<body>
<body class="teams-hidden">
<div id="OuterFrame">
<div id="LogoPanel">
<img src="logo" alt="Logo" />
Expand Down
16 changes: 12 additions & 4 deletions cmsranking/static/Scoreboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ var Scoreboard = new function () {
<col class=\"score contest\" data-contest=\"" + c_id + "\" data-sort_key=\"c_" + c_id + "\"/> <col/><col/><col/>";
}

result += " \
self.show_global_score = contests.length > 1;

if(self.show_global_score) {
result += " \
<col class=\"score global\" data-sort_key=\"global\"/> <col/><col/><col/><col/>";
}

return result;
};
Expand Down Expand Up @@ -212,9 +216,11 @@ var Scoreboard = new function () {
<th colspan=\"4\" class=\"score contest\" data-contest=\"" + c_id + "\" data-sort_key=\"c_" + c_id + "\"><abbr title=\"" + escapeHTML(contest["name"]) + "\">" + escapeHTML(contest["name"]) + "</abbr></th>";
}

result += " \
if(self.show_global_score) {
result += " \
<th colspan=\"5\" class=\"score global\" data-sort_key=\"global\">Global</th> \
</tr>";
}

return result;
};
Expand Down Expand Up @@ -269,10 +275,12 @@ var Scoreboard = new function () {
<td colspan=\"4\" class=\"score contest " + score_class + "\" data-contest=\"" + c_id + "\" data-sort_key=\"c_" + c_id + "\">" + round_to_str(user["c_" + c_id], contest["score_precision"]) + "</td>";
}

var score_class = self.get_score_class(user["global"], DataStore.global_max_score);
result += " \
if(self.show_global_score) {
var score_class = self.get_score_class(user["global"], DataStore.global_max_score);
result += " \
<td colspan=\"5\" class=\"score global " + score_class + "\" data-sort_key=\"global\">" + round_to_str(user["global"], DataStore.global_score_precision) + "</td> \
</tr>";
}

return result;
};
Expand Down