Less popups for #943

This commit is contained in:
James Cole
2017-10-20 08:00:13 +02:00
parent 30bfdda2b0
commit 87987f2a2e
2 changed files with 7 additions and 1 deletions

View File

@@ -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'));
}
/**

View File

@@ -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">