Browse Source

Update some job views

pull/13/head
Nafies Luthfi 7 years ago
parent
commit
312e5c18f8
  1. 2
      resources/views/jobs/unfinished.blade.php
  2. 18
      resources/views/projects/jobs/add-from-other-project.blade.php
  3. 15
      resources/views/projects/jobs/create.blade.php
  4. 52
      resources/views/projects/jobs/index.blade.php

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

@ -6,7 +6,7 @@
<ul class="breadcrumb hidden-print"><li>{{ __('job.on_progress') }}</li></ul> <ul class="breadcrumb hidden-print"><li>{{ __('job.on_progress') }}</li></ul>
<div class="panel panel-default">
<div class="panel panel-default table-responsive">
<div class="panel-heading"> <div class="panel-heading">
{{ Form::open(['method' => 'get', 'class' => 'form-inline']) }} {{ Form::open(['method' => 'get', 'class' => 'form-inline']) }}
{!! FormField::select('project_id', $projects, ['label' => __('project.select'), 'placeholder' => __('project.all')]) !!} {!! FormField::select('project_id', $projects, ['label' => __('project.select'), 'placeholder' => __('project.all')]) !!}

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

@ -4,8 +4,8 @@
@section('action-buttons') @section('action-buttons')
@can('create', new App\Entities\Projects\Job) @can('create', new App\Entities\Projects\Job)
{!! html_link_to_route('projects.jobs.create', trans('job.create'), [$project->id], ['class' => 'btn btn-success','icon' => 'plus']) !!}
{!! html_link_to_route('projects.jobs.add-from-other-project', trans('job.add_from_other_project'), [$project->id], ['class' => 'btn btn-default','icon' => 'plus']) !!}
{!! html_link_to_route('projects.jobs.create', __('job.create'), [$project->id], ['class' => 'btn btn-success','icon' => 'plus']) !!}
{!! html_link_to_route('projects.jobs.add-from-other-project', __('job.add_from_other_project'), [$project->id], ['class' => 'btn btn-default','icon' => 'plus']) !!}
@endcan @endcan
@endsection @endsection
@ -21,18 +21,18 @@
{{ Form::submit(__('project.show_jobs'), ['class' => 'btn btn-default btn-sm']) }} {{ Form::submit(__('project.show_jobs'), ['class' => 'btn btn-default btn-sm']) }}
{{ Form::close() }} {{ Form::close() }}
@if ($selectedProject) @if ($selectedProject)
{!! Form::open(['route' => ['projects.jobs.store-from-other-project', $project->id]]) !!}
{{ Form::open(['route' => ['projects.jobs.store-from-other-project', $project->id]]) }}
<ul class="list-unstyled"> <ul class="list-unstyled">
@forelse($selectedProject->jobs as $key => $job) @forelse($selectedProject->jobs as $key => $job)
<li> <li>
<label for="job_id_{{ $job->id }}"> <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> {{ $job->name }}</label>
<ul style="list-style-type:none"> <ul style="list-style-type:none">
@foreach($job->tasks as $task) @foreach($job->tasks as $task)
<li> <li>
<label for="{{ $job->id }}_task_id_{{ $task->id }}" style="font-weight:normal"> <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> {{ $task->name }}</label>
</li> </li>
@endforeach @endforeach
@ -45,8 +45,8 @@
@else @else
<div class="alert alert-info">{{ __('job.select_project') }}</div> <div class="alert alert-info">{{ __('job.select_project') }}</div>
@endif @endif
{!! Form::submit(__('job.add'), ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
{{ Form::submit(__('job.add'), ['class' => 'btn btn-primary']) }}
{{ Form::close() }}
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
@ -58,7 +58,7 @@
@endsection @endsection
@section('ext_css') @section('ext_css')
{!! Html::style(url('assets/css/plugins/select2.min.css')) !!}
{{ Html::style(url('assets/css/plugins/select2.min.css')) }}
<style> <style>
.select2-selection.select2-selection--single { .select2-selection.select2-selection--single {
border-radius: 0; border-radius: 0;
@ -68,7 +68,7 @@
@endsection @endsection
@section('script') @section('script')
{!! Html::script(url('assets/js/plugins/select2.min.js')) !!}
{{ Html::script(url('assets/js/plugins/select2.min.js')) }}
<script> <script>
(function() { (function() {
$('select[name=project_id]').select2(); $('select[name=project_id]').select2();

15
resources/views/projects/jobs/create.blade.php

@ -4,8 +4,8 @@
@section('action-buttons') @section('action-buttons')
@can('create', new App\Entities\Projects\Job) @can('create', new App\Entities\Projects\Job)
{!! html_link_to_route('projects.jobs.create', trans('job.create'), [$project->id], ['class' => 'btn btn-success','icon' => 'plus']) !!}
{!! html_link_to_route('projects.jobs.add-from-other-project', trans('job.add_from_other_project'), [$project->id], ['class' => 'btn btn-default','icon' => 'plus']) !!}
{!! 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 @endcan
@endsection @endsection
@ -13,7 +13,7 @@
<div class="row"> <div class="row">
<div class="col-sm-6 col-sm-offset-2"> <div class="col-sm-6 col-sm-offset-2">
{!! Form::open(['route' => ['projects.jobs.store', $project->id]]) !!}
{{ Form::open(['route' => ['projects.jobs.store', $project]]) }}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ __('job.create') }}</h3></div> <div class="panel-heading"><h3 class="panel-title">{{ __('job.create') }}</h3></div>
<div class="panel-body"> <div class="panel-body">
@ -41,11 +41,11 @@
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
{!! Form::submit(__('job.create'), ['class' => 'btn btn-primary']) !!}
{{ Form::submit(__('job.create'), ['class' => 'btn btn-primary']) }}
{{ link_to_route('projects.jobs.index', __('app.cancel'), [$project], ['class' => 'btn btn-default']) }} {{ link_to_route('projects.jobs.index', __('app.cancel'), [$project], ['class' => 'btn btn-default']) }}
</div> </div>
</div> </div>
{!! Form::close() !!}
{{ Form::close() }}
</div> </div>
</div> </div>
@endsection @endsection
@ -54,11 +54,8 @@
{!! Html::style(url('assets/css/plugins/jquery.datetimepicker.css')) !!} {!! Html::style(url('assets/css/plugins/jquery.datetimepicker.css')) !!}
@endsection @endsection
@section('ext_js')
{!! Html::script(url('assets/js/plugins/jquery.datetimepicker.js')) !!}
@endsection
@section('script') @section('script')
{!! Html::script(url('assets/js/plugins/jquery.datetimepicker.js')) !!}
<script> <script>
(function() { (function() {
$('.date-select').datetimepicker({ $('.date-select').datetimepicker({

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

@ -1,19 +1,19 @@
@extends('layouts.project') @extends('layouts.project')
@section('subtitle', trans('project.jobs'))
@section('subtitle', __('project.jobs'))
@section('action-buttons') @section('action-buttons')
@can('create', new App\Entities\Projects\Job) @can('create', new App\Entities\Projects\Job)
{!! html_link_to_route('projects.jobs.create', trans('job.create'), [$project->id], ['class' => 'btn btn-success','icon' => 'plus']) !!}
{!! html_link_to_route('projects.jobs.add-from-other-project', trans('job.add_from_other_project'), [$project->id], ['class' => 'btn btn-default','icon' => 'plus']) !!}
{!! 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 @endcan
@endsection @endsection
@section('content-project') @section('content-project')
@if ($jobs->isEmpty()) @if ($jobs->isEmpty())
<p>{{ trans('project.no_jobs') }},
{{ link_to_route('projects.jobs.create', trans('job.create'), [$project->id]) }}.
<p>{{ __('project.no_jobs') }},
{{ link_to_route('projects.jobs.create', __('job.create'), [$project]) }}.
</p> </p>
@else @else
@ -24,20 +24,20 @@
<div class="pull-right"> <div class="pull-right">
@can('update', $project) @can('update', $project)
@if (request('action') == 'sort_jobs') @if (request('action') == 'sort_jobs')
{{ link_to_route('projects.jobs.index', trans('app.done'), [$project->id], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin-top: -2px; margin-left: 6px; margin-right: -8px']) }}
{{ link_to_route('projects.jobs.index', __('app.done'), [$project], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin-top: -2px; margin-left: 6px; margin-right: -8px']) }}
@else @else
{{ link_to_route('projects.jobs.index', 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.index', __('project.sort_jobs'), [$project, 'action' => 'sort_jobs', '#project-jobs'], ['class' => 'btn btn-default btn-xs pull-right', 'style' => 'margin-top: -2px; margin-left: 6px; margin-right: -8px']) }}
@can('see-pricings', $project) @can('see-pricings', $project)
{!! link_to_route('projects.jobs-export', trans('project.jobs_list_export_html'), [$project->id, 'html', 'job_type' => $key], ['class' => '','target' => '_blank']) !!} |
{!! link_to_route('projects.job-progress-export', trans('project.jobs_progress_export_html'), [$project->id, 'html', 'job_type' => $key], ['class' => '','target' => '_blank']) !!}
{!! link_to_route('projects.jobs-export', __('project.jobs_list_export_html'), [$project, 'html', 'job_type' => $key], ['class' => '','target' => '_blank']) !!} |
{!! link_to_route('projects.job-progress-export', __('project.jobs_progress_export_html'), [$project, 'html', 'job_type' => $key], ['class' => '','target' => '_blank']) !!}
@endcan @endcan
@endif @endif
@endcan @endcan
</div> </div>
<h3 class="panel-title"> <h3 class="panel-title">
{{ $key == 1 ? trans('project.jobs') : trans('project.additional_jobs') }}
{{ $key == 1 ? __('project.jobs') : __('project.additional_jobs') }}
@if (request('action') == 'sort_jobs') @if (request('action') == 'sort_jobs')
<em>: {{ trans('project.sort_jobs') }}</em>
<em>: {{ __('project.sort_jobs') }}</em>
@endif @endif
</h3> </h3>
</div> </div>
@ -52,16 +52,16 @@
@else @else
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<thead> <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>{{ __('app.table_no') }}</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) @can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ trans('job.price') }}</th>
<th class="text-right">{{ __('job.price') }}</th>
@endcan @endcan
{{-- <th>{{ trans('job.worker') }}</th> --}}
<th class="text-center">{{ trans('time.updated_at') }}</th>
<th class="text-center">{{ trans('app.action') }}</th>
{{-- <th>{{ __('job.worker') }}</th> --}}
<th class="text-center">{{ __('time.updated_at') }}</th>
<th class="text-center">{{ __('app.action') }}</th>
</thead> </thead>
<tbody> <tbody>
@forelse($groupedJobs as $key => $job) @forelse($groupedJobs as $key => $job)
@ -86,19 +86,21 @@
@can('see-pricings', $job) @can('see-pricings', $job)
<td class="text-right">{{ formatRp($job->price) }}</td> <td class="text-right">{{ formatRp($job->price) }}</td>
@endcan @endcan
{{-- <td>{{ $job->worker->name }}</td> --}}
<td class="text-center">{{ $job->updated_at->diffForHumans() }}</td>
<td class="text-center">
{{ $job->updated_at->diffForHumans() }} <br>
{{ __('job.worker') }} : {{ $job->worker->name }}
</td>
<td class="text-center"> <td class="text-center">
@can('view', $job) @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]) !!} {!! 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 @endcan
@can('edit', $job) @can('edit', $job)
{!! html_link_to_route('jobs.edit', '',[$job->id],['icon' => 'edit', 'title' => trans('job.edit'), 'class' => 'btn btn-warning btn-xs']) !!}
{!! html_link_to_route('jobs.edit', '',[$job->id],['icon' => 'edit', 'title' => __('job.edit'), 'class' => 'btn btn-warning btn-xs']) !!}
@endcan @endcan
</td> </td>
</tr> </tr>
@empty @empty
<tr><td colspan="7">{{ trans('job.empty') }}</td></tr>
<tr><td colspan="7">{{ __('job.empty') }}</td></tr>
@endforelse @endforelse
</tbody> </tbody>
<tfoot> <tfoot>
@ -115,9 +117,9 @@
<th colspan="2"> <th colspan="2">
@can('update', $project) @can('update', $project)
@if (request('action') == 'sort_jobs') @if (request('action') == 'sort_jobs')
{{ link_to_route('projects.jobs.index', trans('app.done'), [$project->id], ['class' => 'btn btn-default btn-xs pull-right']) }}
{{ link_to_route('projects.jobs.index', __('app.done'), [$project->id], ['class' => 'btn btn-default btn-xs pull-right']) }}
@else @else
{{ link_to_route('projects.jobs.index', trans('project.sort_jobs'), [$project->id, 'action' => 'sort_jobs', '#project-jobs'], ['class' => 'btn btn-default btn-xs pull-right']) }}
{{ 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 @endif
@endcan @endcan
</th> </th>

Loading…
Cancel
Save