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
ed6680c8
Commit
ed6680c8
authored
Nov 19, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor for cleaner views and repository
parent
57ecb8a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
32 deletions
+19
-32
EloquentFileRepository.php
Repositories/Eloquent/EloquentFileRepository.php
+1
-2
edit.blade.php
Resources/views/admin/edit.blade.php
+3
-16
edit-fields.blade.php
Resources/views/admin/partials/edit-fields.blade.php
+15
-14
No files found.
Repositories/Eloquent/EloquentFileRepository.php
View file @
ed6680c8
...
...
@@ -17,8 +17,7 @@ class EloquentFileRepository extends EloquentBaseRepository implements FileRepos
*/
public
function
update
(
$file
,
$data
)
{
$translatableData
=
Helper
::
separateLanguages
(
$data
);
Helper
::
updateTranslated
(
$file
,
$translatableData
);
$file
->
update
(
$data
);
return
$file
;
}
...
...
Resources/views/admin/edit.blade.php
View file @
ed6680c8
...
...
@@ -16,26 +16,13 @@
<div class="
row
">
<div class="
col
-
md
-
8
">
<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>
@include('core::partials.form-tab-headers')
<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
])
@include('media::admin.partials.edit-fields', ['lang' =>
$locale
])
</div>
<?php endforeach; ?>
<div class="
box
-
footer
">
...
...
@@ -46,7 +33,7 @@
</div> {{-- end nav-tabs-custom --}}
</div>
<div class="
col
-
md
-
4
">
<img
src=
"{{ $file->path }}"
alt=
"
{{ $file->translate()->alt_attribute }}
"
style=
"width: 100%;"
/>
<img src="
{{
$file
->
path
}}
" alt="" style="
width
:
100
%
;
"/>
</div>
</div>
...
...
Resources/views/admin/partials/edit-fields.blade.php
View file @
ed6680c8
<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>
') !!}
<?php
$altAttribute
=
isset
(
$file
->
translate
(
$lang
)
->
alt_attribute
)
?
$file
->
translate
(
$lang
)
->
alt_attribute
:
''
?>
<div
class=
'form-group{{ $errors->has("{$lang}[alt_attribute]") ? '
has-error
'
:
''
}}'
>
{!! Form::label("{$lang}[alt_attribute]", trans('media::media.form.alt_attribute')) !!}
{!! Form::text("{$lang}[alt_attribute]", Input::old("{$lang}[alt_attribute]", $altAttribute), ['class' => 'form-control', 'placeholder' => trans('media::media.form.alt_attribute')]) !!}
{!! $errors->first("{$lang}[alt_attribute]", '
<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>
') !!}
<?php
$description
=
isset
(
$file
->
translate
(
$lang
)
->
description
)
?
$file
->
translate
(
$lang
)
->
alt_attribute
:
''
?>
<div
class=
'form-group{{ $errors->has("
{$lang}[description
]") ? '
has-error
'
:
''
}}'
>
{!! Form::label("
{$lang}[description
]", trans('media::media.form.description')) !!}
{!! Form::textarea("
{$lang}[description]", Input::old("{$lang}[description]", $
description), ['class' => 'form-control', 'placeholder' => trans('media::media.form.description')]) !!}
{!! $errors->first("
{$lang}[description
]", '
<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>
') !!}
<?php
$keywords
=
isset
(
$file
->
translate
(
$lang
)
->
keywords
)
?
$file
->
translate
(
$lang
)
->
alt_attribute
:
''
?>
<div
class=
'form-group{{ $errors->has("
{$lang}[keywords
]") ? '
has-error
'
:
''
}}'
>
{!! Form::label("
{$lang}[keywords
]", trans('media::media.form.keywords')) !!}
{!! Form::text("
{$lang}[keywords]", Input::old("{$lang}[keywords]", $
keywords), ['class' => 'form-control', 'placeholder' => trans('media::media.form.keywords')]) !!}
{!! $errors->first("
{$lang}[keywords
]", '
<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