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
8ebc4736
Commit
8ebc4736
authored
Dec 19, 2019
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
master slider and 2 mode storage (local/static content)
parent
ab9c52c0
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
574 additions
and
9 deletions
+574
-9
app/Http/Controllers/Webprofile/Backend/CategoryController.php
+1
-1
app/Http/Controllers/Webprofile/Backend/InformationController.php
+1
-1
app/Http/Controllers/Webprofile/Backend/PageController.php
+1
-1
app/Http/Controllers/Webprofile/Backend/PostController.php
+1
-1
app/Http/Controllers/Webprofile/Backend/SliderController.php
+112
-0
app/Repositories/Webprofile/SliderRepository.php
+75
-3
config/filesystems.php
+8
-0
public/js/master/slider.js
+84
-0
resources/lang/en/label.php
+2
-0
resources/lang/id/label.php
+3
-0
resources/views/webprofile/backend/layouts/navigations/admin.blade.php
+1
-1
resources/views/webprofile/backend/setting/index.blade.php
+1
-1
resources/views/webprofile/backend/sliders/create.blade.php
+104
-0
resources/views/webprofile/backend/sliders/edit.blade.php
+114
-0
resources/views/webprofile/backend/sliders/index.blade.php
+65
-0
routes/webprofile/backend.php
+1
-0
No files found.
app/Http/Controllers/Webprofile/Backend/CategoryController.php
View file @
8ebc4736
...
@@ -81,7 +81,7 @@ class CategoryController extends Controller
...
@@ -81,7 +81,7 @@ class CategoryController extends Controller
'data'
=>
$data
,
'data'
=>
$data
,
];
];
return
view
(
'webprofile.backend.categories.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.
create
_category'
));
return
view
(
'webprofile.backend.categories.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.
edit
_category'
));
}
}
/**
/**
...
...
app/Http/Controllers/Webprofile/Backend/InformationController.php
View file @
8ebc4736
...
@@ -90,7 +90,7 @@ class InformationController extends Controller
...
@@ -90,7 +90,7 @@ class InformationController extends Controller
'categories'
=>
$categories
,
'categories'
=>
$categories
,
];
];
return
view
(
'webprofile.backend.informations.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.
create
_information'
));
return
view
(
'webprofile.backend.informations.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.
edit
_information'
));
}
}
/**
/**
...
...
app/Http/Controllers/Webprofile/Backend/PageController.php
View file @
8ebc4736
...
@@ -88,7 +88,7 @@ class PageController extends Controller
...
@@ -88,7 +88,7 @@ class PageController extends Controller
'categories'
=>
$categories
,
'categories'
=>
$categories
,
];
];
return
view
(
'webprofile.backend.pages.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.
create
_page'
));
return
view
(
'webprofile.backend.pages.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.
edit
_page'
));
}
}
/**
/**
...
...
app/Http/Controllers/Webprofile/Backend/PostController.php
View file @
8ebc4736
...
@@ -91,7 +91,7 @@ class PostController extends Controller
...
@@ -91,7 +91,7 @@ class PostController extends Controller
'categories'
=>
$categories
,
'categories'
=>
$categories
,
];
];
return
view
(
'webprofile.backend.posts.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.
create
_post'
));
return
view
(
'webprofile.backend.posts.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.
edit
_post'
));
}
}
/**
/**
...
...
app/Http/Controllers/Webprofile/Backend/SliderController.php
0 → 100644
View file @
8ebc4736
<?php
namespace
App\Http\Controllers\Webprofile\Backend
;
use
Illuminate\Http\Request
;
use
App\Http\Controllers\Controller
;
use
App\Repositories\Webprofile\SliderRepository
;
use
Storage
;
class
SliderController
extends
Controller
{
private
$repo
;
public
function
__construct
(
SliderRepository
$repo
)
{
$this
->
repo
=
$repo
;
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public
function
index
(
Request
$request
)
{
if
(
$request
->
ajax
())
{
$data
=
$this
->
repo
->
get
(
null
,
null
,
[
'created_at'
,
'desc'
]);
return
$this
->
repo
->
datatable
(
$data
);
}
return
view
(
'webprofile.backend.sliders.index'
)
->
withTitle
(
trans
(
'feature.slider'
));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public
function
create
()
{
return
view
(
'webprofile.backend.sliders.create'
)
->
withTitle
(
trans
(
'feature.create_slider'
));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public
function
store
(
Request
$request
)
{
$this
->
repo
->
store
(
$request
);
return
redirect
()
->
route
(
'sliders.index'
);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
show
(
$id
)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
edit
(
$id
)
{
$data
=
$this
->
repo
->
findId
(
$id
);
$data
=
[
'data'
=>
$data
,
];
return
view
(
'webprofile.backend.sliders.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.edit_slider'
));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
update
(
Request
$request
,
$id
)
{
$slider
=
$this
->
repo
->
findId
(
$id
);
$edit
=
$this
->
repo
->
update
(
$request
,
$slider
);
return
redirect
()
->
route
(
'sliders.index'
);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
destroy
(
$id
)
{
$data
=
$this
->
repo
->
findId
(
$id
);
$this
->
repo
->
destroy
(
$data
);
return
response
()
->
json
([
'done'
]);
}
}
app/Repositories/Webprofile/SliderRepository.php
View file @
8ebc4736
...
@@ -4,7 +4,9 @@ namespace App\Repositories\Webprofile;
...
@@ -4,7 +4,9 @@ namespace App\Repositories\Webprofile;
use
App\Models\Webprofile\Slider
;
use
App\Models\Webprofile\Slider
;
use
App\Repositories\Repository
;
use
App\Repositories\Repository
;
use
Illuminate\Support\Str
;
use
DataTables
;
use
DataTables
;
use
Storage
;
class
SliderRepository
extends
Repository
class
SliderRepository
extends
Repository
{
{
...
@@ -30,19 +32,89 @@ class SliderRepository extends Repository
...
@@ -30,19 +32,89 @@ class SliderRepository extends Repository
->
get
();
->
get
();
}
}
/**
* Custom Store a newly created resource in Slider.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public
function
store
(
$request
)
{
$setting
=
webprofilesetting
();
$data
=
$request
->
except
(
'_token'
);
$data
[
'id'
]
=
Str
::
uuid
()
->
toString
();
if
(
$request
->
hasFile
(
'images'
))
{
$cover
=
$request
->
file
(
'images'
);
$extension
=
$cover
->
guessClientExtension
();
$filename
=
$data
[
'id'
]
.
'.'
.
$extension
;
if
(
$setting
[
'external_storage'
]
==
1
)
{
Storage
::
disk
(
'storage'
)
->
put
(
$setting
[
'directory'
]
.
'/slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
else
{
Storage
::
disk
(
'local'
)
->
put
(
'slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
$data
[
'images'
]
=
$filename
;
}
$request
[
'userid_created'
]
=
auth
()
->
user
()
->
id
;
return
$this
->
model
->
create
(
$data
);
}
/**
* Custom Update a resource in Slider.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public
function
update
(
$request
,
$sModel
)
{
$setting
=
webprofilesetting
();
$data
=
$request
->
except
(
'_token'
);
if
(
$request
->
hasFile
(
'images'
))
{
$cover
=
$request
->
file
(
'images'
);
$extension
=
$cover
->
guessClientExtension
();
$filename
=
$sModel
->
id
.
'.'
.
$extension
;
if
(
$setting
[
'external_storage'
]
==
1
)
{
Storage
::
disk
(
'storage'
)
->
put
(
$setting
[
'directory'
]
.
'/slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
else
{
Storage
::
disk
(
'local'
)
->
put
(
'slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
$data
[
'images'
]
=
$filename
;
}
$data
[
'userid_updated'
]
=
auth
()
->
user
()
->
id
;
return
$sModel
->
update
(
$data
);
}
public
function
datatable
(
$data
)
public
function
datatable
(
$data
)
{
{
$setting
=
webprofilesetting
();
return
DataTables
::
of
(
$data
)
return
DataTables
::
of
(
$data
)
->
addIndexColumn
()
->
addIndexColumn
()
->
addColumn
(
'action'
,
function
(
$row
)
{
->
addColumn
(
'action'
,
function
(
$row
)
{
$btn
=
'<a href="
javascript:void(0)" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="Edit" class="edit btn btn-warning btn-round btn-sm edit">Edit
</a>'
;
$btn
=
'<a href="
'
.
url
(
'/webprofile/sliders/'
.
$row
->
id
.
'/edit'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.edit'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.edit'
)
.
'
</a>'
;
$btn
=
$btn
.
' <a href="javascript:void(0)" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="
Delete" class="btn btn-danger btn-round btn-sm delete">Delete
</a>'
;
$btn
=
$btn
.
' <a href="javascript:void(0)" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="
'
.
trans
(
'label.delete'
)
.
'" class="btn btn-danger btn-round btn-sm delete">'
.
trans
(
'label.delete'
)
.
'
</a>'
;
$btn
=
$btn
.
'<br>'
;
$btn
=
$btn
.
'<br>'
;
return
$btn
;
return
$btn
;
})
})
->
addColumn
(
'slider'
,
function
(
$row
)
use
(
$setting
)
{
if
(
$setting
[
'external_storage'
]
==
1
)
{
$str
=
'<img src="'
.
$setting
[
'url_static'
]
.
'/'
.
$setting
[
'directory'
]
.
'/slider/'
.
$row
->
images
.
'" height="100" width="auto">'
;
}
else
{
$str
=
'<img src="'
.
url
(
'/storage/slider/'
.
$row
->
images
)
.
'" height="100" width="auto">'
;
}
return
$str
;
})
->
addColumn
(
'status'
,
function
(
$row
)
{
->
addColumn
(
'status'
,
function
(
$row
)
{
if
(
$row
->
is_active
==
true
)
{
if
(
$row
->
is_active
==
true
)
{
$str
=
'<div style="color: green;"><i class="fa fa-check"></i></div>'
;
$str
=
'<div style="color: green;"><i class="fa fa-check"></i></div>'
;
...
@@ -51,7 +123,7 @@ class SliderRepository extends Repository
...
@@ -51,7 +123,7 @@ class SliderRepository extends Repository
}
}
return
$str
;
return
$str
;
})
})
->
rawColumns
([
'action'
,
'status'
])
->
rawColumns
([
'action'
,
'status'
,
'slider'
])
->
make
(
true
);
->
make
(
true
);
}
}
}
}
config/filesystems.php
View file @
8ebc4736
...
@@ -64,6 +64,14 @@ return [
...
@@ -64,6 +64,14 @@ return [
'url'
=>
env
(
'AWS_URL'
),
'url'
=>
env
(
'AWS_URL'
),
],
],
'storage'
=>
[
'driver'
=>
'ftp'
,
'host'
=>
env
(
'SKU_HOST'
),
'username'
=>
env
(
'SKU_USERNAME'
),
'password'
=>
env
(
'SKU_PASSWORD'
),
'ssl'
=>
true
,
],
],
],
];
];
public/js/master/slider.js
0 → 100644
View file @
8ebc4736
$
(
function
()
{
$
.
ajaxSetup
({
headers
:
{
'X-CSRF-TOKEN'
:
$
(
'meta[name="csrf-token"]'
).
attr
(
'content'
)
}
});
var
table
=
$
(
'.data-table'
).
DataTable
({
processing
:
true
,
serverSide
:
true
,
responsive
:
true
,
ajax
:
url
,
columns
:
[
{
data
:
'DT_RowIndex'
,
name
:
'DT_RowIndex'
},
{
data
:
'slider'
,
name
:
'slider'
},
{
data
:
'status'
,
name
:
'status'
},
{
data
:
'action'
,
name
:
'action'
,
orderable
:
false
,
searchable
:
false
},
],
columnDefs
:
[
{
className
:
'text-center'
,
targets
:
[
0
,
2
,
3
]},
{
className
:
'text-left'
,
targets
:
[
1
]},
],
});
$
(
"body"
).
on
(
"click"
,
".delete"
,
function
(
e
)
{
e
.
preventDefault
();
var
id
=
$
(
this
).
data
(
'id'
);
swal
({
title
:
"Apakah Anda Yakin?"
,
text
:
"Anda akan menghapus data ini!"
,
type
:
"warning"
,
showCancelButton
:
true
,
confirmButtonColor
:
"#DD6B55"
,
confirmButtonText
:
"Yes"
,
cancelButtonText
:
"No"
,
closeOnConfirm
:
false
,
closeOnCancel
:
false
},
function
(
isConfirm
)
{
if
(
isConfirm
)
{
swal
.
close
();
setTimeout
(
function
()
{
$
.
ajax
({
dataType
:
'json'
,
type
:
'DELETE'
,
url
:
url
+
'/'
+
id
,
headers
:
{
'X-CSRF-TOKEN'
:
$
(
'meta[name="csrf-token"]'
).
attr
(
'content'
)
},
}).
done
(
function
(
data
)
{
table
.
draw
();
swal
({
title
:
"Data berhasil dihapus!"
,
type
:
"success"
,
timer
:
"3000"
});
});
},
1000
);
// 1 second delay
}
else
{
swal
(
"Dibatalkan"
,
"Data batal dihapus"
,
"error"
);
}
}
);
});
});
$
(
function
()
{
//iCheck for checkbox and radio inputs
$
(
'input[type="checkbox"].minimal, input[type="radio"].minimal'
).
iCheck
({
checkboxClass
:
'icheckbox_minimal-blue'
,
radioClass
:
'iradio_minimal-blue'
});
});
function
printErrorMsg
(
msg
)
{
$
(
".print-error-msg"
).
find
(
"ul"
).
html
(
''
);
$
(
".print-error-msg"
).
css
(
'display'
,
'block'
);
$
.
each
(
msg
,
function
(
key
,
value
)
{
$
(
".print-error-msg"
).
find
(
"ul"
).
append
(
'<li>'
+
value
+
'</li>'
);
});
}
resources/lang/en/label.php
View file @
8ebc4736
...
@@ -25,4 +25,6 @@ return [
...
@@ -25,4 +25,6 @@ return [
'command'
=>
'Command'
,
'command'
=>
'Command'
,
'event_date'
=>
'Event Date'
,
'event_date'
=>
'Event Date'
,
'value'
=>
'Value'
,
'value'
=>
'Value'
,
'upload'
=>
'Upload'
,
'download'
=>
'Download'
,
];
];
resources/lang/id/label.php
View file @
8ebc4736
...
@@ -25,4 +25,6 @@ return [
...
@@ -25,4 +25,6 @@ return [
'command'
=>
'Komentar'
,
'command'
=>
'Komentar'
,
'event_date'
=>
'Tanggal Kegiatan'
,
'event_date'
=>
'Tanggal Kegiatan'
,
'value'
=>
'Nilai'
,
'value'
=>
'Nilai'
,
'upload'
=>
'Unggah'
,
'download'
=>
'Unduh'
,
];
];
\ No newline at end of file
resources/views/webprofile/backend/layouts/navigations/admin.blade.php
View file @
8ebc4736
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<a
href=
"{{ url('webprofile/informations') }}"
><span
class=
"fa fa-info-circle"
></span><span
class=
"xn-text"
>
@lang('feature.information')
</span></a>
<a
href=
"{{ url('webprofile/informations') }}"
><span
class=
"fa fa-info-circle"
></span><span
class=
"xn-text"
>
@lang('feature.information')
</span></a>
</li>
</li>
<li>
<li>
<a
href=
"{{ url('webprofile/slider') }}"
><span
class=
"fa fa-sliders"
></span><span
class=
"xn-text"
>
@lang('feature.slider')
</span></a>
<a
href=
"{{ url('webprofile/slider
s
') }}"
><span
class=
"fa fa-sliders"
></span><span
class=
"xn-text"
>
@lang('feature.slider')
</span></a>
</li>
</li>
<li>
<li>
<a
href=
"{{ url('webprofile/gallery') }}"
><span
class=
"fa fa-file-image-o"
></span><span
class=
"xn-text"
>
@lang('feature.gallery')
</span></a>
<a
href=
"{{ url('webprofile/gallery') }}"
><span
class=
"fa fa-file-image-o"
></span><span
class=
"xn-text"
>
@lang('feature.gallery')
</span></a>
...
...
resources/views/webprofile/backend/setting/index.blade.php
View file @
8ebc4736
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
@foreach(
$data
as
$value
)
@foreach(
$data
as
$value
)
<tr style="
cursor
:
pointer
">
<tr style="
cursor
:
pointer
">
<td align="
center
"><?php echo
$no
; ?></td>
<td align="
center
"><?php echo
$no
; ?></td>
<td>{!!
$value->name_setting
!!}</td>
<td>{!!
$value->
show_
name_setting
!!}</td>
<td>{!!
$value->value_setting
!!}</td>
<td>{!!
$value->value_setting
!!}</td>
<td style="
text
-
align
:
center
;
">
<td style="
text
-
align
:
center
;
">
<a href="
{{
route
(
'settings.edit'
,
[
'data'
=>
Crypt
::
encrypt
(
$value
->
id
)])
}}
" class="
btn
btn
-
warning
btn
-
xs
"><i class="
fa
fa
-
pencil
"></i></a>
<a href="
{{
route
(
'settings.edit'
,
[
'data'
=>
Crypt
::
encrypt
(
$value
->
id
)])
}}
" class="
btn
btn
-
warning
btn
-
xs
"><i class="
fa
fa
-
pencil
"></i></a>
...
...
resources/views/webprofile/backend/sliders/create.blade.php
0 → 100644
View file @
8ebc4736
@
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.create_slider')</li>
@stop
@section('content')
{!! Form::open(array('url' => route('sliders.store'), 'method' => 'POST', 'id' => 'slider', 'class' => 'form-horizontal', 'files' => true)) !!}
{!! 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.create')</strong> @lang('feature.slider')</h3>
</div>
<div class="
panel
-
body
">
<div class="
row
">
<div class="
col
-
md
-
12
">
<div class="
form
-
group
@
if
(
$errors
->
has
(
'title'
))
has
-
error
@
endif
">
<label class="
col
-
md
-
2
control
-
label
">@lang('label.name') @lang('feature.slider')</label>
<div class="
col
-
md
-
10
">
{{ Form::text('title', old('title'), ['class' => 'form-control']) }}
@if (
$errors->has
('title'))
<label id="
login
-
error
" class="
error
" for="
login
">
{
{$errors->first('title')}
}
</label>
@endif
</div>
</div>
<center>
<div class="
form
-
group
">
<img id="
uploadPreview
" style="
width
:
500
px
;
height
:
100
%
;
" src="
{{
URL
::
to
(
'https://statik.unesa.ac.id/perpus_konten_statik/uploads/slider/slider.png'
)}}
"/><br>
</div>
<div class="
form
-
group
">
{{ Form::file('images', ['class'=>'fileinput btn-danger', 'id'=>'uploadImage', 'data-filename-placement'=>'inside', 'title'=>trans('label.upload'), 'onchange'=>'PreviewImage();', 'accept'=>'image/jpeg,image/png']) }}
</div>
</center>
</div>
</div>
</div>
</div>
</div>
<div class="
col
-
md
-
3
">
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h3 class="
panel
-
title
"><strong>@lang('label.publish')</strong></h3>
<ul class="
panel
-
controls
">
<li><a href="
#" class="panel-collapse"><span class="fa fa-angle-down"></span></a></li>
</
ul
>
</
div
>
<
div
class
="
panel
-
body
">
<div class="
row
">
<div class="
col
-
md
-
12
">
<div class="
form
-
group
">
<label class="
col
-
md
-
2
control
-
label
">@lang('label.status')</label>
<div class="
col
-
md
-
6
">
<center>
<label class="
switch
">
{{ Form::checkbox('is_active', 1, true) }}
<span></span>
</label>
</center>
</div>
</div>
</div>
</div>
</div>
<div class="
panel
-
footer
">
</div>
</div>
</div>
<div class="
col
-
md
-
12
">
<div class="
panel
panel
-
default
">
<div class="
panel
-
footer
">
<button class="
btn
btn
-
info
pull
-
right
">@lang('label.save')</button>
</div>
</div>
</div>
</div>
{!! Form::close() !!}
<!-- page end-->
@stop
@section('script')
<script src="
{
!!
asset
(
'backend/js/plugins/bootstrap/bootstrap-datepicker.js'
)
!!
}
"></script>
<script src="
{
!!
asset
(
'backend/js/plugins/bootstrap/bootstrap-timepicker.min.js'
)
!!
}
"></script>
<script src="
{
!!
asset
(
'backend/js/plugins/bootstrap/bootstrap-file-input.js'
)
!!
}
"></script>
<script src="
{
!!
asset
(
'backend/js/plugins/summernote/summernote.js'
)
!!
}
"></script>
<script type="
text
/
javascript
">
function PreviewImage() {
var oFReader = new FileReader();
oFReader.readAsDataURL(document.getElementById("
uploadImage
").files[0]);
oFReader.onload = function (oFREvent) {
document.getElementById("
uploadPreview
").src = oFREvent.target.result;
};
};
</script>
@stop
resources/views/webprofile/backend/sliders/edit.blade.php
0 → 100644
View file @
8ebc4736
@
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_slider')</li>
@stop
@section('content')
<!-- page start-->
<div class="
row
">
{!! Form::model(
$data
, ['route' => ['sliders.update',
$data->id
], 'method'=>'patch', 'files' => true]) !!}
{!! 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.slider')</h3>
</div>
<div class="
panel
-
body
">
<div class="
row
">
<div class="
col
-
md
-
12
">
<div class="
form
-
group
@
if
(
$errors
->
has
(
'title'
))
has
-
error
@
endif
">
<label class="
col
-
md
-
2
control
-
label
">@lang('label.name') @lang('feature.slider')</label>
<div class="
col
-
md
-
10
">
{{ Form::text('title', old('title'), ['class' => 'form-control']) }}
@if (
$errors->has
('title'))
<label id="
login
-
error
" class="
error
" for="
login
">
{
{$errors->first('title')}
}
</label>
@endif
</div>
</div>
<center>
<div class="
form
-
group
">
@if(
$data->images
)
@if (webprofilesetting()['external_storage'] == 1)
<img id="
uploadPreview
" style="
width
:
500
px
;
height
:
100
%
;
" src="
{{
url
(
webprofilesetting
()[
'url_static'
]
.
'/'
.
webprofilesetting
()[
'directory'
]
.
'/slider/'
.
$data
->
images
)
}}
"/><br>
@else
<img id="
uploadPreview
" style="
width
:
500
px
;
height
:
100
%
;
" src="
{{
url
(
'/storage/slider/'
.
$data
->
images
)
}}
"/><br>
@endif
@else
<img id="
uploadPreview
" style="
width
:
500
px
;
height
:
100
%
;
" src="
{{
url
(
'https://statik.unesa.ac.id/perpus_konten_statik/uploads/slider/slider.png'
)
}}
"/><br>
@endif
</div>
<div class="
form
-
group
">
{{ Form::file('images', array('class'=>'fileinput btn-danger', 'id'=>'uploadImage', 'data-filename-placement'=>'inside', 'title'=>'Upload', 'onchange'=>'PreviewImage();', 'accept'=>'image/jpeg,image/png')) }}
</div>
</center>
</div>
</div>
</div>
</div>
</div>
<div class="
col
-
md
-
3
">
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h3 class="
panel
-
title
"><strong>Terbitkan</strong></h3>
<ul class="
panel
-
controls
">
<li><a href="
#" class="panel-collapse"><span class="fa fa-angle-down"></span></a></li>
</
ul
>
</
div
>
<
div
class
="
panel
-
body
">
<div class="
row
">
<div class="
col
-
md
-
12
">
<div class="
form
-
group
">
<label class="
col
-
md
-
2
control
-
label
">Status</label>
<div class="
col
-
md
-
6
">
<center><label class="
switch
">
{{ Form::checkbox('is_active', 1, true) }}
<span></span>
</label></center>
</div>
</div>
</div>
</div>
</div>
<div class="
panel
-
footer
">
</div>
</div>
</div>
<div class="
col
-
md
-
12
">
<div class="
panel
panel
-
default
">
<div class="
panel
-
footer
">
<button class="
btn
btn
-
info
pull
-
right
">Simpan</button>
</div>
</div>
</div>
</div>
{!! Form::close() !!}
</div>
<!-- page end-->
@stop
@section('script')
<script src="
https
://
statik
.
unesa
.
ac
.
id
/
spn_konten_statik
/
plugins
/
select2
/
select2
.
full
.
min
.
js
"></script>
{!! Html::script('https://statik.unesa.ac.id/profileunesa_konten_statik/admin/js/plugins/bootstrap/bootstrap-datepicker.js') !!}
{!! Html::script('https://statik.unesa.ac.id/profileunesa_konten_statik/admin/js/plugins/bootstrap/bootstrap-timepicker.min.js') !!}
{!! Html::script('https://statik.unesa.ac.id/profileunesa_konten_statik/admin/js/plugins/bootstrap/bootstrap-file-input.js') !!}
{!! Html::script('https://statik.unesa.ac.id/profileunesa_konten_statik/admin/js/plugins/summernote/summernote.js') !!}
<script type="
text
/
javascript
">
function PreviewImage() {
var oFReader = new FileReader();
oFReader.readAsDataURL(document.getElementById("
uploadImage
").files[0]);
oFReader.onload = function (oFREvent) {
document.getElementById("
uploadPreview
").src = oFREvent.target.result;
};
};
$('#categories').select2();
</script>
@stop
resources/views/webprofile/backend/sliders/index.blade.php
0 → 100644
View file @
8ebc4736
@
extends
(
'webprofile.backend.layouts.master'
)
@
section
(
'assets'
)
<
link
rel
=
"stylesheet"
href
=
"{!! asset('backend/js/datatables.net-bs/css/dataTables.bootstrap.min.css') !!}"
>
<
meta
name
=
"csrf-token"
content
=
"{{ csrf_token() }}"
>
@
endsection
@
section
(
'title'
)
{{
$title
}}
@
stop
@
section
(
'breadcrumbs'
)
<
li
><
a
href
=
"{{ url('dashboard') }}"
>@
lang
(
'label.dashboard'
)
</
a
></
li
>
<
li
class
="
active
">@lang('feature.slider')</li>
@stop
@section('content')
<!-- page start-->
<div class="
row
">
<div class="
col
-
lg
-
12
">
<!-- START DEFAULT DATATABLE -->
<div class="
panel
panel
-
default
">
<div class="
panel
-
heading
">
<h3 class="
panel
-
title
">{!!
$title
!!}</h3>
<a class="
btn
btn
-
info
" href="
{{
URL
::
to
(
'webprofile/sliders/create'
)}}
" style="
margin
:
0
cm
0
px
0
cm
10
px
;
">@lang('label.create')</a>
<ul class="
panel
-
controls
">
<li><a href="
#" class="panel-collapse"><span class="fa fa-angle-down"></span></a></li>
</
ul
>
</
div
>
<
div
class
="
panel
-
body
">
<table class="
table
table
-
hover
data
-
table
" width="
100
%
">
<thead>
<tr>
<th width="
7
%
" style="
text
-
align
:
center
;
">@lang('label.number')</th>
<th style="
text
-
align
:
center
;
">@lang('feature.slider')</th>
<th width="
10
%
" style="
text
-
align
:
center
;
">@lang('label.status')</th>
<th align="
center
" width="
10
%
" style="
text
-
align
:
center
;
">@lang('label.action')</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<!-- END DEFAULT DATATABLE -->
</div>
</div>
<!-- page end-->
@stop
@section('script')
<script src="
{
!!
asset
(
'backend/js/datatables.net/js/jquery.dataTables.min.js'
)
!!
}
"></script>
<script src="
{
!!
asset
(
'backend/js/datatables.net-bs/js/dataTables.bootstrap.min.js'
)
!!
}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/dataTables.buttons.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.bootstrap4.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.colVis.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.html5.min.js'
)
}}
"></script>
<script src="
{{
url
(
'backend/assets/plugins/jquery-datatable/buttons/buttons.print.min.js'
)
}}
"></script>
<script>
var url = "
{{
route
(
'sliders.index'
)
}}
";
</script>
{{ Html::script('js/master/slider.js') }}
@stop
routes/webprofile/backend.php
View file @
8ebc4736
...
@@ -7,6 +7,7 @@ Route::group(['middleware' => 'auth'], function () {
...
@@ -7,6 +7,7 @@ Route::group(['middleware' => 'auth'], function () {
Route
::
resource
(
'pages'
,
'PageController'
);
Route
::
resource
(
'pages'
,
'PageController'
);
Route
::
resource
(
'informations'
,
'InformationController'
);
Route
::
resource
(
'informations'
,
'InformationController'
);
Route
::
resource
(
'settings'
,
'SettingController'
);
Route
::
resource
(
'settings'
,
'SettingController'
);
Route
::
resource
(
'sliders'
,
'SliderController'
);
});
});
// });
// });
});
});
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