Merge pull request #2064 from brkcvn/wizard

Wizard
This commit is contained in:
Cüneyt Şentürk
2021-05-29 20:28:08 +03:00
committed by GitHub
34 changed files with 1824 additions and 821 deletions

View File

@ -1,4 +1,4 @@
<html lang="{{ app()->getLocale() }}">
<html>
@include('partials.wizard.head')
<body class="wizard-page">
@ -7,15 +7,22 @@
@stack('body_start')
<div id="app">
<div class="card-body">
<div class="document-loading" v-if="!page_loaded">
<div>
<i class="fas fa-spinner fa-pulse fa-7x"></i>
</div>
</div>
@include('partials.wizard.content')
@include('flash::message')
@yield('content')
</div>
</div>
@stack('body_end')
</div>
@include('partials.wizard.scripts')
</body>
</html>
</body>
</html>

View File

@ -1,22 +0,0 @@
@stack('content_start')
@stack('content_header_start')
<h1 class="text-white">
@yield('title')
@yield('new_button')
</h1>
@stack('content_header_end')
@stack('content_content_start')
@yield('content')
@stack('content_content_end')
<notifications></notifications>
<form id="form-dynamic-component" method="POST" action="#"></form>
<component v-bind:is="component"></component>
@stack('content_end')

View File

@ -1,14 +0,0 @@
@stack('pagination_start')
@if ($items->firstItem())
<div class="pull-left">
<small>{{ trans('pagination.showing', ['first' => $items->firstItem(), 'last' => $items->lastItem(), 'total' => $items->total(), 'type' => strtolower(trans_choice('general.' . $type, 2))]) }}</small>
</div>
<div class="pull-right">
{!! $items->withPath(request()->url())->withQueryString()->links() !!}
</div>
@else
<div class="pull-left">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
@stack('pagination_end')

View File

@ -4,6 +4,8 @@
<script src="{{ asset('public/vendor/bootstrap/dist/js/bootstrap.bundle.min.js') }}"></script>
<script src="{{ asset('public/vendor/js-cookie/js.cookie.js') }}"></script>
<script src="{{ asset('public/js/wizard/wizard.js?v=' . version('short')) }}"></script>
@stack('body_css')
@stack('body_stylesheet')

View File

@ -3,84 +3,5 @@
@section('title', trans('general.wizard'))
@section('content')
<div class="card">
{!! Form::model($company, [
'method' => 'PATCH',
'route' => ['wizard.companies.update'],
'id' => 'company',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button mb-0',
'novalidate' => true
]) !!}
<div id="wizard-loading"></div>
@include('partials.wizard.steps')
<div class="card-body">
<div id="wizard-loading"></div>
<div class="row mb--4">
<div class="col-md-12 {!! (!setting('apps.api_key', null)) ?: 'hidden' !!}">
<div class="form-group {{ $errors->has('api_key') ? 'has-error' : ''}}"
:class="[{'has-error': form.errors.get('api_key') }]">
{!! Form::label('api-key', trans('modules.api_key'), ['class' => 'form-control-label']) !!}
<div class="input-group input-group-merge">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fa fa-key"></i>
</span>
</div>
{!! Form::text('api_key', setting('apps.api_key', null), array_merge([
'class' => 'form-control',
'data-name' => 'api_key',
'data-value' => setting('apps.api_key', null),
'placeholder' => trans('general.form.enter', ['field' => trans('modules.api_key')]),
'v-model' => 'form.api_key'
], [])) !!}
</div>
<div class="invalid-feedback d-block" v-if="form.errors.has('api_key')" v-html="form.errors.get('api_key')"></div>
</div>
<p class="mb-0 mt--3">
<small>{!! trans('modules.get_api_key', ['url' => 'https://akaunting.com/dashboard']) !!}</small>
</p>
<br>
</div>
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::dateGroup('financial_start', trans('settings.localisation.financial_start'), 'calendar', ['id' => 'financial_start', 'class' => 'form-control datepicker', 'show-date-format' => 'j F', 'date-format' => 'd-m', 'autocomplete' => 'off'], Date::now()->startOfYear()->format('d-m')) }}
{{ Form::textareaGroup('address', trans('settings.company.address')) }}
{{ Form::fileGroup('logo', trans('settings.company.logo'), '', ['dropzone-class' => 'form-file']) }}
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12 text-right">
{!! Form::button(
'<span v-if="form.loading" class="btn-inner--icon"><i class="aka-loader"></i></span> <span :class="[{\'ml-0\': form.loading}]" class="btn-inner--text">' . trans('general.save') . '</span>',
[':disabled' => 'form.loading', 'type' => 'submit', 'class' => 'btn btn-icon btn-success']) !!}
<a href="{{ route('wizard.currencies.index') }}" id="wizard-skip" class="btn btn-white">
{{ trans('general.skip') }}
</a>
</div>
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/wizard/company.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,143 +3,5 @@
@section('title', trans('general.wizard'))
@section('content')
<div class="card">
@include('partials.wizard.steps')
<div class="card-body border-bottom-0">
<div class="row">
<div class="col-md-12 text-right">
<button type="button" @click="onAddCurrency" class="btn btn-success btn-sm">
{{ trans('general.add_new') }}
</button>
</div>
</div>
</div>
<div class="table-responsive">
{!! Form::open([
'route' => 'wizard.currencies.store',
'id' => 'currency',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button mb-0',
'novalidate' => true
]) !!}
<table class="table table-flush table-hover" id='tbl-currencies'>
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-4 col-md-3">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-3 d-none d-md-block">@sortablelink('code', trans('currencies.code'))</th>
<th class="col-md-2 d-none d-md-block">@sortablelink('rate', trans('currencies.rate'))</th>
<th class="col-xs-4 col-sm-4 col-md-2 ">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-4 col-md-2 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($currencies as $item)
<tr class="row align-items-center border-top-1" id="currency-{{ $item->id }}">
<td class="col-xs-4 col-sm-4 col-md-3">
<a href="javascript:void(0);" @click="onEditCurrency('{{ $item->id }}')">
{{ $item->name }}
</a>
</td>
<td class="col-md-3 d-none d-md-block">{{ $item->code }}</td>
<td class="col-md-2 d-none d-md-block">{{ $item->rate }}</td>
<td class="col-xs-4 col-sm-4 col-md-2">
@if (user()->can('update-settings-currencies'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
@else
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
@endif
@endif
</td>
<td class="col-xs-4 col-sm-4 col-md-2 text-center">
<div class="dropdown">
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<button type="button" class="dropdown-item" @click="onEditCurrency('{{ $item->id }}')">
{{ trans('general.edit') }}
</button>
@can('delete-settings-currencies')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'wizard.currencies.destroy') !!}
@endcan
</div>
</div>
</td>
</tr>
@endforeach
<tr class="row align-items-center border-top-1" v-show="show">
<td class="col-xs-4 col-sm-4 col-md-3">
{{ Form::textGroup('name', trans('general.name'), 'font', [], null, '') }}
</td>
<td class="col-md-3 d-none d-md-block">
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, null, ['required' => 'required', 'change' => 'onChangeCode', 'model' => 'form.code'], '') }}
</td>
<td class="col-md-2 d-none d-md-block">
{{ Form::textGroup('rate', trans('currencies.rate'), 'percentage', ['required' => 'required'], null, '') }}
</td>
<td class="col-xs-4 col-sm-4 col-md-2">
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</td>
<td class="col-xs-4 col-sm-4 col-md-2 text-center">
{!! Form::button(
trans('general.save'), [
':disabled' => 'form.loading',
'type' => 'submit',
'class' => 'btn btn-success',
]) !!}
<div class="d-none">
{{ Form::numberGroup('precision', trans('currencies.precision'), 'bullseye') }}
{{ Form::textGroup('symbol', trans('currencies.symbol.symbol'), 'font') }}
{{ Form::selectGroup('symbol_first', trans('currencies.symbol.position'), 'text-width', ['1' => trans('currencies.symbol.before'), '0' => trans('currencies.symbol.after')]) }}
{{ Form::textGroup('decimal_mark', trans('currencies.decimal_mark'), 'columns') }}
{{ Form::textGroup('thousands_separator', trans('currencies.thousands_separator'), 'columns', []) }}
</div>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="bulk_action_path" value="settings/currencies"/>
{!! Form::close() !!}
</div>
<div class="card-footer">
<div class="row">
<div class="col-sm-6">
<a href="{{ route('wizard.companies.edit') }}" class="btn btn-icon btn-white">
<span class="btn-inner--text">{{ trans('pagination.previous') }}</span>
</a>
</div>
<div class="col-sm-6 text-right">
<a href="{{ route('wizard.taxes.index') }}" id="wizard-skip" class="btn btn-icon btn-white">
<span class="btn-inner--text">{{ trans('pagination.next') }}</span>
</a>
</div>
</div>
</div>
</div>
@endsection
@push('scripts_start')
<script type="text/javascript">
var currencies = {!! json_encode($currencies->items()) !!}
</script>
<script src="{{ asset('public/js/wizard/currencies.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,68 +3,5 @@
@section('title', trans('general.wizard'))
@section('content')
<div class="card">
@include('partials.wizard.steps')
<div class="card-body bg-default">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div class="content-header">
<h3 class="text-white">{{ trans('modules.recommended_apps') }}</h3>
</div>
@if ($modules)
<div class="row">
@foreach ($modules->data as $module)
@include('partials.modules.item')
@endforeach
</div>
<div class="col-md-12">
<ul>
@if ($modules->current_page < $modules->last_page)
<li class="next"><a href="{{ url(request()->path()) }}?page={{ $modules->current_page + 1 }}" class="btn btn-default btn-sm">{!! trans('pagination.next') !!}</a></li>
@endif
@if ($modules->current_page > 1)
<li class="previous"><a href="{{ url(request()->path()) }}?page={{ $modules->current_page - 1 }}" class="btn btn-default btn-sm">{{ trans('pagination.previous') }}</a></li>
@endif
</ul>
</div>
@else
<div class="card">
<div class="card-body">
<p class="col-md-12">
{{ trans('modules.no_apps') }}
</p>
<p class="col-md-12">
<small>{!! trans('modules.developer') !!}</small>
</p>
</div>
</div>
@endif
</div>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-sm-6">
<a href="{{ route('wizard.taxes.index') }}" class="btn btn-icon btn-white">
<span class="btn-inner--text">{{ trans('pagination.previous') }}</span>
</a>
</div>
<div class="col-sm-6 text-right">
<a href="{{ route('dashboard') }}" id="wizard-skip" class="btn btn-icon btn-success">
<span class="btn-inner--text">{{ trans('general.go_to_dashboard') }}</span>
</a>
</div>
</div>
</div>
</div>
@endsection
@push('scripts_start')
<script src="{{ asset('public/js/wizard/finish.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,125 +3,5 @@
@section('title', trans('general.wizard'))
@section('content')
<div class="card">
@include('partials.wizard.steps')
<div class="card-body border-bottom-0">
<div class="row">
<div class="col-md-12 text-right">
<button type="button" @click="onAddTax" class="btn btn-success btn-sm">
{{ trans('general.add_new') }}
</button>
</div>
</div>
</div>
<div class="table-responsive">
{!! Form::open([
'route' => 'wizard.taxes.store',
'id' => 'tax',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button mb-0',
'novalidate' => true
]) !!}
<table class="table table-flush table-hover" id='tbl-taxes'>
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-4 col-md-3">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-3 d-none d-md-block">@sortablelink('rate', trans('taxes.rate_percent'))</th>
<th class="col-xs-4 col-sm-4 col-md-3">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-4 col-md-3 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($taxes as $item)
<tr class="row align-items-center border-top-1" id="tax-{{ $item->id }}">
<td class="col-xs-4 col-sm-4 col-md-3 tax-name">
<a href="javascript:void(0);" @click="onEditTax('{{ $item->id }}')">
{{ $item->name }}
</a>
</td>
<td class="col-md-3 d-none d-md-block">{{ $item->rate }}</td>
<td class="col-xs-4 col-sm-4 col-md-3">
@if (user()->can('update-settings-taxes'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success" class="mw-60">{{ trans('general.yes') }}</badge>
@else
<badge rounded type="danger" class="mw-60">{{ trans('general.no') }}</badge>
@endif
@endif
</td>
<td class="col-xs-4 col-sm-4 col-md-3 text-center">
<div class="dropdown">
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<button type="button" class="dropdown-item" @click="onEditTax('{{ $item->id }}')">
{{ trans('general.edit') }}
</button>
@can('delete-settings-taxes')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'wizard.taxes.destroy') !!}
@endcan
</div>
</div>
</td>
</tr>
@endforeach
<tr class="row align-items-center border-top-1" v-show="show">
<td class="col-xs-4 col-sm-4 col-md-3">
{{ Form::textGroup('name', trans('general.name'), 'font', [], null, '') }}
</td>
<td class="col-md-3 d-none d-md-block">
{{ Form::textGroup('rate', trans('currencies.rate'), 'percentage', ['required' => 'required'], null, '') }}
</td>
<td class="col-xs-4 col-sm-4 col-md-3">
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</td>
<td class="col-xs-4 col-sm-4 col-md-3 text-center">
{!! Form::button(
trans('general.save'), [
':disabled' => 'form.loading',
'type' => 'submit',
'class' => 'btn btn-success',
]) !!}
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="bulk_action_path" value="settings/taxes" />
{!! Form::close() !!}
</div>
<div class="card-footer">
<div class="row">
<div class="col-sm-6">
<a href="{{ route('wizard.currencies.index') }}" class="btn btn-icon btn-white">
<span class="btn-inner--text">{{ trans('pagination.previous') }}</span>
</a>
</div>
<div class="col-sm-6 text-right">
<a href="{{ route('wizard.finish.index') }}" id="wizard-skip" class="btn btn-icon btn-white">
<span class="btn-inner--text">{{ trans('pagination.next') }}</span>
</a>
</div>
</div>
</div>
</div>
@endsection
@push('scripts_start')
<script type="text/javascript">
var taxes = {!! json_encode($taxes->items()) !!}
</script>
<script src="{{ asset('public/js/wizard/taxes.js?v=' . version('short')) }}"></script>
@endpush