Browse Source

Added time and date of file

pull/1/head
Nafies Luthfi 8 years ago
parent
commit
8e67b05ff7
  1. 10
      app/Entities/Projects/File.php
  2. 1
      resources/lang/id/file.php
  3. 5
      resources/views/projects/files.blade.php
  4. 2
      resources/views/projects/partials/nav-tabs.blade.php

10
app/Entities/Projects/File.php

@ -23,6 +23,16 @@ class File extends Model
return $this->fileExists() ? \Storage::size('public/files/'.$this->filename) : 0;
}
public function getDate()
{
return $this->updated_at->format('Y-m-d');
}
public function getTime()
{
return $this->updated_at->format('H:i:s');
}
public function fileExists()
{
return \Storage::exists('public/files/'.$this->filename);

1
resources/lang/id/file.php

@ -28,4 +28,5 @@ return [
'title' => 'Nama File',
'description' => 'Deskripsi File',
'size' => 'Ukuran File',
'updated_at' => 'Tanggal',
];

5
resources/views/projects/files.blade.php

@ -20,6 +20,7 @@
<thead>
<th>{{ trans('app.table_no') }}</th>
<th>{{ trans('file.file') }}</th>
<th class="text-center">{{ trans('file.updated_at') }}</th>
<th class="text-right">{{ trans('file.size') }}</th>
<th class="text-center">{{ trans('file.download') }}</th>
<th class="text-center">{{ trans('app.action') }}</th>
@ -32,6 +33,10 @@
<strong class="">{{ $file->title }}</strong>
<div class="text-info small">{{ $file->description }}</div>
</td>
<td class="text-center">
<div class="">{{ $file->getDate() }}</div>
<div class="text-info small">{{ $file->getTime() }}</div>
</td>
<td class="text-right">{{ formatSizeUnits($file->getSize()) }}</td>
<td class="text-center">
{!! html_link_to_route('files.download', '', [$file->id], ['icon' => 'file', 'title' => trans('file.download')]) !!}

2
resources/views/projects/partials/nav-tabs.blade.php

@ -13,7 +13,7 @@
{!! link_to_route('projects.subscriptions', trans('project.subscriptions'), [$project->id]) !!}
</li>
<li class="{{ Request::segment(3) == 'files' ? 'active' : '' }}">
{!! link_to_route('projects.files', trans('project.files'), [$project->id]) !!}
{!! link_to_route('projects.files', trans('project.files') . ' (' . $project->files->count() . ')', [$project->id]) !!}
</li>
</ul>
<br>
Loading…
Cancel
Save