akaunting 3.0 (the last dance)
This commit is contained in:
@@ -1,41 +1,31 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.new', ['type' => trans_choice('general.dashboards', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.dashboards', 1)]))
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="dashboard" route="dashboards.store">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('dashboards.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'id' => 'dashboard',
|
||||
'route' => 'dashboards.store',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
<x-slot name="body">
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
@can('read-auth-users')
|
||||
<x-form.group.checkbox name="users" label="{{ trans_choice('general.users', 2) }}" :options="$users" :checked="[]" />
|
||||
@endcan
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
@can('read-auth-users')
|
||||
{{ Form::checkboxGroup('users', trans_choice('general.users', 2), $users, 'name') }}
|
||||
@endcan
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="dashboards.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('dashboards.index') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="dashboards" />
|
||||
</x-layouts.admin>
|
||||
|
||||
@@ -1,44 +1,35 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.dashboards', 1)]) }}</x-slot>
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.dashboards', 1)]))
|
||||
<x-slot name="content">
|
||||
<x-form.container>
|
||||
<x-form id="dashboard" method="PATCH" :route="['dashboards.update', $dashboard->id]" :model="$dashboard">
|
||||
<x-form.section>
|
||||
<x-slot name="head">
|
||||
<x-form.section.head title="{{ trans('general.general') }}" description="{{ trans('dashboards.form_description.general') }}" />
|
||||
</x-slot>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($dashboard, [
|
||||
'id' => 'dashboard',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['dashboards.update', $dashboard->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true,
|
||||
]) !!}
|
||||
<x-slot name="body">
|
||||
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'font') }}
|
||||
@can('read-auth-users')
|
||||
<x-form.group.checkbox name="users" label="{{ trans_choice('general.users', 2) }}" :options="$users" :checked="$dashboard->users()->pluck('id')->toArray()" />
|
||||
@endcan
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
|
||||
@can('read-auth-users')
|
||||
{{ Form::checkboxGroup('users', trans_choice('general.users', 2), $users, 'name') }}
|
||||
@endcan
|
||||
<x-form.group.switch name="enabled" label="{{ trans('general.enabled') }}" />
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), $dashboard->enabled) }}
|
||||
</div>
|
||||
</div>
|
||||
@can('update-common-dashboards')
|
||||
<x-form.section>
|
||||
<x-slot name="foot">
|
||||
<x-form.buttons cancel-route="dashboards.index" />
|
||||
</x-slot>
|
||||
</x-form.section>
|
||||
@endcan
|
||||
</x-form>
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
@can('update-common-dashboards')
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('dashboards.index') }}
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="dashboards" />
|
||||
</x-layouts.admin>
|
||||
|
||||
@@ -1,91 +1,74 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="title">{{ trans_choice('general.dashboards', 2) }}</x-slot>
|
||||
|
||||
@section('title', trans_choice('general.dashboards', 2))
|
||||
<x-slot name="buttons">
|
||||
@can('create-common-dashboards')
|
||||
<x-link href="{{ route('dashboards.create') }}" kind="primary">
|
||||
{{ trans('general.title.new', ['type' => trans_choice('general.dashboards', 1)]) }}
|
||||
</x-link>
|
||||
@endcan
|
||||
</x-slot>
|
||||
|
||||
@can('create-common-dashboards')
|
||||
@section('new_button')
|
||||
<a href="{{ route('dashboards.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
|
||||
@endsection
|
||||
@endcan
|
||||
<x-slot name="content">
|
||||
<x-index.container>
|
||||
<x-index.search
|
||||
search-string="App\Models\Common\Dashboard"
|
||||
bulk-action="App\BulkActions\Common\Dashboards"
|
||||
/>
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
|
||||
{!! Form::open([
|
||||
'method' => 'GET',
|
||||
'route' => 'dashboards.index',
|
||||
'role' => 'form',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="align-items-center" v-if="!bulk_action.show">
|
||||
<x-search-string model="App\Models\Common\Dashboard" />
|
||||
</div>
|
||||
<x-table>
|
||||
<x-table.thead>
|
||||
<x-table.tr class="flex items-center px-1">
|
||||
<x-table.th class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
|
||||
<x-index.bulkaction.all />
|
||||
</x-table.th>
|
||||
|
||||
{{ Form::bulkActionRowGroup('general.dashboards', $bulk_actions, ['group' => 'common', 'type' => 'dashboards']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
<x-table.th class="w-8/12 sm:w-5/12">
|
||||
<x-sortablelink column="name" title="{{ trans('general.name') }}" />
|
||||
</x-table.th>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-3 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-6 col-lg-7 col-xl-7 long-texts">@sortablelink('name', trans('general.name'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">@sortablelink('enabled', trans('general.enabled'))</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<x-table.th class="w-7/12 hidden sm:table-cell" kind="right">
|
||||
{{ trans_choice('general.users', 1) }}
|
||||
</x-table.th>
|
||||
</x-table.tr>
|
||||
</x-table.thead>
|
||||
|
||||
<tbody>
|
||||
<x-table.tbody>
|
||||
@foreach($dashboards as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-3 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">
|
||||
{{ Form::bulkActionGroup($item->id, $item->name) }}
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-6 col-lg-7 col-xl-7 long-texts"><a href="{{ route('dashboards.edit', $item->id) }}">{{ $item->name }}</a></td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2">
|
||||
@if (user()->can('update-common-dashboards'))
|
||||
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
|
||||
@else
|
||||
@if ($item->enabled)
|
||||
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
|
||||
@else
|
||||
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
|
||||
@endif
|
||||
<x-table.tr href="{{ route('dashboards.edit', $item->id) }}">
|
||||
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
|
||||
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" />
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-5/12 p-0 whitespace-nowrap text-sm font-medium text-black">
|
||||
{{ $item->name }}
|
||||
|
||||
@if (! $item->enabled)
|
||||
<x-index.disable text="{{ trans_choice('general.dashboards', 1) }}" />
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2 col-xl-2 text-center">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h text-muted"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
@if ($item->enabled)
|
||||
<a class="dropdown-item" href="{{ route('dashboards.switch', $item->id) }}">{{ trans('general.switch') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endif
|
||||
<a class="dropdown-item" href="{{ route('dashboards.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
@can('delete-common-dashboards')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'dashboards.destroy') !!}
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-7/12" kind="right">
|
||||
@if ($item->users)
|
||||
@foreach($item->users as $user)
|
||||
<span class="bg-lilac-900 px-3 py-1 text-sm rounded-lg text-black ltr:ml-3 rtl:mr-3">
|
||||
{{ !empty($user->name) ? $user->name : trans('general.na') }}
|
||||
</span>
|
||||
@endforeach
|
||||
@endif
|
||||
</x-table.td>
|
||||
|
||||
<x-table.td kind="action">
|
||||
<x-table.actions :model="$item" />
|
||||
</x-table.td>
|
||||
</x-table.tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</x-table.tbody>
|
||||
</x-table>
|
||||
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $dashboards])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
<x-pagination :items="$dashboards" />
|
||||
</x-index.container>
|
||||
</x-slot>
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
<x-script folder="common" file="dashboards" />
|
||||
</x-layouts.admin>
|
||||
|
||||
@@ -1,148 +1,186 @@
|
||||
@extends('layouts.admin')
|
||||
<x-layouts.admin>
|
||||
<x-slot name="metaTitle">
|
||||
{{ $dashboard->name }}
|
||||
</x-slot>
|
||||
|
||||
@section('title', $dashboard->name)
|
||||
<x-slot name="title">
|
||||
@if ($user_dashboards->count() > 1)
|
||||
<div class="flex items-center relative cursor-pointer">
|
||||
<x-dropdown id="dashboard-list">
|
||||
<x-slot name="trigger" class="flex items-center" override="class">
|
||||
<span class="text-2xl xl:text-5xl text-black font-light truncate border-b border-transparent transition-all hover:text-black-700 hover:border-black">
|
||||
{{ $dashboard->name }}
|
||||
</span>
|
||||
|
||||
@section('dashboard_action')
|
||||
@canany(['create-common-widgets', 'read-common-dashboards'])
|
||||
<span class="dashboard-action">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-sm items-align-center py-2 mt--1" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-v"></i>
|
||||
</a>
|
||||
<svg class="w-5 h-5 mt-1 text-gray-400" x-description="Heroicon name: solid/selector" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
<path fill-rule="evenodd" d="M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd"></path>
|
||||
</svg>
|
||||
</x-slot>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-sm-right dropdown-menu-xs-right dropdown-menu-arrow">
|
||||
@can('create-common-widgets')
|
||||
{!! Form::button(trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]), [
|
||||
'type' => 'button',
|
||||
'class' => 'dropdown-item',
|
||||
'title' => trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]),
|
||||
'@click' => 'onCreateWidget()',
|
||||
]) !!}
|
||||
@endcan
|
||||
@can('update-common-dashboards')
|
||||
<div class="dropdown-divider"></div>
|
||||
@can('create-common-dashboards')
|
||||
<a class="dropdown-item" href="{{ route('dashboards.create') }}">{{ trans('general.title.create', ['type' => trans_choice('general.dashboards', 1)]) }}</a>
|
||||
@endcan
|
||||
<a class="dropdown-item" href="{{ route('dashboards.index') }}">{{ trans('general.title.manage', ['type' => trans_choice('general.dashboards', 2)]) }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
@foreach ($user_dashboards as $user_dashboard)
|
||||
<x-dropdown.link href="{{ route('dashboards.switch', $user_dashboard->id) }}">
|
||||
{{ $user_dashboard->name }}
|
||||
</x-dropdown.link>
|
||||
@endforeach
|
||||
</x-dropdown>
|
||||
</div>
|
||||
</span>
|
||||
@endcanany
|
||||
@else
|
||||
{{ $dashboard->name }}
|
||||
@endif
|
||||
</x-slot>
|
||||
|
||||
@php
|
||||
$text = json_encode([
|
||||
'name' => trans('general.name'),
|
||||
'type' => trans_choice('general.types', 1),
|
||||
'width' => trans('general.width'),
|
||||
'sort' => trans('general.sort'),
|
||||
'enabled' => trans('general.enabled'),
|
||||
'yes' => trans('general.yes'),
|
||||
'no' => trans('general.no'),
|
||||
'save' => trans('general.save'),
|
||||
'cancel' => trans('general.cancel')
|
||||
]);
|
||||
<x-slot name="buttons">
|
||||
<!--Dashboard General Filter-->
|
||||
<el-date-picker
|
||||
v-model="filter_date"
|
||||
type="daterange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
@change="onChangeFilterDate"
|
||||
range-separator="-"
|
||||
start-placeholder="{{ $date_picker_shortcuts[trans('reports.this_year')]['start'] }}"
|
||||
end-placeholder="{{ $date_picker_shortcuts[trans('reports.this_year')]['end'] }}"
|
||||
popper-class="dashboard-picker"
|
||||
:picker-options="{
|
||||
shortcuts: [
|
||||
{
|
||||
text: '{{ trans("reports.this_year") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["end"] }}');
|
||||
|
||||
$placeholder = json_encode([
|
||||
'name' => trans('general.form.enter', ['field' => trans('general.name')]),
|
||||
'type' => trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]),
|
||||
'width' => trans('general.form.select.field', ['field' => trans('general.width')]),
|
||||
'sort' => trans('general.form.enter', ['field' => trans('general.sprt')])
|
||||
]);
|
||||
@endphp
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.previous_year") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["end"] }}');
|
||||
|
||||
<akaunting-widget
|
||||
v-if="widget_modal"
|
||||
:title="'{{ trans_choice('general.widgets', 1) }}'"
|
||||
:show="widget_modal"
|
||||
:widget_id="widget.id"
|
||||
:name="widget.name"
|
||||
:width="widget.width"
|
||||
:action="widget.action"
|
||||
:type="widget.class"
|
||||
:types="widgets"
|
||||
:sort="widget.sort"
|
||||
:dashboard_id="{{ $dashboard->id }}"
|
||||
:text="{{ $text }}"
|
||||
:placeholder="{{ $placeholder }}"
|
||||
@cancel="onCancel">
|
||||
</akaunting-widget>
|
||||
@endsection
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.this_quarter") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["end"] }}');
|
||||
|
||||
@section('new_button')
|
||||
<!--Dashboard General Filter-->
|
||||
<el-date-picker
|
||||
v-model="filter_date"
|
||||
type="daterange"
|
||||
align="right"
|
||||
unlink-panels
|
||||
:format="'yyyy-MM-dd'"
|
||||
value-format="yyyy-MM-dd"
|
||||
@change="onChangeFilterDate"
|
||||
range-separator=">>"
|
||||
start-placeholder="{{ $date_picker_shortcuts[trans("reports.this_year")]["start"] }}"
|
||||
end-placeholder="{{ $date_picker_shortcuts[trans("reports.this_year")]["end"] }}"
|
||||
:picker-options="{
|
||||
shortcuts: [
|
||||
{
|
||||
text: '{{ trans("reports.this_year") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_year")]["end"] }}');
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.previous_quarter") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["end"] }}');
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.last_12_months") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["end"] }}');
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.previous_year") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_year")]["end"] }}');
|
||||
]
|
||||
}">
|
||||
</el-date-picker>
|
||||
</x-slot>
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.this_quarter") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.this_quarter")]["end"] }}');
|
||||
@section('dashboard_action')
|
||||
@canany(['create-common-widgets', 'read-common-dashboards'])
|
||||
<div class="dashboard-action">
|
||||
<x-dropdown id="dropdown-dashboard-company">
|
||||
<x-slot name="trigger" class="flex" override="class">
|
||||
<span id="dashboard-more-actions" class="material-icons-outlined text-4xl text-purple cursor-pointer hover:bg-gray-100 hover:rounded-lg hover:shadow-md">more_vert</span>
|
||||
</x-slot>
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.previous_quarter") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.previous_quarter")]["end"] }}');
|
||||
@can('create-common-widgets')
|
||||
<x-button
|
||||
type="button"
|
||||
id="dashboard-add-widget"
|
||||
class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap"
|
||||
override="class"
|
||||
title="{{ trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]) }}"
|
||||
@click="onCreateWidget()"
|
||||
>
|
||||
<span class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100">
|
||||
{{ trans('general.title.add', ['type' => trans_choice('general.widgets', 1)]) }}
|
||||
</span>
|
||||
</x-button>
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '{{ trans("reports.last_12_months") }}',
|
||||
onClick(picker) {
|
||||
const start = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["start"] }}');
|
||||
const end = new Date('{{ $date_picker_shortcuts[trans("reports.last_12_months")]["end"] }}');
|
||||
<x-dropdown.divider />
|
||||
@endcan
|
||||
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}
|
||||
]
|
||||
}">
|
||||
</el-date-picker>
|
||||
@endsection
|
||||
@can('update-common-dashboards')
|
||||
@can('create-common-dashboards')
|
||||
<x-dropdown.link href="{{ route('dashboards.create') }}">
|
||||
{{ trans('general.title.create', ['type' => trans_choice('general.dashboards', 1)]) }}
|
||||
</x-dropdown.link>
|
||||
@endcan
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
@foreach($widgets as $widget)
|
||||
@widget($widget)
|
||||
@endforeach
|
||||
</div>
|
||||
@endsection
|
||||
<x-dropdown.link href="{{ route('dashboards.index') }}">
|
||||
{{ trans('general.title.manage', ['type' => trans_choice('general.dashboards', 2)]) }}
|
||||
</x-dropdown.link>
|
||||
@endcan
|
||||
</x-dropdown>
|
||||
</div>
|
||||
@endcanany
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/common/dashboards.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
||||
@php
|
||||
$text = json_encode([
|
||||
'name' => trans('general.name'),
|
||||
'type' => trans_choice('general.types', 1),
|
||||
'width' => trans('general.width'),
|
||||
'sort' => trans('general.sort'),
|
||||
'enabled' => trans('general.enabled'),
|
||||
'yes' => trans('general.yes'),
|
||||
'no' => trans('general.no'),
|
||||
'save' => trans('general.save'),
|
||||
'cancel' => trans('general.cancel')
|
||||
]);
|
||||
|
||||
$placeholder = json_encode([
|
||||
'name' => trans('general.form.enter', ['field' => trans('general.name')]),
|
||||
'type' => trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]),
|
||||
'width' => trans('general.form.select.field', ['field' => trans('general.width')]),
|
||||
'sort' => trans('general.form.enter', ['field' => trans('general.sprt')])
|
||||
]);
|
||||
@endphp
|
||||
|
||||
<akaunting-widget
|
||||
v-if="widget_modal"
|
||||
:title="'{{ trans_choice('general.widgets', 1) }}'"
|
||||
:show="widget_modal"
|
||||
:widget_id="widget.id"
|
||||
:name="widget.name"
|
||||
:width="widget.width"
|
||||
:action="widget.action"
|
||||
:type="widget.class"
|
||||
:types="widgets"
|
||||
:sort="widget.sort"
|
||||
:dashboard_id="{{ $dashboard->id }}"
|
||||
:text="{{ $text }}"
|
||||
:placeholder="{{ $placeholder }}"
|
||||
@cancel="onCancel">
|
||||
</akaunting-widget>
|
||||
@endsection
|
||||
|
||||
<x-slot name="content">
|
||||
<div class="dashboard flex flex-wrap -mx-12">
|
||||
@foreach($widgets as $widget)
|
||||
@widget($widget)
|
||||
@endforeach
|
||||
</div>
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="common" file="dashboards" />
|
||||
</x-layouts.admin>
|
||||
|
||||
Reference in New Issue
Block a user