Skip to content

Commit

Permalink
rules config option and currency config
Browse files Browse the repository at this point in the history
  • Loading branch information
hwalker928 committed Dec 12, 2024
1 parent 971655a commit 742fc88
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ services:
environment:
ADMIN_USER: Harry
VALID_NAMES: alice,ben,charlie,david
BUDGET: 10
BUDGET: £10
URL: "http://localhost:5000"
RULES: Keep your recipient a secret,Multiple presents are allowed,Spend as close to the budget as possible
REROLL_COUNT: 1 # Set to 0 to disable rerolls
REDIS_HOST: redis
Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"year": os.getenv("YEAR", datetime.datetime.now().year),
"budget": os.getenv("BUDGET", "10"),
"url": os.getenv("URL", "http://localhost:5000"),
"rules": os.getenv("RULES", "").split(","),
}

app = Flask(__name__)
Expand Down
20 changes: 6 additions & 14 deletions templates/rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
alt="Secret Santa"
/>
<h2>
There is a maximum budget of <b>£{{config["budget"]}}</b> to spend.
There is a maximum budget of <b>{{config["budget"]}}</b> to spend.
</h2>
<h3>You have been selected...</h3>
<h2>
Expand Down Expand Up @@ -109,8 +109,8 @@ <h2>
<h3><b>Reroll</b></h3>
<p>
You have <b>one chance</b> to reroll and be selected a new person to
buy for. If you choose to reroll, you <b>will not</b> be able to go
back. You may get the same person again.
buy for. If you choose to reroll, you <b>cannot</b> go back. You may
get the same person again.
</p>
<button
id="rerollBtn"
Expand All @@ -134,17 +134,9 @@ <h3><b>Reroll</b></h3>
<div id="finalMessage" class="fade-in hidden">
<h3 style="margin-top: 40px">Rules:</h3>
<ol class="list-group list-group-flush text-left">
<li class="list-group-item">Keep your recipient a secret!</li>
<li class="list-group-item">Multiple presents are allowed.</li>
<li class="list-group-item">
Use
<a
href="https://www.sainsburys.co.uk/gol-ui/product/sainsburys-green-tree-wrapping-paper-3m"
target="_blank"
>this wrapping paper</a
>.
</li>
<li class="list-group-item">No Dr Pepper t-shirts.</li>
{ % for rule in config["rules"] %}
<li class="list-group-item">{{rule}}</li>
{ % endfor %}
</ol>
<p style="margin-top: 30px">
You may now close this page! It is recommended to screenshot this
Expand Down

0 comments on commit 742fc88

Please sign in to comment.