Skip to content

Commit

Permalink
Update wizard views
Browse files Browse the repository at this point in the history
  • Loading branch information
ycs77 committed Jun 14, 2019
1 parent b2672f0 commit ef37f38
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 43 deletions.
88 changes: 46 additions & 42 deletions resources/views/base.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,57 @@

@section('content')
<div class="container my-3">
<h1 class="text-center">{{ $wizardTitle }}</h1>
<div class="row justify-content-center">
<div class="col-md-8">
<h1 class="text-center">{{ $wizardTitle }}</h1>

<div class="steps-scroll mb-3">
<ul class="steps">
@foreach ($stepRepo->all() as $key => $_step)
<?php
$stepClass = '';
if ($step->index() == $_step->index()) {
$stepClass = $errors->isEmpty() ? 'step-active' : 'step-error';
} elseif ($step->index() > $_step->index()) {
$stepClass = 'step-success';
}
?>
<li class="step {{ $stepClass }}">
<div class="step-content">
<span class="step-circle">{{ $_step->number() }}</span>
<span class="step-text">@lang($_step->label())</span>
</div>
</li>
@endforeach
</ul>
</div>
<div class="steps-scroll mb-3">
<ul class="steps">
@foreach ($stepRepo->all() as $key => $_step)
<?php
$stepClass = '';
if ($step->index() == $_step->index()) {
$stepClass = $errors->isEmpty() ? 'step-active' : 'step-error';
} elseif ($step->index() > $_step->index()) {
$stepClass = 'step-success';
}
?>
<li class="step {{ $stepClass }}">
<div class="step-content">
<span class="step-circle">{{ $_step->number() }}</span>
<span class="step-text">@lang($_step->label())</span>
</div>
</li>
@endforeach
</ul>
</div>

<form action="{{ action($postAction, [$step->slug()]) }}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
<form action="{{ action($postAction, [$step->slug()]) }}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}

@include($step->view(), compact('step', 'errors'))
@include($step->view(), compact('step', 'errors'))

<div class="d-flex justify-content-between align-items-center">
@if ($stepRepo->hasPrev())
<a href="{{ action($formAction, ['step' => $stepRepo->prevSlug()]) }}?trigger=back" class="btn btn-primary">
@lang('wizard::generic.back')
</a>
@else
<span></span>
@endif
<div class="d-flex justify-content-between align-items-center">
@if ($stepRepo->hasPrev())
<a href="{{ action($formAction, ['step' => $stepRepo->prevSlug()]) }}?trigger=back" class="btn btn-primary">
@lang('wizard::generic.back')
</a>
@else
<span></span>
@endif

@if ($stepRepo->hasNext())
<button type="submit" class="btn btn-primary">
@lang('wizard::generic.next')
</button>
@else
<button type="submit" class="btn btn-primary">
@lang('wizard::generic.done')
</button>
@endif
@if ($stepRepo->hasNext())
<button type="submit" class="btn btn-primary">
@lang('wizard::generic.next')
</button>
@else
<button type="submit" class="btn btn-primary">
@lang('wizard::generic.done')
</button>
@endif
</div>
</form>
</div>
</form>
</div>
</div>
@endsection
2 changes: 1 addition & 1 deletion resources/views/done.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@isset ($wizardData)
<div class="row justify-content-center mt-3">
<div class="col-sm-8">
<div class="col-md-8">
<ul class="list-group">
@foreach ($wizardData as $slug => $stepData)
@if ($stepRepo->find($slug))
Expand Down

0 comments on commit ef37f38

Please sign in to comment.