Update index to handle new fields.

This commit is contained in:
James Cole
2023-10-22 07:17:53 +02:00
parent 0d65e396d4
commit 5425dac180
3 changed files with 163 additions and 60 deletions

View File

@@ -26,62 +26,64 @@
<table class="table table-hover">
<thead>
<tr>
{% if isOwner %}
<th>&nbsp;</th>
{% endif %}
<th>&nbsp;</th>
<th>{{ 'currency'|_ }}</th>
<th>{{ 'number_of_decimals'|_ }}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for currency in currencies %}
<tr>
{% if isOwner %}
<td>
<div class="btn-group btn-group-xs">
{% if isOwner %}
<a class="btn btn-default" href="{{ route('currencies.edit',currency.id) }}"><span
class="fa fa-fw fa-pencil"></span></a>
<a class="btn btn-danger" href="{{ route('currencies.delete',currency.id) }}"><span
class="fa fa-fw fa-trash"></span></a>
{% endif %}
{# Disable the currency. #}
{% if currency.userEnabled %}
<a class="btn btn-default disable-currency" data-code="{{ currency.code }}"
href="#">
<span class="fa fa-fw fa-square-o"></span>
{{ 'disable_currency'|_ }}</a>
{% endif %}
{# Enable the currency. #}
{% if not currency.userEnabled %}
<a class="btn btn-default enable-currency" data-code="{{ currency.code }}"
href="#">
<span class="fa fa-fw fa-check-square-o"></span>
{{ 'enable_currency'|_ }}</a>
{% endif %}
{# Make currency default. #}
{% if currency.id != defaultCurrency.id %}
<button data-code="{{ currency.code }}" class="make_default btn btn-default"><span
class="fa fa-fw fa-star"></span> {{ 'make_default_currency'|_ }}</button>
{% endif %}
</div>
</td>
{% endif %}
<td>
{% if currency.enabled == false %}
{% if currency.userEnabled == false %}
<span class="text-muted">
{% endif %}
{{ currency.name }} ({{ currency.code }}) ({{ currency.symbol|raw }})
{% if currency.id == defaultCurrency.id %}
<span class="label label-success" id="default-currency">{{ 'default_currency'|_ }}</span>
{% endif %}
{% if currency.enabled == false %}
{% if currency.userEnabled == false %}
<span class="label label-default">{{ 'currency_is_disabled'|_ }}</span>
{% endif %}
{% if currency.userEnabled == false %}
</span>
<br><small class="text-danger">{{ 'currency_is_disabled'|_ }}</small>
{% endif %}
</td>
<td>{{ currency.decimal_places }}</td>
<td class="buttons">
<div class="btn-group">
{% if currency.id != defaultCurrency.id %}
<button data-id="{{ currency.id }}" class="make_default btn btn-default"><span
class="fa fa-fw fa-star"></span> {{ 'make_default_currency'|_ }}</button>
{% endif %}
{% if currency.enabled %}
<a class="btn btn-default disable-currency" data-id="{{ currency.id }}"
href="#">
<span class="fa fa-fw fa-square-o"></span>
{{ 'disable_currency'|_ }}</a>
{% endif %}
{% if not currency.enabled %}
<a class="btn btn-default enable-currency" data-id="{{ currency.id }}"
href="#">
<span class="fa fa-fw fa-check-square-o"></span>
{{ 'enable_currency'|_ }}</a>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
@@ -100,9 +102,8 @@
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var makeDefaultUrl = "{{ route('currencies.default') }}";
var disableCurrencyUrl = "{{ route('currencies.disable') }}";
var enableCurrencyUrl = "{{ route('currencies.enable') }}";
var redirectUrl = "{{ route('currencies.index') }}";
var updateCurrencyUrl = "{{ route('api.v1.currencies.update', ['']) }}";
</script>
<script type="text/javascript" src="v1/js/ff/currencies/index.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}