From 280eccab7c3000c25b924be6c712d4246f70c268 Mon Sep 17 00:00:00 2001 From: nfoert Date: Wed, 21 Aug 2024 09:40:21 -0400 Subject: [PATCH] Show message in wallet if you don't have any cards saved --- cardie/main/templates/home.html | 7 +++++++ cardie/static/main/scripts/home/home.js | 4 ++++ cardie/staticfiles/main/scripts/home/home.js | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/cardie/main/templates/home.html b/cardie/main/templates/home.html index b9545ca..dbd5511 100644 --- a/cardie/main/templates/home.html +++ b/cardie/main/templates/home.html @@ -54,10 +54,17 @@

My Wallet

+

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"

+ +
+ +

You don't have any cards saved yet! Once you do, they will appear here for you to find later.

+

My Cards

+

This is where all of the cards you've designed appear

diff --git a/cardie/static/main/scripts/home/home.js b/cardie/static/main/scripts/home/home.js index 84d113e..aaceeaf 100644 --- a/cardie/static/main/scripts/home/home.js +++ b/cardie/static/main/scripts/home/home.js @@ -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"]); } diff --git a/cardie/staticfiles/main/scripts/home/home.js b/cardie/staticfiles/main/scripts/home/home.js index 84d113e..aaceeaf 100644 --- a/cardie/staticfiles/main/scripts/home/home.js +++ b/cardie/staticfiles/main/scripts/home/home.js @@ -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"]); }