Initial user ability to set foreign currency

This commit is contained in:
James Cole
2017-04-14 10:16:52 +02:00
parent b99bfcd02e
commit 9a69ce309e
16 changed files with 152 additions and 13 deletions

View File

@@ -2,6 +2,6 @@
<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
<div class="col-sm-8">
<p class="form-control-static">{{ value|raw }}</p>
<p class="form-control-static" id="{{ options.id }}">{{ value|raw }}</p>
</div>
</div>

View File

@@ -1,4 +1,4 @@
var accountInfo = [];
{% for id, account in accounts %}
accountInfo[{{ id }}] = {preferredCurrency: {{ account.preferredCurrency }}};
accountInfo[{{ id }}] = {preferredCurrency: {{ account.preferredCurrency }}, name: "{{ account.name }}"};
{% endfor %}

View File

@@ -0,0 +1,4 @@
var currencyInfo = [];
{% for id, currency in currencies %}
currencyInfo[{{ id }}] = {name: "{{ currency.name }}", symbol: "{{ currency.symbol }}", code: "{{ currency.code }}"};
{% endfor %}

View File

@@ -47,6 +47,11 @@
{# ALWAYS SHOW AMOUNT #}
{{ ExpandedForm.amount('amount') }}
{# INSTRUCTIONS FOR EXCHANGE RATES #}
{{ ExpandedForm.staticText('exchange_rate_instruction','(here be text)') }}
{{ ExpandedForm.nonSelectableAmount('exchanged_amount') }}
{# ALWAYS SHOW DATE #}
{{ ExpandedForm.date('date', preFilled.date|default(phpdate('Y-m-d'))) }}
</div>
@@ -209,6 +214,7 @@
var middleCrumbName = [];
var middleCrumbUrl = [];
var button = [];
var exchangeRateInstructions = "{{ 'exchange_rate_instructions'|_|escape('js') }}";
{% for type in {0:'withdrawal',1:'deposit',2:'transfer'} %}
txt['{{ type }}'] = '{{ type|_ }}';
@@ -225,6 +231,7 @@
<script type="text/javascript" src="js/lib/modernizr-custom.js"></script>
<script type="text/javascript" src="js/lib/jquery-ui.min.js"></script>
<script type="text/javascript" src="javascript/accounts?ext=.js"></script>
<script type="text/javascript" src="javascript/currencies?ext=.js"></script>
<script type="text/javascript" src="js/ff/transactions/single/create.js"></script>
{% endblock %}