@extends('layouts.app') @section('title', trans('project.files') . ' | ' . $project->name) @section('content') @include('projects.partials.breadcrumb',['title' => trans('project.files')])

{{ $project->name }} {{ trans('project.files') }}

@include('projects.partials.nav-tabs')

{{ trans('project.files') }}

@forelse($files as $key => $file) @empty @endforelse
{{ trans('app.table_no') }} {{ trans('file.file') }} {{ trans('file.updated_at') }} {{ trans('file.size') }} {{ trans('file.download') }} {{ trans('app.action') }}
{{ 1 + $key }} {{ $file->title }}
{{ $file->description }}
{{ $file->getDate() }}
{{ $file->getTime() }}
{{ formatSizeUnits($file->getSize()) }} {!! html_link_to_route('files.download', '', [$file->id], ['icon' => 'file', 'title' => trans('file.download')]) !!} {!! html_link_to_route('projects.files', '', [$project->id, 'action' => 'edit', 'id' => $file->id], ['icon' => 'edit', 'title' => trans('file.edit')]) !!}
{{ trans('file.empty') }}
@if (Request::has('action') == false)

{{ trans('file.create') }}

{!! 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::text('title') !!} {!! FormField::textarea('description') !!} {!! Form::submit(trans('file.upload'), ['class' => 'btn btn-info']) !!} {!! Form::close() !!}
@endif @if (Request::get('action') == 'edit' && $editableFile)

{{ trans('file.edit') }} : {{ $editableFile->title }}

{!! 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']) }} {!! Form::close() !!}
@endif
@endsection