1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Hide New Expense Category if user has no right to create

This commit is contained in:
DESKTOP-ATRT1VG\Dago 2018-02-19 13:41:36 +08:00
parent d27eb414c6
commit 410253be04

View File

@ -90,12 +90,18 @@
['label' => trans('texts.new_recurring_expense'), 'url' => url('/recurring_expenses/create')],
]
)->split() !!}
{!! DropdownButton::normal(trans('texts.categories'))
->withAttributes(['class'=>'categoriesDropdown'])
->withContents([
['label' => trans('texts.new_expense_category'), 'url' => url('/expense_categories/create')],
]
)->split() !!}
@if (Auth::user()->can('create', ENTITY_EXPENSE_CATEGORY))
{!! DropdownButton::normal(trans('texts.categories'))
->withAttributes(['class'=>'categoriesDropdown'])
->withContents([
['label' => trans('texts.new_expense_category'), 'url' => url('/expense_categories/create')],
]
)->split() !!}
@else
{!! DropdownButton::normal(trans('texts.categories'))
->withAttributes(['class'=>'categoriesDropdown'])
->split() !!}
@endif
<script type="text/javascript">
$(function() {
$('.recurringDropdown:not(.dropdown-toggle)').click(function(event) {