From 215b9410c7732af0428f2f46f2b3dd7e254fc0d3 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Sun, 30 Aug 2020 21:10:28 -0700 Subject: [PATCH] cosmetic updates to wallet, qrcode, formatting, favicon --- requirements.txt | 2 ++ wowstash/blueprints/wallet/routes.py | 11 +++++- wowstash/static/css/main.css | 20 ++++++++++- wowstash/static/favicon.ico | Bin 975 -> 4030 bytes wowstash/templates/head.html | 1 + wowstash/templates/wallet/dashboard.html | 42 +++++++++++------------ 6 files changed, 52 insertions(+), 24 deletions(-) diff --git a/requirements.txt b/requirements.txt index eee54ff..d7c35a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,5 @@ Flask-WTF flask_sqlalchemy flask-bcrypt flask-login +qrcode +Pillow diff --git a/wowstash/blueprints/wallet/routes.py b/wowstash/blueprints/wallet/routes.py index e23912c..cbf8c7c 100644 --- a/wowstash/blueprints/wallet/routes.py +++ b/wowstash/blueprints/wallet/routes.py @@ -1,3 +1,6 @@ +from io import BytesIO +from base64 import b64encode +from qrcode import make as qrcode_make from flask import request, render_template, session, redirect, url_for, current_app from flask_login import login_required, current_user from wowstash.blueprints.wallet import wallet_bp @@ -10,6 +13,7 @@ from wowstash.models import User @login_required def dashboard(): all_transfers = list() + _address_qr = BytesIO() user = User.query.get(current_user.id) wallet_height = wallet.height()['height'] daemon_height = daemon.height()['height'] @@ -19,11 +23,16 @@ def dashboard(): for type in transfers: for tx in transfers[type]: all_transfers.append(tx) + + qr_uri = f'wownero:{subaddress}?tx_description="{current_user.email}"' + address_qr = qrcode_make(qr_uri).save(_address_qr) + qrcode = b64encode(_address_qr.getvalue()).decode() return render_template( "wallet/dashboard.html", wallet_height=wallet_height, daemon_height=daemon_height, subaddress=subaddress, balances=balances, - all_transfers=all_transfers + all_transfers=all_transfers, + qrcode=qrcode ) diff --git a/wowstash/static/css/main.css b/wowstash/static/css/main.css index 04b6785..2b83023 100644 --- a/wowstash/static/css/main.css +++ b/wowstash/static/css/main.css @@ -510,7 +510,25 @@ header.masthead .header-content-lg { } .slim { - width: 75%; line-break: anywhere; margin: auto; } + +.inline { + display: inline; +} + +.container-slim { + width: 70%; + margin: 0 auto; +} + +.dashboard-buttons { + width: 100%; + margin: 2em auto; + display: block; +} + +.dashboard-button { + display: inline; +} diff --git a/wowstash/static/favicon.ico b/wowstash/static/favicon.ico index 7268f82031b841a11f9a2c30395dea1c9b506c0b..fc219a4efdc8228be8d5cf23dcc567da5103ba49 100644 GIT binary patch literal 4030 zcmb`K3se->8OLYY7wj&(>;q`Dfz^1TVq&8qY7u!=%h9GiHIf=5Q4~Z;MDa)x6BIEP zB?>-@qDZwWDng1ue6Lhde4v0LDxh0L@r7vASoX=lzu(Ndialsz&FuN_otZoH{pNq~ z{l1-L7y*5J^bCFLne8fu@nRUJ56OoVLgLQ0QM)H!8hix95_)f2p`HilZG8 z6)2xyZodo&H^N<$&z;jh0GeKN4X(>tmDvZwe z5=Tz@mSon3&4g}5BHT9AK(hD2W9|&d^ufdq<@hb6Nu3@Ms)M;jCe-SFAa z4xIuzhU=E|5FdQl*)Qb!5XgKvei&qf{P2mbF4R!vM{n{_60`jkTU1YsezjI=JJr))6y=6hQJOJ%bl-unrP$ zvffce7eN~u@9;Qe63>`hoc9Q#EjEaAtdOj> zK$%tt&$xf`-Z;MYFDu~w&R7~}&Tl@vpZaxjoo!#@O9hA9V+BXs!TaUsFu}2IH=Tp5 z&Wt*~-7`&JyR9}u{0}Qc`F03*Ik>W%8lI<$Sp@Cx zr@+(yec}ZndU_m^(-vTMVlo2zPlnDv0-De`czl=&#q6zcOFs%})_q6{9$7pSi!Is@ zmvMD0fh6e+mu8sGNU|)TTmrYQCHYt3o|Fss&z8eu6xFJM<>!y1`dlrl zcV0(h*zC}_gxKsN6zLLYF~$4LPra%)g7M`#7g(B?;Gz*TybMj_Bzlpoi>6zH+E(W$qnpFkW?+*B>4}{>b08 z4TlY9P!r5PVRBxZZ{9+ANv(ss?-5GZ8S#DJGst>p7uB87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jFQf1-zndX@IHtJ7J>9(i*9X!4tG;cO@aoL=;=d)b zNb0rYoby2+6IZ|9{-9g`E5oEMcb0QDw7*V&?Y(J|hcTPdK6$=^54x9nmyGKxrGx{-7m4nVDu^QN8iD^}*jdb;r3T zDi$(<3H3G}7ZlDi1&G|Z%w*!Jt>vH>5#O-F)x+9z(qx7&73Ve?zZRSmaWT#Mrr>*5 z2mR}>Tc0&7KkTr5IYZU%K-Mq2{*-?UouJNMYs26CQ2u-@Yq^XR-;s%2av`(b75JZe z@VmWFwym4?`gz1&iGxpe&u4j}eEFvL+W5_xFU!u=i*1VgbLOjf&CaNNv)5OHWPh`N zimq;*u}sYl7}BaGt`Q|Ei6yC4$wjF^iowXh&|KHRRM*fj#K_Rf$kfWvK-<8`%D~{w zFTr>e4Y~O#nQ4`{HOyVU@-a|@B*=!~{Irtt#G+J&^73-M%)IR4h zddb|v%EI20MVN&ZTpCOcr!XsT4pBIL + diff --git a/wowstash/templates/wallet/dashboard.html b/wowstash/templates/wallet/dashboard.html index f71f507..5db37c2 100644 --- a/wowstash/templates/wallet/dashboard.html +++ b/wowstash/templates/wallet/dashboard.html @@ -7,27 +7,26 @@ {% include 'navbar.html' %} -
-
+
+

Wallet Info

-
-
-

Address: {{ subaddress }}

-

Balance: {{ balances.1 }} WOW (locked {{ balances.0 }} WOW)

-

Height ({{ wallet_height }} / {{ daemon_height }})

-
- -
-
- Transfers -
-
- Send -
-
- Receive -
+

Address:

+

{{ subaddress }}

+
+ +

+

Balance

+

{{ balances.1 }} WOW

+

({{ balances.0 }} locked)

+ +
+ List Tx +
+
+ Send Tx +
+
@@ -36,8 +35,6 @@

Transfers

-

- @@ -45,6 +42,7 @@ + {% for tx in all_transfers | sort(attribute='timestamp', reverse=True) %} @@ -54,11 +52,11 @@ + {% endfor %}
DateTx ID Amount ConfirmationsHeight Fee
{{ tx.txid | truncate(12) }} {{ tx.amount / 100000000000 }} {{ tx.confirmations }}{{ tx.height }} {{ tx.fee / 100000000000 }} WOW
-