Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
5d353749
Commit
5d353749
authored
Oct 29, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding the edit media view
parent
f614a9c6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
6 deletions
+81
-6
MediaController.php
Http/Controllers/Admin/MediaController.php
+4
-4
media.php
Resources/lang/en/media.php
+7
-1
media.php
Resources/lang/fr/media.php
+2
-1
edit.blade.php
Resources/views/admin/edit.blade.php
+51
-0
edit-fields.blade.php
Resources/views/admin/partials/edit-fields.blade.php
+17
-0
No files found.
Http/Controllers/Admin/MediaController.php
View file @
5d353749
...
...
@@ -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'
);
}
/**
...
...
Resources/lang/en/media.php
View file @
5d353749
...
...
@@ -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'
...
...
Resources/lang/fr/media.php
View file @
5d353749
...
...
@@ -2,7 +2,8 @@
return
[
'title'
=>
[
'media'
=>
'Média'
'media'
=>
'Média'
,
'edit media'
=>
'Edition de média'
],
'breadcrumb'
=>
[
'media'
=>
'Média'
...
...
Resources/views/admin/edit.blade.php
0 → 100644
View file @
5d353749
@
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
Resources/views/admin/partials/edit-fields.blade.php
0 → 100644
View file @
5d353749
<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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment