92 lines
4.4 KiB
PHP
Raw Normal View History

2019-11-16 10:21:14 +03:00
@extends('layouts.admin')
@section('title', trans_choice('general.reports', 2))
@section('new_button')
2020-10-22 18:58:58 +03:00
@can('create-common-reports')
<a href="{{ route('reports.create') }}" class="btn btn-success btn-sm">{{ trans('general.add_new') }}</a>
@endcan
2019-11-16 10:21:14 +03:00
@endsection
@section('content')
<div class="row mb-4">
2020-01-04 13:42:58 +03:00
@foreach($categories as $name => $reports)
<div class="col-md-12">
<h3>{{ $name }}</h3>
2019-11-16 10:21:14 +03:00
</div>
2020-01-04 13:42:58 +03:00
@foreach($reports as $report)
<div class="col-md-4">
<div class="card card-stats">
2021-02-12 13:28:03 +03:00
@canany(['create-common-reports', 'update-common-reports', 'delete-common-reports'])
2021-06-15 15:09:56 +03:00
<a class="btn btn-sm items-align-center py-2 mr-0 card-action-button shadow-none--hover" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-v text-primary"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
@can('update-common-reports')
<a class="dropdown-item" href="{{ route('reports.edit', $report->id) }}">{{ trans('general.edit') }}</a>
@endcan
@can('create-common-reports')
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{ route('reports.duplicate', $report->id) }}">{{ trans('general.duplicate') }}</a>
@endcan
@can('delete-common-reports')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($report, 'reports.destroy') !!}
@endcan
2019-11-16 10:21:14 +03:00
</div>
2021-02-12 13:28:03 +03:00
@endcanany
2019-11-16 10:21:14 +03:00
2020-01-04 13:42:58 +03:00
<div class="card-body">
<div class="row">
<div class="col">
<a href="{{ route('reports.show', $report->id) }}">
<h5 class="card-title text-uppercase text-muted mb-0">{{ $report->name }}</h5>
</a>
2021-06-15 12:37:13 +03:00
<div class="d-flex align-items-center">
<a href="{{ route('reports.show', $report->id) }}">
<h2 class="font-weight-bold mb-0" v-if="reports_total[{{ $report->id }}]" v-html="reports_total[{{ $report->id }}]"></h2>
<h2 class="font-weight-bold mb-0" v-else>{{ $totals[$report->id] }}</h2>
</a>
<button type="button" @click="onRefreshTotal('{{ $report->id }}')" class="btn btn-otline-primary btn-sm ml-2">
<i class="fas fa-redo"></i>
</button>
</div>
2020-01-04 13:42:58 +03:00
</div>
2021-06-15 12:37:13 +03:00
2020-01-04 13:42:58 +03:00
<div class="col-auto">
<a href="{{ route('reports.show', $report->id) }}">
<div class="icon icon-shape bg-orange text-white rounded-circle shadow">
2020-01-18 13:11:19 +03:00
<i class="{{ $icons[$report->id] }}"></i>
2020-01-04 13:42:58 +03:00
</div>
</a>
</div>
2019-11-16 10:21:14 +03:00
</div>
2021-06-15 12:37:13 +03:00
2020-01-04 13:42:58 +03:00
<p class="mt-3 mb-0 text-sm">
<a class="text-default" href="{{ route('reports.show', $report->id) }}">
<span class="pre">{{ $report->description }}</span>
2019-11-16 10:21:14 +03:00
</a>
2020-01-04 13:42:58 +03:00
</p>
2019-11-16 10:21:14 +03:00
</div>
</div>
</div>
2020-01-04 13:42:58 +03:00
@endforeach
2019-11-16 10:21:14 +03:00
2020-01-04 13:42:58 +03:00
@endforeach
2019-11-16 10:21:14 +03:00
</div>
@endsection
@push('scripts_start')
2021-06-15 12:37:13 +03:00
<script type="text/javascript">
var reports_total = {!! json_encode($totals) !!};
</script>
2019-11-16 10:21:14 +03:00
<script src="{{ asset('public/js/common/reports.js?v=' . version('short')) }}"></script>
@endpush