@extends('layouts.project') @section('subtitle', __('project.jobs')) @section('action-buttons') @can('create', new App\Entities\Projects\Job) {!! html_link_to_route('projects.jobs.create', __('job.create'), [$project], ['class' => 'btn btn-success','icon' => 'plus']) !!} {!! html_link_to_route('projects.jobs.add-from-other-project', __('job.add_from_other_project'), [$project], ['class' => 'btn btn-default','icon' => 'plus']) !!} @endcan @endsection @section('content-project') @if ($jobs->isEmpty())
{{ __('project.no_jobs') }}, {{ link_to_route('projects.jobs.create', __('job.create'), [$project]) }}.
@else @foreach($jobs->groupBy('type_id') as $key => $groupedJobs)| {{ __('app.table_no') }} | {{ __('job.name') }} | {{ __('job.tasks_count') }} | {{ __('job.progress') }} | @can('see-pricings', new App\Entities\Projects\Job){{ __('job.price') }} | @endcan {{--{{ __('job.worker') }} | --}}{{ __('time.updated_at') }} | {{ __('app.action') }} | @forelse($groupedJobs as $key => $job) @php $no = 1 + $key; $job->progress = $job->tasks->avg('progress'); @endphp
|---|---|---|---|---|---|---|
| {{ $no }} |
{{ $job->name }}
@if ($job->tasks->isEmpty() == false)
|
{{ $job->tasks_count = $job->tasks->count() }} | {{ formatDecimal($job->progress) }} % | @can('see-pricings', $job){{ formatRp($job->price) }} | @endcan
{{ $job->updated_at->diffForHumans() }} {{ __('job.worker') }} : {{ $job->worker->name }} |
@can('view', $job) {!! html_link_to_route('jobs.show', '',[$job->id],['icon' => 'search', 'title' => __('job.show'), 'class' => 'btn btn-info btn-xs','id' => 'show-job-' . $job->id]) !!} @endcan @can('edit', $job) {!! html_link_to_route('jobs.edit', '',[$job->id],['icon' => 'edit', 'title' => __('job.edit'), 'class' => 'btn btn-warning btn-xs']) !!} @endcan |
| {{ __('job.empty') }} | ||||||
| Total | {{ $groupedJobs->sum('tasks_count') }} | {{ formatDecimal($groupedJobs->sum('progress') / $groupedJobs->count()) }} % ({{ formatDecimal($project->getJobOveralProgress()) }} %) | @can('see-pricings', new App\Entities\Projects\Job){{ formatRp($groupedJobs->sum('price')) }} | @endcan@can('update', $project) @if (request('action') == 'sort_jobs') {{ link_to_route('projects.jobs.index', __('app.done'), [$project->id], ['class' => 'btn btn-default btn-xs pull-right']) }} @else {{ link_to_route('projects.jobs.index', __('project.sort_jobs'), [$project->id, 'action' => 'sort_jobs', '#project-jobs'], ['class' => 'btn btn-default btn-xs pull-right']) }} @endif @endcan | ||