Table data implemented

This commit is contained in:
Lucas Patenaude
2024-04-13 18:40:46 -06:00
parent 8746bf6e20
commit 14a19ccdf7
4 changed files with 21 additions and 3 deletions

View File

@@ -42,6 +42,7 @@
} }
#league-stats-container { #league-stats-container {
width: 100%;
display: flex; display: flex;
flex: 1; flex: 1;
} }

View File

@@ -1,8 +1,7 @@
#league-table-container { #league-table-container {
flex: 1; width: 60%;
background-color: #eaeaea; /* Example background color */ background-color: #eaeaea; /* Example background color */
margin: 10px;
border: 1px solid gray; border: 1px solid gray;
border-radius: 8px; border-radius: 8px;

View File

@@ -30,7 +30,13 @@ const fetchLeaguesData = async (req, res, next) => {
team_name: team.team.name, team_name: team.team.name,
team_crest: team.team.crest team_crest: team.team.crest
}, },
})), games_played: team.playedGames,
wins: team.won,
losses: team.lost,
draws: team.draw,
goal_difference: team.goalDifference,
points: team.points
}))
}; };
next(); next();
} catch (error) { } catch (error) {

View File

@@ -19,6 +19,12 @@
<th>#</th> <th>#</th>
<th></th> <th></th>
<th>Club</th> <th>Club</th>
<th>GP</th>
<th>W</th>
<th>L</th>
<th>D</th>
<th>GD</th>
<th>Pts</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -27,6 +33,12 @@
<td>{{table.league_position}}</td> <td>{{table.league_position}}</td>
<td><img src="{{table.team_crest}}" alt="{{table.team_name}} Crest" id="table-logo"></td> <td><img src="{{table.team_crest}}" alt="{{table.team_name}} Crest" id="table-logo"></td>
<td>{{table.team_name}}</td> <td>{{table.team_name}}</td>
<td>{{games_played}}</td>
<td>{{wins}}</td>
<td>{{losses}}</td>
<td>{{draws}}</td>
<td>{{goal_difference}}</td>
<td>{{points}}</td>
</tr> </tr>
{{/each}} {{/each}}
</tbody> </tbody>