Browse Source

added a delete button

master
Kostanjevec 2 months ago
parent
commit
58eb61c201
  1. 4
      app.py
  2. 2
      templates/deck/index.html

4
app.py

@ -85,6 +85,10 @@ def create_app(test_config=None):
elif rate == "No":
k = 0.1
submit_card.interest_rate = abs(submit_card.interest_rate*k)
elif rate == "Delete":
submit_card.interest_rate = 0
#@TODO to bi lahko zbrisalo tudi file v določenih primerih
# zaporedno število trenutnega carda v decku
next_card = deck_object.current_card + 1

2
templates/deck/index.html

@ -16,6 +16,8 @@
<button type="submit" name="rate" value="Yes" accesskey="1">Yes</button> <!--ti keyi so alt+shit+key...-->
<button type="submit" name="rate" value="Maybe" accesskey="2">Maybe</button>
<button type="submit" name="rate" value="No" accesskey="3">No</button>
<button type="submit" name="rate" value="Delete" accesskey="d">Delete</button>
<button style="margin-top: 1rem" type="submit" name="share" value="share">Share</button>
</form>
</article>

Loading…
Cancel
Save