Skip to content

Commit

Permalink
Show real donations amount in homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Hernandez committed Feb 16, 2020
1 parent 9ab30d7 commit 80f895c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from flask import render_template
import qrcode

from gsheet_utils import GSheet

from io import BytesIO
import base64

Expand All @@ -16,10 +18,12 @@
app = Flask(__name__)
donations = db_connect_to_collection(MONGO_URI, 'viveros', 'donaciones')

gsheet = GSheet()

@app.route('/')
def index():
return render_template('index.html')
total_donations = gsheet.get_data("'donaciones 2020'!I1")[0][0]
return render_template('index.html', total_donations=f"{int(total_donations):,}")


@app.route('/dashboard')
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<div class="col-md-8 ml-auto mr-auto">
<div class="brand">
<div class="odometer">
<h1 class="scroller" style="font-size: 8em;">19,104</h1>
<h1 class="scroller" style="font-size: 8em;">{{total_donations}}</h1>
<h3><i class="material-icons">nature</i> Árboles y plantas donadas</h3>
</div>
</div>
Expand Down

0 comments on commit 80f895c

Please sign in to comment.