From 8f7b4772d862462a6edd03ef85dc69fb4536866a Mon Sep 17 00:00:00 2001
From: s2-fidan <sude2.fidan@live.uwe.ac.uk>
Date: Thu, 20 Apr 2023 13:44:59 +0100
Subject: [PATCH] title change and some spaces

---
 footballHelper.py           | 6 ++++--
 templates/playerSearch.html | 6 +++---
 templates/players.html      | 2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/footballHelper.py b/footballHelper.py
index bdbfe5a..3c88e4f 100644
--- a/footballHelper.py
+++ b/footballHelper.py
@@ -57,16 +57,18 @@ class Player:
 
             # value = current weekly salary x weeks left in the current contract x win percentage rate.
             # dividing by winrate so we can later multiply by the new winrate
-            mutableVal = moneyValue / (self.wins / (self.losses + self.wins))
+            mutableVal = moneyValue / (self.wins / self.played)
 
             # adjust winrate accordingly 
             if x == 'W':
                 self.wins += 1
+                self.played += 1
             else:
                 self.losses += 1
+                self.played += 1
 
             # recalculate value
-            mutableVal = mutableVal * (self.wins / (self.losses + self.wins))
+            mutableVal = mutableVal * (self.wins / self.played)
 
             # add the values to the dictionary
             valueDict[f"{mutableVal:.2f}"] = f"{(mutableVal - moneyValue):.2f}"
diff --git a/templates/playerSearch.html b/templates/playerSearch.html
index 48ae09f..aefe29b 100644
--- a/templates/playerSearch.html
+++ b/templates/playerSearch.html
@@ -4,7 +4,7 @@
 {% block content %}
 
       <main>
-        <h1>Players</h1>
+        <h1>{{player.name}}</h1>
 
           <div class="buttonDown">
 
@@ -12,7 +12,6 @@
 
                   <div class="col-md-3">
                   <div class="h-100 p-5 text-bg-dark border rounded-3">
-                      <h2>{{player.name}}</h2>
                       <div>
                       <img src="{{ url_for('static', filename='images/' ~ player.gender ~ '.png') }}"/>
                       </div>
@@ -31,6 +30,7 @@
 
                   <div class="h-100 p-5 bg-dark border rounded-3">
                       <h2>Player Stats</h2>
+                      <br></br>
                       <p>Date Signed: {{ player.dateSigned }}</p>
                       <p>Current Team: {{player.club}}</p>
                       <p>Team Location: {{player.location}}</p>
@@ -38,7 +38,7 @@
                       <p>Salary: £{{player.salary}}k </p>
                       <p>Games Played: {{player.played}}</p>
                       <p>Games Won: {{player.wins}}</p>
-                  
+                      <br></br>
                       <h2>Predicted Transfer Value: £{{transferValue}}</h2>
 
                       <table class="table table-striped table-dark">
diff --git a/templates/players.html b/templates/players.html
index 5fa65f8..4b7f5ba 100644
--- a/templates/players.html
+++ b/templates/players.html
@@ -6,7 +6,7 @@
 {% block content %}
 
 <main class="mainbody">
-    <h1>Players</h1>
+    <h1>All Players</h1>
     <table class="table table-striped table-dark text-center">
         <thead class="thead">
             <tr>
-- 
GitLab