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 7268f82..fc219a4 100644 Binary files a/wowstash/static/favicon.ico and b/wowstash/static/favicon.ico differ diff --git a/wowstash/templates/head.html b/wowstash/templates/head.html index 4ed6c31..67c29c1 100644 --- a/wowstash/templates/head.html +++ b/wowstash/templates/head.html @@ -3,6 +3,7 @@ + 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
-