Browse Source

Update job views and remove unused scripts

Update add job from other project page to use lang
Use __() helper instead of trans()
Update link_to_route parameters
pull/6/head
Nafies Luthfi 8 years ago
parent
commit
9387a3e4e6
  1. 2
      resources/lang/en/job.php
  2. 2
      resources/lang/id/job.php
  3. 44
      resources/views/jobs/add-from-other-project.blade.php
  4. 22
      resources/views/jobs/create.blade.php
  5. 16
      resources/views/jobs/delete.blade.php
  6. 24
      resources/views/jobs/edit.blade.php
  7. 2
      resources/views/jobs/partials/breadcrumb.blade.php
  8. 14
      resources/views/jobs/partials/job-show.blade.php
  9. 42
      resources/views/jobs/partials/job-tasks-operation.blade.php
  10. 28
      resources/views/jobs/partials/job-tasks.blade.php
  11. 10
      resources/views/jobs/show.blade.php
  12. 26
      resources/views/jobs/unfinished.blade.php
  13. 2
      tests/Feature/ManageJobsTest.php

2
resources/lang/en/job.php

@ -17,6 +17,7 @@ return [
// Actions
'create' => 'Create new Job',
'add' => 'Add Jobs',
'created' => 'New Job has been created.',
'show' => 'View Job Detail',
'edit' => 'Edit Job',
@ -26,6 +27,7 @@ return [
'deleted' => 'Job has been deleted.',
'undeleted' => 'Job not deleted.',
'add_from_other_project' => 'Add Job from another Project',
'select_project' => 'Select a project.',
'sort_tasks' => 'Sort Task Priority',
// Attributes

2
resources/lang/id/job.php

@ -26,10 +26,12 @@ return [
'deleted' => 'Hapus data Job telah berhasil.',
'undeleted' => 'Data Job gagal dihapus.',
'add_from_other_project' => 'Tambah Job dari Project Lain',
'select_project' => 'Pilih salah satu project.',
'sort_tasks' => 'Urutkan Prioritas Task',
// Attributes
'name' => 'Nama Job',
'add' => 'Tambahkan Job',
'description' => 'Deskripsi',
'progress' => 'Progress',
'worker' => 'Pekerja',

44
resources/views/jobs/add-from-other-project.blade.php

@ -1,24 +1,24 @@
@extends('layouts.app')
@section('title', trans('job.add_from_other_project') . ' | ' . $project->name)
@section('title', __('job.add_from_other_project').' | '.$project->name)
@section('content')
@include('projects.partials.breadcrumb',['title' => trans('job.add_from_other_project')])
@include('projects.partials.breadcrumb',['title' => __('job.add_from_other_project')])
<div class="row">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('job.add_from_other_project') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('job.add_from_other_project') }}</h3></div>
<div class="panel-body">
{!! Form::open(['method'=>'get']) !!}
{!! Form::open(['method' => 'get']) !!}
<div class="form-group">
<label for="project_id" class="text-primary">{{ trans('project.project') }}</label>
<label for="project_id" class="text-primary">{{ __('project.project') }}</label>
<div class="input-group">
{!! Form::select('project_id', $projects, request('project_id'), [
'class' => 'form-control customer-select',
'placeholder' => '-- Pilih Project --'
'class' => 'form-control customer-select',
'placeholder' => '-- '.__('project.select').' --'
]) !!}
<span class="input-group-btn"><button class="btn btn-default btn-sm" type="submit">{{ trans('project.show_jobs') }}</button></span>
<span class="input-group-btn"><button class="btn btn-default btn-sm" type="submit">{{ __('project.show_jobs') }}</button></span>
</div>
</div>
{!! Form::close() !!}
@ -28,31 +28,31 @@
@forelse($selectedProject->jobs as $key => $job)
<li>
<label for="job_id_{{ $job->id }}">
{!! Form::checkbox('job_ids[' . $job->id . ']', $job->id, null, ['id' => 'job_id_' . $job->id]) !!}
{!! Form::checkbox('job_ids['.$job->id.']', $job->id, null, ['id' => 'job_id_'.$job->id]) !!}
{{ $job->name }}</label>
<ul style="list-style-type:none">
@foreach($job->tasks as $task)
<li>
<label for="{{ $job->id }}_task_id_{{ $task->id }}" style="font-weight:normal">
{!! Form::checkbox($job->id . '_task_ids[' . $task->id . ']', $task->id, null, ['id' => $job->id . '_task_id_' . $task->id]) !!}
{!! Form::checkbox($job->id.'_task_ids['.$task->id.']', $task->id, null, ['id' => $job->id.'_task_id_'.$task->id]) !!}
{{ $task->name }}</label>
</li>
@endforeach
</ul>
</li>
@empty
<li><div class="alert alert-info">Tidak ada fitur</div></li>
<li><div class="alert alert-info">{{ __('job.not_found') }}</div></li>
@endforelse
</ul>
@else
<div class="alert alert-info">Pilih salah satu project</div>
<div class="alert alert-info">{{ __('job.select_project') }}</div>
@endif
{!! Form::submit(trans('job.create'), ['class'=>'btn btn-primary']) !!}
{!! Form::submit(__('job.add'), ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
</div>
<div class="panel-footer">
{!! link_to_route('projects.jobs.index', trans('app.cancel'), [$project->id], ['class'=>'btn btn-default']) !!}
{{ link_to_route('projects.jobs.index', __('app.cancel'), [$project], ['class' => 'btn btn-default']) }}
</div>
</div>
</div>
@ -61,19 +61,3 @@
</div>
</div>
@endsection
@section('ext_js')
{!! Html::script(url('assets/js/plugins/autoNumeric.min.js')) !!}
@endsection
@section('script')
<script>
(function() {
$('#price').autoNumeric("init",{
aSep: '.',
aDec: ',',
mDec: '0'
});
})();
</script>
@endsection

22
resources/views/jobs/create.blade.php

@ -1,38 +1,38 @@
@extends('layouts.app')
@section('title', trans('job.create'))
@section('title', __('job.create'))
@section('content')
@include('projects.partials.breadcrumb', ['title' => trans('job.create')])
@include('projects.partials.breadcrumb', ['title' => __('job.create')])
<div class="row">
<div class="col-sm-6">
{!! Form::open(['route' => ['projects.jobs.store', $project->id]]) !!}
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('job.create') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('job.create') }}</h3></div>
<div class="panel-body">
{!! FormField::text('name', ['label' => trans('job.name')]) !!}
{!! FormField::text('name', ['label' => __('job.name')]) !!}
<div class="row">
<div class="col-sm-4">
{!! FormField::price('price', [
'label' => trans('job.price'),
'label' => __('job.price'),
'currency' => Option::get('money_sign', 'Rp'),
'value' => 0,
'value' => 0,
]) !!}
</div>
<div class="col-sm-4">
{!! FormField::select('worker_id', $workers, ['label' => trans('job.worker'), 'value' => 1]) !!}
{!! FormField::select('worker_id', $workers, ['label' => __('job.worker'), 'value' => 1]) !!}
</div>
<div class="col-sm-4">
{!! FormField::radios('type_id', [1 => trans('job.main'), trans('job.additional')], ['value' => 1, 'label' => trans('job.type'), 'list_style' => 'unstyled']) !!}
{!! FormField::radios('type_id', [1 => __('job.main'), __('job.additional')], ['value' => 1, 'label' => __('job.type'), 'list_style' => 'unstyled']) !!}
</div>
</div>
{!! FormField::textarea('description', ['label' => trans('job.description')]) !!}
{!! FormField::textarea('description', ['label' => __('job.description')]) !!}
</div>
<div class="panel-footer">
{!! Form::submit(trans('job.create'), ['class' => 'btn btn-primary']) !!}
{!! link_to_route('projects.jobs.index', trans('app.cancel'), [$project->id], ['class' => 'btn btn-default']) !!}
{!! Form::submit(__('job.create'), ['class' => 'btn btn-primary']) !!}
{{ link_to_route('projects.jobs.index', __('app.cancel'), [$project], ['class' => 'btn btn-default']) }}
</div>
</div>
{!! Form::close() !!}

16
resources/views/jobs/delete.blade.php

@ -1,21 +1,21 @@
@extends('layouts.app')
@section('title', trans('job.delete'))
@section('title', __('job.delete'))
@section('content')
<h1 class="page-header">
<div class="pull-right">
{!! FormField::delete([
'route'=>['jobs.destroy',$job->id]],
trans('app.delete_confirm_button'),
['class'=>'btn btn-danger'],
'route' => ['jobs.destroy', $job]],
__('app.delete_confirm_button'),
['class' => 'btn btn-danger'],
[
'job_id'=>$job->id,
'project_id'=>$job->project_id,
'job_id' => $job->id,
'project_id' => $job->project_id,
]) !!}
</div>
{{ trans('app.delete_confirm') }}
{!! link_to_route('jobs.show', trans('app.cancel'), [$job->id], ['class' => 'btn btn-default']) !!}
{{ __('app.delete_confirm') }}
{{link_to_route('jobs.show', __('app.cancel'), [$job], ['class' => 'btn btn-default']) }}
</h1>
<div class="row">
<div class="col-md-4">

