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
f8a698ff
Commit
f8a698ff
authored
Nov 27, 2020
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jika kategori dihapus pada post index
parent
1fb09616
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
app/Repositories/Webprofile/PostRepository.php
+16
-12
No files found.
app/Repositories/Webprofile/PostRepository.php
View file @
f8a698ff
...
@@ -35,11 +35,11 @@ class PostRepository extends Repository
...
@@ -35,11 +35,11 @@ class PostRepository extends Repository
return
DataTables
::
of
(
$data
)
return
DataTables
::
of
(
$data
)
->
addIndexColumn
()
->
addIndexColumn
()
->
addColumn
(
'action'
,
function
(
$row
)
{
->
addColumn
(
'action'
,
function
(
$row
)
{
$btn
=
'<a href="'
.
url
(
'/webprofile/posts/'
.
$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
=
'<a href="'
.
url
(
'/webprofile/posts/'
.
$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="'
.
trans
(
'label.delete'
)
.
'" class="btn btn-danger btn-round btn-sm delete">'
.
trans
(
'label.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
;
})
})
...
@@ -49,38 +49,42 @@ class PostRepository extends Repository
...
@@ -49,38 +49,42 @@ class PostRepository extends Repository
}
else
{
}
else
{
$str
=
'<div style="color: red;"><i class="fa fa-times"></i></div>'
;
$str
=
'<div style="color: red;"><i class="fa fa-times"></i></div>'
;
}
}
return
$str
;
return
$str
;
})
})
->
addColumn
(
'category'
,
function
(
$row
)
{
->
addColumn
(
'category'
,
function
(
$row
)
{
$str
=
''
;
if
(
$row
->
rCategory
)
{
$str
=
$row
->
rCategory
->
name
;
$str
=
$row
->
rCategory
->
name
;
}
return
$str
;
return
$str
;
})
})
->
addColumn
(
'post_date'
,
function
(
$row
)
{
->
addColumn
(
'post_date'
,
function
(
$row
)
{
$str
=
''
;
$str
=
''
;
if
(
$row
->
post_status
==
1
)
{
if
(
$row
->
post_status
==
1
)
{
$str
.=
'<div style="color: green;">'
.
trans
(
'label.publish'
)
.
'</div>'
;
$str
.=
'<div style="color: green;">'
.
trans
(
'label.publish'
)
.
'</div>'
;
}
}
if
(
$row
->
post_status
==
0
)
{
if
(
$row
->
post_status
==
0
)
{
$str
.=
'<div style="color: red;">'
.
trans
(
'label.draft'
)
.
'</div>'
;
$str
.=
'<div style="color: red;">'
.
trans
(
'label.draft'
)
.
'</div>'
;
}
}
$str
.=
D
ate
(
'd-m-Y'
,
strtotime
(
$row
->
post_date
));
$str
.=
d
ate
(
'd-m-Y'
,
strtotime
(
$row
->
post_date
));
return
$str
;
return
$str
;
})
})
->
addColumn
(
'sum'
,
function
(
$row
)
{
->
addColumn
(
'sum'
,
function
(
$row
)
{
$str
=
trans
(
'label.viewer'
)
.
' : '
.
$row
->
viewer
.
'<br>'
;
$str
=
trans
(
'label.viewer'
)
.
' : '
.
$row
->
viewer
.
'<br>'
;
$str
.=
trans
(
'label.command'
)
.
' : '
.
$row
->
comment_count
;
$str
.=
trans
(
'label.command'
)
.
' : '
.
$row
->
comment_count
;
return
$str
;
return
$str
;
})
})
->
addColumn
(
'title'
,
function
(
$row
)
{
->
addColumn
(
'title'
,
function
(
$row
)
{
$str
=
$row
->
title
.
'<br>'
;
$str
=
$row
->
title
.
'<br>'
;
if
(
$row
->
rEn
)
{
if
(
$row
->
rEn
)
{
$str
.=
'<i style="color: blue;">'
.
$row
->
rEn
[
'title'
]
.
'</i>'
;
$str
.=
'<i style="color: blue;">'
.
$row
->
rEn
[
'title'
]
.
'</i>'
;
}
}
return
$str
;
return
$str
;
...
...
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