From ba4e8894ffd58e17c36e42d700fe54ad52e5205d Mon Sep 17 00:00:00 2001 From: lalanza808 Date: Sun, 12 Jan 2020 02:10:37 -0800 Subject: [PATCH] add donations and fix up some static --- web/templates/base.html | 2 ++ .../sales/notify/sale_completed/seller/body.txt | 2 +- xmrauctions/context_processors.py | 4 +++- xmrauctions/settings.py | 14 +++++++++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/web/templates/base.html b/web/templates/base.html index ad20b08..1d3e7d7 100644 --- a/web/templates/base.html +++ b/web/templates/base.html @@ -146,6 +146,8 @@
  • Terms
  • FAQ
  • +
    +

    Donations Accepted:
    {{ site_meta.donation_address }}

    diff --git a/web/templates/sales/notify/sale_completed/seller/body.txt b/web/templates/sales/notify/sale_completed/seller/body.txt index 978a438..591bfe0 100644 --- a/web/templates/sales/notify/sale_completed/seller/body.txt +++ b/web/templates/sales/notify/sale_completed/seller/body.txt @@ -2,6 +2,6 @@ Congratulations {{ sale.item.owner }}, The sale of your item, "{{ sale.item.name }}" (#{{ sale.item.id }}), has concluded. The agreed upon bid price has been transferred to the payout address provided when posting the item. -In a few more minutes post-processing will complete, the platform will receive it's fees, and the sale, item, and bids will all be removed from the system. +In a few more minutes post-processing will complete, the platform will receive it's fees, and the sale, item, and bids will all be removed from the system. If your fees were waived, please consider donating to the development fund. The address is at the bottom of the {{ site_name }} home page. Thanks for using {{ site_name }}! diff --git a/xmrauctions/context_processors.py b/xmrauctions/context_processors.py index 81e8141..879ce18 100644 --- a/xmrauctions/context_processors.py +++ b/xmrauctions/context_processors.py @@ -5,6 +5,8 @@ def inject_site_meta(request): return { 'site_meta': { 'debug': settings.DEBUG, - 'name': settings.SITE_NAME + 'name': settings.SITE_NAME, + 'donation_address': settings.DONATION_WALLET_ADDRESS, + 'platform_address': settings.PLATFORM_WALLET_ADDRESS } } diff --git a/xmrauctions/settings.py b/xmrauctions/settings.py index 98069e4..3f280a9 100644 --- a/xmrauctions/settings.py +++ b/xmrauctions/settings.py @@ -14,6 +14,7 @@ https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ """ import os +from core.monero import AuctionWallet # Build paths inside the project like this: os.path.join(BASE_DIR, ...) @@ -26,7 +27,7 @@ DEBUG = os.environ.get('DEBUG', False) ALLOWED_HOSTS = str(os.environ['ALLOWED_HOSTS']).split(',') ESCROW_PERIOD_DAYS = os.environ.get('ESCROW_PERIOD_DAYS', 30) PLATFORM_FEE_PERCENT = os.environ.get('PLATFORM_FEE_PERCENT', 0) -PLATFORM_WALLET_ADDRESS = os.environ.get('PLATFORM_WALLET_ADDRESS', None) + # Application definition @@ -242,3 +243,14 @@ CORS_ORIGIN_WHITELIST = os.environ.get('CORS_ORIGIN_WHITELIST', []) CORS_ORIGIN_REGEX_WHITELIST = [ r"^https://static\.\w+\.xmrauctions\.com$", ] + + +# Platform Wallets + +aw = AuctionWallet() +platform_wallet_address = None +if aw.connected is True: + platform_wallet_address = str(aw.wallet.accounts[0].address()) + +PLATFORM_WALLET_ADDRESS = os.environ.get('PLATFORM_WALLET_ADDRESS', platform_wallet_address) +DONATION_WALLET_ADDRESS = os.environ.get('DONATION_ADDRESS', PLATFORM_WALLET_ADDRESS)