24
resources/views/jobs/edit.blade.php

@ -1,35 +1,35 @@
@extends('layouts.app')
@section('title', trans('job.edit'))
@section('title', __('job.edit'))
@section('content')
<div class="row"><br>
<div class="col-md-6">
{!! Form::model($job, ['route' =>['jobs.update', $job->id], 'method' => 'patch']) !!}
{!! Form::model($job, ['route' => ['jobs.update', $job], 'method' => 'patch']) !!}
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ $job->name }} <small>{{ trans('job.edit') }}</small></h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ $job->name }} <small>{{ __('job.edit') }}</small></h3></div>
<div class="panel-body">
{!! FormField::text('name', ['label' => trans('job.name')]) !!}
{!! FormField::text('name', ['label' => __('job.name')]) !!}
<div class="row">
<div class="col-sm-4">
{!! FormField::price('price', ['label' => trans('job.price'), 'currency' => Option::get('money_sign', 'Rp')]) !!}
{!! FormField::price('price', ['label' => __('job.price'), 'currency' => Option::get('money_sign', 'Rp')]) !!}
</div>
<div class="col-sm-4">
{!! FormField::select('worker_id', $workers, ['label' => trans('job.worker')]) !!}
{!! FormField::select('worker_id', $workers, ['label' => __('job.worker')]) !!}
</div>
<div class="col-sm-4">
{!! FormField::radios('type_id', [1 => trans('job.main'), trans('job.additional')], ['value' => 1, 'label' => trans('job.type'), 'list_style' => 'unstyled']) !!}
{!! FormField::radios('type_id', [1 => __('job.main'), __('job.additional')], ['value' => 1, 'label' => __('job.type'), 'list_style' => 'unstyled']) !!}
</div>
</div>
{!! FormField::textarea('description', ['label' => trans('job.description')]) !!}
{!! FormField::textarea('description', ['label' => __('job.description')]) !!}
</div>
<div class="panel-footer">
{!! Form::hidden('project_id', $job->project_id) !!}
{!! Form::submit(trans('job.update'), ['class' => 'btn btn-primary']) !!}
{!! link_to_route('jobs.show', trans('app.show'), [$job->id], ['class' => 'btn btn-info']) !!}
{!! link_to_route('projects.jobs.index', trans('job.back_to_index'), [$job->project_id], ['class' => 'btn btn-default']) !!}
{!! link_to_route('jobs.delete', trans('job.delete'), [$job->id], ['class' => 'btn btn-danger pull-right']) !!}
{!! Form::submit(__('job.update'), ['class' => 'btn btn-primary']) !!}
{{ link_to_route('jobs.show', __('app.show'), [$job], ['class' => 'btn btn-info']) }}
{{ link_to_route('projects.jobs.index', __('job.back_to_index'), [$job->project_id], ['class' => 'btn btn-default']) }}
{{ link_to_route('jobs.delete', __('job.delete'), [$job], ['class' => 'btn btn-danger pull-right']) }}
</div>
</div>
{!! Form::close() !!}

