feat: Add vote message
All checks were successful
Build Docker / Build Image (push) Successful in 25s

This commit is contained in:
Nathan Woodburn 2024-02-22 12:43:17 +11:00
parent 8df92712d6
commit ec1d29ea0b
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
3 changed files with 5 additions and 2 deletions

2
.gitignore vendored
View File

@ -3,3 +3,5 @@ node_modules
__pycache__/ __pycache__/
data/ data/
.env

View File

@ -14,7 +14,7 @@ import render
app = Flask(__name__) app = Flask(__name__)
dotenv.load_dotenv() dotenv.load_dotenv()
CURRENT_VOTE = os.getenv('CURRENT_VOTE')
DISCORD_WEBHOOK = os.getenv('DISCORD_WEBHOOK') DISCORD_WEBHOOK = os.getenv('DISCORD_WEBHOOK')
# If votes file doesn't exist, create it # If votes file doesn't exist, create it
@ -52,7 +52,7 @@ def faviconPNG():
def index(): def index():
year = datetime.datetime.now().year year = datetime.datetime.now().year
votes = render.votes() votes = render.votes()
return render_template('index.html',year=year,votes=votes) return render_template('index.html',year=year,votes=votes, current_vote=CURRENT_VOTE)
@app.route('/<path:path>') @app.route('/<path:path>')
def catch_all(path): def catch_all(path):

View File

@ -44,6 +44,7 @@
<div class="col-md-8 text-center text-md-start mx-auto"> <div class="col-md-8 text-center text-md-start mx-auto">
<div class="text-center"> <div class="text-center">
<h1 class="display-4 fw-bold mb-5">Vote on projects from<br><a class="no-a-display" href="https://nathan.woodburn.au" target="_blank"><span class="underline">Nathan.Woodburn/</span></a></h1> <h1 class="display-4 fw-bold mb-5">Vote on projects from<br><a class="no-a-display" href="https://nathan.woodburn.au" target="_blank"><span class="underline">Nathan.Woodburn/</span></a></h1>
<h2 class="display-3" style="margin-bottom: 20px;">{{current_vote}}</h2>
<h3>You have&nbsp;<span id="balance">0</span>&nbsp;votes.</h3> <h3>You have&nbsp;<span id="balance">0</span>&nbsp;votes.</h3>
<h4><span id="percent">0</span>% of the voting power.</h4> <h4><span id="percent">0</span>% of the voting power.</h4>
<p class="fs-5 text-muted mb-5">Vote here</p> <p class="fs-5 text-muted mb-5">Vote here</p>