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
c4e9f5bd
Unverified
Commit
c4e9f5bd
authored
Sep 14, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replacing page forms with VueJS PageForm component
parent
29eb03d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
118 deletions
+10
-118
create.blade.php
Modules/Page/Resources/views/admin/create.blade.php
+2
-56
edit.blade.php
Modules/Page/Resources/views/admin/edit.blade.php
+8
-62
No files found.
Modules/Page/Resources/views/admin/create.blade.php
View file @
c4e9f5bd
...
@@ -23,63 +23,9 @@
...
@@ -23,63 +23,9 @@
@endpush
@endpush
@section('content')
@section('content')
{!! Form::open(['route' => ['admin.page.page.store'], 'method' => 'post']) !!}
<page-form :locales="
{{
json_encode
(
LaravelLocalization
::
getSupportedLocales
())
}}
"
<page-form :locales="
{{
json_encode
(
LaravelLocalization
::
getSupportedLocales
())
}}
"
:translations=
"{{ json_encode(['page' => trans('page::pages'), 'core' => trans('core::core')]) }}"
></page-form>
:translations="
{{
json_encode
([
'page'
=>
trans
(
'page::pages'
),
'core'
=>
trans
(
'core::core'
)])
}}
"
<div
class=
"row"
>
route="
{{
route
(
'api.page.page.store'
)
}}
"></page-form>
<div
class=
"col-md-10"
>
<div
class=
"nav-tabs-custom"
>
@include('partials.form-tab-headers', ['fields' => ['title', 'body']])
<div
class=
"tab-content"
>
<?php
$i
=
0
;
?>
<?php
foreach
(
LaravelLocalization
::
getSupportedLocales
()
as
$locale
=>
$language
)
:
?>
<?php
++
$i
;
?>
<div
class=
"tab-pane {{ App::getLocale() == $locale ? 'active' : '' }}"
id=
"tab_{{ $i }}"
>
@include('page::admin.partials.create-fields', ['lang' => $locale])
</div>
<?php
endforeach
;
?>
<?php
if
(
config
(
'asgard.page.config.partials.normal.create'
)
!==
[])
:
?>
<?php
foreach
(
config
(
'asgard.page.config.partials.normal.create'
)
as
$partial
)
:
?>
@include($partial)
<?php
endforeach
;
?>
<?php
endif
;
?>
<div
class=
"box-footer"
>
<button
type=
"submit"
class=
"btn btn-primary btn-flat"
>
{{ trans('core::core.button.create') }}
</button>
<a
class=
"btn btn-danger pull-right btn-flat"
href=
"{{ URL::route('admin.page.page.index')}}"
><i
class=
"fa fa-times"
></i>
{{ trans('core::core.button.cancel') }}
</a>
</div>
</div>
</div>
{{-- end nav-tabs-custom --}}
</div>
<div
class=
"col-md-2"
>
<div
class=
"box box-primary"
>
<div
class=
"box-body"
>
<div
class=
"checkbox{{ $errors->has('is_home') ? ' has-error' : '' }}"
>
<input
type=
"hidden"
name=
"is_home"
value=
"0"
>
<label
for=
"is_home"
>
<input
id=
"is_home"
name=
"is_home"
type=
"checkbox"
class=
"flat-blue"
value=
"1"
/>
{{ trans('page::pages.is homepage') }}
{!! $errors->first('is_home', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</label>
</div>
<hr/>
<div
class=
'form-group{{ $errors->has("template") ? '
has-error
'
:
''
}}'
>
{!! Form::label("template", trans('page::pages.template')) !!}
{!! Form::select("template", $all_templates, old("template", 'default'), ['class' => "form-control", 'placeholder' => trans('page::pages.template')]) !!}
{!! $errors->first("template", '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
<hr>
@tags('asgardcms/page')
</div>
</div>
</div>
</div>
{!! Form::close() !!}
@stop
@stop
@section('footer')
@section('footer')
...
...
Modules/Page/Resources/views/admin/edit.blade.php
View file @
c4e9f5bd
...
@@ -16,72 +16,18 @@
...
@@ -16,72 +16,18 @@
.checkbox label {
.checkbox label {
padding-left: 0;
padding-left: 0;
}
}
.error {
color: #dd4b39 !important;
}
</style>
</style>
@endpush
@endpush
@section('content')
@section('content')
{!! Form::open(['route' => ['admin.page.page.update',
$page->id
], 'method' => 'put']) !!}
<page-form :locales="
{{
json_encode
(
LaravelLocalization
::
getSupportedLocales
())
}}
"
<div class="
row
">
:translations="
{{
json_encode
([
'page'
=>
trans
(
'page::pages'
),
'core'
=>
trans
(
'core::core'
)])
}}
"
<div class="
col
-
md
-
10
">
:page-id="
{{
$page
->
id
}}
"
<div class="
nav
-
tabs
-
custom
">
route="
{{
route
(
'api.page.page.update'
,
$page
->
id
)
}}
">
@include('partials.form-tab-headers', ['fields' => ['title', 'body']])
</page-form>
<div class="
tab
-
content
">
<?php
$i
= 0; ?>
<?php foreach (LaravelLocalization::getSupportedLocales() as
$locale
=>
$language
): ?>
<?php ++
$i
; ?>
<div class="
tab
-
pane
{{
App
::
getLocale
()
==
$locale
?
'active'
:
''
}}
" id="
tab_
{{
$i
}}
">
@include('page::admin.partials.edit-fields', ['lang' =>
$locale
])
</div>
<?php endforeach; ?>
<?php if (config('asgard.page.config.partials.normal.edit') !== []): ?>
<?php foreach (config('asgard.page.config.partials.normal.edit') as
$partial
): ?>
@include(
$partial
)
<?php endforeach; ?>
<?php endif; ?>
<div class="
box
-
footer
">
<button type="
submit
" class="
btn
btn
-
primary
btn
-
flat
" name="
button
" value="
index
" >
<i class="
fa
fa
-
angle
-
left
"></i>
{{ trans('core::core.button.update and back') }}
</button>
<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
(
'admin.page.page.index'
)}}
"><i class="
fa
fa
-
times
"></i> {{ trans('core::core.button.cancel') }}</a>
</div>
</div>
</div> {{-- end nav-tabs-custom --}}
</div>
<div class="
col
-
md
-
2
">
<div class="
box
box
-
primary
">
<div class="
box
-
body
">
<div class="
checkbox
{{
$errors
->
has
(
'is_home'
)
?
' has-error'
:
''
}}
">
<input type="
hidden
" name="
is_home
" value="
0
">
<label for="
is_home
">
<input id="
is_home
"
name="
is_home
"
type="
checkbox
"
class="
flat
-
blue
"
{{ isset(
$page->is_home
) && (bool)
$page->is_home
== true ? 'checked' : '' }}
value="
1
" />
{{ trans('page::pages.is homepage') }}
{!!
$errors->first
('is_home', '<span class="
help
-
block
">:message</span>') !!}
</label>
</div>
<hr/>
<div class='form-group{{
$errors->has
("
template
") ? ' has-error' : '' }}'>
{!! Form::label("
template
", trans('page::pages.template')) !!}
{!! Form::select("
template
",
$all_templates
, old("
template
",
$page->template
), ['class' => "
form
-
control
", 'placeholder' => trans('page::pages.template')]) !!}
{!!
$errors->first
("
template
", '<span class="
help
-
block
">:message</span>') !!}
</div>
<hr>
@tags('asgardcms/page',
$page
)
</div>
</div>
</div>
</div>
{!! Form::close() !!}
@stop
@stop
@section('footer')
@section('footer')
...
...
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