2
resources/views/jobs/partials/breadcrumb.blade.php

@ -1,5 +1,5 @@
<ul class="breadcrumb hidden-print">
<li>{{ link_to_route('projects.index',trans('project.projects')) }}</li>
<li>{{ link_to_route('projects.index', __('project.projects')) }}</li>
<li>{{ $job->present()->projectLink }}</li>
<li>{{ $job->present()->projectJobsLink }}</li>
<li class="active">{{ isset($title) ? $title : $job->name }}</li>

14
resources/views/jobs/partials/job-show.blade.php

@ -1,15 +1,15 @@
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('job.detail') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('job.detail') }}</h3></div>
<table class="table table-condensed">
<tbody>
<tr><th class="col-md-4">{{ trans('job.name') }}</th><td class="col-md-8">{{ $job->name }}</td></tr>
<tr><th>{{ trans('job.type') }}</th><td>{{ $job->type() }}</td></tr>
<tr><th class="col-md-4">{{ __('job.name') }}</th><td class="col-md-8">{{ $job->name }}</td></tr>
<tr><th>{{ __('job.type') }}</th><td>{{ $job->type() }}</td></tr>
@can('see-pricings', $job)
<tr><th>{{ trans('job.price') }}</th><td>{{ formatRp($job->price) }}</td></tr>
<tr><th>{{ __('job.price') }}</th><td>{{ formatRp($job->price) }}</td></tr>
@endcan
<tr><th>{{ trans('job.progress') }}</th><td>{{ formatDecimal($job->tasks->avg('progress')) }}%</td></tr>
<tr><th>{{ trans('job.worker') }}</th><td>{{ $job->worker->name }}</td></tr>
<tr><th>{{ trans('job.description') }}</th><td>{!! nl2br($job->description) !!}</td></tr>
<tr><th>{{ __('job.progress') }}</th><td>{{ formatDecimal($job->tasks->avg('progress')) }}%</td></tr>
<tr><th>{{ __('job.worker') }}</th><td>{{ $job->worker->name }}</td></tr>
<tr><th>{{ __('job.description') }}</th><td>{!! nl2br($job->description) !!}</td></tr>
</tbody>
</table>
</div>

