From df07aecd88a030bd6d02fc33b81d6ed75022f3dc Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 22 Oct 2017 19:41:41 +0900 Subject: [PATCH 01/49] =?UTF-8?q?=E6=97=A7=E3=83=AC=E3=82=A4=E3=82=A2?= =?UTF-8?q?=E3=82=A6=E3=83=88=E3=81=AE=E9=80=80=E9=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/auth/login.blade.php | 2 +- resources/views/auth/register.blade.php | 2 +- resources/views/ejaculation/checkin.blade.php | 2 +- resources/views/guest.blade.php | 2 +- resources/views/home.blade.php | 2 +- resources/views/layouts/{base.blade.php => base-old.blade.php} | 0 resources/views/user/profile.blade.php | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename resources/views/layouts/{base.blade.php => base-old.blade.php} (100%) diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index e98313b..cf5bdd0 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.base') +@extends('layouts.base-old') @section('content')
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 961a9e5..7edea93 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.base') +@extends('layouts.base-old') @section('content')
diff --git a/resources/views/ejaculation/checkin.blade.php b/resources/views/ejaculation/checkin.blade.php index d101135..24b2067 100644 --- a/resources/views/ejaculation/checkin.blade.php +++ b/resources/views/ejaculation/checkin.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.base') +@extends('layouts.base-old') @section('content')
diff --git a/resources/views/guest.blade.php b/resources/views/guest.blade.php index 012db60..9aa8092 100644 --- a/resources/views/guest.blade.php +++ b/resources/views/guest.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.base') +@extends('layouts.base-old') @section('content')
diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index e8b45e8..ae43013 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.base') +@extends('layouts.base-old') @section('head') @endsection @section('content')
-
-
-
- {{ Auth::user()->display_name }} -

@{{ Auth::user()->name }}

-
-

av_timer現在のセッション

+
+
+
+ +

{{ Auth::user()->display_name }}

+
@{{ Auth::user()->name }}
+ +
現在のセッション
@if (isset($currentSession)) -

{{ $currentSession }}経過

-

({{ $ejaculations[0]['ejaculated_date'] }} にリセット)

+

{{ $currentSession }}経過

+

({{ $ejaculations[0]['ejaculated_date'] }} にリセット)

@else -

計測がまだ始まっていません

-

(一度チェックインすると始まります)

+

計測がまだ始まっていません

+

(一度チェックインすると始まります)

@endif - @if (isset($summary) && $summary[0]->total_checkins > 0) -
-

assessment概況

-

平均記録: {{ Formatter::formatInterval($summary[0]->average) }}

-

最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}

-

最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}

-

合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}

-

通算回数: {{ $summary[0]->total_checkins }}回

- @endif -
-
-
-
- オープンβテスト中 -

予告なくサービスの中断や大幅な機能変更、時にはデータの損失が発生する可能性があります。

-

特に、データについてはなるべく保持できるよう努めますが、どうしようもないことも時には発生しますので予めご了承ください。

+ +
概況
+

平均記録: {{ Formatter::formatInterval($summary[0]->average) }}

+

最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}

+

最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}

+

合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}

+

通算回数: {{ $summary[0]->total_checkins }}回回

-
-
    - @forelse ($ejaculations as $ejaculation) - @if ($loop->first) -
  • - 最近のチェックイン -
  • - @endif - -
  • - {{ $ejaculation['ejaculated_span'] ?? '精通' }} {{ $ejaculation['before_date'] }}{{ !empty($ejaculation['before_date']) ? ' ~ ' : '' }}{{ $ejaculation['ejaculated_date'] }} -
    - {{ $ejaculation['note'] }} -
    - @if ($ejaculation['is_private']) - lock 非公開チェックイン - @endif - {{--
    結月ゆかり
    -
    琴葉茜
    --}} -
  • - - @if ($loop->index === 7) -
  • - -
  • - @break - @endif - @empty -
  • -
    - まだチェックインがありません。右上のチェックインボタンから今すぐ精通! -
    -
  • - @endforelse -
+
+ +
+
ランキング
+
+

参加しているランキングはありません。自信のあるお題を探して、参加登録してみませんか?

+

参加登録をすると、定期的に集計されてここにあなたの順位が表示されます。

+
+ +
+
+
穴兄弟レーダー
+
+

+ あなたがよく使うタグやオカズから、関連していそうなオカズリンクを探して表示しています。 +

