From 5a645d712fb110734e690daeff96ec7f1d143202 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 10 Jan 2022 23:16:34 +0700 Subject: [PATCH] Fix bug friend + virtual --- templates/contest/ranking.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/templates/contest/ranking.html b/templates/contest/ranking.html index a4227a8..b856755 100644 --- a/templates/contest/ranking.html +++ b/templates/contest/ranking.html @@ -330,8 +330,18 @@ function add_initial_friend_rank() { var usernames = $('.user-name .user a').map(function() {return this.text}).get(); + + var is_virtual = []; + $('.user-name').each(function() { + if($(this).children('sup').length) { + is_virtual.push(1); + } + else is_virtual.push(0); + }); + console.log(is_virtual); + $('.rank-td').each(function(i) { - this.innerHTML += ' (' + window.user_rank[usernames[i]] + ')'; + if (!is_virtual[i]) this.innerHTML += ' (' + window.user_rank[usernames[i]] + ')'; }); }