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
9d3db05f
Commit
9d3db05f
authored
Jan 13, 2020
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
front page
parent
fad2715d
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
127 additions
and
16 deletions
+127
-16
app/Http/Controllers/Webprofile/Backend/PageController.php
+1
-0
app/Http/Controllers/Webprofile/Front/FrontController.php
+0
-15
app/Http/Controllers/Webprofile/Front/PageController.php
+66
-0
app/Repositories/Repository.php
+15
-0
resources/views/webprofile/front/jollyany/en/page.blade.php
+22
-0
resources/views/webprofile/front/jollyany/page.blade.php
+22
-0
routes/webprofile/front.php
+1
-1
No files found.
app/Http/Controllers/Webprofile/Backend/PageController.php
View file @
9d3db05f
...
...
@@ -64,6 +64,7 @@ class PageController extends Controller
public
function
store
(
Request
$request
)
{
$data
=
$request
->
except
(
'_token'
);
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
$save
=
$this
->
repo
->
store
(
$data
);
...
...
app/Http/Controllers/Webprofile/Front/FrontController.php
View file @
9d3db05f
...
...
@@ -2,7 +2,6 @@
namespace
App\Http\Controllers\Webprofile\Front
;
use
Illuminate\Http\Request
;
use
App\Http\Controllers\Controller
;
use
App\Models\Webprofile\Design
;
use
App\Models\Webprofile\Gallery
;
...
...
@@ -34,19 +33,12 @@ class FrontController extends Controller
private
function
getDataId
(
$setting
)
{
$posts
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
paginate
(
$setting
[
'post_per_page'
]);
$resend
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$hot
=
Posts
::
where
(
'post_status'
,
'1'
)
->
orderby
(
'viewer'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$info
=
Information
::
where
(
'info_status'
,
'1'
)
->
where
(
'event_date'
,
'>='
,
Date
(
'Y-m-d'
))
->
orderby
(
'event_date'
,
'asc'
)
->
get
();
$slider
=
Slider
::
where
(
'is_active'
,
'1'
)
->
orderby
(
'created_at'
,
'desc'
)
->
get
();
$menu
=
Menu
::
orderby
(
'urutan'
,
'asc'
)
->
get
();
$gallery
=
Gallery
::
where
(
'is_active'
,
'1'
)
->
orderBy
(
'created_at'
,
'asc'
)
->
limit
(
'4'
)
->
get
();
$quote
=
Design
::
where
(
'name_design'
,
'quote'
)
->
get
();
$widget_right
=
Design
::
where
(
'name_design'
,
'widget_right'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$widget_left
=
Design
::
where
(
'name_design'
,
'widget_left'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
...
...
@@ -73,19 +65,12 @@ class FrontController extends Controller
private
function
getDataEn
(
$setting
)
{
$posts
=
Posts
::
with
([
'rEn'
])
->
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
paginate
(
$setting
[
'post_per_page'
]);
$resend
=
Posts
::
with
([
'rEn'
])
->
where
(
'post_status'
,
'1'
)
->
orderby
(
'post_date'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$hot
=
Posts
::
with
([
'rEn'
])
->
where
(
'post_status'
,
'1'
)
->
orderby
(
'viewer'
,
'desc'
)
->
limit
(
'5'
)
->
get
();
$info
=
Information
::
with
([
'rEn'
])
->
where
(
'info_status'
,
'1'
)
->
where
(
'event_date'
,
'>='
,
Date
(
'Y-m-d'
))
->
orderby
(
'event_date'
,
'asc'
)
->
get
();
$slider
=
Slider
::
where
(
'is_active'
,
'1'
)
->
orderby
(
'created_at'
,
'desc'
)
->
get
();
$menu
=
Menu
::
with
([
'rEn'
])
->
orderby
(
'urutan'
,
'asc'
)
->
get
();
$gallery
=
Gallery
::
where
(
'is_active'
,
'1'
)
->
orderBy
(
'created_at'
,
'asc'
)
->
limit
(
'4'
)
->
get
();
$quote
=
Design
::
where
(
'name_design'
,
'quote'
)
->
get
();
$widget_right
=
Design
::
where
(
'name_design'
,
'widget_right'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$widget_left
=
Design
::
where
(
'name_design'
,
'widget_left'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
...
...
app/Http/Controllers/Webprofile/Front/PageController.php
0 → 100644
View file @
9d3db05f
<?php
namespace
App\Http\Controllers\Webprofile\Front
;
use
App\Http\Controllers\Controller
;
use
App\Models\Webprofile\Design
;
use
App\Models\Webprofile\Menu
;
use
App\Models\Webprofile\Pages
;
use
Session
;
class
PageController
extends
Controller
{
public
function
index
(
$title
)
{
$setting
=
webprofilesetting
();
if
(
!
Session
::
has
(
'selected_language'
))
{
session
([
'selected_language'
=>
'id'
]);
}
if
(
Session
::
get
(
'selected_language'
)
==
'id'
)
{
$data
=
$this
->
getDataId
(
$setting
,
$title
);
return
view
(
'webprofile.front.'
.
$setting
[
'theme'
]
.
'.page'
,
$data
);
}
else
if
(
Session
::
get
(
'selected_language'
)
==
'en'
)
{
$data
=
$this
->
getDataEn
(
$setting
,
$title
);
return
view
(
'webprofile.front.'
.
$setting
[
'theme'
]
.
'.en.page'
,
$data
);
}
}
public
function
getDataId
(
$setting
,
$title
)
{
$setting
=
webprofilesetting
();
$data
=
Pages
::
where
(
'slug'
,
$title
)
->
first
();
$menu
=
Menu
::
orderby
(
'urutan'
,
'asc'
)
->
get
();
$widget_right
=
Design
::
where
(
'name_design'
,
'widget_right'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$widget_left
=
Design
::
where
(
'name_design'
,
'widget_left'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$data
=
[
'setting'
=>
$setting
,
'data'
=>
$data
,
'menu'
=>
$menu
,
'widget_right'
=>
$widget_right
,
'widget_left'
=>
$widget_left
,
];
return
$data
;
}
public
function
getDataEn
(
$setting
,
$title
)
{
$setting
=
webprofilesetting
();
$data
=
Pages
::
with
([
'rEn'
])
->
where
(
'slug'
,
$title
)
->
first
();
$menu
=
Menu
::
orderby
(
'urutan'
,
'asc'
)
->
get
();
$widget_right
=
Design
::
where
(
'name_design'
,
'widget_right'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$widget_left
=
Design
::
where
(
'name_design'
,
'widget_left'
)
->
orderBy
(
'urutan'
,
'ASC'
)
->
get
();
$data
=
[
'setting'
=>
$setting
,
'data'
=>
$data
,
'menu'
=>
$menu
,
'widget_right'
=>
$widget_right
,
'widget_left'
=>
$widget_left
,
];
return
$data
;
}
}
app/Repositories/Repository.php
View file @
9d3db05f
...
...
@@ -73,4 +73,19 @@ abstract class Repository
{
return
$model
->
delete
();
}
public
function
upload
(
$name
,
$request
,
$tipe
,
$setting
)
{
if
(
$request
->
hasFile
(
$tipe
))
{
$cover
=
$request
->
file
(
$tipe
);
$extension
=
$cover
->
guessClientExtension
();
$filename
=
$name
.
'.'
.
$extension
;
if
(
$setting
[
'external_storage'
]
==
1
)
{
Storage
::
disk
(
'storage'
)
->
put
(
$setting
[
'directory'
]
.
'/'
.
$tipe
.
'/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
else
{
Storage
::
disk
(
'local'
)
->
put
(
'public/'
.
$tipe
.
'/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
return
$filename
;
}
}
}
resources/views/webprofile/front/jollyany/en/page.blade.php
0 → 100644
View file @
9d3db05f
@
extends
(
'webprofile.front.jollyany.master'
)
@
section
(
'content'
)
<
section
class
="
post
-
wrapper
-
top
jt
-
shadow
clearfix
">
<div class="
container
">
<div class="
col
-
lg
-
12
">
<h2>{!!
$data->rEn
->title !!}</h2>
</div>
</div>
</section><!-- end post-wrapper-top -->
<section class="
blog
-
wrapper
">
<div class="
container
">
<div class="
row
">
<div id="
main
-
content
" class="
col
-
md
-
12
" role="
main
" align="
justify
">
{!!
$data->rEn
->content !!}
</div>
</div>
</div><!-- end title -->
</div><!-- end container -->
</section><!--end white-wrapper -->
@endsection
resources/views/webprofile/front/jollyany/page.blade.php
0 → 100644
View file @
9d3db05f
@
extends
(
'webprofile.front.jollyany.master'
)
@
section
(
'content'
)
<
section
class
="
post
-
wrapper
-
top
jt
-
shadow
clearfix
">
<div class="
container
">
<div class="
col
-
lg
-
12
">
<h2>{!!
$data->title
!!}</h2>
</div>
</div>
</section><!-- end post-wrapper-top -->
<section class="
blog
-
wrapper
">
<div class="
container
">
<div class="
row
">
<div id="
main
-
content
" class="
col
-
md
-
12
" role="
main
" align="
justify
">
{!!
$data->content
!!}
</div>
</div>
</div><!-- end title -->
</div><!-- end container -->
</section><!--end white-wrapper -->
@endsection
routes/webprofile/front.php
View file @
9d3db05f
<?php
Route
::
group
([
'namespace'
=>
'Webprofile\Front'
],
function
()
{
Route
::
get
(
'/'
,
'FrontController@index'
);
Route
::
get
(
'page/{id}'
,
'
FrontController@page
'
)
->
name
(
'page'
);
Route
::
get
(
'page/{id}'
,
'
PageController@index
'
)
->
name
(
'page'
);
Route
::
get
(
'post/{id}'
,
'FrontController@post'
)
->
name
(
'post'
);
Route
::
get
(
'archive'
,
'FrontController@archive'
)
->
name
(
'archive'
);
Route
::
get
(
'category/{id}'
,
'FrontController@category'
)
->
name
(
'category'
);
...
...
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