+
+ +
-
@endsection diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 410ec6a..c8b8c15 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -46,7 +46,7 @@
From e9b19e7be1e36437caf267ad8fee24729d99eacc Mon Sep 17 00:00:00 2001 From: shibafu Date: Mon, 30 Oct 2017 22:03:34 +0900 Subject: [PATCH 07/49] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E7=94=BB=E9=9D=A2=E3=81=AE=E3=83=AC=E3=82=A4?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/user/profile.blade.php | 166 ++++++++++++++++--------- 1 file changed, 107 insertions(+), 59 deletions(-) diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index a9490b7..1672459 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.base-old') +@extends('layouts.base') @section('head') -@endsection - -@section('content') -
-
-
-
-
- -

{{ $user->display_name }}

-
@{{ $user->name }}
- -
現在のセッション
- @if (isset($currentSession)) -

{{ $currentSession }}経過

-

({{ $ejaculations[0]['ejaculated_date'] }} にリセット)

- @else -

計測がまだ始まっていません

-

(一度チェックインすると始まります)

+@section('tab-content') +
    + @forelse ($ejaculations as $ejaculation) +
  • + +
    +
    {{ $ejaculation['ejaculated_span'] ?? '精通' }} {{ $ejaculation['before_date'] }}{{ !empty($ejaculation['before_date']) ? ' ~ ' : '' }}{{ $ejaculation['ejaculated_date'] }}
    + @if ($user->id === Auth::user()->id) +
    + + +
    + @endif +
    + + @if ($ejaculation['is_private']) {{-- TODO: タグを付けたら、タグが空じゃないかも判定に加える --}} +

    + @if ($ejaculation['is_private']) + 非公開 @endif + {{-- + 催眠音声 + 適当なタグ + --}} +

    + @endif + + {{-- + + --}} + + @if (!empty($ejaculation['note'])) +

    + {{ $ejaculation['note'] }} +

    + @endif +
  • + @empty +
  • +

    まだチェックインしていません。

    +
  • + @endforelse +
+ -
概況
-

平均記録: {{ Formatter::formatInterval($summary[0]->average) }}

-

最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}

-

最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}

-

合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}

-

通算回数: {{ $summary[0]->total_checkins }}回

-
-
-
-
- -
-
-
    - @forelse ($ejaculations as $ejaculation) -
  • - -
    -
    {{ $ejaculation['ejaculated_span'] ?? '精通' }} {{ $ejaculation['before_date'] }}{{ !empty($ejaculation['before_date']) ? ' ~ ' : '' }}{{ $ejaculation['ejaculated_date'] }}
    -
    - - -
    -
    - - @if ($ejaculation['is_private']) {{-- TODO: タグを付けたら、タグが空じゃないかも判定に加える --}} -

    - @if ($ejaculation['is_private']) - 非公開 - @endif - {{-- - 催眠音声 - 適当なタグ - --}} -

    - @endif - - {{-- - - --}} - - @if (!empty($ejaculation['note'])) -

    - {{ $ejaculation['note'] }} -

    - @endif -
  • - @empty -
  • -

    まだチェックインしていません。

    -
  • - @endforelse -
- -
-
- -
-
- -
-
-
-
-
+@component('components.modal', ['id' => 'deleteCheckinModal']) + @slot('title') + 削除確認 + @endslot + のチェックインを削除してもよろしいですか? +
+ {{ csrf_field() }} + {{ method_field('DELETE') }} +
+ @slot('footer') + + + @endslot +@endcomponent @endsection + +@push('script') + +@endpush \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 8c0605a..f552f10 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,4 +23,5 @@ Route::get('/user/{name?}', 'UserController@profile')->name('profile'); Route::middleware('auth')->group(function () { Route::get('/checkin', 'EjaculationController@create')->name('checkin'); Route::post('/checkin', 'EjaculationController@store')->name('checkin'); + Route::delete('/checkin/{id}', 'EjaculationController@destroy')->name('checkin.destroy'); }); \ No newline at end of file From edcc2bceafac1f32544b104a6a26d28259a80322 Mon Sep 17 00:00:00 2001 From: shibafu Date: Fri, 3 Nov 2017 18:10:50 +0900 Subject: [PATCH 09/49] =?UTF-8?q?profile=E3=83=AB=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=AE=E5=90=8D=E5=89=8D=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/EjaculationController.php | 2 +- resources/views/home.blade.php | 4 ++-- resources/views/layouts/base.blade.php | 12 ++++++------ resources/views/user/base.blade.php | 10 +++++----- routes/web.php | 8 +++++--- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app/Http/Controllers/EjaculationController.php b/app/Http/Controllers/EjaculationController.php index ba9e249..b648abd 100644 --- a/app/Http/Controllers/EjaculationController.php +++ b/app/Http/Controllers/EjaculationController.php @@ -59,6 +59,6 @@ class EjaculationController extends Controller $ejaculation = Ejaculation::findOrFail($id); $user = User::findOrFail($ejaculation->user_id); $ejaculation->delete(); - return redirect()->route('profile', ['name' => $user->name])->with('status', '削除しました。'); + return redirect()->route('user.profile', ['name' => $user->name])->with('status', '削除しました。'); } } \ No newline at end of file diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index e1b0176..f163762 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -10,8 +10,8 @@
-

