Use components for form buttons and file notes
This commit is contained in:
parent
db4b90183f
commit
026b3f5a20
@ -11,14 +11,7 @@
|
||||
<div class="h-100 bg-animation">
|
||||
<div class="d-flex h-100 justify-content-center align-items-center">
|
||||
<div class="mx-auto app-login-box col-md-8">
|
||||
@if(file_exists('login-note.html'))
|
||||
<div class="mx-auto card text-white card-body bg-primary w-50">
|
||||
<h5 class="text-white card-title"><i class="icon fa-2x fas fa-info pe-3"></i><span class="font-size-xlg">NOTE</span></h5>
|
||||
<span class="w-100 pb-0">
|
||||
{!! file_get_contents('login-note.html') !!}
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
<x-file-note file="login-note.html"/>
|
||||
|
||||
<div class="modal-dialog w-100 mx-auto">
|
||||
<div class="modal-content">
|
||||
|
11
resources/views/components/error.blade.php
Normal file
11
resources/views/components/error.blade.php
Normal file
@ -0,0 +1,11 @@
|
||||
@if($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<h4 class="alert-heading"><i class="fas fa-fw fa-thumbs-down"></i> Error?</h4>
|
||||
<hr>
|
||||
<ul style="list-style-type: square;">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
12
resources/views/components/file-note.blade.php
Normal file
12
resources/views/components/file-note.blade.php
Normal file
@ -0,0 +1,12 @@
|
||||
@if(file_exists($file))
|
||||
<div class="row pb-3">
|
||||
<div class="col-12">
|
||||
<div class="mx-auto card text-white card-body bg-primary w-50">
|
||||
<h5 class="text-white card-title"><i class="icon fa-2x fas fa-info pe-3"></i><span class="font-size-xlg">NOTE</span></h5>
|
||||
<span class="w-100 pb-0">
|
||||
{!! file_get_contents($file) !!}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
9
resources/views/components/form/cancel.blade.php
Normal file
9
resources/views/components/form/cancel.blade.php
Normal file
@ -0,0 +1,9 @@
|
||||
<button id="cancel" class="btn btn-sm btn-outline-dark">Cancel</button>
|
||||
|
||||
@section('page-scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#cancel').on('click',()=>history.back());
|
||||
});
|
||||
</script>
|
||||
@append
|
9
resources/views/components/form/reset.blade.php
Normal file
9
resources/views/components/form/reset.blade.php
Normal file
@ -0,0 +1,9 @@
|
||||
<button id="form-reset" class="btn btn-outline-danger">@lang('Reset')</button>
|
||||
|
||||
@section('page-scripts')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#form-reset').on('click',()=>$('#{{$form}}')[0].reset());
|
||||
});
|
||||
</script>
|
||||
@append
|
9
resources/views/components/form/submit.blade.php
Normal file
9
resources/views/components/form/submit.blade.php
Normal file
@ -0,0 +1,9 @@
|
||||
<button id="form-submit" class="btn btn-sm btn-success">@lang($action)</button>
|
||||
|
||||
@section('page-scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#form-submit').on('click',()=>$('#{{$form}}')[0].submit());
|
||||
});
|
||||
</script>
|
||||
@append
|
7
resources/views/components/note.blade.php
Normal file
7
resources/views/components/note.blade.php
Normal file
@ -0,0 +1,7 @@
|
||||
@if(session()->has('note'))
|
||||
<div class="alert alert-info">
|
||||
<h4 class="alert-heading"><i class="fas fa-fw fa-note-sticky"></i> Note:</h4>
|
||||
<hr>
|
||||
<p>{{ session()->pull('note') }}</p>
|
||||
</div>
|
||||
@endif
|
12
resources/views/components/success.blade.php
Normal file
12
resources/views/components/success.blade.php
Normal file
@ -0,0 +1,12 @@
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
<h4 class="alert-heading"><i class="fas fa-fw fa-thumbs-up"></i> Success!</h4>
|
||||
<hr>
|
||||
<p>{{ session()->pull('success') }}</p>
|
||||
<ul style="list-style-type: square;">
|
||||
@foreach (session()->pull('updated') as $key => $values)
|
||||
<li>{{ $key }}: {{ join(',',$values) }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
@ -28,39 +28,11 @@
|
||||
@endsection
|
||||
|
||||
@section('main-content')
|
||||
@if(session()->has('note'))
|
||||
<div class="alert alert-info">
|
||||
<h4 class="alert-heading"><i class="fas fa-fw fa-note-sticky"></i> Note:</h4>
|
||||
<hr>
|
||||
<p>{{ session()->pull('note') }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
<h4 class="alert-heading"><i class="fas fa-fw fa-thumbs-up"></i> Success!</h4>
|
||||
<hr>
|
||||
<p>{{ session()->pull('success') }}</p>
|
||||
<ul style="list-style-type: square;">
|
||||
@foreach (session()->pull('updated') as $key => $values)
|
||||
<li>{{ $key }}: {{ join(',',$values) }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<x-note/>
|
||||
<x-success/>
|
||||
<x-error/>
|
||||
|
||||
<!-- @todo If we are redirected here, check old() and add back any attributes that were in the original submission -->
|
||||
@if($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<h4 class="alert-heading"><i class="fas fa-fw fa-thumbs-down"></i> Error?</h4>
|
||||
<hr>
|
||||
<ul style="list-style-type: square;">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="main-card mb-3 card">
|
||||
<div class="card-body">
|
||||
@ -116,14 +88,14 @@
|
||||
</div>
|
||||
<div class="col-2"></div>
|
||||
</div>
|
||||
|
||||
<div class="row d-none pt-3">
|
||||
<div class="col-12 offset-sm-2 col-sm-4 col-lg-2">
|
||||
<span id="form-reset" class="btn btn-outline-danger">@lang('Reset')</span>
|
||||
<span id="form-submit" class="btn btn-success">@lang('Update')</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="row d-none pt-3">
|
||||
<div class="col-12 offset-sm-2 col-sm-4 col-lg-2">
|
||||
<x-form.reset form="dn-edit"/>
|
||||
<x-form.submit action="Update" form="dn-edit"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Internal Attributes -->
|
||||
@ -223,14 +195,6 @@
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#form-reset').click(function() {
|
||||
$('#dn-edit')[0].reset();
|
||||
});
|
||||
|
||||
$('#form-submit').click(function() {
|
||||
$('#dn-edit')[0].submit();
|
||||
});
|
||||
|
||||
$('#newattr').on('change',function(item) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
|
@ -52,13 +52,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<span class="ms-auto">
|
||||
<button type="submit" class="btn btn-success btn-sm">Process</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="card-footer">
|
||||
<span class="ms-auto">
|
||||
<x-form.submit action="Process" form="import-form"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
--}}
|
||||
|
||||
@section('main-content')
|
||||
<div class="card card-solid">
|
||||
<div class="card card-solid mb-3">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-4">
|
||||
@ -38,19 +38,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(file_exists('home-note.html'))
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-12 offset-lg-2 col-lg-8">
|
||||
<div class="mx-auto card text-white card-body bg-primary">
|
||||
<h5 class="text-white card-title"><i class="icon fa-2x fas fa-info pe-3"></i><span class="font-size-xlg">NOTE</span></h5>
|
||||
<span class="w-100 pb-0">
|
||||
{!! file_get_contents('home-note.html') !!}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<x-file-note file="home-note.html"/>
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
|
@ -34,44 +34,15 @@
|
||||
@endsection
|
||||
|
||||
@section('main-content')
|
||||
@if(session()->has('note'))
|
||||
<div class="alert alert-info">
|
||||
<h4 class="alert-heading"><i class="fas fa-fw fa-note-sticky"></i> Note:</h4>
|
||||
<hr>
|
||||
<p>{{ session()->pull('note') }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success">
|
||||
<h4 class="alert-heading"><i class="fas fa-fw fa-thumbs-up"></i> Success!</h4>
|
||||
<hr>
|
||||
<p>{{ session()->pull('success') }}</p>
|
||||
<ul style="list-style-type: square;">
|
||||
@foreach (session()->pull('updated') as $key => $values)
|
||||
<li>{{ $key }}: {{ join(',',$values) }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<h4 class="alert-heading"><i class="fas fa-fw fa-thumbs-down"></i> Error?</h4>
|
||||
<hr>
|
||||
<ul style="list-style-type: square;">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<x-note/>
|
||||
<x-success/>
|
||||
<x-error/>
|
||||
|
||||
<div class="main-card mb-3 card">
|
||||
<form id="dn-update" method="POST" class="needs-validation" action="{{ url('entry/update/commit') }}" novalidate>
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="dn" value="{{ $o->getDNSecure() }}">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-6 col-xl-4 mx-auto pt-3">
|
||||
@ -104,28 +75,15 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pt-3">
|
||||
<div class="col-12 offset-sm-2 col-sm-4 col-lg-2 mx-auto">
|
||||
<span id="form-reset" class="btn btn-outline-danger">@lang('Reset')</span>
|
||||
<span id="form-submit" class="btn btn-success">@lang('Update')</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="row p-3">
|
||||
<div class="col-12 offset-sm-2 col-sm-4 col-lg-2 mx-auto">
|
||||
<x-form.cancel/>
|
||||
<x-form.submit action="Update" form="dn-update"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#form-reset').click(function() {
|
||||
$('#dn-update')[0].reset();
|
||||
});
|
||||
|
||||
$('#form-submit').click(function() {
|
||||
$('#dn-update')[0].submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
Loading…
x
Reference in New Issue
Block a user