From 87987f2a2eac2fc621c0263d1d591ef39dc21b4c Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 20 Oct 2017 08:00:13 +0200 Subject: [PATCH] Less popups for #943 --- app/Http/Controllers/CurrencyController.php | 4 +++- resources/views/currencies/index.twig | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 @@ + {% if isOwner %} + {% endif %} @@ -28,12 +30,14 @@ {% for currency in currencies %} + {% if isOwner %} + {% endif %}
 {{ 'currency'|_ }} {{ 'number_of_decimals'|_ }}  
{{ currency.name }} ({{ currency.code }}) ({{ currency.symbol|raw }}) {{ currency.decimal_places }}