2019-02-11 23:25:46 +09:00
|
|
|
@extends('layouts.admin')
|
|
|
|
|
|
|
|
@section('title', 'お知らせ')
|
|
|
|
|
|
|
|
@section('tab-content')
|
|
|
|
<div class="container">
|
|
|
|
<h2>お知らせの編集</h2>
|
|
|
|
<hr>
|
2019-03-14 00:04:53 +09:00
|
|
|
<form action="{{ route('admin.info.update', ['info' => $info]) }}" method="post">
|
2019-02-11 23:25:46 +09:00
|
|
|
{{ method_field('PUT') }}
|
|
|
|
{{ csrf_field() }}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-12 col-lg-6">
|
|
|
|
<label for="category">カテゴリ</label>
|
|
|
|
<select id="category" name="category" class="form-control">
|
|
|
|
@foreach($categories as $id => $category)
|
2019-03-14 00:04:53 +09:00
|
|
|
<option value="{{ $id }}" {{ (old('category') ?? $info->category) == $id ? 'selected' : '' }}>{{ $category['label'] }}</option>
|
2019-02-11 23:25:46 +09:00
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-12 col-lg-6 d-flex flex-column justify-content-center">
|
|
|
|
<div class="custom-control custom-checkbox">
|
2019-03-14 00:04:53 +09:00
|
|
|
<input id="pinned" name="pinned" type="checkbox" class="custom-control-input" value="1"
|
2019-02-11 23:25:46 +09:00
|
|
|
{{ (is_bool(old('pinned')) ? old('pinned') : $info->pinned) ? 'checked' : ''}}>
|
|
|
|
<label for="pinned" class="custom-control-label">ピン留め (常に優先表示) する</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="title">タイトル</label>
|
2019-03-16 12:29:33 +09:00
|
|
|
<input id="title" name="title" type="text" class="form-control {{ $errors->has('title') ? ' is-invalid' : '' }}" value="{{ old('title') ?? $info->title }}">
|
|
|
|
|
|
|
|
@if ($errors->has('title'))
|
|
|
|
<div class="invalid-feedback">{{ $errors->first('title') }}</div>
|
|
|
|
@endif
|
2019-02-11 23:25:46 +09:00
|
|
|
</div>
|
|
|
|
<div class="form-group mt-3">
|
|
|
|
<label for="content">本文</label>
|
2019-03-16 12:29:33 +09:00
|
|
|
<textarea id="content" name="content" rows="15" class="form-control {{ $errors->has('content') ? ' is-invalid' : '' }}" maxlength="10000">{{ old('content') ?? $info->content }}</textarea>
|
2019-02-11 23:25:46 +09:00
|
|
|
<small class="form-text text-muted">
|
|
|
|
最大 10000 文字、Markdown 形式
|
|
|
|
</small>
|
2019-03-16 12:29:33 +09:00
|
|
|
|
|
|
|
@if ($errors->has('content'))
|
|
|
|
<div class="invalid-feedback">{{ $errors->first('content') }}</div>
|
|
|
|
@endif
|
2019-02-11 23:25:46 +09:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
<button type="submit" class="btn btn-primary">更新</button>
|
2019-03-14 00:04:53 +09:00
|
|
|
<button type="submit" class="btn btn-danger" form="delete-form">削除</button>
|
2019-02-11 23:25:46 +09:00
|
|
|
</div>
|
|
|
|
</form>
|
2019-03-14 00:04:53 +09:00
|
|
|
<form id="delete-form" action="{{ route('admin.info.destroy', ['info' => $info]) }}" method="post">
|
|
|
|
{{ method_field('DELETE') }}
|
|
|
|
{{ csrf_field() }}
|
|
|
|
</form>
|
2019-02-11 23:25:46 +09:00
|
|
|
</div>
|
|
|
|
@endsection
|