[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-codeless] branch master updated: added dropdown for
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-codeless] branch master updated: added dropdown for merchant address type |
Date: |
Wed, 25 Jul 2018 15:42:51 +0200 |
This is an automated email from the git hooks/post-receive script.
shivam-kohli pushed a commit to branch master
in repository codeless.
The following commit(s) were added to refs/heads/master by this push:
new cc56d2a added dropdown for merchant address type
cc56d2a is described below
commit cc56d2a73f1a58ccc40062bc95153843195ee055
Author: shivam kohli <address@hidden>
AuthorDate: Wed Jul 25 19:12:43 2018 +0530
added dropdown for merchant address type
---
inventory/forms.py | 12 ++++++----
inventory/views.py | 6 ++++-
templates/inventory/home.html | 1 +
templates/inventory/signup.html | 53 ++++++++++++++++++++++++++++++++++++++++-
4 files changed, 65 insertions(+), 7 deletions(-)
diff --git a/inventory/forms.py b/inventory/forms.py
index 1fbfa43..cb52a71 100644
--- a/inventory/forms.py
+++ b/inventory/forms.py
@@ -27,10 +27,10 @@ from inventory.models import Merchant, Product
ADDRESS_CHOICES= [
- ('SEPA', 'sepa'),
- ('UPI', 'upi'),
- ('BITCOIN', 'bitcoin'),
- ('ACH', 'ach'),
+ ('sepa', 'SEPA'),
+ ('upi', 'UPI'),
+ ('bitcoin', 'BITCOIN'),
+ ('ach', 'ACH'),
]
@@ -39,7 +39,8 @@ class SignUpForm(UserCreationForm):
last_name = forms.CharField(max_length=30, required=False)
email = forms.EmailField(max_length=254)
website = forms.URLField(label='Enter website URL', max_length=250,
required=False)
- address = forms.CharField(label='What is your favorite fruit?',
widget=forms.Select(choices=ADDRESS_CHOICES))
+ address = forms.CharField(label='Payment Address type ',
widget=forms.Select(choices=ADDRESS_CHOICES))
+ pay_url = forms.URLField(label='Directly enter the Plain PaytoURI',
max_length=250, required=False)
class Meta:
model = User
@@ -51,6 +52,7 @@ class SignUpForm(UserCreationForm):
'password1',
'password2',
'address',
+ 'pay_url',
'website'
)
diff --git a/inventory/views.py b/inventory/views.py
index e4e6a4c..97b63b6 100644
--- a/inventory/views.py
+++ b/inventory/views.py
@@ -492,6 +492,11 @@ def signup(request):
instance = get_object_or_404(Merchant, user=user)
instance.address = form.cleaned_data.get('address')
instance.website = form.cleaned_data.get('website')
+ if form.cleaned_data.get('pay_url'):
+ instance.address = form.cleaned_data.get('pay_url')
+ else:
+ #payto URI will be made
+ pass
instance.save()
return redirect('home')
else:
@@ -512,7 +517,6 @@ def login(request):
if user is not None:
auth_login(request, user)
current_url = resolve(request.path_info).url_name
- print(current_url)
# Redirect to a success page.
return redirect('home')
else:
diff --git a/templates/inventory/home.html b/templates/inventory/home.html
index a64be0d..68d1b6a 100644
--- a/templates/inventory/home.html
+++ b/templates/inventory/home.html
@@ -21,6 +21,7 @@ with the Taler Codeless Merchant. If not, see
<https://www.gnu.org/licenses/>.
<html>
<head>
<title>Home</title>
+ <!-- https://taler.net/images/logo-2018-dold.svg -->
<style type="text/css">
*,
*::before,
diff --git a/templates/inventory/signup.html b/templates/inventory/signup.html
index 098336f..d39cec9 100644
--- a/templates/inventory/signup.html
+++ b/templates/inventory/signup.html
@@ -136,6 +136,45 @@ with the Taler Codeless Merchant. If not, see
<https://www.gnu.org/licenses/>.
margin: 0;
padding: 0;}
</style>
+ <style>
+ .tooltip {
+ position: relative;
+ display: inline-block;
+ }
+
+ .tooltip .tooltiptext {
+ visibility: hidden;
+ width: 300px;
+ background-color: #555;
+ color: #fff;
+ text-align: center;
+ border-radius: 6px;
+ padding: 5px 0;
+ position: absolute;
+ z-index: 1;
+ bottom: 125%;
+ left: 50%;
+ margin-left: -60px;
+ opacity: 0;
+ transition: opacity 0.3s;
+ }
+
+ .tooltip .tooltiptext::after {
+ content: "";
+ position: absolute;
+ top: 100%;
+ left: 50%;
+ margin-left: -5px;
+ border-width: 5px;
+ border-style: solid;
+ border-color: #555 transparent transparent transparent;
+ }
+
+ .tooltip:hover .tooltiptext {
+ visibility: visible;
+ opacity: 1;
+ }
+ </style>
</head>
<body>
<div class="sidenav">
@@ -153,7 +192,19 @@ with the Taler Codeless Merchant. If not, see
<https://www.gnu.org/licenses/>.
<form method="post" enctype="multipart/form-data">
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
- {{ form.as_p }}
+ <!-- {{ form.as_p }} -->
+
+ {% for field in form %}
+ {% if field.label == 'Directly enter the Plain PaytoURI' %}
+ <br><br><label class="tooltip">{{ field.label }}<font
size="1"><span class="tooltiptext">This field is not necessary, if you have
choosen the address type.</span></font></label>
+ {{ field }}
+ {% else %}
+ <label class="mylabel">{{ field.label }}</label>
+ {{ field }}
+ {% endif %}
+ {% endfor %}
+
+
<button name="add_product" type="submit" class="submit">Sign
up</button>
</form>
</div>
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-codeless] branch master updated: added dropdown for merchant address type,
gnunet <=