summaryrefslogtreecommitdiff
path: root/talerbank/app/templates/profile_page.html
blob: d9f0a9c497efa778c2873593da3cfbffac5e0a02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html>
<!--
  This file is part of GNU TALER.
  Copyright (C) 2014, 2015, 2016 INRIA

  TALER is free software; you can redistribute it and/or modify it under the
  terms of the GNU Lesser General Public License as published by the Free Software
  Foundation; either version 2.1, or (at your option) any later version.

  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License along with
  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>

  @author Marcello Stanisci
-->
{% extends "base.html" %}
{% load staticfiles %}

{% block head %}
  <meta name="currency" value="{{ currency }}">
  <meta name="precision" value="{{ precision }}">
  <meta name="callback-url" value="{% url 'pin_tan' %}">
  {% if withdraw and withdraw == "success" %}
    <meta name="reserve-pub" value="{{ reserve_pub }}">
  {% endif %}
  <link rel="stylesheet" type="text/css" href="{% static "disabled-button.css" %}">
  <script src="{% static "chrome-store-link.js" %}" type="application/javascript"></script>
  <script src="{% static "profile-page.js" %}" type="application/javascript"></script>
{% endblock head %}
{% block headermsg %}
  <h1 class="nav">Welcome <em>{{ name }}</em>!</h1>
{% endblock headermsg %}
{% block content %}
  <section id="menu">
    <a href="{% url 'logout' %}">[Logout]</a><br>
    <p>
    Account:<br>
    # {{ account_no }}
    </p>
    <p>Current<br>
      balance:<br>
      <b>
      {{ balance }}</b> <br>
      {{ currency }}
    </p>
  </section>
  <section id="main">
    <article>
      <div class="notification">
        {% if withdraw %}
        {% if withdraw == "success" %}
        <p class="informational informational-ok">
          Withdrawal approved!
        </p>
        {% else %}
        <p class="informational informational-fail">
          Withdrawal failed!
        </p>
        {% endif %}
        {% endif %}
        {% if registration %}
        {% if registration == "success" %}
        <p class="informational informational-ok">
          Registration successful!
        </p>
        {% endif %}
        {% endif %}
        </div>
    </article>
    <article>
      <div class="taler-installed-hide">
        <h2>Withdraw digital coins using Taler</h2>
        You need to install the Taler wallet to withdraw digital coins.
         <span id="install-done" style="visibility: hidden">(done)</span>
         <ul>
           <li>from the app store for <a
               href="https://chrome.google.com/webstore/detail/gnu-taler-wallet/millncjiddlpgdmkklmhfadpacifaonc">Google
               Chrome and Chromium</a>
           </li>
           <li>By visiting our <a href="/landing">landing page</a>.
           </li>
         </ul>
        Right now, you need Chrome or Chromium to
        install the wallet. We plan to support other browsers in the future.
      </div>

      <div>
        <h2>Withdraw digital coins using Taler</h2>

        <form id="reserve-form" name="tform" action="">
  	  {% csrf_token %}
          <input type="text" id="reserve-pk-input" name="reserve_pk" hidden></input>
          Amount to withdraw:
          <select id="reserve-amount" name="kudos_amount" autofocus>
	    <!-- programmatically filled -->
          </select>
          <input type="text" name="mint_rcv" id="kudos-mint" hidden></input>

          <div class="taler-installed-show">
            <input id="select-exchange"
                   type="button"
                   value="Select exchange provider"></input>
          </div>
          <input id="select-exchange"
                 class="taler-installed-show"
                 type="button"
                 value="Select exchange provider"></input>
          <!-- fake disabled button -->
          <input class="taler-installed-hide"
                 type="button"
                 disabled
                 value="Select exchange provider"></input>
          </div>
        </form>
      </div>
    </article>
    <article>
      <h2>Transaction history</h2>
      <div id="transactions-history">
        {% if history %}
        <table class="history">
          <tbody>
          <tr>
            <th style="text-align:center">Date</th>
            <th style="text-align:center">Amount</th>
            <th style="text-align:center">Counterpart</th>
            <th style="text-align:center">Subject</th>
          </tr>
          {% for item in history %}
          <tr>
            <td style="text-align:right">{{ item.date }}</td>
	    <td style="text-align:right">
              {% if item.direction == "FROM" %}+{% else %}-{% endif %}{{ item.float_amount }}
  	      {{ item.float_currency }}
            </td>
  	    <td class="text-align:left">{% if item.counterpart_username %} {{ item.counterpart_username }} {% endif %} (account #{{ item.counterpart }})</td>
	    <td class="text-align:left">{{ item.subject }}</td>
	  </tr>
          {% endfor %}
          </tbody>
        </table>
        {% else %}
        <p class="informational informational-fail">
          No transactions made to/from this account
        </p>
        {% endif %}
      </div>

    </article>
  </section>
  <div class="copyright">
    <p>Copyright &copy; 2014&mdash;2016 INRIA</p>
    <a href="/javascript" data-jslicense="1" class="jslicenseinfo">JavaScript license information</a>
  </div>
{% endblock %}