チェックイン画面のレイアウト変更
別にレイアウト変わってないので焼き直しが正しい
This commit is contained in:
parent
723bb236c9
commit
94918fc337
@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\User;
|
use App\User;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Validator;
|
use Validator;
|
||||||
use App\Ejaculation;
|
use App\Ejaculation;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@ -23,15 +24,17 @@ class EjaculationController extends Controller
|
|||||||
'note' => 'nullable|string|max:500',
|
'note' => 'nullable|string|max:500',
|
||||||
])->after(function ($validator) use ($request) {
|
])->after(function ($validator) use ($request) {
|
||||||
// 日時の重複チェック
|
// 日時の重複チェック
|
||||||
$dt = $request->input('date') . ' ' . $request->input('time');
|
if (!$validator->errors()->hasAny(['date', 'time'])) {
|
||||||
if (Ejaculation::where(['user_id' => Auth::id(), 'ejaculated_date' => $dt])->count()) {
|
$dt = $request->input('date') . ' ' . $request->input('time');
|
||||||
$validator->errors()->add('datetime', '既にこの日時にチェックインしているため、登録できません。');
|
if (Ejaculation::where(['user_id' => Auth::id(), 'ejaculated_date' => $dt])->count()) {
|
||||||
|
$validator->errors()->add('datetime', '既にこの日時にチェックインしているため、登録できません。');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})->validate();
|
})->validate();
|
||||||
|
|
||||||
Ejaculation::create([
|
Ejaculation::create([
|
||||||
'user_id' => Auth::id(),
|
'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') ?? '',
|
'note' => $request->input('note') ?? '',
|
||||||
'is_private' => $request->has('is_private') ?? false
|
'is_private' => $request->has('is_private') ?? false
|
||||||
]);
|
]);
|
||||||
|
@ -1,83 +1,110 @@
|
|||||||
@extends('layouts.base-old')
|
@extends('layouts.base')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2 class="grey-text">今致してる?</h2>
|
<h2>今致してる?</h2>
|
||||||
<div class="row">
|
<hr>
|
||||||
<form method="post" action="{{ route('checkin') }}" class="col s12 push-m3 m6">
|
<div class="row justify-content-center mt-5">
|
||||||
{{ csrf_field() }}
|
<div class="col-lg-6">
|
||||||
|
<form method="post" action="{{ route('checkin') }}" class="col s12 push-m3 m6">
|
||||||
|
{{ csrf_field() }}
|
||||||
|
|
||||||
<div class="card-panel">
|
<div class="form-row">
|
||||||
<div class="row">
|
<div class="form-group col-sm-6">
|
||||||
<div class="input-field col s6">
|
<label for="date"><span class="oi oi-calendar"></span> 日付</label>
|
||||||
<i class="material-icons prefix">today</i>
|
<input id="date" name="date" type="text" class="form-control {{ $errors->has('date') || $errors->has('datetime') ? ' is-invalid' : '' }}"
|
||||||
<input id="date" name="date" class="validate{{ $errors->has('date') || $errors->has('datetime') ? ' invalid' : '' }}" type="text" pattern="^20[0-9]{2}/(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])$" value="{{ old('date') ?? date('Y/m/d') }}" required>
|
pattern="^20[0-9]{2}/(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])$" value="{{ old('date') ?? date('Y/m/d') }}" required>
|
||||||
<label for="date">日付</label>
|
|
||||||
|
|
||||||
@if ($errors->has('date'))
|
@if ($errors->has('date'))
|
||||||
<span class="red-text"><strong>{{ $errors->first('date') }}</strong></span>
|
<div class="invalid-feedback">{{ $errors->first('date') }}</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="input-field col s6">
|
<div class="form-group col-sm-6">
|
||||||
<i class="material-icons prefix">schedule</i>
|
<label for="time"><span class="oi oi-clock"></span> 時刻</label>
|
||||||
<input id="time" name="time" class="validate{{ $errors->has('time') || $errors->has('datetime') ? ' invalid' : '' }}" type="text" pattern="^([01][0-9]|2[0-3]):[0-5][0-9]$" value="{{ old('time') ?? date('H:i') }}">
|
<input id="time" name="time" type="text" class="form-control {{ $errors->has('time') || $errors->has('datetime') ? ' is-invalid' : '' }}"
|
||||||
<label for="time">時刻</label>
|
pattern="^([01][0-9]|2[0-3]):[0-5][0-9]$" value="{{ old('time') ?? date('H:i') }}" required>
|
||||||
|
|
||||||
@if ($errors->has('time'))
|
@if ($errors->has('time'))
|
||||||
<span class="red-text"><strong>{{ $errors->first('time') }}</strong></span>
|
<div class="invalid-feedback">{{ $errors->first('time') }}</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@if ($errors->has('datetime'))
|
@if ($errors->has('datetime'))
|
||||||
<div class="col s12">
|
<div class="form-group col-sm-12" style="margin-top: -1rem;">
|
||||||
<span class="red-text"><strong>{{ $errors->first('datetime') }}</strong></span>
|
<small class="text-danger">{{ $errors->first('datetime') }}</small>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
<div class="input-field col s12">
|
</div>
|
||||||
<i class="material-icons prefix">label</i>
|
{{--
|
||||||
<input id="tags" type="text" disabled placeholder="未実装です">
|
<div class="form-row">
|
||||||
<label for="tags">タグ</label>
|
<div class="form-group col-sm-12">
|
||||||
|
<label for="tags"><span class="oi oi-tags"></span> タグ</label>
|
||||||
|
<input id="tags" type="text" class="form-control" placeholder="未実装です" disabled>
|
||||||
|
<small class="form-text text-muted">
|
||||||
|
スペース区切りで複数入力できます。
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
{{--<div class="input-field col s12">--}}
|
</div>
|
||||||
{{--TODO: Material Chipsデータのシリアライズとかをjsで書いておく必要あるかも? --}}
|
<div class="form-row">
|
||||||
{{--<i class="material-icons prefix">label</i>--}}
|
<div class="form-group col-sm-12">
|
||||||
{{--<div class="chips"></div>--}}
|
<label for="link"><span class="oi oi-link-intact"></span> オカズリンク</label>
|
||||||
{{--<label>タグ</label>--}}
|
<input id="link" type="text" class="form-control" placeholder="https://...">
|
||||||
{{--</div>--}}
|
<small class="form-text text-muted">
|
||||||
<div class="input-field col s12">
|
オカズのURLを貼り付けて登録することができます。
|
||||||
<i class="material-icons prefix">comment</i>
|
</small>
|
||||||
<textarea id="note" name="note" class="materialize-textarea{{ $errors->has('note') ? ' invalid' : '' }}" data-length="500">{{ old('note') }}</textarea>
|
</div>
|
||||||
<label for="note">ノート</label>
|
<div class="form-group col-sm-12 d-none">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">このオカズで合っていますか?</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="d-flex mb-4">
|
||||||
|
<img src="holder.js/128x128" alt="" class="rounded">
|
||||||
|
<div class="align-self-center ml-2 mr-auto">
|
||||||
|
<p class="mb-1">タイトル</p>
|
||||||
|
<small class="text-muted">概要</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a href="#" class="btn btn-success"><span class="oi oi-check"></span> 決定</a>
|
||||||
|
<a href="#" class="btn btn-outline-secondary">キャンセル</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
--}}
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-sm-12">
|
||||||
|
<label for="note"><span class="oi oi-comment-square"></span> ノート</label>
|
||||||
|
<textarea id="note" name="note" class="form-control {{ $errors->has('note') ? ' is-invalid' : '' }}" rows="4">{{ old('note') }}</textarea>
|
||||||
|
<small class="form-text text-muted">
|
||||||
|
最大 500 文字
|
||||||
|
</small>
|
||||||
@if ($errors->has('note'))
|
@if ($errors->has('note'))
|
||||||
<span class="red-text"><strong>{{ $errors->first('note') }}</strong></span>
|
<div class="invalid-feedback">{{ $errors->first('note') }}</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="form-row mt-4">
|
||||||
<div class="input-field col s12">
|
<p>オプション</p>
|
||||||
<h6 class="grey-text">オプション</h6>
|
<div class="form-group col-sm-12">
|
||||||
<p>
|
<div class="form-check">
|
||||||
<input id="is-private" name="is_private" class="filled-in" type="checkbox" {{ old('is_private') ? 'checked' : '' }}>
|
<label class="custom-control custom-checkbox">
|
||||||
<label for="is-private">チェックイン履歴を非公開にする</label>
|
<input name="is_private" type="checkbox" class="custom-control-input" {{ old('is_private') ? 'checked' : '' }}>
|
||||||
</p>
|
<span class="custom-control-indicator"></span>
|
||||||
|
<span class="custom-control-description">
|
||||||
|
<span class="oi oi-lock-locked"></span> このチェックインを非公開にする
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row center">
|
|
||||||
<div class="input-field col s12">
|
<div class="text-center">
|
||||||
<button id="submit" class="btn waves-effect waves-light teal lighten-2" type="submit">チェックイン</button>
|
<button class="btn btn-primary" type="submit">チェックイン</button>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('script')
|
@push('script')
|
||||||
<script>
|
@endpush
|
||||||
$(function() {
|
|
||||||
$('#note').characterCounter();
|
|
||||||
// $('.chips').material_chip();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endsection
|
|
Loading…
Reference in New Issue
Block a user