Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display Cards #51

Merged
merged 9 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def displayDeck(username, deckTitle):
# remove card to avoid repetition
cardList.pop(index)

return render_template('card.html', deckTitle=deckTitle, question=question, username=username)
return render_template('card.html', deckTitle=deckTitle, question=question, username=username, cardList=cardList)

if 'add-card' in request.form:
return redirect('/username/deckTitle/add')
Expand Down
23 changes: 14 additions & 9 deletions templates/card.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{% extends 'base.html' %}

{% block container %}
<h3> {{ deckTitle }}</h3>
<div class="card">
<h3>{{ question }}</h3>
</div>

<form class="vertical-align" method="post">
<button class="button2" type="submit" name="add-card">Add Card</button>
<button class="button2" type="submit" name="edit">Edit</button>
</form>

<h3> {{ deckTitle }}</h3>
{% for question in cardList %}
<div class="card">
<h3>{{ question }}</h3>
</div>
{% endfor %}

<form class="vertical-align" method="post">
<button class="button2" type="submit" name="add-card">Add Card</button>
<button class="button2" type="submit" name="edit">Edit</button>
</form>



{% endblock %}
20 changes: 10 additions & 10 deletions templates/decks.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

{% block container %}

{% for deck in mainDecks %}
<div class="main-deck">
<a href="{{ url_for('displayDeck', username='guest', deckTitle=deck.title )}}"><h3>{{ deck.title }}</h3></a>
</div>
{% endfor %}
{% for deck in mainDecks %}
<div class="main-deck">
<a href="{{ url_for('displayDeck', username='guest', deckTitle=deck.title )}}"><h3>{{ deck.title }}</h3></a>
</div>
{% endfor %}

{% for deck in personalDecks %}
<div class="personal-deck">
<a href="{{ url_for('home') }}"><h3>{{ deck.title }}</h3></a>
</div>
{% endfor %}
{% for deck in personalDecks %}
<div class="personal-deck">
<a href="{{ url_for('home') }}"><h3>{{ deck.title }}</h3></a>
</div>
{% endfor %}

{% endblock %}
Loading