gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-bank] branch master updated: adjust wire transfer fo


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] branch master updated: adjust wire transfer form
Date: Mon, 18 Dec 2017 18:21:02 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new f54e7ad  adjust wire transfer form
f54e7ad is described below

commit f54e7ada5a9338cbcbb4699632403eebdcf9baf9
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Dec 18 18:20:45 2017 +0100

    adjust wire transfer form
---
 talerbank/app/static/bank.css             | 25 +++++++++++++++++++++++++
 talerbank/app/templates/base.html         |  2 +-
 talerbank/app/templates/profile_page.html | 19 +++++++++++++++++--
 talerbank/app/views.py                    | 18 ++++++++++++++----
 4 files changed, 57 insertions(+), 7 deletions(-)

diff --git a/talerbank/app/static/bank.css b/talerbank/app/static/bank.css
index 0f38f11..20e7586 100644
--- a/talerbank/app/static/bank.css
+++ b/talerbank/app/static/bank.css
@@ -12,3 +12,28 @@ a.pure-button {
 .cancelled {
   text-decoration: line-through;
 }
+
+/**
+ * NOTE: could not set input width with "normal"
+ * 'size' and 'maxlength' HTML attributes because
+ * they are ignored for "number"-typed inputs. */
+input#id_amount {
+  width: 230px;
+  padding-right: 160px;
+}
+
+/* Styling the wrapper */
+span.currency-symbol {
+  position: absolute;
+  margin-top: 13px;
+  margin-left: 90px;
+}
+
+input[type="number"]::-webkit-outer-spin-button, 
input[type="number"]::-webkit-inner-spin-button {
+  -webkit-appearance: none;
+  margin: 0;
+}
+
+input[type="number"] {
+  -moz-appearance: textfield;
+}
diff --git a/talerbank/app/templates/base.html 
b/talerbank/app/templates/base.html
index a604561..56d736f 100644
--- a/talerbank/app/templates/base.html
+++ b/talerbank/app/templates/base.html
@@ -21,8 +21,8 @@
 <html data-taler-nojs="true">
   <head>
     <title>{{ settings_value("TALER_CURRENCY") }} Bank - Taler Demo</title>
-    <link rel="stylesheet" type="text/css" href="{{ static('pure.css') }}" />
     <link rel="stylesheet" type="text/css" href="{{ static('bank.css') }}" />
+    <link rel="stylesheet" type="text/css" href="{{ static('pure.css') }}" />
     <link rel="stylesheet" type="text/css" href="{{ 
static('web-common/demo.css') }}" />
     <link rel="stylesheet" type="text/css" href="{{ 
static('web-common/taler-fallback.css') }}" id="taler-presence-stylesheet" />
     {% block head %} {% endblock %}
diff --git a/talerbank/app/templates/profile_page.html 
b/talerbank/app/templates/profile_page.html
index 608dc82..07a4dcf 100644
--- a/talerbank/app/templates/profile_page.html
+++ b/talerbank/app/templates/profile_page.html
@@ -112,6 +112,8 @@
                  class="taler-installed-show pure-button pure-button-primary"
                  type="submit"
                  value="Select exchange provider" />
+          <br />
+          <br />
           <input class="taler-installed-hide pure-button pure-button-primary"
                  type="button"
                  disabled
@@ -125,10 +127,23 @@
               name="tform">
 
           <input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token 
}}" />
-          {{ wt_form }}
+            <span class="currency-widget">
+              <span class="currency-symbol">{{ currency }}</span>
+              {{ wt_form.amount }}
+            </span>
+            <label for="id_receiver">
+              to
+              {{ wt_form.receiver }}
+            </label>
+            <br />
+            <br />
+            <label for="id_subject">
+              subject
+              {{ wt_form.subject }}
+            </label>
           <input class="pure-button pure-button-primary"
                  type="submit"
-                 value="Submit" />
+                 value="Transfer!" />
         </form>
       </div>
       <p>
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 33cf870..edc48d7 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -94,11 +94,21 @@ def get_session_flag(request, name):
     return False
 
 
+def predefined_accounts_dropdown():
+    account = 2
+    ret = []
+    for i in settings.TALER_PREDEFINED_ACCOUNTS[1:]:
+        ret.append((account, "%s (#%d)" % (i, account)))
+        account += 1
+    return ret
+
 class WTForm(forms.Form):
-    '''Form used to wire transfer funds internally in the bank.'''
-    amount = forms.FloatField(
-        label=settings.TALER_CURRENCY, min_value=0.1)
-    counterpart = forms.IntegerField()
+    '''Form used to wire transfer money internally in the bank.'''
+    amount = forms.FloatField(min_value=0.1,
+        widget=forms.NumberInput(attrs={"class": "currency-input"}))
+    receiver = forms.TypedChoiceField(
+        choices=predefined_accounts_dropdown,
+        coerce=int)
     subject = forms.CharField()
 
 # Check if user's logged in.  Check if he/she has withdrawn or

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]