-
-
-
-
-
-
Your transponder
- {% if transponder_paired %}
-
{% translate "Successfully paired" %}
- {% else %}
-
{% translate "Not paired" %}
- {% endif %}
-
-
-
- {% if transponder_paired %}
-
-
-
- {% else %}
+
+
+
+
+
+
+
-
{% translate "Hold your transponder to a terminal and follow the instructions on screen to pair." %}
+
Your transponder
+ {% if transponder_paired %}
+
{% translate "Successfully paired" %}
+ {% else %}
+
{% translate "Not paired" %}
+ {% endif %}
- {% endif %}
+
+
+ {% if transponder_paired %}
+
+
+ {% else %}
+
+
{% translate "Hold your transponder to a terminal and follow the instructions on screen to pair." %}
+
+ {% endif %}
-
-
Latest 20 transactions
-
-
- {% for transaction in giftcardtransaction_list %}
-
+
+
+{% if wallet.giftcard.value < 0 %}
+
+
+
+ {% translate "Please top-up as soon as possible so we can keep providing this shared coffee machine. We sell coffee at cost, don't make money and have little buffer." %}
+
+
+ -
+ {% blocktranslate trimmed %}
+ Put cash into an envelope and label it with your HPI username ({{ user_slug }}).
+ Throw it into the Fachschaftsrat mailbox behind the reception in the main building.
+ You can find envelops in the magazine holder next to the FSR office.
+ {% endblocktranslate %}
+
+ -
+ {% translate "Wait. We manually process each payment. But you can drink coffee right away: we automatically deduct that from your top-up." %}
+
+
+
+
+{% endif %}
+
+
+
Latest 20 transactions
+
+
+ {% for transaction in giftcardtransaction_list %}
+
+ {% if transaction.order %}
+
+ {% else %}
+
+ {% endif %}
+
+
{% if transaction.order %}
-
- {% else %}
-
- {% endif %}
-
-
- {% if transaction.order %}
-
-
-
- {{ transaction.order }}
-
-
-
- {{ transaction.order.positions.count }}
+
+
+
+ {{ transaction.order }}
+
+
+
+ {{ transaction.order.positions.count }}
{% blocktranslate trimmed count count=transaction.order.positions.count %}
item
{% plural %}
items
{% endblocktranslate %}
· {{ transaction.datetime }}
-
+
- {% else %}
-
- {{ transaction.text }}
{{ transaction.datetime }}
-
- {% endif %}
-
-
-
-
- {% endfor %}
-
+ {% else %}
+
+ {{ transaction.text }}
{{ transaction.datetime }}
+
+ {% endif %}
+
+
+
+
+ {% endfor %}
+
{% endblock %}
diff --git a/pretix_wallet/utils.py b/pretix_wallet/utils.py
index 0577529..225456c 100644
--- a/pretix_wallet/utils.py
+++ b/pretix_wallet/utils.py
@@ -15,6 +15,10 @@ def link_token_to_wallet(organizer, customer, token_id):
medium.save()
+def email_address_to_user_slug(email):
+ return email.split('@')[0]
+
+
def create_customerwallet_if_not_exists(organizer, customer):
try:
created = False
@@ -24,7 +28,7 @@ def create_customerwallet_if_not_exists(organizer, customer):
issuer=organizer,
currency="EUR",
conditions=f"Wallet for {customer.name_cached} ({customer.email})",
- secret=f"{customer.email.split('@')[0]}-{gen_giftcard_secret(length=organizer.settings.giftcard_length)}")
+ secret=f"{email_address_to_user_slug(customer.email)}-{gen_giftcard_secret(length=organizer.settings.giftcard_length)}")
wallet = CustomerWallet.objects.create(customer=customer, giftcard=giftcard)
created = True
return wallet, created
diff --git a/pretix_wallet/views.py b/pretix_wallet/views.py
index 9e31b30..7f04bd4 100644
--- a/pretix_wallet/views.py
+++ b/pretix_wallet/views.py
@@ -17,7 +17,7 @@
from pretix_wallet.pagination import CustomPagination, ProductPagination
from pretix_wallet.serializers import ProductSerializer, WalletSerializer, TransactionSerializer, \
CustomerWalletSerializer
-from pretix_wallet.utils import link_token_to_wallet, create_customerwallet_if_not_exists
+from pretix_wallet.utils import link_token_to_wallet, create_customerwallet_if_not_exists, email_address_to_user_slug
class TerminalAuthMixin:
@@ -42,6 +42,7 @@ def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
ctx['wallet'] = self.request.customer.wallet
ctx['transponder_paired'] = self.request.customer.wallet.giftcard.linked_media.exists()
+ ctx['user_slug'] = email_address_to_user_slug(self.request.customer.email)
return ctx
diff --git a/pyproject.toml b/pyproject.toml
index 0eae742..76135ed 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -6,10 +6,12 @@ readme = "README.rst"
license = {text = "Apache"}
keywords = ["pretix"]
authors = [
- {name = "Your name", email = "your-email@example.org"},
+ {name = "Julian Baumann", email = "jeriox@users.noreply.github.com"},
+ {name = "Aaron Schlitt", email = "aaron@aaronschlitt.de"},
+ {name = "Ben Bals", email = "benbals@posteo.de"},
]
maintainers = [
- {name = "Your name", email = "your-email@example.org"},
+ {name = "Julian Baumann", email = "jeriox@users.noreply.github.com"},
]
dependencies = [