Skip to content

Commit

Permalink
Show message in wallet if you don't have any cards saved
Browse files Browse the repository at this point in the history
  • Loading branch information
nfoert committed Aug 21, 2024
1 parent 24b439f commit 280ecca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cardie/main/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,17 @@

<div id="home-wallet" x-show="!cards" x-transition>
<p class="ui_text_subheader_left"><i class="ph-bold ph-wallet"></i> My Wallet</p>
<p class="ui_text_body">Your wallet is where all of the cards you saved appear. You can save cards by going to the link for a card and pressing "Save this card"</p>

<div id="home_wallet_nocards" class="ui_status_info">
<i class="ph-bold ph-info ui_status_icon"></i>
<p class="ui_status_text">You don't have any cards saved yet! Once you do, they will appear here for you to find later.</p>
</div>
</div>

<div id="home-cards" x-show="cards" x-transition>
<p class="ui_text_subheader_left"><i class="ph-bold ph-cards"></i> My Cards</p>
<p class="ui_text_body">This is where all of the cards you've designed appear</p>
<button class="ui_button_small" id="home_cards_create" @click="create_new_card()"><i class="ph-bold ph-plus-circle"></i> Create new Card</button>
</div>
<div>
Expand Down
4 changes: 4 additions & 0 deletions cardie/static/main/scripts/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ async function get_wallet() {
} else {
text = JSON.parse(text);

if (!text.length == 0) {
document.querySelector("#home_wallet_nocards").style.display = "none";
}

for (const card in text) {
create_wallet_card(text[card]["uuid"], text[card]["name"]);
}
Expand Down
4 changes: 4 additions & 0 deletions cardie/staticfiles/main/scripts/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ async function get_wallet() {
} else {
text = JSON.parse(text);

if (!text.length == 0) {
document.querySelector("#home_wallet_nocards").style.display = "none";
}

for (const card in text) {
create_wallet_card(text[card]["uuid"], text[card]["name"]);
}
Expand Down

0 comments on commit 280ecca

Please sign in to comment.