You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
3.8 KiB
62 lines
3.8 KiB
@extends('layouts.app')
|
|
|
|
@section('title', __('master.edit'))
|
|
|
|
@section('content')
|
|
<div class="row">
|
|
<div class="col-md-6 col-md-offset-3">
|
|
@if (request('action') == 'delete' && $singleMstr)
|
|
@can('delete', $singleMstr)
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading"><h3 class="panel-title">{{ __('master.delete') }}</h3></div>
|
|
<div class="panel-body">
|
|
<label class="control-label">{{ __('master.name') }}</label>
|
|
<p>{{ $singleMstr->name }}</p>
|
|
<label class="control-label">{{ __('master.description') }}</label>
|
|
<p>{{ $singleMstr->description }}</p>
|
|
{!! $errors->first('master_id', '<span class="form-error small">:message</span>') !!}
|
|
</div>
|
|
<hr style="margin:0">
|
|
<div class="panel-body">{{ __('master.delete_confirm') }}</div>
|
|
<div class="panel-footer">
|
|
<form method="POST" action="{{ route('masters.destroy', $singleMstr) }}" accept-charset="UTF-8" onsubmit="return confirm("Are you sure to delete this?")" class="del-form pull-right" style="display: inline;">
|
|
{{ csrf_field() }} {{ method_field('delete') }}
|
|
<input name="master_id" type="hidden" value="{{ $singleMstr->id }}">
|
|
<input name="{{ request('page') }}" type="hidden">
|
|
<input name="{{ request('q') }}" type="hidden">
|
|
<button title="Delete this item" type="submit" class="btn btn-danger">{{ __('app.delete_confirm_button') }}</button>
|
|
</form>
|
|
<a href="{{ route('masters.edit', $singleMstr) }}" class="btn btn-default">{{ __('app.cancel') }}</a>
|
|
</div>
|
|
</div>
|
|
@endcan
|
|
@else
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading"><h3 class="panel-title">{{ __('master.edit') }}</h3></div>
|
|
<form method="POST" action="{{ route('masters.update', $singleMstr) }}" accept-charset="UTF-8">
|
|
{{ csrf_field() }} {{ method_field('patch') }}
|
|
<div class="panel-body">
|
|
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
|
|
<label for="name" class="control-label">{{ __('master.name') }}</label>
|
|
<input id="name" type="text" class="form-control" name="name" value="{{ old('name', $singleMstr->name) }}" required>
|
|
{!! $errors->first('name', '<span class="help-block small">:message</span>') !!}
|
|
</div>
|
|
<div class="form-group{{ $errors->has('description') ? ' has-error' : '' }}">
|
|
<label for="description" class="control-label">{{ __('master.description') }}</label>
|
|
<textarea id="description" class="form-control" name="description" rows="4">{{ old('description', $singleMstr->description) }}</textarea>
|
|
{!! $errors->first('description', '<span class="help-block small">:message</span>') !!}
|
|
</div>
|
|
</div>
|
|
<div class="panel-footer">
|
|
<input type="submit" value="{{ __('master.update') }}" class="btn btn-success">
|
|
<a href="{{ route('masters.show', $singleMstr) }}" class="btn btn-default">{{ __('app.cancel') }}</a>
|
|
@can('delete', $singleMstr)
|
|
<a href="{{ route('masters.edit', [$singleMstr, 'action' => 'delete']) }}" id="del-master-{{ $singleMstr->id }}" class="btn btn-danger pull-right">{{ __('app.delete') }}</a>
|
|
@endcan
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
@endsection
|