{{ Auth::user()->display_name }}

-
@{{ Auth::user()->name }}
+

{{ Auth::user()->display_name }}

+
@{{ Auth::user()->name }}
現在のセッション
@if (isset($currentSession)) diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 2817a1f..520b18b 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -30,14 +30,14 @@ - - - {{-- From 6ed0938694d500254964a05fcb1f402c22a0c06a Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 5 Nov 2017 01:26:52 +0900 Subject: [PATCH 13/49] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=AE=E5=B7=A6=E3=82=AB=E3=83=A9=E3=83=A0?= =?UTF-8?q?=E3=81=AB=E3=81=82=E3=82=8B=E6=83=85=E5=A0=B1=E3=81=AB=E9=96=A2?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=87=A6=E7=90=86=E3=82=92=E3=83=AA=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Ejaculation.php | 4 ++ app/Http/Controllers/HomeController.php | 46 +------------- app/Http/Controllers/UserController.php | 49 ++++++--------- app/Http/ViewComposers/ProfileComposer.php | 61 +++++++++++++++++++ app/Providers/ViewComposerServiceProvider.php | 30 +++++++++ config/app.php | 1 + resources/views/components/profile.blade.php | 23 +++++++ resources/views/home.blade.php | 25 +------- resources/views/user/base.blade.php | 25 +------- resources/views/user/okazu.blade.php | 4 ++ resources/views/user/profile.blade.php | 12 ++-- resources/views/user/stats.blade.php | 4 ++ 12 files changed, 157 insertions(+), 127 deletions(-) create mode 100644 app/Http/ViewComposers/ProfileComposer.php create mode 100644 app/Providers/ViewComposerServiceProvider.php create mode 100644 resources/views/components/profile.blade.php create mode 100644 resources/views/user/okazu.blade.php create mode 100644 resources/views/user/stats.blade.php diff --git a/app/Ejaculation.php b/app/Ejaculation.php index f6f8628..8b975ef 100644 --- a/app/Ejaculation.php +++ b/app/Ejaculation.php @@ -13,4 +13,8 @@ class Ejaculation extends Model 'note', 'geo_latitude', 'geo_longitude', 'is_private' ]; + + protected $dates = [ + 'ejaculated_date' + ]; } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 9659481..e8b1e5e 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -28,50 +28,6 @@ class HomeController extends Controller public function index() { if (Auth::check()) { - $ejaculations = Ejaculation::select(DB::raw(<<<'SQL' -to_char(ejaculated_date, 'YYYY/MM/DD HH24:MI') AS ejaculated_date, -note, -is_private, -to_char(lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC), 'YYYY/MM/DD HH24:MI') AS before_date, -to_char(ejaculated_date - (lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC)), 'FMDDD日 FMHH24時間 FMMI分') AS ejaculated_span -SQL -)) - ->where(['user_id' => Auth::id()]) - ->orderBy('ejaculated_date', 'desc') - ->limit(9) - ->get(); - - // 現在のオナ禁セッションの経過時間 - if (count($ejaculations) > 0) { - $currentSession = Carbon::parse($ejaculations[0]['ejaculated_date']) - ->diff(Carbon::now()) - ->format('%a日 %h時間 %i分'); - } else { - $currentSession = null; - } - - // 概況欄のデータ取得 - $summary = DB::select(<<<'SQL' -SELECT - avg(span) AS average, - max(span) AS longest, - min(span) AS shortest, - sum(span) AS total_times, - count(*) AS total_checkins -FROM - ( - SELECT - extract(epoch from ejaculated_date - lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC)) AS span - FROM - ejaculations - WHERE - user_id = :user_id - ORDER BY - ejaculated_date DESC - ) AS temp -SQL -, ['user_id' => Auth::id()]); - $informations = Information::query() ->select('id', 'category', 'pinned', 'title', 'created_at') ->orderBy('pinned') @@ -79,7 +35,7 @@ SQL ->paginate(3); $categories = Information::CATEGORIES; - return view('home')->with(compact('ejaculations', 'currentSession', 'summary', 'informations', 'categories')); + return view('home')->with(compact('informations', 'categories')); } else { return view('guest'); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index f398126..bb17762 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -23,7 +23,7 @@ class UserController extends Controller // チェックインの取得 $query = Ejaculation::select(DB::raw(<<<'SQL' id, -to_char(ejaculated_date, 'YYYY/MM/DD HH24:MI') AS ejaculated_date, +ejaculated_date, note, is_private, to_char(lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC), 'YYYY/MM/DD HH24:MI') AS before_date, @@ -37,37 +37,26 @@ SQL $ejaculations = $query->orderBy('ejaculated_date', 'desc') ->paginate(20); - // 現在のオナ禁セッションの経過時間 - if (count($ejaculations) > 0) { - $currentSession = Carbon::parse($ejaculations[0]['ejaculated_date']) - ->diff(Carbon::now()) - ->format('%a日 %h時間 %i分'); - } else { - $currentSession = null; + return view('user.profile')->with(compact('user', 'ejaculations')); + } + + public function stats($name) + { + $user = User::where('name', $name)->first(); + if (empty($user)) { + abort(404); } - // 概況欄のデータ取得 - $summary = DB::select(<<<'SQL' -SELECT - avg(span) AS average, - max(span) AS longest, - min(span) AS shortest, - sum(span) AS total_times, - count(*) AS total_checkins -FROM - ( - SELECT - extract(epoch from ejaculated_date - lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC)) AS span - FROM - ejaculations - WHERE - user_id = :user_id - ORDER BY - ejaculated_date DESC - ) AS temp -SQL - , ['user_id' => $user->id]); + return view('user.stats')->with(compact('user')); + } - return view('user.profile')->with(compact('user', 'ejaculations', 'currentSession', 'summary')); + public function okazu($name) + { + $user = User::where('name', $name)->first(); + if (empty($user)) { + abort(404); + } + + return view('user.okazu')->with(compact('user')); } } diff --git a/app/Http/ViewComposers/ProfileComposer.php b/app/Http/ViewComposers/ProfileComposer.php new file mode 100644 index 0000000..5a0f862 --- /dev/null +++ b/app/Http/ViewComposers/ProfileComposer.php @@ -0,0 +1,61 @@ +offsetExists('user')) { + throw new \LogicException('View data "user" was not exist.'); + } + $user = $view->offsetGet('user'); + + // 現在のオナ禁セッションの経過時間 + $latestEjaculation = Ejaculation::select('ejaculated_date') + ->where('user_id', $user->id) + ->orderByDesc('ejaculated_date') + ->first(); + if (!empty($latestEjaculation)) { + $currentSession = $latestEjaculation->ejaculated_date + ->diff(Carbon::now()) + ->format('%a日 %h時間 %i分'); + } else { + $currentSession = null; + } + + // 概況欄のデータ取得 + $summary = DB::select(<<<'SQL' +SELECT + avg(span) AS average, + max(span) AS longest, + min(span) AS shortest, + sum(span) AS total_times, + count(*) AS total_checkins +FROM + ( + SELECT + extract(epoch from ejaculated_date - lead(ejaculated_date, 1, NULL) OVER (ORDER BY ejaculated_date DESC)) AS span + FROM + ejaculations + WHERE + user_id = :user_id + ORDER BY + ejaculated_date DESC + ) AS temp +SQL + , ['user_id' => $user->id]); + + $view->with(compact('latestEjaculation', 'currentSession', 'summary')); + } +} \ No newline at end of file diff --git a/app/Providers/ViewComposerServiceProvider.php b/app/Providers/ViewComposerServiceProvider.php new file mode 100644 index 0000000..bb4f062 --- /dev/null +++ b/app/Providers/ViewComposerServiceProvider.php @@ -0,0 +1,30 @@ + +
+ +

