krgm.so-manager-dev.com/resources/views/admin/news/edit.blade.php
ou.zaikou e1629913bd 初回コミット
Signed-off-by:  ou.zaikou<caihaoweng@gmail.com>
2025-08-21 23:09:40 +09:00

82 lines
3.3 KiB
PHP

@extends('layouts.app')
@section('title', 'ニュース編集')
@section('content')
{{-- コンテンツヘッダー(パンくず) --}}
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-lg-6"><h1 class="m-0 text-dark">ニュース編集</h1></div>
<div class="col-lg-6">
<ol class="breadcrumb float-sm-right text-sm">
<li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
<li class="breadcrumb-item"><a href="{{ route('news') }}">最新ニュース登録</a></li>
<li class="breadcrumb-item active">編集</li>
</ol>
</div>
</div>
</div>
</div>
<section class="content">
<div class="container-fluid">
{{-- フラッシュ/エラー表示 --}}
@if(session('success')) <div class="alert alert-success">{{ session('success') }}</div> @endif
@if ($errors->any())
<div class="alert alert-danger"><ul class="mb-0">@foreach($errors->all() as $e)<li>{{ $e }}</li>@endforeach</ul></div>
@endif
{{-- 入力フォーム --}}
<div class="card">
<div class="card-body">
<form method="post" action="{{ route('news_edit', ['id'=>$news->news_id ?? $news->id]) }}">
@csrf
<div class="form-group">
<label>ニュース内容 <span class="text-danger">*</span></label>
<textarea name="news" class="form-control" rows="8" required>{{ old('news', $news->news) }}</textarea>
</div>
<div class="form-group">
<label>公開日時</label>
<input type="text" name="open_datetime" class="form-control" placeholder="YYYY-MM-DD HH:MM:SS"
value="{{ old('open_datetime', $news->open_datetime) }}">
</div>
<div class="form-group">
<label>リンクURL</label>
<input type="text" name="link_url" class="form-control" value="{{ old('link_url', $news->link_url) }}">
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label>画像1URL</label>
<input type="text" name="image1_filename" class="form-control" value="{{ old('image1_filename', $news->image1_filename) }}">
</div>
<div class="form-group col-md-6">
<label>画像2URL</label>
<input type="text" name="image2_filename" class="form-control" value="{{ old('image2_filename', $news->image2_filename) }}">
</div>
</div>
<div class="form-group">
<label>表示モード <span class="text-danger">*</span></label>
<select name="mode" class="form-control" required>
<option value="1" @selected(old('mode', $news->mode)==1)>公開</option>
<option value="2" @selected(old('mode', $news->mode)==2)>下書き</option>
<option value="0" @selected(old('mode', $news->mode)==0)>非表示</option>
</select>
</div>
<div class="text-right">
<a href="{{ route('news') }}" class="btn btn-outline-secondary">一覧に戻る</a>
<button class="btn btn-primary">保存</button>
</div>
</form>
</div>
</div>
{{-- 登録/更新メタ情報 --}}
<div class="text-muted small">
<div>登録日時:{{ $news->created_at }}</div>
<div>更新日時:{{ $news->updated_at }}</div>
</div>
</div>
</section>
@endsection