Browse Source

Update job and task related views

Restructure task lang file
Remove unused views
pull/3/head
Nafies Luthfi 8 years ago
parent
commit
115a1b817f
  1. 3
      resources/lang/id/job.php
  2. 22
      resources/lang/id/task.php
  3. 31
      resources/views/jobs/partials/job-tasks-operation.blade.php
  4. 12
      resources/views/jobs/partials/job-tasks.blade.php
  5. 3
      resources/views/jobs/show.blade.php
  6. 4
      resources/views/jobs/unfinished.blade.php
  7. 71
      resources/views/projects/jobs-export-excel.blade.php
  8. 58
      resources/views/projects/jobs-export-html-2.blade.php
  9. 2
      resources/views/projects/jobs-export-html.blade.php
  10. 75
      resources/views/projects/jobs-export-progress-excel.blade.php
  11. 121
      resources/views/projects/jobs.blade.php
  12. 2
      resources/views/projects/jobs/index.blade.php

3
resources/lang/id/job.php

@ -3,7 +3,8 @@
return [
// Labels
'job' => 'Job',
'jobs' => 'Daftar Job',
'list' => 'Daftar Job',
'additional' => 'Daftar Job Tambahan',
'on_progress' => 'Job on Progress',
'search' => 'Cari Job',
'found' => 'Job ditemukan',

22
resources/lang/id/task.php

@ -1,9 +1,17 @@
<?php
return [
// Labels
'task' => 'Task',
'tasks' => 'Daftar Task',
'name' => 'Nama 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',
@ -13,11 +21,9 @@ return [
'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',
// Attributes
'name' => 'Nama Task',
'progress' => 'Progress',
'empty' => 'Belum ada Task',
'route_name' => 'Route Aplikasi',
'back_to_index' => 'Kembali ke daftar Task',
'description' => 'Deskripsi Task',
];

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

@ -4,27 +4,35 @@
<div class="panel-heading"><h3 class="panel-title">{{ trans('task.create') }}</h3></div>
<div class="panel-body">
<div class="row">
<div class="col-sm-5">{!! FormField::text('name') !!}</div>
<div class="col-sm-2">{!! FormField::text('progress', ['addon' => ['after' => '%'],'value' => 0]) !!}</div>
<div class="col-sm-6">{!! FormField::text('name', ['label' => trans('task.name')]) !!}</div>
<div class="col-md-4">
{!! Form::label('progress', trans('task.progress'), ['class' => 'control-label']) !!}
{!! Form::input('range', 'progress', 0, [
'min' => '0',
'max' => '100',
'step' => '10',
]) !!}
</div>
{!! FormField::textarea('description') !!}
<div class="col-md-2" style="font-size: 28px; margin-top: 15px;">
<strong id="ap_weight">0</strong>%
</div>
</div>
{!! FormField::textarea('description', ['label' => trans('task.description')]) !!}
{!! Form::submit(trans('task.create'), ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
</div>
</div>
@endif
@if (Request::get('action') == 'task_edit' && $editableTask)
{!! Form::model($editableTask, ['route' => ['tasks.update', $editableTask->id],'method' =>'patch'])!!}
{!! Form::model($editableTask, ['route' => ['tasks.update', $editableTask->id],'method' => 'patch'])!!}
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('task.edit') }}</h3></div>
<div class="panel-body">
<div class="row">
<div class="col-sm-6">{!! FormField::text('name') !!}</div>
</div>
{!! FormField::textarea('description') !!}
<div class="row">
<div class="col-md-4">
{!! Form::label('progress', 'Progress', ['class' => 'control-label']) !!}
{!! Form::label('progress', trans('task.progress'), ['class' => 'control-label']) !!}
{!! Form::input('range', 'progress', null, [
'min' => '0',
@ -35,8 +43,11 @@
<div class="col-md-2" style="font-size: 28px; margin-top: 15px;">
<strong id="ap_weight">{{ $editableTask->progress }}</strong>%
</div>
</div>
{!! FormField::textarea('description') !!}
<div class="row">
<div class="col-md-6">
{!! FormField::select('job_id', $job->project->jobs->pluck('name','id'), ['label' => 'Pindahkan ke Fitur lain']) !!}
{!! FormField::select('job_id', $job->project->jobs->pluck('name','id'), ['label' => trans('task.move_to_other_job')]) !!}
</div>
</div>
{!! Form::submit(trans('task.update'), ['class' => 'btn btn-warning']) !!}
@ -59,7 +70,7 @@
{!! FormField::delete([
'route'=>['tasks.destroy',$editableTask->id]],
trans('app.delete_confirm_button'),
['class'=>'btn btn-danger'],
['class' => 'btn btn-danger'],
[
'task_id' => $editableTask->id,
'job_id' => $editableTask->job_id,

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

@ -9,21 +9,19 @@
</div>
<table class="table table-condensed">
<thead>
<th>{{ trans('app.table_no') }}</th>
<th class="col-md-7">{{ trans('task.name') }}</th>
<th class="col-md-2">{{ trans('task.route_name') }}</th>
<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>
</thead>
<tbody id="sort-tasks">
@forelse($job->tasks as $key => $task)
<tr id="{{ $task->id }}">
<td>{{ 1 + $key }}</td>
<td class="text-center">{{ 1 + $key }}</td>
<td>
<div>{{ $task->name }}</div>
<div class="small text-info">{!! nl2br($task->description) !!}</div>
</td>
<td>{{ $task->route_name }}</td>
<td class="text-center">{{ $task->progress }} %</td>
<td class="text-center">
{!! html_link_to_route('jobs.show', '', [
@ -49,12 +47,12 @@
</td>
</tr>
@empty
<tr><td colspan="5">{{ trans('task.empty') }}</td></tr>
<tr><td colspan="4">{{ trans('task.empty') }}</td></tr>
@endforelse
</tbody>
<tfoot>
<tr>
<th class="text-right" colspan="3">Total</th>
<th class="text-right" colspan="2">Total</th>
<th class="text-center">{{ formatDecimal($job->tasks->avg('progress')) }} %</th>
<th>
@if (request('action') == 'sort_tasks')

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

@ -24,7 +24,6 @@
@include('jobs.partials.job-tasks')
@endsection
@if (Request::get('action') == 'task_edit' && $editableTask)
@section('ext_css')
{!! Html::style(url('assets/css/plugins/rangeslider.css')) !!}
<style>
@ -61,5 +60,3 @@
})();
</script>
@endsection
@endif

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

@ -3,9 +3,7 @@
@section('title', trans('project.jobs'))
@section('content')
<h1 class="page-header">
Daftar Fitur on Progress
</h1>
<h1 class="page-header">{{ trans('job.on_progress') }}</h1>
<div class="panel panel-default">
<table class="table table-condensed">

71
resources/views/projects/jobs-export-excel.blade.php

@ -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>

58
resources/views/projects/jobs-export-html-2.blade.php

@ -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>

2
resources/views/projects/jobs-export-html.blade.php

@ -26,7 +26,7 @@
@if ($job->tasks->count())
<tr><td colspan="2">&nbsp;</td></tr>
<tr style="background-color: #ffd298">
<th class="col-md-3">Sub Fitur</th>
<th class="col-md-3">{{ trans('task.list') }}</th>
<th class="col-md-6">{{ trans('app.description') }}</th>
</tr>
@foreach($job->tasks as $task)

75
resources/views/projects/jobs-export-progress-excel.blade.php

@ -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>

121
resources/views/projects/jobs.blade.php

@ -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

2
resources/views/projects/jobs/index.blade.php

@ -28,7 +28,7 @@
@endif
</div>
<h3 class="panel-title">
{{ $key == 1 ? 'Daftar Fitur' : 'Fitur Tambahan' }}
{{ $key == 1 ? trans('job.list') : trans('job.additional') }}
</h3>
</div>
<table class="table table-condensed table-striped">

Loading…
Cancel
Save