From cf5bf2b2746ff32964856c3f5e068c08aec201dc Mon Sep 17 00:00:00 2001 From: shibafu Date: Mon, 4 Mar 2019 22:30:34 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=8A=E6=83=A3=E8=8F=9C=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=8A=E3=83=BC=E3=82=92=E3=82=82=E3=81=A3=E3=81=A8=E3=81=9F?= =?UTF-8?q?=E3=81=8F=E3=81=95=E3=82=93=E8=A6=8B=E3=82=8B=E7=94=BB=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/TimelineController.php | 23 +++++++ resources/views/home.blade.php | 3 + resources/views/timeline/public.blade.php | 68 +++++++++++++++++++++ routes/web.php | 2 + 4 files changed, 96 insertions(+) create mode 100644 app/Http/Controllers/TimelineController.php create mode 100644 resources/views/timeline/public.blade.php diff --git a/app/Http/Controllers/TimelineController.php b/app/Http/Controllers/TimelineController.php new file mode 100644 index 0000000..a179537 --- /dev/null +++ b/app/Http/Controllers/TimelineController.php @@ -0,0 +1,23 @@ +where('users.is_protected', false) + ->where('ejaculations.is_private', false) + ->where('ejaculations.link', '<>', '') + ->orderBy('ejaculations.ejaculated_date', 'desc') + ->select('ejaculations.*') + ->with('user', 'tags') + ->paginate(21); + + return view('timeline.public')->with(compact('ejaculations')); + } +} diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index ccafb85..6c443ec 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -91,6 +91,9 @@ @endif @endforeach +
  • + もっと見る » +
  • @endif diff --git a/resources/views/timeline/public.blade.php b/resources/views/timeline/public.blade.php new file mode 100644 index 0000000..74bdf0d --- /dev/null +++ b/resources/views/timeline/public.blade.php @@ -0,0 +1,68 @@ +@extends('layouts.base') + +@section('title', 'お惣菜コーナー') + +@section('content') +
    +

    お惣菜コーナー

    +

    公開チェックインから、オカズリンク付きのものを表示しています。

    +
    +
    +
    + @foreach($ejaculations as $ejaculation) +
    + +
    +
    + {{ $ejaculation->user->display_name }} + {{ $ejaculation->ejaculated_date->format('Y/m/d H:i') }} +
    +
    + + @if ($ejaculation->user->isMe()) + + + @endif +
    +
    + + @if ($ejaculation->is_private || $ejaculation->tags->isNotEmpty()) +

    + @if ($ejaculation->is_private) + 非公開 + @endif + @foreach ($ejaculation->tags as $tag) + {{ $tag->name }} + @endforeach +

    + @endif + + @if (!empty($ejaculation->link)) +
    + @component('components.link-card', ['link' => $ejaculation->link]) + @endcomponent +

    + {{ $ejaculation->link }} +

    +
    + @endif + + @if (!empty($ejaculation->note)) +

    + {!! Formatter::linkify(nl2br(e($ejaculation->note))) !!} +

    + @endif +
    + @endforeach +
    + {{ $ejaculations->links(null, ['className' => 'mt-4 justify-content-center']) }} +
    +@endsection + +@push('script') + +@endpush \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index dc78587..a772f46 100644 --- a/routes/web.php +++ b/routes/web.php @@ -28,6 +28,8 @@ Route::middleware('auth')->group(function () { Route::put('/checkin/{id}', 'EjaculationController@update')->name('checkin.update'); Route::delete('/checkin/{id}', 'EjaculationController@destroy')->name('checkin.destroy'); + Route::get('/timeline/public', 'TimelineController@showPublic')->name('timeline.public'); + Route::redirect('/setting', '/setting/profile', 301); Route::get('/setting/profile', 'SettingController@profile')->name('setting'); Route::post('/setting/profile', 'SettingController@updateProfile')->name('setting.profile.update');