mirror of
https://github.com/Kovah/LinkAce.git
synced 2025-02-22 02:03:58 +01:00
BS4: Category edit view
This commit is contained in:
parent
802c17d860
commit
aed08e9285
@ -4,11 +4,9 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<p class="card-header-title">
|
||||
@lang('category.add')
|
||||
</p>
|
||||
@lang('category.add')
|
||||
</header>
|
||||
<div class="card-content">
|
||||
<div class="card-body">
|
||||
|
||||
<form action="{{ route('categories.update', [$category->id]) }}" method="POST">
|
||||
@method('PATCH')
|
||||
@ -16,15 +14,16 @@
|
||||
|
||||
<input type="hidden" name="category_id" value="{{ $category->id }}">
|
||||
|
||||
<div class="field">
|
||||
<label class="label" for="name">@lang('category.name')</label>
|
||||
<div class="control">
|
||||
<input name="name" id="name" class="input is-large{{ $errors->has('name') ? ' is-danger' : '' }}"
|
||||
type="text" placeholder="@lang('category.name')" value="{{ old('name') ?: $category->name }}"
|
||||
required autofocus>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name">@lang('category.name')</label>
|
||||
|
||||
<input name="name" id="name"
|
||||
class="form-control form-control-lg{{ $errors->has('name') ? ' is-invalid' : '' }}"
|
||||
type="text" placeholder="@lang('category.name')" value="{{ old('name') ?: $category->name }}"
|
||||
required autofocus>
|
||||
|
||||
@if ($errors->has('name'))
|
||||
<p class="help has-text-danger" role="alert">
|
||||
<p class="invalid-feedback" role="alert">
|
||||
{{ $errors->first('name') }}
|
||||
</p>
|
||||
@endif
|
||||
@ -32,65 +31,70 @@
|
||||
|
||||
<br>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-half">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">
|
||||
@lang('category.description')
|
||||
</label>
|
||||
|
||||
<textarea name="description" id="description" rows="4" class="form-control"
|
||||
placeholder="@lang('category.description')">{{ old('description') ?: $category->description }}</textarea>
|
||||
|
||||
<div class="field">
|
||||
<label class="label" for="description">@lang('category.description')</label>
|
||||
<div class="control">
|
||||
<textarea name="description" id="description" rows="4" class="textarea"
|
||||
placeholder="@lang('category.description')">{{ old('description') ?: $category->description }}</textarea>
|
||||
</div>
|
||||
@if ($errors->has('description'))
|
||||
<p class="help has-text-danger" role="alert">
|
||||
<p class="invalid-feedback" role="alert">
|
||||
{{ $errors->first('description') }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="column is-half">
|
||||
<div class="col">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parent_category">
|
||||
@lang('category.parent_category')
|
||||
</label>
|
||||
|
||||
<select id="parent_category" name="parent_category"
|
||||
class="form-control{{ $errors->has('parent_category') ? ' is-invalid' : '' }}">
|
||||
<option value="0">@lang('category.select_parent_category')</option>
|
||||
@foreach($categories as $select_category)
|
||||
<option value="{{ $select_category->id }}"
|
||||
@if(old('parent_category')
|
||||
|| (old('parent_category') === null && $category->parent_category === $select_category->id)
|
||||
) selected @endif>
|
||||
{{ $select_category->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
|
||||
<div class="field">
|
||||
<label class="label" for="parent_category">@lang('category.parent_category')</label>
|
||||
<div class="control">
|
||||
<div class="select{{ $errors->has('parent_category') ? ' is-danger' : '' }}">
|
||||
<select id="parent_category" name="parent_category">
|
||||
<option value="0">@lang('category.select_parent_category')</option>
|
||||
@foreach($categories as $select_category)
|
||||
<option value="{{ $select_category->id }}"
|
||||
@if(old('parent_category')
|
||||
|| (old('parent_category') === null && $category->parent_category === $select_category->id)
|
||||
) selected @endif>
|
||||
{{ $select_category->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@if ($errors->has('parent_category'))
|
||||
<p class="help has-text-danger" role="alert">
|
||||
<p class="invalid-feedback" role="alert">
|
||||
{{ $errors->first('parent_category') }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label" for="is_private">@lang('linkace.is_private')</label>
|
||||
<div class="control">
|
||||
<div class="select{{ $errors->has('is_private') ? ' is-danger' : '' }}">
|
||||
<select id="is_private" name="is_private">
|
||||
<option value="0" @if($category->is_private === 0) selected @endif>
|
||||
@lang('linkace.no')
|
||||
</option>
|
||||
<option value="1" @if($category->is_private === 1) selected @endif>
|
||||
@lang('linkace.yes')
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="is_private">
|
||||
@lang('linkace.is_private')
|
||||
</label>
|
||||
|
||||
<select id="is_private" name="is_private"
|
||||
class="form-control{{ $errors->has('parent_category') ? ' is-invalid' : '' }}">
|
||||
<option value="0" @if($category->is_private === 0) selected @endif>
|
||||
@lang('linkace.no')
|
||||
</option>
|
||||
<option value="1" @if($category->is_private === 1) selected @endif>
|
||||
@lang('linkace.yes')
|
||||
</option>
|
||||
</select>
|
||||
|
||||
@if ($errors->has('is_private'))
|
||||
<p class="help has-text-danger" role="alert">
|
||||
<p class="invalid-feedback" role="alert">
|
||||
{{ $errors->first('is_private') }}
|
||||
</p>
|
||||
@endif
|
||||
@ -99,14 +103,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="field">
|
||||
<div class="control has-text-right">
|
||||
<button type="submit" class="button is-primary is-medium">
|
||||
<i class="fa fa-save fa-mr"></i> @lang('category.update')
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-3 text-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fa fa-save fa-mr"></i> @lang('category.edit')
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
Loading…
x
Reference in New Issue
Block a user