Show submission date on leaderboard
#1
by openfree - opened
- index.html +19 -11
index.html
CHANGED
|
@@ -545,7 +545,7 @@ const T = {
|
|
| 545 |
entrants:"๋ช
์ฐธ๊ฐ",
|
| 546 |
l_struct:"๋ถ์ ๊ตฌ์กฐ์ (SMILES ๋๋ InChI)", l_name:"ํ์ ID (์ด๋ฆยท์์ยท๋๋ค์)",
|
| 547 |
l_model:"์ฌ์ฉ ๋ชจ๋ธ๋ช
(์ ํ)", l_why:"์ค๊ณ ๊ทผ๊ฑฐ (์ ํ)",
|
| 548 |
-
cols:{rank:"#",cand:"ํ๋ณด",user:"์ ์ถ์",who:"๋ชจ๋ธ",activity:"์ฝํจ",binding:"๊ฒฐํฉ",
|
| 549 |
selectivity:"์ ํ์ฑ",admet:"ADMET",novelty:"์ ๊ท",synthesis:"ํฉ์ฑ",total:"์ด์ "},
|
| 550 |
counts:(a,b)=>`์ ์ถ ${a} ยท ๊ธฐ์ค๋ฌผ์ง ${b}`,
|
| 551 |
empty:"์์ง ์ฑ์ ๋ ์ ์ถ์ด ์์ต๋๋ค.", loading:"๋ถ๋ฌ์ค๋ ์คโฆ",
|
|
@@ -641,7 +641,7 @@ const T = {
|
|
| 641 |
entrants:"entrants",
|
| 642 |
l_struct:"Structure (SMILES or InChI)", l_name:"Display ID (name, affiliation or handle)",
|
| 643 |
l_model:"Model used (optional)", l_why:"Design rationale (optional)",
|
| 644 |
-
cols:{rank:"#",cand:"Candidate",user:"Entrant",who:"Model",activity:"Activity",binding:"Binding",
|
| 645 |
selectivity:"Select.",admet:"ADMET",novelty:"Novelty",synthesis:"Synth.",total:"Total"},
|
| 646 |
counts:(a,b)=>`${a} entries ยท ${b} references`,
|
| 647 |
empty:"No scored entries yet.", loading:"Loadingโฆ",
|
|
@@ -661,13 +661,20 @@ let LANG = (function(){
|
|
| 661 |
})();
|
| 662 |
let LANG_AUTO = true;
|
| 663 |
|
| 664 |
-
const COLS = ["rank","cand","user","who","activity","binding","selectivity","admet","novelty","synthesis","total"];
|
| 665 |
const AX = ["activity","binding","selectivity","admet","novelty","synthesis"];
|
| 666 |
let DATA = null, sortKey = "total", sortDir = -1;
|
| 667 |
|
| 668 |
-
const $ = s => document.querySelector(s);
|
| 669 |
-
const f1 = v => (v==null||v==="") ? "โ" : (+v).toFixed(1);
|
| 670 |
-
const t = () => T[LANG];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 671 |
|
| 672 |
function applyLang(){
|
| 673 |
const d = t();
|
|
@@ -705,8 +712,9 @@ document.querySelectorAll("#langbar button").forEach(b=>b.onclick=()=>setLang(b.
|
|
| 705 |
function sortVal(e, k){
|
| 706 |
if(k==="rank") return e.rank ?? 1e9; // unranked rows sink when sorting by rank
|
| 707 |
if(k==="cand") return String(e.candidate_id||"").toLowerCase();
|
| 708 |
-
if(k==="user") return String(e.hf_user||e.display_name||"").toLowerCase();
|
| 709 |
-
if(k==="who") return String(e.model_name||"").toLowerCase();
|
|
|
|
| 710 |
if(k==="total") return e.total ?? -1;
|
| 711 |
return (e.axes||{})[k] ?? -1;
|
| 712 |
}
|
|
@@ -739,7 +747,7 @@ function render(){
|
|
| 739 |
document.querySelectorAll("#head th").forEach(th=>th.onclick=()=>{
|
| 740 |
const k = th.dataset.k;
|
| 741 |
if(sortKey===k) sortDir = -sortDir;
|
| 742 |
-
else { sortKey = k; sortDir = (k==="rank"||k==="cand"||k==="who") ? 1 : -1; }
|
| 743 |
render();
|
| 744 |
});
|
| 745 |
|
|
@@ -775,11 +783,11 @@ function render(){
|
|
| 775 |
: `#${e.rank}<span class="rkscore">${f1(e.total)}${LANG==="ko"?"์ ":" pts"}</span>`;
|
| 776 |
return `<tr class="${cls}">
|
| 777 |
<td class="rk ${e.rank===1?"top":""}">${rk}</td>
|
| 778 |
-
<td>${id}${tag}</td><td>${user}</td><td>${who}</td>
|
| 779 |
${AX.map(k=>`<td>${f1(a[k])}</td>`).join("")}
|
| 780 |
<td><div class="barwrap"><span class="bar"><i style="width:${Math.max(2,(e.total||0)/max*100)}%"></i></span>
|
| 781 |
<span class="tot">${f1(e.total)}</span></div></td></tr>`;
|
| 782 |
-
}).join("") : `<tr><td colspan="
|
| 783 |
|
| 784 |
wireCopy($("#rows"));
|
| 785 |
wire3D($("#rows"));
|
|
|
|
| 545 |
entrants:"๋ช
์ฐธ๊ฐ",
|
| 546 |
l_struct:"๋ถ์ ๊ตฌ์กฐ์ (SMILES ๋๋ InChI)", l_name:"ํ์ ID (์ด๋ฆยท์์ยท๋๋ค์)",
|
| 547 |
l_model:"์ฌ์ฉ ๋ชจ๋ธ๋ช
(์ ํ)", l_why:"์ค๊ณ ๊ทผ๊ฑฐ (์ ํ)",
|
| 548 |
+
cols:{rank:"#",cand:"ํ๋ณด",user:"์ ์ถ์",who:"๋ชจ๋ธ",date:"์ ์ถ์ผ",activity:"์ฝํจ",binding:"๊ฒฐํฉ",
|
| 549 |
selectivity:"์ ํ์ฑ",admet:"ADMET",novelty:"์ ๊ท",synthesis:"ํฉ์ฑ",total:"์ด์ "},
|
| 550 |
counts:(a,b)=>`์ ์ถ ${a} ยท ๊ธฐ์ค๋ฌผ์ง ${b}`,
|
| 551 |
empty:"์์ง ์ฑ์ ๋ ์ ์ถ์ด ์์ต๋๋ค.", loading:"๋ถ๋ฌ์ค๋ ์คโฆ",
|
|
|
|
| 641 |
entrants:"entrants",
|
| 642 |
l_struct:"Structure (SMILES or InChI)", l_name:"Display ID (name, affiliation or handle)",
|
| 643 |
l_model:"Model used (optional)", l_why:"Design rationale (optional)",
|
| 644 |
+
cols:{rank:"#",cand:"Candidate",user:"Entrant",who:"Model",date:"Submitted",activity:"Activity",binding:"Binding",
|
| 645 |
selectivity:"Select.",admet:"ADMET",novelty:"Novelty",synthesis:"Synth.",total:"Total"},
|
| 646 |
counts:(a,b)=>`${a} entries ยท ${b} references`,
|
| 647 |
empty:"No scored entries yet.", loading:"Loadingโฆ",
|
|
|
|
| 661 |
})();
|
| 662 |
let LANG_AUTO = true;
|
| 663 |
|
| 664 |
+
const COLS = ["rank","cand","user","who","date","activity","binding","selectivity","admet","novelty","synthesis","total"];
|
| 665 |
const AX = ["activity","binding","selectivity","admet","novelty","synthesis"];
|
| 666 |
let DATA = null, sortKey = "total", sortDir = -1;
|
| 667 |
|
| 668 |
+
const $ = s => document.querySelector(s);
|
| 669 |
+
const f1 = v => (v==null||v==="") ? "โ" : (+v).toFixed(1);
|
| 670 |
+
const t = () => T[LANG];
|
| 671 |
+
const submittedDate = e => {
|
| 672 |
+
if(e.is_anchor || !e.submitted_at) return "โ";
|
| 673 |
+
const locale = LANG === "ko" ? "ko-KR" : "en-CA";
|
| 674 |
+
return new Intl.DateTimeFormat(locale, {
|
| 675 |
+
timeZone:"Asia/Seoul", year:"numeric", month:"2-digit", day:"2-digit"
|
| 676 |
+
}).format(new Date(Number(e.submitted_at) * 1000));
|
| 677 |
+
};
|
| 678 |
|
| 679 |
function applyLang(){
|
| 680 |
const d = t();
|
|
|
|
| 712 |
function sortVal(e, k){
|
| 713 |
if(k==="rank") return e.rank ?? 1e9; // unranked rows sink when sorting by rank
|
| 714 |
if(k==="cand") return String(e.candidate_id||"").toLowerCase();
|
| 715 |
+
if(k==="user") return String(e.hf_user||e.display_name||"").toLowerCase();
|
| 716 |
+
if(k==="who") return String(e.model_name||"").toLowerCase();
|
| 717 |
+
if(k==="date") return e.submitted_at ?? 0;
|
| 718 |
if(k==="total") return e.total ?? -1;
|
| 719 |
return (e.axes||{})[k] ?? -1;
|
| 720 |
}
|
|
|
|
| 747 |
document.querySelectorAll("#head th").forEach(th=>th.onclick=()=>{
|
| 748 |
const k = th.dataset.k;
|
| 749 |
if(sortKey===k) sortDir = -sortDir;
|
| 750 |
+
else { sortKey = k; sortDir = (k==="rank"||k==="cand"||k==="who") ? 1 : -1; }
|
| 751 |
render();
|
| 752 |
});
|
| 753 |
|
|
|
|
| 783 |
: `#${e.rank}<span class="rkscore">${f1(e.total)}${LANG==="ko"?"์ ":" pts"}</span>`;
|
| 784 |
return `<tr class="${cls}">
|
| 785 |
<td class="rk ${e.rank===1?"top":""}">${rk}</td>
|
| 786 |
+
<td>${id}${tag}</td><td>${user}</td><td>${who}</td><td>${submittedDate(e)}</td>
|
| 787 |
${AX.map(k=>`<td>${f1(a[k])}</td>`).join("")}
|
| 788 |
<td><div class="barwrap"><span class="bar"><i style="width:${Math.max(2,(e.total||0)/max*100)}%"></i></span>
|
| 789 |
<span class="tot">${f1(e.total)}</span></div></td></tr>`;
|
| 790 |
+
}).join("") : `<tr><td colspan="12" class="who">${d.empty}</td></tr>`;
|
| 791 |
|
| 792 |
wireCopy($("#rows"));
|
| 793 |
wire3D($("#rows"));
|