42
resources/views/jobs/partials/job-tasks-operation.blade.php

@ -2,12 +2,12 @@
@can('create', new App\Entities\Projects\Task)
{!! Form::open(['route' => ['tasks.store', $job->id]])!!}
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('task.create') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('task.create') }}</h3></div>
<div class="panel-body">
<div class="row">
<div class="col-sm-6">{!! FormField::text('name', ['label' => trans('task.name')]) !!}</div>
<div class="col-sm-6">{!! FormField::text('name', ['label' => __('task.name')]) !!}</div>
<div class="col-md-4">
{!! Form::label('progress', trans('task.progress'), ['class' => 'control-label']) !!}
{!! Form::label('progress', __('task.progress'), ['class' => 'control-label']) !!}
{!! Form::input('range', 'progress', 0, [
'min' => '0', 'max' => '100', 'step' => '10',
]) !!}
@ -16,8 +16,8 @@
<strong id="ap_weight">0</strong>%
</div>
</div>
{!! FormField::textarea('description', ['label' => trans('task.description')]) !!}
{!! Form::submit(trans('task.create'), ['class' => 'btn btn-primary']) !!}
{!! FormField::textarea('description', ['label' => __('task.description')]) !!}
{!! Form::submit(__('task.create'), ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
</div>
</div>
@ -26,14 +26,14 @@
@if (Request::get('action') == 'task_edit' && $editableTask)
@can('update', $editableTask)
{!! Form::model($editableTask, ['route' => ['tasks.update', $editableTask->id],'method' => 'patch'])!!}
{!! Form::model($editableTask, ['route' => ['tasks.update', $editableTask], 'method' => 'patch'])!!}
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('task.edit') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('task.edit') }}</h3></div>
<div class="panel-body">
<div class="row">
<div class="col-sm-6">{!! FormField::text('name') !!}</div>
<div class="col-md-4">
{!! Form::label('progress', trans('task.progress'), ['class' => 'control-label']) !!}
{!! Form::label('progress', __('task.progress'), ['class' => 'control-label']) !!}
{!! Form::input('range', 'progress', null, [
'min' => '0',
@ -48,11 +48,11 @@
{!! FormField::textarea('description') !!}
<div class="row">
<div class="col-md-6">
{!! FormField::select('job_id', $job->project->jobs->pluck('name','id'), ['label' => trans('task.move_to_other_job')]) !!}
{!! FormField::select('job_id', $job->project->jobs->pluck('name', 'id'), ['label' => __('task.move_to_other_job')]) !!}
</div>
</div>
{!! Form::submit(trans('task.update'), ['class' => 'btn btn-warning']) !!}
{!! link_to_route('jobs.show', trans('app.cancel'), [$job->id], ['class' => 'btn btn-default']) !!}
{!! Form::submit(__('task.update'), ['class' => 'btn btn-warning']) !!}
{{ link_to_route('jobs.show', __('app.cancel'), [$job], ['class' => 'btn btn-default']) }}
{!! Form::close() !!}
</div>
</div>
@ -62,25 +62,25 @@
@if (Request::get('action') == 'task_delete' && $editableTask)
@can('delete', $editableTask)
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('task.delete') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('task.delete') }}</h3></div>
<div class="panel-body">
<div>{{ $editableTask->name }}</div>
<div class="small text-info">{!! nl2br($editableTask->description) !!}</div>
</div>
<div class="panel-footer">
{{ trans('app.delete_confirm') }}
{!! link_to_route('jobs.show', trans('app.cancel'), [$job->id], ['class' => 'btn btn-default']) !!}
{{ __('app.delete_confirm') }}
{{ link_to_route('jobs.show', __('app.cancel'), [$job], ['class' => 'btn btn-default']) }}
<div class="pull-right">
{!! FormField::delete([
'route'=>['tasks.destroy',$editableTask->id]],
trans('app.delete_confirm_button'),
{!! FormField::delete(['route' => ['tasks.destroy', $editableTask]],
__('app.delete_confirm_button'),
['class' => 'btn btn-danger'],
[
'task_id' => $editableTask->id,
'job_id' => $editableTask->job_id,
]) !!}
</div>
'task_id' => $editableTask->id,
'job_id' => $editableTask->job_id,
]
) !!}
</div>
</div>
</div>
@endcan
@endif

