Browse Source
Update job and task related views
Update job and task related views
Restructure task lang file Remove unused viewspull/3/head
12 changed files with 57 additions and 371 deletions
-
3resources/lang/id/job.php
-
44resources/lang/id/task.php
-
31resources/views/jobs/partials/job-tasks-operation.blade.php
-
12resources/views/jobs/partials/job-tasks.blade.php
-
3resources/views/jobs/show.blade.php
-
4resources/views/jobs/unfinished.blade.php
-
71resources/views/projects/jobs-export-excel.blade.php
-
58resources/views/projects/jobs-export-html-2.blade.php
-
2resources/views/projects/jobs-export-html.blade.php
-
75resources/views/projects/jobs-export-progress-excel.blade.php
-
121resources/views/projects/jobs.blade.php
-
2resources/views/projects/jobs/index.blade.php
@ -1,23 +1,29 @@ |
|||
<?php |
|||
|
|||
return [ |
|||
'task' => 'Task', |
|||
'tasks' => 'Daftar Task', |
|||
'name' => 'Nama Task', |
|||
'create' => 'Input Task Baru', |
|||
'created' => 'Input Task baru telah berhasil.', |
|||
'show' => 'Detail Task', |
|||
'edit' => 'Edit Task', |
|||
'update' => 'Update Task', |
|||
'updated' => 'Update data Task telah berhasil.', |
|||
'delete' => 'Hapus Task', |
|||
'deleted' => 'Hapus data Task telah berhasil.', |
|||
'undeleted' => 'Data Task gagal dihapus.', |
|||
'search' => 'Cari Task', |
|||
'found' => 'Task ditemukan', |
|||
'not_found' => 'Task tidak ditemukan', |
|||
'progress' => 'Progress', |
|||
'empty' => 'Belum ada Task', |
|||
'route_name' => 'Route Aplikasi', |
|||
'back_to_index' => 'Kembali ke daftar Task', |
|||
// Labels
|
|||
'task' => 'Task', |
|||
'list' => 'Daftar Task', |
|||
'empty' => 'Belum ada Task', |
|||
'search' => 'Cari Task', |
|||
'found' => 'Task ditemukan', |
|||
'not_found' => 'Task tidak ditemukan', |
|||
'back_to_index' => 'Kembali ke daftar Task', |
|||
'move_to_other_job' => 'Pindahkan ke Job lain', |
|||
|
|||
// Actions
|
|||
'create' => 'Input Task Baru', |
|||
'created' => 'Input Task baru telah berhasil.', |
|||
'show' => 'Detail Task', |
|||
'edit' => 'Edit Task', |
|||
'update' => 'Update Task', |
|||
'updated' => 'Update data Task telah berhasil.', |
|||
'delete' => 'Hapus Task', |
|||
'deleted' => 'Hapus data Task telah berhasil.', |
|||
'undeleted' => 'Data Task gagal dihapus.', |
|||
|
|||
// Attributes
|
|||
'name' => 'Nama Task', |
|||
'progress' => 'Progress', |
|||
'description' => 'Deskripsi Task', |
|||
]; |
|||
@ -1,71 +0,0 @@ |
|||
<?php |
|||
// $filename = str_slug(trans('project.jobs') . '-' . $project->name) . '.xls';
|
|||
// header("Content-Disposition: attachment; filename=\"$filename\"");
|
|||
// header("Content-Type: application/vnd.ms-excel");
|
|||
?>
|
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
{{-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> --}} |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>{{ $project->name }}</title> |
|||
<style> |
|||
table { |
|||
border-collapse:collapse; |
|||
} |
|||
th, td { |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<table border="1" class="table table-condensed table-striped"> |
|||
<thead> |
|||
<tr> |
|||
<td colspan="4" style="text-align:center"> |
|||
<strong>{{ trans('project.jobs') }} {{ $project->name }}</strong> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>{{ trans('app.table_no') }}</th> |
|||
<th>{{ trans('job.name') }}</th> |
|||
<th class="text-right">{{ trans('job.price') }}</th> |
|||
<th>{{ trans('app.description') }}</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody id="sort-jobs"> |
|||
@forelse($jobs as $key => $job) |
|||
<tr> |
|||
<td>{{ 1 + $key }}</td> |
|||
<td> |
|||
{{ $job->name }} |
|||
</td> |
|||
<td class="text-right">{{ $job->price }}</td> |
|||
<td style="wrap-text: true;">{!! nl2br($job->description) !!}</td> |
|||
</tr> |
|||
|
|||
@if ($job->tasks->count()) |
|||
@foreach($job->tasks as $task) |
|||
<tr> |
|||
<td></td> |
|||
<td>{{ $task->name }}</td> |
|||
<td></td> |
|||
<td style="wrap-text: true;">{!! nl2br($task->description) !!}</td> |
|||
</tr> |
|||
@endforeach |
|||
@endif |
|||
@empty |
|||
<tr><td colspan="7">{{ trans('job.empty') }}</td></tr> |
|||
@endforelse |
|||
</tbody> |
|||
<tfoot> |
|||
<tr> |
|||
<th class="text-right" colspan="2">Total</th> |
|||
<th class="text-right">{{ $jobs->sum('price') }}</th> |
|||
<th></th> |
|||
</tr> |
|||
</tfoot> |
|||
</table> |
|||
</body> |
|||
</html> |
|||
@ -1,58 +0,0 @@ |
|||
<?php |
|||
// $filename = str_slug(trans('project.jobs') . '-' . $project->name) . '.xls';
|
|||
// header("Content-Disposition: attachment; filename=\"$filename\"");
|
|||
// header("Content-Type: application/vnd.ms-excel");
|
|||
?>
|
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
{{-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> --}} |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>{{ trans('project.jobs') }} {{ $project->name }}</title> |
|||
{!! Html::style('assets/css/app.s.css') !!} |
|||
</head> |
|||
<body style="font-family:'Liberation Serif';font-size: 16px;"> |
|||
<div class="container"> |
|||
<h1 class="page-header text-center">{{ trans('project.jobs') }} {{ $project->name }}</h1> |
|||
|
|||
@foreach($jobs as $key => $job) |
|||
<h2 class="job-title">{{ ++$key }}. {{ $job->name }}</h2> |
|||
<p style="padding-left: 30px">{!! nl2br($job->description) !!}</p> |
|||
@if ($job->tasks->count()) |
|||
<div style="padding-left: 30px"> |
|||
<h3>Sub Fitur</h3> |
|||
@foreach($job->tasks as $taskKey => $task) |
|||
<h4>{{ ++$taskKey }}) {{ $task->name }}</h4> |
|||
<p style="padding-left: 21px">{!! nl2br($task->description) !!}</p> |
|||
@endforeach |
|||
</div> |
|||
@endif |
|||
@endforeach |
|||
|
|||
<h1 class="page-header text-center">{{ trans('project.cost_proposal') }}</h1> |
|||
<table width="100%" class="table table-condensed table-bordered"> |
|||
<tbody> |
|||
<tr> |
|||
<th class="text-center">{{ trans('app.table_no') }}</th> |
|||
<th>{{ trans('job.name') }}</th> |
|||
<th class="text-center">{{ trans('job.price') }}</th> |
|||
</tr> |
|||
@foreach($jobs as $key => $job) |
|||
<tr> |
|||
<td class="text-center">{{ 1 + $key }}</td> |
|||
<td>{{ $job->name }}</td> |
|||
<td class="text-right">{{ formatRp($job->price) }}</td> |
|||
</tr> |
|||
@endforeach |
|||
</tbody> |
|||
<tfoot> |
|||
<tr> |
|||
<th class="text-right" colspan="2">Total</th> |
|||
<th class="text-right">{{ formatRp($jobs->sum('price')) }}</th> |
|||
</tr> |
|||
</tfoot> |
|||
</table> |
|||
</div> |
|||
</body> |
|||
</html> |
|||
@ -1,75 +0,0 @@ |
|||
<?php |
|||
// $filename = str_slug(trans('project.jobs') . '-' . $project->name) . '.xls';
|
|||
// header("Content-Disposition: attachment; filename=\"$filename\"");
|
|||
// header("Content-Type: application/vnd.ms-excel");
|
|||
?>
|
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
{{-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> --}} |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<title>{{ $project->name }}</title> |
|||
<style> |
|||
th, td { |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<table border="1" class="table table-condensed table-striped"> |
|||
<thead> |
|||
<tr> |
|||
<td colspan="4" style="text-align:center"> |
|||
<h1>{{ trans('project.jobs') }} {{ $project->name }}</h1> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>{{ trans('app.table_no') }}</th> |
|||
<th>{{ trans('job.name') }}</th> |
|||
<th class="text-center">{{ trans('job.progress') }}</th> |
|||
<th class="text-right">{{ trans('job.price') }}</th> |
|||
{{-- <th>{{ trans('app.description') }}</th> --}} |
|||
</tr> |
|||
</thead> |
|||
<tbody id="sort-jobs"> |
|||
@forelse($jobs as $key => $job) |
|||
<tr> |
|||
<td>{{ 1 + $key }}</td> |
|||
<td> |
|||
{{ $job->name }} |
|||
</td> |
|||
<td class="text-center">{{ formatDecimal($job->progress = $job->tasks->avg('progress')) }}</td> |
|||
<td class="text-right">{{ $job->price }}</td> |
|||
{{-- <td style="wrap-text: true;">{!! nl2br($job->description) !!}</td> --}} |
|||
</tr> |
|||
|
|||
@if ($job->tasks->count()) |
|||
@foreach($job->tasks as $task) |
|||
<tr> |
|||
<td></td> |
|||
<td>{{ $task->name }}</td> |
|||
<td>{{ $task->progress }}</td> |
|||
<td></td> |
|||
{{-- <td style="wrap-text: true;">{!! nl2br($task->description) !!}</td> --}} |
|||
</tr> |
|||
@endforeach |
|||
@endif |
|||
<?php /* |
|||
*/?>
|
|||
@empty |
|||
<tr><td colspan="7">{{ trans('job.empty') }}</td></tr> |
|||
@endforelse |
|||
</tbody> |
|||
<tfoot> |
|||
<tr> |
|||
<th class="text-right" colspan="2">Total</th> |
|||
{{-- <th class="text-center">{{ formatDecimal($jobs->sum('progress') / count($jobs)) }}</th> --}} |
|||
<th class="text-center">{{ formatDecimal($project->getJobOveralProgress()) }} %</th> |
|||
<th class="text-right">{{ $jobs->sum('price') }}</th> |
|||
{{-- <th></th> --}} |
|||
</tr> |
|||
</tfoot> |
|||
</table> |
|||
</body> |
|||
</html> |
|||
@ -1,121 +0,0 @@ |
|||
@extends('layouts.project') |
|||
|
|||
@section('subtitle', trans('project.jobs')) |
|||
|
|||
@section('action-buttons') |
|||
{!! html_link_to_route('jobs.create', trans('job.create'), [$project->id], ['class' => 'btn btn-success','icon' => 'plus']) !!} |
|||
{!! html_link_to_route('jobs.add-from-other-project', trans('job.add_from_other_project'), [$project->id], ['class' => 'btn btn-default','icon' => 'plus']) !!} |
|||
@endsection |
|||
|
|||
@section('content-project') |
|||
|
|||
@if ($jobs->isEmpty()) |
|||
<p>{{ trans('project.no_jobs') }}, |
|||
{{ link_to_route('jobs.create', trans('job.create'), [$project->id]) }}. |
|||
</p> |
|||
@else |
|||
|
|||
@foreach($jobs->groupBy('type_id') as $key => $groupedJobs) |
|||
|
|||
<div id="project-jobs" class="panel panel-default table-responsive"> |
|||
<div class="panel-heading"> |
|||
<div class="pull-right"> |
|||
@if (request('action') == 'sort_jobs') |
|||
{{ link_to_route('projects.jobs', trans('app.done'), [$project->id], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin-top: -2px; margin-left: 6px; margin-right: -8px']) }} |
|||
@else |
|||
{{ link_to_route('projects.jobs', trans('project.sort_jobs'), [$project->id, 'action' => 'sort_jobs', '#project-jobs'], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin-top: -2px; margin-left: 6px; margin-right: -8px']) }} |
|||
|
|||
{!! link_to_route('projects.jobs-export', trans('project.jobs_export_html'), [$project->id, 'html', 'job_type' => $key], ['class' => '','target' => '_blank']) !!} |
|||
@endif |
|||
</div> |
|||
<h3 class="panel-title"> |
|||
{{ $key == 1 ? 'Daftar Fitur' : 'Fitur Tambahan' }} |
|||
</h3> |
|||
</div> |
|||
<table class="table table-condensed table-striped"> |
|||
<thead> |
|||
<th>{{ trans('app.table_no') }}</th> |
|||
<th>{{ trans('job.name') }}</th> |
|||
<th class="text-center">{{ trans('job.tasks_count') }}</th> |
|||
<th class="text-center">{{ trans('job.progress') }}</th> |
|||
<th class="text-right">{{ trans('job.price') }}</th> |
|||
{{-- <th>{{ trans('job.worker') }}</th> --}} |
|||
<th class="text-center">{{ trans('app.action') }}</th> |
|||
</thead> |
|||
<tbody class="sort-jobs"> |
|||
@forelse($groupedJobs as $key => $job) |
|||
@php |
|||
$no = 1 + $key; |
|||
$job->progress = $job->tasks->avg('progress'); |
|||
@endphp |
|||
<tr id="{{ $job->id }}" {!! $job->progress <= 50 ? 'style="background-color: #faebcc"' : '' !!}> |
|||
<td>{{ $no }}</td> |
|||
<td> |
|||
{{ $job->name }} |
|||
@if ($job->tasks->isEmpty() == false) |
|||
<ul> |
|||
@foreach($job->tasks as $task) |
|||
<li>{{ $task->name }}</li> |
|||
@endforeach |
|||
</ul> |
|||
@endif |
|||
</td> |
|||
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td> |
|||
<td class="text-center">{{ formatDecimal($job->progress) }} %</td> |
|||
<td class="text-right">{{ formatRp($job->price) }}</td> |
|||
{{-- <td>{{ $job->worker->name }}</td> --}} |
|||
<td class="text-center"> |
|||
{!! html_link_to_route('jobs.show', '',[$job->id],['icon' => 'search', 'title' => 'Lihat ' . trans('job.show'), 'class' => 'btn btn-info btn-xs','id' => 'show-job-' . $job->id]) !!} |
|||
{!! html_link_to_route('jobs.edit', '',[$job->id],['icon' => 'edit', 'title' => trans('job.edit'), 'class' => 'btn btn-warning btn-xs']) !!} |
|||
</td> |
|||
</tr> |
|||
@empty |
|||
<tr><td colspan="7">{{ trans('job.empty') }}</td></tr> |
|||
@endforelse |
|||
</tbody> |
|||
<tfoot> |
|||
<tr> |
|||
<th class="text-right" colspan="2">Total</th> |
|||
<th class="text-center">{{ $groupedJobs->sum('tasks_count') }}</th> |
|||
<th class="text-center"> |
|||
<span title="Total Progress">{{ formatDecimal($groupedJobs->sum('progress') / $groupedJobs->count()) }} %</span> |
|||
<span title="Overal Progress" style="font-weight:300">({{ formatDecimal($project->getJobOveralProgress()) }} %)</span> |
|||
</th> |
|||
<th class="text-right">{{ formatRp($groupedJobs->sum('price')) }}</th> |
|||
<th colspan="2"> |
|||
@if (request('action') == 'sort_jobs') |
|||
{{ link_to_route('projects.jobs', trans('app.done'), [$project->id], ['class' => 'btn btn-default btn-xs pull-right']) }} |
|||
@else |
|||
{{ link_to_route('projects.jobs', trans('project.sort_jobs'), [$project->id, 'action' => 'sort_jobs', '#project-jobs'], ['class' => 'btn btn-default btn-xs pull-right']) }} |
|||
@endif |
|||
</th> |
|||
</tr> |
|||
</tfoot> |
|||
</table> |
|||
</div> |
|||
@endforeach |
|||
|
|||
@endif |
|||
@endsection |
|||
|
|||
@if (request('action') == 'sort_jobs') |
|||
|
|||
@section('ext_js') |
|||
{!! Html::script(url('assets/js/plugins/jquery-ui.min.js')) !!} |
|||
@endsection |
|||
|
|||
@section('script') |
|||
|
|||
<script> |
|||
(function() { |
|||
$('.sort-jobs').sortable({ |
|||
update: function (event, ui) { |
|||
var data = $(this).sortable('toArray').toString(); |
|||
$.post("{{ route('projects.jobs-reorder', $project->id) }}", {postData: data}); |
|||
} |
|||
}); |
|||
})(); |
|||
</script> |
|||
@endsection |
|||
|
|||
@endif |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue