Browse Source

Change formatSizeUnits() to format_size_units()

pull/32/head
Nafies Luthfi 7 years ago
parent
commit
b0dfc805e9
  1. 2
      app/helpers.php
  2. 2
      resources/views/backups/index.blade.php
  3. 46
      resources/views/projects/files.blade.php
  4. 26
      resources/views/reports/log-files.blade.php

2
app/helpers.php

@ -150,7 +150,7 @@ function str_split_ucwords($string)
* @param int $bytes File size.
* @return string Converted file size with unit.
*/
function formatSizeUnits($bytes)
function format_size_units($bytes)
{
if ($bytes >= 1073741824) {
$bytes = number_format($bytes / 1073741824, 2).' GB';

2
resources/views/backups/index.blade.php

@ -24,7 +24,7 @@
<tr>
<td>{{ $key + 1 }}</td>
<td>{{ $backup->getFilename() }}</td>
<td>{{ formatSizeUnits($backup->getSize()) }}</td>
<td>{{ format_size_units($backup->getSize()) }}</td>
<td>{{ date('Y-m-d H:i:s', $backup->getMTime()) }}</td>
<td class="text-center">
<a href="{{ route('backups.index', ['action' => 'restore', 'file_name' => $backup->getFilename()]) }}"

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

@ -1,12 +1,12 @@
@extends('layouts.app')
@section('title', trans('project.files') . ' | ' . $project->name)
@section('title', __('project.files').' | '.$project->name)
@section('content')
@include('projects.partials.breadcrumb',['title' => trans('project.files')])
@include('projects.partials.breadcrumb',['title' => __('project.files')])
<h1 class="page-header">
{{ $project->name }} <small>{{ trans('project.files') }}</small>
{{ $project->name }} <small>{{ __('project.files') }}</small>
</h1>
@include('projects.partials.nav-tabs')
@ -14,16 +14,16 @@
<div class="col-md-8">
<div class="panel panel-default table-responsive">
<div class="panel-heading">
<h3 class="panel-title">{{ trans('project.files') }}</h3>
<h3 class="panel-title">{{ __('project.files') }}</h3>
</div>
<table class="table table-condensed table-striped">
<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>
<th>{{ __('app.table_no') }}</th>
<th>{{ __('file.file') }}</th>
<th class="text-center">{{ __('file.updated_at') }}</th>
<th class="text-right">{{ __('file.size') }}</th>
<th class="text-center">{{ __('file.download') }}</th>
<th class="text-center">{{ __('app.action') }}</th>
</thead>
<tbody class="sort-files">
@forelse($files as $key => $file)
@ -37,16 +37,16 @@
<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-right">{{ format_size_units($file->getSize()) }}</td>
<td class="text-center">
{!! html_link_to_route('files.download', '', [$file->id], ['icon' => 'file', 'title' => trans('file.download')]) !!}
{!! html_link_to_route('files.download', '', [$file->id], ['icon' => 'file', 'title' => __('file.download')]) !!}
</td>
<td class="text-center">
{!! html_link_to_route('projects.files', '', [$project->id, 'action' => 'edit', 'id' => $file->id], ['icon' => 'edit', 'title' => trans('file.edit')]) !!}
{!! html_link_to_route('projects.files', '', [$project->id, 'action' => 'edit', 'id' => $file->id], ['icon' => 'edit', 'title' => __('file.edit')]) !!}
</td>
</tr>
@empty
<tr><td colspan="6">{{ trans('file.empty') }}</td></tr>
<tr><td colspan="6">{{ __('file.empty') }}</td></tr>
@endforelse
</tbody>
</table>
@ -55,27 +55,27 @@
<div class="col-md-4">
@if (Request::has('action') == false)
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('file.create') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('file.create') }}</h3></div>
<div class="panel-body">
{!! Form::open(['route' => ['files.upload', $project->id], 'id' => 'upload-file', 'files' => true]) !!}
{{ Form::hidden('fileable_type', get_class($project)) }}
{!! FormField::file('file', ['label' => trans('file.select')]) !!}
{!! FormField::file('file', ['label' => __('file.select')]) !!}
{!! FormField::text('title') !!}
{!! FormField::textarea('description') !!}
{!! Form::submit(trans('file.upload'), ['class' => 'btn btn-info']) !!}
{!! Form::submit(__('file.upload'), ['class' => 'btn btn-info']) !!}
{!! Form::close() !!}
</div>
</div>
@endif
@if (Request::get('action') == 'edit' && $editableFile)
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('file.edit') }} : {{ $editableFile->title }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('file.edit') }} : {{ $editableFile->title }}</h3></div>
<div class="panel-body">
{!! Form::model($editableFile, ['route' => ['files.update', $editableFile->id],'method' => 'patch']) !!}
{!! FormField::text('title', ['label' => trans('file.title'), 'required' => true]) !!}
{!! FormField::textarea('description', ['label' => trans('file.description')]) !!}
{!! Form::submit(trans('file.update'), ['class' => 'btn btn-success']) !!}
{{ link_to_route('projects.files', trans('app.cancel'), [$project->id], ['class' => 'btn btn-default']) }}
{!! FormField::text('title', ['label' => __('file.title'), 'required' => true]) !!}
{!! FormField::textarea('description', ['label' => __('file.description')]) !!}
{!! Form::submit(__('file.update'), ['class' => 'btn btn-success']) !!}
{{ link_to_route('projects.files', __('app.cancel'), [$project->id], ['class' => 'btn btn-default']) }}
{!! Form::close() !!}
</div>
</div>
@ -84,4 +84,4 @@
</div>
@endsection
@endsection

26
resources/views/reports/log-files.blade.php

@ -1,11 +1,9 @@
@extends('layouts.app')
@section('title','Log Files')
@section('title', 'Log Files')
@section('content')
<h3 class="page-header">
Log Files
</h3>
<h3 class="page-header">Log Files</h3>
<div class="row">
<div class="col-md-8">
<div class="panel panel-default">
@ -15,35 +13,33 @@
<th>Nama File</th>
<th>Ukuran</th>
<th>Tanggal Jam</th>
<th>{{ trans('app.action') }}</th>
<th>{{ __('app.action') }}</th>
</thead>
<tbody>
@forelse($logFiles as $key => $logFile)
<tr>
<td>{{ $key + 1 }}</td>
<td>{{ $logFile->getFilename() }}</td>
<td>{{ formatSizeUnits($logFile->getSize()) }}</td>
<td>{{ format_size_units($logFile->getSize()) }}</td>
<td>{{ date('Y-m-d H:i:s', $logFile->getMTime()) }}</td>
<td>
{!! html_link_to_route('log-files.download','',[$logFile->getFilename()],[
{!! html_link_to_route('log-files.download', '', [$logFile->getFilename()], [
'class'=>'btn btn-default btn-xs',
'icon' => 'download',
'id' => 'download-' . $logFile->getFilename(),
'title' => 'Download file ' . $logFile->getFilename()
'id' => 'download-'.$logFile->getFilename(),
'title' => 'Download file '.$logFile->getFilename()
]) !!}
{!! html_link_to_route('log-files.show','',[$logFile->getFilename()],[
{!! html_link_to_route('log-files.show', '', [$logFile->getFilename()], [
'class'=>'btn btn-default btn-xs',
'icon' => 'search',
'id' => 'view-' . $logFile->getFilename(),
'title' => 'View file ' . $logFile->getFilename(),
'id' => 'view-'.$logFile->getFilename(),
'title' => 'View file '.$logFile->getFilename(),
'target' => '_blank',
]) !!}
</td>
</tr>
@empty
<tr>
<td colspan="3">Belum ada file logFile</td>
</tr>
<tr><td colspan="5">Belum ada file logFile</td></tr>
@endforelse
</tbody>
</table>

Loading…
Cancel
Save