28
resources/views/jobs/partials/job-tasks.blade.php

@ -1,18 +1,18 @@
<div id="job-tasks" class="panel panel-default">
<div class="panel-heading">
@if (request('action') == 'sort_tasks')
{{ link_to_route('jobs.show', trans('app.done'), [$job->id], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin: -2px -8px']) }}
{{ link_to_route('jobs.show', __('app.done'), [$job], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin: -2px -8px']) }}
@else
{{ link_to_route('jobs.show', trans('job.sort_tasks'), [$job->id, 'action' => 'sort_tasks', '#job-tasks'], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin: -2px -8px']) }}
{{ link_to_route('jobs.show', __('job.sort_tasks'), [$job, 'action' => 'sort_tasks', '#job-tasks'], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin: -2px -8px']) }}
@endif
<h3 class="panel-title">{{ trans('job.tasks') }}</h3>
<h3 class="panel-title">{{ __('job.tasks') }}</h3>
</div>
<table class="table table-condensed">
<thead>
<th class="col-md-1 text-center">{{ trans('app.table_no') }}</th>
<th class="col-md-6">{{ trans('task.name') }}</th>
<th class="text-center col-md-1">{{ trans('task.progress') }}</th>
<th class="col-md-2 text-center">{{ trans('app.action') }}</th>
<th class="col-md-1 text-center">{{ __('app.table_no') }}</th>
<th class="col-md-6">{{ __('task.name') }}</th>
<th class="text-center col-md-1">{{ __('task.progress') }}</th>
<th class="col-md-2 text-center">{{ __('app.action') }}</th>
</thead>
<tbody id="sort-tasks">
@forelse($job->tasks as $key => $task)
@ -26,24 +26,24 @@
<td class="text-center">
@can('update', $task)
{!! html_link_to_route('jobs.show', '', [
$job->id,
$job,
'action' => 'task_edit',
'task_id' => $task->id
],[
'class' => 'btn btn-warning btn-xs',
'title' => trans('task.edit'),
'title' => __('task.edit'),
'id' => $task->id . '-tasks-edit',
'icon' => 'edit'
]) !!}
@endcan
@can('delete', $task)
{!! html_link_to_route('jobs.show', '', [
$job->id,
$job,
'action' => 'task_delete',
'task_id' => $task->id
],[
'class' => 'btn btn-danger btn-xs',
'title' => trans('task.delete'),
'title' => __('task.delete'),
'id' => $task->id . '-tasks-delete',
'icon' => 'close'
]) !!}
@ -51,7 +51,7 @@
</td>
</tr>
@empty
<tr><td colspan="4">{{ trans('task.empty') }}</td></tr>
<tr><td colspan="4">{{ __('task.empty') }}</td></tr>
@endforelse
</tbody>
<tfoot>
@ -60,9 +60,9 @@
<th class="text-center">{{ formatDecimal($job->tasks->avg('progress')) }} %</th>
<th>
@if (request('action') == 'sort_tasks')
{{ link_to_route('jobs.show', trans('app.done'), [$job->id], ['class' => 'btn btn-default btn-xs pull-right']) }}
{{ link_to_route('jobs.show', __('app.done'), [$job], ['class' => 'btn btn-default btn-xs pull-right']) }}
@else
{{ link_to_route('jobs.show', trans('job.sort_tasks'), [$job->id, 'action' => 'sort_tasks', '#job-tasks'], ['class' => 'btn btn-default btn-xs pull-right']) }}
{{ link_to_route('jobs.show', __('job.sort_tasks'), [$job, 'action' => 'sort_tasks', '#job-tasks'], ['class' => 'btn btn-default btn-xs pull-right']) }}
@endif
</th>
</tr>

10
resources/views/jobs/show.blade.php

@ -1,6 +1,6 @@
@extends('layouts.app')
@section('title', trans('job.detail') . ' | ' . $job->name . ' | ' . $job->project->name)
@section('title', __('job.detail') . ' | ' . $job->name . ' | ' . $job->project->name)
@section('content')
@include('jobs.partials.breadcrumb')
@ -8,14 +8,14 @@
<h1 class="page-header">
<div class="pull-right">
@can('create', new App\Entities\Projects\Job)
{!! html_link_to_route('projects.jobs.create', trans('job.create'), [$job->project_id], ['class' => 'btn btn-success','icon' => 'plus']) !!}
{!! html_link_to_route('projects.jobs.create', __('job.create'), [$job->project_id], ['class' => 'btn btn-success','icon' => 'plus']) !!}
@endcan
@can('update', $job)
{!! link_to_route('jobs.edit', trans('job.edit'), [$job->id], ['class' => 'btn btn-warning']) !!}
{{ link_to_route('jobs.edit', __('job.edit'), [$job], ['class' => 'btn btn-warning']) }}
@endcan
{!! link_to_route('projects.jobs.index', trans('job.back_to_index'), [$job->project_id, '#' . $job->id], ['class' => 'btn btn-default']) !!}
{{ link_to_route('projects.jobs.index', __('job.back_to_index'), [$job->project_id, '#' . $job->id], ['class' => 'btn btn-default']) }}
</div>
{{ $job->name }} <small>{{ trans('job.detail') }}</small>
{{ $job->name }} <small>{{ __('job.detail') }}</small>
</h1>
<div class="row">
<div class="col-md-5">

26
resources/views/jobs/unfinished.blade.php

@ -1,23 +1,23 @@
@extends('layouts.app')
@section('title', trans('job.on_progress'))
@section('title', __('job.on_progress'))
@section('content')
<h1 class="page-header">{{ trans('job.on_progress') }}</h1>
<h1 class="page-header">{{ __('job.on_progress') }}</h1>
<div class="panel panel-default">
<table class="table table-condensed">
<thead>
<th>{{ trans('app.table_no') }}</th>
<th>{{ trans('project.name') }}</th>
<th>{{ trans('job.name') }}</th>
<th class="text-center">{{ trans('job.tasks_count') }}</th>
<th class="text-center">{{ trans('job.progress') }}</th>
<th>{{ __('app.table_no') }}</th>
<th>{{ __('project.name') }}</th>
<th>{{ __('job.name') }}</th>
<th class="text-center">{{ __('job.tasks_count') }}</th>
<th class="text-center">{{ __('job.progress') }}</th>
@can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ trans('job.price') }}</th>
<th class="text-right">{{ __('job.price') }}</th>
@endcan
<th>{{ trans('job.worker') }}</th>
<th>{{ trans('app.action') }}</th>
<th>{{ __('job.worker') }}</th>
<th>{{ __('app.action') }}</th>
</thead>
<tbody>
@forelse($jobs as $key => $job)
@ -44,16 +44,16 @@
@endcan
<td>{{ $job->worker->name }}</td>
<td>
{!! link_to_route('jobs.show', trans('app.show'),[$job->id],['class' => 'btn btn-info btn-xs']) !!}
{{ link_to_route('jobs.show', __('app.show'), [$job], ['class' => 'btn btn-info btn-xs']) }}
</td>
</tr>
@empty
<tr><td colspan="8">{{ trans('job.empty') }}</td></tr>
<tr><td colspan="8">{{ __('job.empty') }}</td></tr>
@endforelse
</tbody>
<tfoot>
<tr>
<th class="text-right" colspan="3">Total</th>
<th class="text-right" colspan="3">{{ __('app.total') }}</th>
<th class="text-center">{{ $jobs->sum('tasks_count') }}</th>
<th class="text-center">{{ formatDecimal($jobs->avg('progress')) }} %</th>
@can('see-pricings', new App\Entities\Projects\Job)

2
tests/Feature/ManageJobsTest.php

@ -150,7 +150,7 @@ class ManageJobsTest extends TestCase
$this->press(trans('project.show_jobs'));
$this->seePageIs(route('projects.jobs.add-from-other-project', [$projects[1]->id, 'project_id' => $projects[0]->id]));
$this->submitForm(trans('job.create'), [
$this->submitForm(trans('job.add'), [
'job_ids['.$jobs[0]->id.']' => $jobs[0]->id,
$jobs[0]->id.'_task_ids['.$tasks1[0]->id.']' => $tasks1[0]->id,

Loading…
Cancel
Save