Skip to content

Commit 5538955

Browse files
author
fon.sukchaya
committed
change to use current variable name for results.html and displays them
1 parent ebe7cc9 commit 5538955

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

carbonapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def calculate():
103103
# total_footprint = transportation_footprint * 10 + food_footprint * 2 + home_energy_footprint * 1000 # assuming 10 km per day, 2 meals per day, and 1000 kWh per year
104104

105105
# Render template with results
106-
return render_template('results.html', total_footprint=carbon_footprint_per_year)
106+
return render_template('results.html', total_footprint=carbon_footprint_per_year, transportation_footprint=transportation_footprint, food_footprint=food_footprint, home_energy_footprint=home_energy_footprint)
107107

108108
@app.errorhandler(400)
109109
def bad_request(e):

templates/results.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ <h3 class="card-title mb-0">Results</h3>
7575
<script>
7676
var trace1 = {
7777
x: ['Transportation', 'Food', 'Energy'],
78-
y: [{{total_transportation}}, {{total_food}}, {{total_energy}}],
78+
y: [{{transportation_footprint}}, {{food_footprint}}, {{home_energy_footprint}}],
7979
type: 'bar'
8080
};
8181

0 commit comments

Comments
 (0)