Skip to content

Firefly III: a personal finances manager

Less popups for #943

James Cole87987f2a2eac
diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php
index 7590ff821a..04d262a893 100644
--- a/app/Http/Controllers/CurrencyController.php
+++ b/app/Http/Controllers/CurrencyController.php
@@ -207,11 +207,13 @@ class CurrencyController extends Controller
{
$currencies = $this->repository->get();
$defaultCurrency = $this->repository->getCurrencyByPreference(Preferences::get('currencyPreference', config('firefly.default_currency', 'EUR')));
+ $isOwner = true;
if (!$this->userRepository->hasRole(auth()->user(), 'owner')) {
$request->session()->flash('info', trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));
+ $isOwner = false;
}
- return view('currencies.index', compact('currencies', 'defaultCurrency'));
+ return view('currencies.index', compact('currencies', 'defaultCurrency','isOwner'));
}
/**
diff --git a/resources/views/currencies/index.twig b/resources/views/currencies/index.twig
index e13c3b8df2..da68f20955 100644
--- a/resources/views/currencies/index.twig
+++ b/resources/views/currencies/index.twig
@@ -19,7 +19,9 @@
<table class="table table-hover">
<thead>
<tr>
+ {% if isOwner %}
<th>&nbsp;</th>
+ {% endif %}
<th>{{ 'currency'|_ }}</th>
<th>{{ 'number_of_decimals'|_ }}</th>
<th>&nbsp;</th>
@@ -28,12 +30,14 @@
<tbody>
{% for currency in currencies %}
<tr>
+ {% if isOwner %}
<td>
<div class="btn-group btn-group-xs">
<a class="btn btn-default" href="{{ route('currencies.edit',currency.id) }}"><i class="fa fa-fw fa-pencil"></i></a>
<a class="btn btn-danger" href="{{ route('currencies.delete',currency.id) }}"><i class="fa fa-fw fa-trash"></i></a>
</div>
</td>
+ {% endif %}
<td>{{ currency.name }} ({{ currency.code }}) ({{ currency.symbol|raw }})</td>
<td>{{ currency.decimal_places }}</td>
<td class="defaultCurrency">