Merge branch 'main' into develop

This commit is contained in:
James Cole
2023-10-22 08:05:48 +02:00
31 changed files with 765 additions and 323 deletions

View File

@@ -1583,7 +1583,8 @@ return [
'create_currency' => 'Create a new currency',
'store_currency' => 'Store new currency',
'update_currency' => 'Update currency',
'new_default_currency' => ':name is now the default currency.',
'new_default_currency' => '":name" is now the default currency.',
'default_currency_failed' => 'Could not make ":name" the default currency. Please check the logs.',
'cannot_delete_currency' => 'Cannot delete :name because it is still in use.',
'cannot_delete_fallback_currency' => ':name is the system fallback currency and can\'t be deleted.',
'cannot_disable_currency_journals' => 'Cannot disable :name because transactions are still using it.',
@@ -1609,7 +1610,9 @@ return [
'disable_currency' => 'Disable',
'currencies_default_disabled' => 'Most of these currencies are disabled by default. To use them, you must enable them first.',
'currency_is_now_enabled' => 'Currency ":name" has been enabled',
'could_not_enable_currency' => 'Could not enable currency ":name". Please review the logs.',
'currency_is_now_disabled' => 'Currency ":name" has been disabled',
'could_not_disable_currency' => 'Could not disable currency ":name". Perhaps it is still in use?',
// forms:
'mandatoryFields' => 'Mandatory fields',

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 %}