{{ $user->display_name }}

+
@{{ $user->name }}
+ +
現在のセッション
+ @if (isset($currentSession)) +

{{ $currentSession }}経過

+

({{ $latestEjaculation->ejaculated_date->format('Y/m/d H:i') }} にリセット)

+ @else +

計測がまだ始まっていません

+

(一度チェックインすると始まります)

+ @endif + +
概況
+

平均記録: {{ Formatter::formatInterval($summary[0]->average) }}

+

最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}

+

最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}

+

合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}

+

通算回数: {{ $summary[0]->total_checkins }}回

+
+
\ No newline at end of file diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index d3ad6e6..4e9aae1 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -7,29 +7,8 @@
-
-
- -

{{ Auth::user()->display_name }}

-
@{{ Auth::user()->name }}
- -
現在のセッション
- @if (isset($currentSession)) -

{{ $currentSession }}経過

-

({{ $ejaculations[0]['ejaculated_date'] }} にリセット)

- @else -

計測がまだ始まっていません

-

(一度チェックインすると始まります)

- @endif - -
概況
-

平均記録: {{ Formatter::formatInterval($summary[0]->average) }}

-

最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}

-

最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}

-

合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}

-

通算回数: {{ $summary[0]->total_checkins }}回

-
-
+ @component('components.profile', ['user' => Auth::user()]) + @endcomponent
diff --git a/resources/views/user/base.blade.php b/resources/views/user/base.blade.php index 8eb53b2..732a569 100644 --- a/resources/views/user/base.blade.php +++ b/resources/views/user/base.blade.php @@ -4,29 +4,8 @@
-
-
- -

