From ace7eb11110b56931e4a60c9d48a4913a6f98fbe Mon Sep 17 00:00:00 2001
From: TonyFord <tonyford@strategy-investor.de>
Date: Tue, 24 May 2022 21:16:51 +0200
Subject: [PATCH] Anzeige Titelgewinne und Finalteilnahmen in der Tabelle

---
 html/_layouts/default.php   |  6 +++++-
 html/assets/css/custom.scss | 21 +++++++++++++++++----
 html/assets/js/script.js    |  9 +++++----
 3 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/html/_layouts/default.php b/html/_layouts/default.php
index b53340b..0cf88d9 100644
--- a/html/_layouts/default.php
+++ b/html/_layouts/default.php
@@ -189,7 +189,11 @@ if( !empty($csv) ){
           <th>Pl.</th>
           <th>Sp.</th>
           <th>Team</th>
-          <th>S/U/N</th>
+          <th><i class="fas fa-crown" title="Titelgewinne"></i></th>
+          <th><i class="fas fa-star" title="Finalteilnahmen"></i></th>
+          <th title="Siege">S</th>
+          <th title="Unentschieden">U</th>
+          <th title="Niederlagen">N</th>
           <th>Hist.</th>
           <th>Tore</th>
           <th>Dif</th>
diff --git a/html/assets/css/custom.scss b/html/assets/css/custom.scss
index 09e2285..694fe37 100644
--- a/html/assets/css/custom.scss
+++ b/html/assets/css/custom.scss
@@ -216,11 +216,22 @@ tr.stats {
         text-align: right;
         font-weight: bold;
       }
-      &:nth-child(1) { width: 30px; text-align: right; }
-      &:nth-child(2) { width: 30px; text-align: right; }
+      &:nth-child(1) { width: 25px; text-align: right; }
+      &:nth-child(2) { width: 25px; text-align: right; }
       &:nth-child(3) { width: 220px; }
-      &:nth-child(4) { width: 50px; }
-      &:nth-child(5) { width: 50px; }
+      &:nth-child(4),
+      &:nth-child(5),
+      &:nth-child(6),
+      &:nth-child(7),
+      &:nth-child(8){ width: 15px; text-align: center; }
+      &:nth-child(9),
+      &:nth-child(10),
+      &:nth-child(11){ width: 50px; }
+      &:nth-child(5){ width: 30px; padding-right: 20px; }
+    }
+
+    th {
+      .fa-crown, .fa-star { font-size: 0.9em; }
     }
   }
 }
@@ -323,3 +334,5 @@ td.n { color: firebrick; }
     }
   }
 }
+
+.fa-crown { color: goldenrod; }
diff --git a/html/assets/js/script.js b/html/assets/js/script.js
index 5df1be9..65fddb6 100644
--- a/html/assets/js/script.js
+++ b/html/assets/js/script.js
@@ -429,10 +429,11 @@ function calculatePunktestand(saison,runde,show=true){
       if( t.length == 0 ) t.push(0);
       tmp+='<td>'+t.reduce( (a,b) => a+b )+'</td>';
       tmp+='<td><img class="flags" src="./images/flags/'+(( v.flag ) ? v.flag : v.nt.toLowerCase())+'.svg"> <a href="javascript:calculateTeam('+((saison == 0) ? SAISON_NOW : saison)+',\''+v.nt+'\')">'+v.name.replace(/\(NL\)/g,'<sup>'+v.nt.toUpperCase()+'</sup></a>')+' <a href="'+v.link+'" target="ultrasoccer"><i class="fas fa-link"></i></a></td>';
-      tmp+='<td>'+
-      v[saison].Tr.map( (a) => ( ( a == 'S') ? 1 : 0 ) ).reduce( (a,b) => a+b )+'/'+
-      v[saison].Tr.map( (a) => ( ( a == 'U') ? 1 : 0 ) ).reduce( (a,b) => a+b )+'/'+
-      v[saison].Tr.map( (a) => ( ( a == 'N') ? 1 : 0 ) ).reduce( (a,b) => a+b )+'</td>';
+      tmp+='<td>'+ERGEBNISSE.filter((a) => ( a.runde=='F' && ( parseInt(a.TH) > parseInt(a.TA) && a.H == v.nt.toLowerCase() || parseInt(a.TH) < parseInt(a.TA) && a.A == v.nt.toLowerCase() ) ) ).length+'</td>';
+      tmp+='<td>'+ERGEBNISSE.filter((a) => ( a.runde=='F' && ( a.H == v.nt.toLowerCase() || a.A == v.nt.toLowerCase() ) ) ).length+'</td>';
+      tmp+='<td>'+v[saison].Tr.map( (a) => ( ( a == 'S') ? 1 : 0 ) ).reduce( (a,b) => a+b )+'</td>';
+      tmp+='<td>'+v[saison].Tr.map( (a) => ( ( a == 'U') ? 1 : 0 ) ).reduce( (a,b) => a+b )+'</td>';
+      tmp+='<td>'+v[saison].Tr.map( (a) => ( ( a == 'N') ? 1 : 0 ) ).reduce( (a,b) => a+b )+'</td>';
       var hist=v[saison].Tr.map( (a) => '<'+a+'></'+a+'>' ).slice(-6).join('');
       tmp+='<td>'+hist+'</td>';
       tmp+='<td>'+v[saison].Tp+'/'+v[saison].Tn+'</td>';
-- 
GitLab