Browse Source

Added last update time on project job list

Update job updated_at on task update
pull/12/head
Nafies Luthfi 8 years ago
parent
commit
046c5c7c03
  1. 2
      app/Entities/Projects/Task.php
  2. 2
      resources/lang/de/time.php
  3. 2
      resources/lang/en/time.php
  4. 2
      resources/lang/id/time.php
  5. 1
      resources/views/jobs/partials/job-show.blade.php
  6. 2
      resources/views/projects/jobs/index.blade.php

2
app/Entities/Projects/Task.php

@ -8,6 +8,8 @@ class Task extends Model
{ {
protected $guarded = ['id', 'created_at', 'updated_at']; protected $guarded = ['id', 'created_at', 'updated_at'];
protected $touches = ['job'];
public function job() public function job()
{ {
return $this->belongsTo(Job::class, 'job_id'); return $this->belongsTo(Job::class, 'job_id');

2
resources/lang/de/time.php

@ -18,4 +18,6 @@ return [
'11' => 'November', '11' => 'November',
'12' => 'Dezember', '12' => 'Dezember',
], ],
'updated_at' => 'Last Update',
]; ];

2
resources/lang/en/time.php

@ -18,4 +18,6 @@ return [
'11' => 'November', '11' => 'November',
'12' => 'December', '12' => 'December',
], ],
'updated_at' => 'Last Update',
]; ];

2
resources/lang/id/time.php

@ -18,4 +18,6 @@ return [
'11' => 'Nopember', '11' => 'Nopember',
'12' => 'Desember', '12' => 'Desember',
], ],
'updated_at' => 'Update Terakhir',
]; ];

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

@ -9,6 +9,7 @@
@endcan @endcan
<tr><th>{{ __('job.progress') }}</th><td>{{ formatDecimal($job->progress) }}%</td></tr> <tr><th>{{ __('job.progress') }}</th><td>{{ formatDecimal($job->progress) }}%</td></tr>
<tr><th>{{ __('job.worker') }}</th><td>{{ $job->worker->name }}</td></tr> <tr><th>{{ __('job.worker') }}</th><td>{{ $job->worker->name }}</td></tr>
<tr><th>{{ __('time.updated_at') }}</th><td>{{ $job->updated_at }}</td></tr>
<tr><th>{{ __('job.description') }}</th><td>{!! nl2br($job->description) !!}</td></tr> <tr><th>{{ __('job.description') }}</th><td>{!! nl2br($job->description) !!}</td></tr>
</tbody> </tbody>
</table> </table>

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

@ -60,6 +60,7 @@
<th class="text-right">{{ trans('job.price') }}</th> <th class="text-right">{{ trans('job.price') }}</th>
@endcan @endcan
{{-- <th>{{ trans('job.worker') }}</th> --}} {{-- <th>{{ trans('job.worker') }}</th> --}}
<th class="text-center">{{ trans('time.updated_at') }}</th>
<th class="text-center">{{ trans('app.action') }}</th> <th class="text-center">{{ trans('app.action') }}</th>
</thead> </thead>
<tbody> <tbody>
@ -86,6 +87,7 @@
<td class="text-right">{{ formatRp($job->price) }}</td> <td class="text-right">{{ formatRp($job->price) }}</td>
@endcan @endcan
{{-- <td>{{ $job->worker->name }}</td> --}} {{-- <td>{{ $job->worker->name }}</td> --}}
<td class="text-center">{{ $job->updated_at->diffForHumans() }}</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]) !!}

Loading…
Cancel
Save