{{ $user->display_name }}

-
@{{ $user->name }}
- -
現在のセッション
- @if (isset($currentSession)) -

{{ $currentSession }}経過

-

({{ $ejaculations[0]['ejaculated_date'] }} にリセット)

- @else -

計測がまだ始まっていません

-

(一度チェックインすると始まります)

- @endif - -
概況
-

平均記録: {{ Formatter::formatInterval($summary[0]->average) }}

-

最長記録: {{ Formatter::formatInterval($summary[0]->longest) }}

-

最短記録: {{ Formatter::formatInterval($summary[0]->shortest) }}

-

合計時間: {{ Formatter::formatInterval($summary[0]->total_times) }}

-

通算回数: {{ $summary[0]->total_checkins }}回

-
-
+ @component('components.profile', ['user' => $user]) + @endcomponent
--}} - @if (!empty($ejaculation['note'])) + @if (!empty($ejaculation->note))

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

@endif diff --git a/resources/views/user/stats.blade.php b/resources/views/user/stats.blade.php new file mode 100644 index 0000000..6bc8f66 --- /dev/null +++ b/resources/views/user/stats.blade.php @@ -0,0 +1,4 @@ +@extends('user.base') + +@section('tab-content') +@endsection \ No newline at end of file From 723bb236c9ed7e69e8cb3b384fbe742aa3f9e481 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 5 Nov 2017 10:32:16 +0900 Subject: [PATCH 14/49] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E7=94=BB=E9=9D=A2=E3=81=8C=E9=9D=9E=E3=83=AD?= =?UTF-8?q?=E3=82=B0=E3=82=A4=E3=83=B3=E6=99=82=E3=81=AB=E3=82=B3=E3=82=B1?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/layouts/base.blade.php | 2 +- resources/views/user/profile.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 520b18b..75b006e 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -60,7 +60,7 @@ @endauth @guest -
+ ログイン
@endguest diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index 6caaf0f..137beae 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -7,7 +7,7 @@
{{ $ejaculation->ejaculated_span ?? '精通' }} {{ $ejaculation->before_date }}{{ !empty($ejaculation->before_date) ? ' ~ ' : '' }}{{ $ejaculation->ejaculated_date->format('Y/m/d H:i') }}
- @if ($user->id === Auth::user()->id) + @if (Auth::check() && $user->id === Auth::user()->id)
From 94918fc33719aab66e22031cc208ab97ba7df7da Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 5 Nov 2017 19:14:36 +0900 Subject: [PATCH 15/49] =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E7=94=BB=E9=9D=A2=E3=81=AE=E3=83=AC=E3=82=A4?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 別にレイアウト変わってないので焼き直しが正しい --- .../Controllers/EjaculationController.php | 11 +- resources/views/ejaculation/checkin.blade.php | 141 +++++++++++------- 2 files changed, 91 insertions(+), 61 deletions(-) diff --git a/app/Http/Controllers/EjaculationController.php b/app/Http/Controllers/EjaculationController.php index b648abd..78ba14d 100644 --- a/app/Http/Controllers/EjaculationController.php +++ b/app/Http/Controllers/EjaculationController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\User; +use Carbon\Carbon; use Validator; use App\Ejaculation; use Illuminate\Http\Request; @@ -23,15 +24,17 @@ class EjaculationController extends Controller 'note' => 'nullable|string|max:500', ])->after(function ($validator) use ($request) { // 日時の重複チェック - $dt = $request->input('date') . ' ' . $request->input('time'); - if (Ejaculation::where(['user_id' => Auth::id(), 'ejaculated_date' => $dt])->count()) { - $validator->errors()->add('datetime', '既にこの日時にチェックインしているため、登録できません。'); + if (!$validator->errors()->hasAny(['date', 'time'])) { + $dt = $request->input('date') . ' ' . $request->input('time'); + if (Ejaculation::where(['user_id' => Auth::id(), 'ejaculated_date' => $dt])->count()) { + $validator->errors()->add('datetime', '既にこの日時にチェックインしているため、登録できません。'); + } } })->validate(); Ejaculation::create([ 'user_id' => Auth::id(), - 'ejaculated_date' => $request->input('date') . ' ' . $request->input('time'), + 'ejaculated_date' => Carbon::createFromFormat('Y/m/d H:i', $request->input('date') . ' ' . $request->input('time')), 'note' => $request->input('note') ?? '', 'is_private' => $request->has('is_private') ?? false ]); diff --git a/resources/views/ejaculation/checkin.blade.php b/resources/views/ejaculation/checkin.blade.php index 24b2067..4130d60 100644 --- a/resources/views/ejaculation/checkin.blade.php +++ b/resources/views/ejaculation/checkin.blade.php @@ -1,83 +1,110 @@ -@extends('layouts.base-old') +@extends('layouts.base') @section('content')
-

今致してる?

-
-
- {{ csrf_field() }} +

今致してる?

+
+
+
+ + {{ csrf_field() }} -
-
-
- today - - +
+
+ + @if ($errors->has('date')) - {{ $errors->first('date') }} +
{{ $errors->first('date') }}
@endif
-
- schedule - - +
+ + @if ($errors->has('time')) - {{ $errors->first('time') }} +
{{ $errors->first('time') }}
@endif
@if ($errors->has('datetime')) -
- {{ $errors->first('datetime') }} -
+
+ {{ $errors->first('datetime') }} +
@endif -
- label - - +
+ {{-- +
+
+ + + + スペース区切りで複数入力できます。 +
- {{--
--}} - {{--TODO: Material Chipsデータのシリアライズとかをjsで書いておく必要あるかも? --}} - {{--label--}} - {{--
--}} - {{----}} - {{--
--}} -
- comment - - - +
+
+
+ + + + オカズのURLを貼り付けて登録することができます。 + +
+
+
+
このオカズで合っていますか?
+
+
+ +
+

タイトル

+ 概要 +
+
+ 決定 + キャンセル +
+
+
+
+ --}} +
+
+ + + + 最大 500 文字 + @if ($errors->has('note')) - {{ $errors->first('note') }} +
{{ $errors->first('note') }}
@endif
-
-
-
オプション
-

- - -

+
+

オプション

+
+
+ +
-
-
- -
+ +
+
-
- + +
@endsection -@section('script') - -@endsection \ No newline at end of file +@push('script') +@endpush \ No newline at end of file From 016d4d8e3f28c6bf9b83fada1e38137bdcfb895e Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 5 Nov 2017 19:31:50 +0900 Subject: [PATCH 16/49] =?UTF-8?q?word-wrap=E4=BD=95=E3=82=82=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/tissue.css | 4 ++++ resources/views/user/profile.blade.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/css/tissue.css b/public/css/tissue.css index 6670dc0..c5c0f87 100644 --- a/public/css/tissue.css +++ b/public/css/tissue.css @@ -7,6 +7,10 @@ background: linear-gradient(to bottom, #f8f9fa, #fff) } +.tis-word-wrap { + word-wrap: break-word; +} + .list-group-item.border-bottom-only { border-left: none; border-right: none; diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index 137beae..296fde1 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -40,7 +40,7 @@ --}} @if (!empty($ejaculation->note)) -

+

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

@endif From fca4c21d3a44f5a777363499fd30e89c5506c436 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 5 Nov 2017 19:51:31 +0900 Subject: [PATCH 17/49] =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3=E3=83=84=E5=B9=85?= =?UTF-8?q?=E3=82=92=E7=B8=AE=E3=82=81=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/layouts/base.blade.php | 90 +++++++++++++------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 75b006e..291cddc 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -20,50 +20,52 @@ {{ csrf_field() }} - {{ config('app.name', 'Tissue') }} - -