Commit 5d353749 authored by Nicolas Widart's avatar Nicolas Widart

Adding the edit media view

parent f614a9c6
......@@ -64,18 +64,18 @@ class MediaController extends AdminBaseController
*/
public function edit(File $file)
{
return View::make('media.edit');
return View::make('media::admin.edit', compact('file'));
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @param File $file
* @return Response
*/
public function update($id)
public function update(File $file)
{
//
dd('form posted');
}
/**
......
......@@ -2,7 +2,8 @@
return [
'title' => [
'media' => 'Media'
'media' => 'Media',
'edit media' => 'Edit media'
],
'breadcrumb' => [
'media' => 'Media'
......@@ -12,6 +13,11 @@ return [
'width' => 'Width',
'height' => 'Height'
],
'form' => [
'alt_attribute' => 'Alt attribute',
'description' => 'Description',
'keywords' => 'Keywords',
],
'choose file' => 'Choose a file',
'insert' => 'Insert this file',
'file picker' => 'File Picker'
......
......@@ -2,7 +2,8 @@
return [
'title' => [
'media' => 'Média'
'media' => 'Média',
'edit media' => 'Edition de média'
],
'breadcrumb' => [
'media' => 'Média'
......
@extends('core::layouts.master')
@section('content-header')
<h1>
{{ trans('media::media.title.edit media') }} <small>{{ $file->name }}</small>
</h1>
<ol class="breadcrumb">
<li><a href="{{ URL::route('dashboard.index') }}"><i class="fa fa-dashboard"></i> {{ trans('core::core.breadcrumb.home') }}</a></li>
<li><a href="{{ URL::route('dashboard.media.index') }}">{{ trans('media::media.title.media') }}</a></li>
<li class="active">{{ trans('media::media.title.edit media') }}</li>
</ol>
@stop
@section('content')
{!! Form::open(['route' => ['dashboard.media.update', $file->id], 'method' => 'put']) !!}
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<?php $i = 0; ?>
<?php foreach(LaravelLocalization::getSupportedLocales() as $locale => $language): ?>
<?php $i++; ?>
<li class="{{ App::getLocale() == $locale ? 'active' : '' }}">
<a href="#tab_{{ $i }}" data-toggle="tab">{{ trans('core::core.tab.'. strtolower($language['name'])) }}</a>
</li>
<?php endforeach; ?>
</ul>
<div class="tab-content">
<div class="row">
@include('flash::message')
</div>
<?php $i = 0; ?>
<?php foreach(LaravelLocalization::getSupportedLocales() as $locale => $language): ?>
<?php $i++; ?>
<div class="tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}" id="tab_{{ $i }}">
@include('media::admin.partials.edit-fields', [
'lang' => $locale
])
</div>
<?php endforeach; ?>
<div class="box-footer">
<button type="submit" class="btn btn-primary btn-flat">{{ trans('core::core.button.update') }}</button>
<a class="btn btn-danger pull-right btn-flat" href="{{ URL::route('dashboard.media.index')}}"><i class="fa fa-times"></i> {{ trans('core::core.button.cancel') }}</a>
</div>
</div>
</div> {{-- end nav-tabs-custom --}}
</div>
</div>
{!! Form::close() !!}
@stop
<div class='form-group{{ $errors->has("alt_attribute[{$lang}]") ? ' has-error' : '' }}'>
{!! Form::label("alt_attribute[{$lang}]", trans('media::media.form.alt_attribute')) !!}
{!! Form::text("alt_attribute[{$lang}]", Input::old("alt_attribute[{$lang}]", $file->translate($lang)->alt_attribute), ['class' => 'form-control', 'placeholder' => trans('media::media.form.alt_attribute')]) !!}
{!! $errors->first("alt_attribute[{$lang}]", '<span class="help-block">:message</span>') !!}
</div>
<div class='form-group{{ $errors->has("description[{$lang}]") ? ' has-error' : '' }}'>
{!! Form::label("description[{$lang}]", trans('media.media.form.description')) !!}
{!! Form::textarea("description[{$lang}]", Input::old("description[{$lang}]", $file->translate($lang)->description), ['class' => 'form-control', 'placeholder' => trans('media::media.form.description')]) !!}
{!! $errors->first("description[{$lang}]", '<span class="help-block">:message</span>') !!}
</div>
<div class='form-group{{ $errors->has("keywords[{$lang}]") ? ' has-error' : '' }}'>
{!! Form::label("keywords[{$lang}]", trans('media::media.form.keywords')) !!}
{!! Form::text("keywords[{$lang}]", Input::old("keywords[{$lang}]", $file->translate($lang)->keywords), ['class' => 'form-control', 'placeholder' => trans('media::media.form.keywords')]) !!}
{!! $errors->first("keywords[{$lang}]", '<span class="help-block">:message</span>') !!}
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment