Spaces:
Running
Running
fixed-causes list shows all causes.json entries (67), not only cause-keyed ones
Browse files- challenge.html +1 -1
- rt_challenge.py +11 -1
challenge.html
CHANGED
|
@@ -291,7 +291,7 @@ function board(){const s=SEA[CUR],t=s[L],st=state(CUR),rows=(DATA.seasons||{})[C
|
|
| 291 |
if(st!=='open'){cl.style.display='block';cl.textContent=st==='soon'?T('Submissions for this season open when it starts.','μ΄ μμ¦μ κ°λ§νλ©΄ μ μΆν μ μμ΅λλ€.'):T('This season is closed.','μ΄ μμ¦μ μ’
λ£λμμ΅λλ€.');document.getElementById('f').style.display='none';document.getElementById('needlogin').style.display='none'}
|
| 292 |
else{cl.style.display='none';document.getElementById('needlogin').style.display=ME?'none':'block';document.getElementById('f').style.display=ME?'block':'none'}}
|
| 293 |
function causes(){const cs=DATA.causes||[];document.getElementById('st_fix').textContent=cs.length;
|
| 294 |
-
document.getElementById('causes').innerHTML=cs.length?'<table class="ctab"><thead><tr><th>#</th><th>'+T('Cause','μμΈ')+'</th><th>'+T('Season','μμ¦')+'</th><th>'+T('Found by','λ°κ²¬μ')+'</th><th>'+T('Status','μν')+'</th></tr></thead><tbody>'+cs.map((c,i)=>'<tr><td>'+(i+1)+'</td><td><b>'+esc(L==='ko'?c.ko:c.en)+'</b></td><td>'+esc((SEA[c.season]||SEA.s1)[L][0])+'</td><td>'+esc(c.finder)+'</td><td><span class="fix">'+T('Fixed','μμ μλ£')+(c.fixed_at?' Β· '+esc(c.fixed_at.slice(5)):'')+'</span></td></tr>').join('')+'</tbody></table><p class="mut" style="font-size:12px;margin:10px 0 0">'+T('Shell check families accepted so far: ','μ§κΈκΉμ§ μΈμ λ μ
Έ νμ κ³μ΄: ')+(DATA.families||0)+'</p>':'<div class="empty">'+T('No accepted causes yet.','μμ§ μΈμ λ μμΈμ΄ μμ΅λλ€.')+'</div>'}
|
| 295 |
function hallf(){const fmt=t=>t?new Date(t*1000).toLocaleDateString(L==='ko'?'ko-KR':'en-US',{year:'numeric',month:'short',day:'numeric'}):'';
|
| 296 |
let h='';
|
| 297 |
for(const k of Object.keys(SEA)){const t=SEA[k][L],w=DATA.windows[k]||{},st=state(k),rows=((DATA.seasons||{})[k]||[]).slice(0,10);
|
|
|
|
| 291 |
if(st!=='open'){cl.style.display='block';cl.textContent=st==='soon'?T('Submissions for this season open when it starts.','μ΄ μμ¦μ κ°λ§νλ©΄ μ μΆν μ μμ΅λλ€.'):T('This season is closed.','μ΄ μμ¦μ μ’
λ£λμμ΅λλ€.');document.getElementById('f').style.display='none';document.getElementById('needlogin').style.display='none'}
|
| 292 |
else{cl.style.display='none';document.getElementById('needlogin').style.display=ME?'none':'block';document.getElementById('f').style.display=ME?'block':'none'}}
|
| 293 |
function causes(){const cs=DATA.causes||[];document.getElementById('st_fix').textContent=cs.length;
|
| 294 |
+
document.getElementById('causes').innerHTML=cs.length?'<table class="ctab"><thead><tr><th>#</th><th>'+T('Cause','μμΈ')+'</th><th>'+T('Season','μμ¦')+'</th><th>'+T('Found by','λ°κ²¬μ')+'</th><th>'+T('Status','μν')+'</th></tr></thead><tbody>'+cs.map((c,i)=>'<tr><td>'+(i+1)+'</td><td><b>'+esc(L==='ko'?c.ko:c.en)+'</b></td><td>'+(c.season?esc((SEA[c.season]||SEA.s1)[L][0]):'Β·')+'</td><td>'+esc(c.finder||'Β·')+'</td><td><span class="fix">'+T('Fixed','μμ μλ£')+(c.fixed_at?' Β· '+esc(c.fixed_at.slice(5)):'')+'</span></td></tr>').join('')+'</tbody></table><p class="mut" style="font-size:12px;margin:10px 0 0">'+T('Shell check families accepted so far: ','μ§κΈκΉμ§ μΈμ λ μ
Έ νμ κ³μ΄: ')+(DATA.families||0)+'</p>':'<div class="empty">'+T('No accepted causes yet.','μμ§ μΈμ λ μμΈμ΄ μμ΅λλ€.')+'</div>'}
|
| 295 |
function hallf(){const fmt=t=>t?new Date(t*1000).toLocaleDateString(L==='ko'?'ko-KR':'en-US',{year:'numeric',month:'short',day:'numeric'}):'';
|
| 296 |
let h='';
|
| 297 |
for(const k of Object.keys(SEA)){const t=SEA[k][L],w=DATA.windows[k]||{},st=state(k),rows=((DATA.seasons||{})[k]||[]).slice(0,10);
|
rt_challenge.py
CHANGED
|
@@ -273,7 +273,17 @@ def leaderboard():
|
|
| 273 |
hall[c["finder"]]["causes"] += 1
|
| 274 |
for sea, (_at, u) in first.items():
|
| 275 |
hall[u]["first"].append(sea)
|
| 276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
"hall": sorted(hall.values(), key=lambda h: (-h["causes"], -(h["S"] + h["A"]), -h["B"], h["user"].lower())),
|
| 278 |
"families": sum(h["B"] for h in hall.values()), "submissions": n_subs}
|
| 279 |
_cache.update(t=time.time(), board=board, extra=extra)
|
|
|
|
| 273 |
hall[c["finder"]]["causes"] += 1
|
| 274 |
for sea, (_at, u) in first.items():
|
| 275 |
hall[u]["first"].append(sea)
|
| 276 |
+
# The "fixed causes" list must show every cause recorded in causes.json, not only the ones whose
|
| 277 |
+
# judgement carried a cause key. Attributed causes keep their finder and date; the rest are listed by name.
|
| 278 |
+
if names:
|
| 279 |
+
all_causes = []
|
| 280 |
+
for k, nm in names.items():
|
| 281 |
+
nm = nm if isinstance(nm, dict) else {}
|
| 282 |
+
all_causes.append(causes.get(k) or {"key": k, "en": nm.get("en", k), "ko": nm.get("ko", k),
|
| 283 |
+
"season": "", "finder": "", "at": "", "fixed_at": ""})
|
| 284 |
+
else:
|
| 285 |
+
all_causes = list(causes.values())
|
| 286 |
+
extra = {"causes": sorted(all_causes, key=lambda c: (c["at"] == "", c["at"], c["key"])),
|
| 287 |
"hall": sorted(hall.values(), key=lambda h: (-h["causes"], -(h["S"] + h["A"]), -h["B"], h["user"].lower())),
|
| 288 |
"families": sum(h["B"] for h in hall.values()), "submissions": n_subs}
|
| 289 |
_cache.update(t=time.time(), board=board, extra=extra)
|