Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
b7188745
Commit
b7188745
authored
4 years ago
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit menu
parent
9ce4db6d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
7 deletions
+117
-7
app/Http/Controllers/Webprofile/Backend/MenuController.php
+29
-4
resources/lang/en/feature.php
+2
-0
resources/lang/id/feature.php
+2
-0
resources/views/webprofile/backend/menu/edit.blade.php
+75
-0
resources/views/webprofile/backend/menu/index.blade.php
+9
-3
No files found.
app/Http/Controllers/Webprofile/Backend/MenuController.php
View file @
b7188745
...
@@ -9,6 +9,7 @@ use App\Models\Webprofile\Menu;
...
@@ -9,6 +9,7 @@ use App\Models\Webprofile\Menu;
use
Validator
;
use
Validator
;
use
Alert
;
use
Alert
;
use
App\Repositories\Webprofile\En\MenuRepository
;
use
App\Repositories\Webprofile\En\MenuRepository
;
use
App\Repositories\Webprofile\MenuRepository
as
WebprofileMenuRepository
;
use
Crypt
;
use
Crypt
;
use
Auth
;
use
Auth
;
use
Statickidz\GoogleTranslate
;
use
Statickidz\GoogleTranslate
;
...
@@ -18,9 +19,12 @@ class MenuController extends Controller
...
@@ -18,9 +19,12 @@ class MenuController extends Controller
private
$SOURCE
=
'id'
;
private
$SOURCE
=
'id'
;
private
$TARGET
=
'en'
;
private
$TARGET
=
'en'
;
public
function
__construct
(
MenuRepository
$repoEn
)
public
function
__construct
(
{
MenuRepository
$repoEn
,
WebprofileMenuRepository
$repo
)
{
$this
->
repoEn
=
$repoEn
;
$this
->
repoEn
=
$repoEn
;
$this
->
repo
=
$repo
;
}
}
/**
/**
...
@@ -267,8 +271,18 @@ class MenuController extends Controller
...
@@ -267,8 +271,18 @@ class MenuController extends Controller
*
*
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\Response
*/
*/
public
function
edit
(
Menu
$menu
)
public
function
edit
(
$id
)
{
{
$id
=
Crypt
::
decrypt
(
$id
);
$setting
=
webprofilesetting
();
$data
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
]);
$data
=
[
'data'
=>
$data
,
'setting'
=>
$setting
,
];
return
view
(
'webprofile.backend.menu.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.edit_menu'
));
}
}
/**
/**
...
@@ -279,8 +293,19 @@ class MenuController extends Controller
...
@@ -279,8 +293,19 @@ class MenuController extends Controller
*
*
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\Response
*/
*/
public
function
update
(
Request
$request
,
Menu
$menu
)
public
function
update
(
Request
$request
,
$id
)
{
{
$data
=
$request
->
except
([
'_token'
,
'id'
]);
$data
[
'name'
]
=
$data
[
'titleiid'
];
$menu
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
]);
$this
->
repo
->
update
(
$data
,
$menu
);
$dataEn
[
'name'
]
=
$data
[
'titleien'
];
$menuEn
=
$this
->
repoEn
->
findId
(
$menu
->
rEn
->
id
);
$this
->
repoEn
->
update
(
$dataEn
,
$menuEn
);
return
redirect
()
->
route
(
'menu.index'
);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
resources/lang/en/feature.php
View file @
b7188745
...
@@ -52,4 +52,6 @@ return [
...
@@ -52,4 +52,6 @@ return [
'footer_row_3'
=>
'Footer 3'
,
'footer_row_3'
=>
'Footer 3'
,
'footer_row_4'
=>
'Footer 4'
,
'footer_row_4'
=>
'Footer 4'
,
'menuid'
=>
'Indonesian Title'
,
'menuen'
=>
'English Title'
,
];
];
This diff is collapsed.
Click to expand it.
resources/lang/id/feature.php
View file @
b7188745
...
@@ -52,4 +52,6 @@ return [
...
@@ -52,4 +52,6 @@ return [
'footer_row_3'
=>
'Footer 3'
,
'footer_row_3'
=>
'Footer 3'
,
'footer_row_4'
=>
'Footer 4'
,
'footer_row_4'
=>
'Footer 4'
,
'menuid'
=>
'Judul Dalam Bahasa Indonesia'
,
'menuen'
=>
'Judul Dalam Bahasa Inggris'
,
];
];
This diff is collapsed.
Click to expand it.
resources/views/webprofile/backend/menu/edit.blade.php
0 → 100644
View file @
b7188745
@
extends
(
'webprofile.backend.layouts.master'
)
@
section
(
'title'
)
{{
$title
}}
@
stop
@
section
(
'breadcrumbs'
)
<
li
><
a
href
=
"{{ url('dashboard') }}"
>@
lang
(
'label.dashboard'
)
</
a
></
li
>
<
li
class
="
active
">@lang('feature.edit_menu')</li>
@stop
@section('content')
{!! Form::model(
$data
, ['route' => ['menu.update',
$data->id
], 'method'=>'patch', 'class'=>'form-horizontal']) !!}
{!! csrf_field() !!}
<!-- page start-->
<div class="
row
">
<div class="
col
-
md
-
9
">
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h3 class="
panel
-
title
"><strong>@lang('label.edit')</strong> @lang('feature.menu')</h3>
</div>
<div class="
panel
-
body
">
<div class="
row
">
<div class="
col
-
md
-
12
">
<div class="
form
-
group
@
if
(
$errors
->
has
(
'titleiid'
))
has
-
error
@
endif
">
<label class="
col
-
md
-
2
control
-
label
">@lang('feature.menuid')</label>
<div class="
col
-
md
-
10
">
{{ Form::text('titleiid',
$data->name
, array('class' => 'form-control')) }}
@if (
$errors->has
('titleiid'))
<label id="
login
-
error
" class="
error
" for="
login
">
{
{$errors->first('titleiid')}
}
</label>
@endif
</div>
</div>
<div class="
form
-
group
@
if
(
$errors
->
has
(
'titleien'
))
has
-
error
@
endif
">
<label class="
col
-
md
-
2
control
-
label
">@lang('feature.menuen')</label>
<div class="
col
-
md
-
10
">
{{ Form::text('titleien',
$data->rEn
->name, array('class' => 'form-control')) }}
@if (
$errors->has
('titleien'))
<label id="
login
-
error
" class="
error
" for="
login
">
{
{$errors->first('titleien')}
}
</label>
@endif
</div>
</div>
<div class="
form
-
group
@
if
(
$errors
->
has
(
'url'
))
has
-
error
@
endif
">
<label class="
col
-
md
-
2
control
-
label
">URL</label>
<div class="
col
-
md
-
10
">
{{ Form::text('url', old('url'), array('class' => 'form-control')) }}
@if (
$errors->has
('url'))
<label id="
login
-
error
" class="
error
" for="
login
">
{
{$errors->first('url')}
}
</label>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="
col
-
md
-
9
">
<div class="
panel
panel
-
default
">
<div class="
panel
-
footer
">
<a href="
{{
URL
::
to
(
'webprofile/menu'
)}}
" class="
btn
btn
-
default
pull
-
right
">@lang('label.cancel')</a>
<button class="
btn
btn
-
info
pull
-
right
">@lang('label.save')</button>
</div>
</div>
</div>
</div>
{!! Form::close() !!}
<!-- page end-->
@stop
@section('script')
{!! Html::script('https://statik.unesa.ac.id/perpus_konten_statik/admin/js/plugins/bootstrap/bootstrap-datepicker.js') !!}
{!! Html::script('https://statik.unesa.ac.id/perpus_konten_statik/admin/js/plugins/bootstrap/bootstrap-timepicker.min.js') !!}
{!! Html::script('https://statik.unesa.ac.id/perpus_konten_statik/admin/js/plugins/bootstrap/bootstrap-file-input.js') !!}
{!! Html::script('https://statik.unesa.ac.id/perpus_konten_statik/admin/js/plugins/summernote/summernote.js') !!}
@stop
This diff is collapsed.
Click to expand it.
resources/views/webprofile/backend/menu/index.blade.php
View file @
b7188745
...
@@ -146,7 +146,9 @@
...
@@ -146,7 +146,9 @@
@endif
@endif
</td>
</td>
<td style="
text
-
align
:
center
;
vertical
-
align
:
middle
;
">
<td style="
text
-
align
:
center
;
vertical
-
align
:
middle
;
">
<button class="
btn
btn
-
danger
btn
-
xs
" id="
btn_delete
" data-file="
{{
$value
[
'id'
]}}
"><i class="
fa
fa
-
trash
-
o
"></i></button>
<a href="
{{
route
(
'menu.edit'
,
[
'data'
=>
Crypt
::
encrypt
(
$value
[
'id'
])])
}}
" data-toggle="
tooltip
" data-original-title="
@
lang
(
'label.edit'
)
" class="
edit
btn
btn
-
primary
btn
-
xs
"><i class="
fa
fa
-
edit
"></i></a>
<button class="
btn
btn
-
danger
btn
-
xs
" id="
btn_delete
" data-file="
{{
$value
[
'id'
]}}
" data-toggle="
tooltip
" data-original-title="
@
lang
(
'label.delete'
)
"><i class="
fa
fa
-
trash
-
o
"></i></button>
{{ Form::open(['url'=>route('menu.destroy', ['data'=>Crypt::encrypt(
$value['id'])]
), 'method'=>'delete', 'id' =>
$value['id']
, 'style' => 'display: none;']) }}
{{ Form::open(['url'=>route('menu.destroy', ['data'=>Crypt::encrypt(
$value['id'])]
), 'method'=>'delete', 'id' =>
$value['id']
, 'style' => 'display: none;']) }}
{{ csrf_field() }}
{{ csrf_field() }}
{{ Form::close() }}
{{ Form::close() }}
...
@@ -184,7 +186,9 @@
...
@@ -184,7 +186,9 @@
@endif
@endif
</td>
</td>
<td style="
text
-
align
:
center
;
vertical
-
align
:
middle
;
">
<td style="
text
-
align
:
center
;
vertical
-
align
:
middle
;
">
<button class="
btn
btn
-
danger
btn
-
xs
" id="
btn_delete
" data-file="
{{
$val
[
'id'
]}}
"><i class="
fa
fa
-
trash
-
o
"></i></button>
<a href="
{{
route
(
'menu.edit'
,
[
'data'
=>
Crypt
::
encrypt
(
$val
[
'id'
])])
}}
" data-toggle="
tooltip
" data-original-title="
@
lang
(
'label.edit'
)
" class="
edit
btn
btn
-
primary
btn
-
xs
"><i class="
fa
fa
-
edit
"></i></a>
<button class="
btn
btn
-
danger
btn
-
xs
" id="
btn_delete
" data-file="
{{
$val
[
'id'
]}}
" data-toggle="
tooltip
" data-original-title="
@
lang
(
'label.delete'
)
"><i class="
fa
fa
-
trash
-
o
"></i></button>
{{ Form::open(['url'=>route('menu.destroy', ['data'=>Crypt::encrypt(
$val['id'])]
), 'method'=>'delete', 'id' =>
$val['id']
, 'style' => 'display: none;']) }}
{{ Form::open(['url'=>route('menu.destroy', ['data'=>Crypt::encrypt(
$val['id'])]
), 'method'=>'delete', 'id' =>
$val['id']
, 'style' => 'display: none;']) }}
{{ csrf_field() }}
{{ csrf_field() }}
{{ Form::close() }}
{{ Form::close() }}
...
@@ -222,7 +226,9 @@
...
@@ -222,7 +226,9 @@
@endif
@endif
</td>
</td>
<td style="
text
-
align
:
center
;
vertical
-
align
:
middle
;
">
<td style="
text
-
align
:
center
;
vertical
-
align
:
middle
;
">
<button class="
btn
btn
-
danger
btn
-
xs
" id="
btn_delete
" data-file="
{{
$val2
[
'id'
]}}
"><i class="
fa
fa
-
trash
-
o
"></i></button>
<a href="
{{
route
(
'menu.edit'
,
[
'data'
=>
Crypt
::
encrypt
(
$val2
[
'id'
])])
}}
" data-toggle="
tooltip
" data-original-title="
@
lang
(
'label.edit'
)
" class="
edit
btn
btn
-
primary
btn
-
xs
"><i class="
fa
fa
-
edit
"></i></a>
<button class="
btn
btn
-
danger
btn
-
xs
" id="
btn_delete
" data-file="
{{
$val2
[
'id'
]}}
" data-toggle="
tooltip
" data-original-title="
@
lang
(
'label.delete'
)
"><i class="
fa
fa
-
trash
-
o
"></i></button>
{{ Form::open(['url'=>route('menu.destroy', ['data'=>Crypt::encrypt(
$val2['id'])]
), 'method'=>'delete', 'id' =>
$val2['id']
, 'style' => 'display: none;']) }}
{{ Form::open(['url'=>route('menu.destroy', ['data'=>Crypt::encrypt(
$val2['id'])]
), 'method'=>'delete', 'id' =>
$val2['id']
, 'style' => 'display: none;']) }}
{{ csrf_field() }}
{{ csrf_field() }}
{{ Form::close() }}
{{ Form::close() }}
...
...
This diff is collapsed.
Click to expand it.
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