Lehreransicht: Farmer-Spalten in "Aktuell" uebersetzt statt roher Keys
LIVE_PRIMARY_FIELDS um farmer-Eintrag ergaenzt: Jahr /10, Markt, Konto (rot bei minus), Trefferquote (Balken), Sorten /10, Laender, Felder, Versuche, CO2 kg, Krankheiten (rot bei >0). Redundante/interne Keys (phase, market-id, progressPct, simId, timestamp) fallen weg. Vorher fiel die Tabelle auf rohe englische Keys. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -635,6 +635,29 @@ function _liveBar(val, min, max, goodWhen) {
|
||||
}
|
||||
|
||||
var LIVE_PRIMARY_FIELDS = {
|
||||
farmer: [
|
||||
{k:'year', label:'Jahr', fmt:function(v){ return (v||0) + '<span style="color:#8a8a8a"> / 10</span>'; }},
|
||||
{k:'market_de', label:'Markt', align:'left', fmt:function(v){ return v ? '🌍 '+esc(v) : '<span style="color:#8a8a8a">—</span>'; }},
|
||||
{k:'cash', label:'Konto', fmt:function(v){
|
||||
if (v == null) return '<span style="color:#9a9a9a">—</span>';
|
||||
var color = v < 0 ? '#c0392b' : '#5a8a5e';
|
||||
return '<span style="color:'+color+';font-weight:700">'+Number(v).toLocaleString('de-AT')+' €</span>';
|
||||
}},
|
||||
{k:'hit_rate', label:'Trefferquote', fmt:function(v){ return _liveBar(v, 0, 100, 'high'); }},
|
||||
{k:'crops_used', label:'Sorten', fmt:function(v){ return (v||0) + '<span style="color:#8a8a8a"> / 10</span>'; }},
|
||||
{k:'countries', label:'Länder', fmt:function(v){ return (v!=null? v : 0); }},
|
||||
{k:'fields', label:'Felder', fmt:function(v){ return (v!=null? v : 0); }},
|
||||
{k:'attempts', label:'Versuche',fmt:function(v){ return (v!=null? v : 0); }},
|
||||
{k:'co2_kg', label:'CO₂', unit:'kg', fmt:function(v){
|
||||
if (v == null) return '<span style="color:#9a9a9a">—</span>';
|
||||
return '<span style="font-variant-numeric:tabular-nums">'+Number(Math.round(v)).toLocaleString('de-AT')+'</span>';
|
||||
}},
|
||||
{k:'diseases', label:'Krankheiten', align:'center', fmt:function(v){
|
||||
if (v == null) return '<span style="color:#9a9a9a">—</span>';
|
||||
var color = (v > 0) ? '#c07a6b' : '#8a8a8a';
|
||||
return '<span style="color:'+color+';font-weight:'+(v>0?'700':'400')+'">'+v+'</span>';
|
||||
}},
|
||||
],
|
||||
'tourismusregion': [
|
||||
{k:'mapId', label:'Karte', align:'left', fmt:function(v){
|
||||
return {talschleife:'🏞 Talschleife', seerunde:'🚣 Seerunde', serpentinen:'⛰ Serpentinen',
|
||||
|
||||
Reference in New Issue
Block a user