diff --git a/app/Http/Controllers/Home/Index.php b/app/Http/Controllers/Home/Index.php index e35a280..714134d 100644 --- a/app/Http/Controllers/Home/Index.php +++ b/app/Http/Controllers/Home/Index.php @@ -22,7 +22,7 @@ class Index { public function index () { $get = DB::table('blg_content')->where('isPost', 1); if ($this->valid['blg_addpost'] == 0 && $this->valid['blg_editpost'] == 0) $get = $get->where('public_status', 0); - $get = $get->orderBy('publish_date', 'desc')->get(); + $get = $get->orderBy('publish_date', 'desc')->paginate(10); setlocale(LC_ALL, 'ja_JP.utf8'); return view('pages.site.index', ['res' => $get, 'menu' => $this->menu, 'user' => $this->user]); diff --git a/app/Http/Controllers/Video/Prayer.php b/app/Http/Controllers/Video/Prayer.php index 7c116d8..9336368 100644 --- a/app/Http/Controllers/Video/Prayer.php +++ b/app/Http/Controllers/Video/Prayer.php @@ -90,7 +90,20 @@ class Prayer { $g->comment->channel = $g->snippet->topLevelComment->snippet->authorChannelUrl; $g->comment->icon = $g->snippet->topLevelComment->snippet->authorProfileImageUrl; $g->comment->created = date('Y年m月d日 H:i:s', strtotime($g->snippet->topLevelComment->snippet->publishedAt)); - $g->comment->message = $g->snippet->topLevelComment->snippet->textDisplay; + $g->comment->message = strip_tags($g->snippet->topLevelComment->snippet->textDisplay, array('
')); + $g->comment->replyCount = (isset($g->snippet->totalReplyCount) ? $g->snippet->totalReplyCount : 0); + + if (isset($g->replies)) { + $g->comment->replies = array(); + foreach ($g->replies->comments as $k => $c) { + $g->comment->replies[$k]['id'] = $c->id; + $g->comment->replies[$k]['name'] = $c->snippet->authorDisplayName; + $g->comment->replies[$k]['channel'] = $c->snippet->authorChannelUrl; + $g->comment->replies[$k]['icon'] = $c->snippet->authorProfileImageUrl; + $g->comment->replies[$k]['created'] = date('Y年m月d日 H:i:s', strtotime($c->snippet->publishedAt)); + $g->comment->replies[$k]['message'] = strip_tags($c->snippet->textDisplay, array('
')); + } + } $come[] = $g->comment; } diff --git a/public/img/header.jpeg b/public/img/header.jpeg new file mode 100644 index 0000000..8d394a1 Binary files /dev/null and b/public/img/header.jpeg differ diff --git a/resources/js/components/comments.vue b/resources/js/components/comments.vue index a808502..2f75599 100644 --- a/resources/js/components/comments.vue +++ b/resources/js/components/comments.vue @@ -20,10 +20,33 @@ より: {{ c.created }} -

{{ c.message }}

-
返信
+

+
返信({{ c.replyCount }})
+ + + @@ -52,7 +75,7 @@
-
本文
+
本文*
diff --git a/resources/sass/app.scss b/resources/sass/app.scss index ab52bf5..7a034d2 100644 --- a/resources/sass/app.scss +++ b/resources/sass/app.scss @@ -28,6 +28,7 @@ @import "conponent/check"; @import "conponent/form"; @import "conponent/modal"; +@import "conponent/pagination"; @import "conponent/select"; // テーブル diff --git a/resources/sass/conponent/_pagination.scss b/resources/sass/conponent/_pagination.scss new file mode 100644 index 0000000..5df020b --- /dev/null +++ b/resources/sass/conponent/_pagination.scss @@ -0,0 +1,49 @@ +.page-link { + background: linear-gradient(to bottom, $evil4 0%, $evil1 34%, $evil6 100%); +} + +.page-link, .page-item .disabled { + text-align: center; + color: $white1; + padding: 8px 20px; + font-size: 28px; + border-bottom: solid 2px $suwa03; + cursor: pointer; + transition: background 0.3s, color 0.3s; + margin: auto; +} + +.page-link > a { + color: $white1; +} + +.page-link > a:hover { + text-decoration: none; +} + +.page-link:hover { + color: $white1; + background: linear-gradient(to bottom, $evil3 0%, $evil0 34%, $evil2 100%); +} + +.page-item.disabled > .page-link { + color: $white1; + background: linear-gradient(to bottom, $black3 0%, $grey4 34%, $grey5 100%); + border-color: $suwa04; +} + +.page-item.active > .page-link { + color: $white1; + background: linear-gradient(to bottom, $suwa04 0%, $suwa01 34%, $suwa06 100%); + border-color: $suwa04; +} + +.page-item.active > .page-link:hover { + color: $white1; + background: linear-gradient(to bottom, $suwa03 0%, $suwa00 34%, $suwa02 100%); +} + +.pagination { + margin: auto; + padding: 8px; +} \ No newline at end of file diff --git a/resources/views/pages/site/index.blade.php b/resources/views/pages/site/index.blade.php index 5c44812..13973e9 100644 --- a/resources/views/pages/site/index.blade.php +++ b/resources/views/pages/site/index.blade.php @@ -12,4 +12,8 @@ @endforeach
+
+ {{ $res->links() }} +
+ @endsection diff --git a/routes/api/user.php b/routes/api/user.php index 7d2025a..5394b6e 100644 --- a/routes/api/user.php +++ b/routes/api/user.php @@ -1,4 +1,4 @@