Merge pull request #567 from cuneytsenturk/wizard

Wizard
This commit is contained in:
Cüneyt Şentürk
2018-10-25 16:58:50 +03:00
committed by GitHub
43 changed files with 2173 additions and 16 deletions

View File

@ -102,10 +102,14 @@ return [
'partially' => 'Partially',
'partially_paid' => 'Partially Paid',
'export' => 'Export',
'finish' => 'Finish',
'wizard' => 'Wizard',
'skip' => 'Skip',
'enable' => 'Enable',
'disable' => 'Disable',
'select_all' => 'Select All',
'unselect_all' => 'Unselect All',
'go_to' => 'Go to :name',
'title' => [
'new' => 'New :type',
'edit' => 'Edit :type',

View File

@ -16,6 +16,8 @@ return [
'no_apps' => 'There are no apps in this category, yet.',
'developer' => 'Are you a developer? <a href="https://akaunting.com/blog/akaunting-app-store" target="_blank">Here</a> you can learn how to create an app and start selling today!',
'recommended_apps' => 'Recommended Apps',
'about' => 'About',
'added' => 'Added',

View File

@ -0,0 +1,20 @@
<html lang="{{ setting('general.default_locale') }}">
@include('partials.wizard.head')
<body class="hold-transition {{ setting('general.admin_theme', 'skin-green-light') }} sidebar-mini fixed">
@stack('body_start')
<!-- Site wrapper -->
<div class="wrapper">
@include('partials.wizard.content')
</div>
@stack('body_end')
<script type="text/javascript">
$('#wizard-skip, .stepwizard .btn.btn-default').on('click', function() {
$('#wizard-loading').html('<span class="wizard-loading-bar"><span class="wizard-loading-spin"><i class="fa fa-spinner fa-spin"></i></span></span>');
});
</script>
</body>
</html>

View File

@ -0,0 +1,39 @@
@stack('content_start')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper no-margin">
@stack('content_wrapper_start')
<!-- Content Header (Page header) -->
<section class="content-header content-center">
@stack('content_header_start')
<h1>
@yield('title')
@yield('new_button')
</h1>
@stack('content_header_end')
</section>
<!-- Main content -->
<section class="content content-center">
@include('flash::message')
@stack('content_content_start')
@yield('content')
@stack('content_content_end')
</section>
<!-- /.content -->
@stack('content_wrapper_end')
</div>
<!-- /.content-wrapper -->
<script type="text/javascript">
$('div.alert').not('.alert-important').delay(3000).fadeOut(350);
</script>
@stack('content_end')

View File

@ -0,0 +1,101 @@
<head>
@stack('head_start')
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title>@yield('title') - @setting('general.company_name')</title>
<!-- Bootstrap 3.3.6 -->
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/bootstrap/css/bootstrap.min.css') }}">
<!-- Font Awesome -->
<link rel="stylesheet" href="{{ asset('public/css/font-awesome.min.css') }}">
<!-- Ionicons -->
<link rel="stylesheet" href="{{ asset('public/css/ionicons.min.css') }}">
<!-- Theme style -->
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/dist/css/AdminLTE.min.css') }}">
<!-- AdminLTE Skins -->
@if (setting('general.admin_theme', 'skin-green-light') == 'skin-green-light')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/dist/css/skins/skin-green-light.min.css') }}">
@else
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/dist/css/skins/skin-black.min.css') }}">
<link rel="stylesheet" href="{{ asset('public/css/skin-black.css?v=' . version('short')) }}">
@endif
<!-- Select2 -->
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/select2/select2.min.css') }}">
<!-- App style -->
<link rel="stylesheet" href="{{ asset('public/css/app.css?v=' . version('short')) }}">
<link rel="stylesheet" href="{{ asset('public/css/akaunting-green.css?v=' . version('short')) }}">
<link rel="shortcut icon" href="{{ asset('public/img/favicon.ico') }}">
@stack('css')
@stack('stylesheet')
<style type="text/css">
.wizard-loading-bar {
font-size: 35px;
position: absolute;
z-index: 999999;
width: 100%;
height: 100%;
background: rgb(136, 136, 136);
opacity: 0.2;
-moz-border-radius-bottomleft: 1px;
-moz-border-radius-bottomright: 1px;
border-bottom-left-radius: 1px;
border-bottom-right-radius: 1px;font-size: 35px;
position: absolute;
z-index: 999999;
width: 100%;
height: 100%;
background: rgb(136, 136, 136);
opacity: 0.2;
-moz-border-radius-bottomleft: 1px;
-moz-border-radius-bottomright: 1px;
border-bottom-left-radius: 1px;
border-bottom-right-radius: 1px;
}
.wizard-loading-spin {
font-size: 100px;
position: absolute;
margin: auto;
color: #fff;
padding: 8% 40%;
z-index: 9999;
}
</style>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- jQuery 2.2.3 -->
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/jQuery/jquery-2.2.3.min.js') }}"></script>
<!-- Bootstrap 3.3.6 -->
<script src="{{ asset('vendor/almasaeed2010/adminlte/bootstrap/js/bootstrap.min.js') }}"></script>
<!-- SlimScroll -->
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/slimScroll/jquery.slimscroll.min.js') }}"></script>
<!-- FastClick -->
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/fastclick/fastclick.js') }}"></script>
<!-- AdminLTE App -->
<script src="{{ asset('vendor/almasaeed2010/adminlte/dist/js/app.min.js') }}"></script>
<!-- Select2 -->
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/select2/select2.min.js') }}"></script>
<!-- Mask Money -->
<script src="{{ asset('public/js/jquery/jquery.maskMoney.js') }}"></script>
<script src="{{ asset('public/js/app.js?v=' . version('short')) }}"></script>
@stack('js')
@stack('scripts')
@stack('head_end')
</head>

View File

@ -0,0 +1,16 @@
@stack('pagination_start')
@if ($items->firstItem())
<div class="pull-left" style="margin-top: 7px;">
<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->appends(request()->except('page'))->links() !!}
</div>
@else
<div class="pull-left">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
@stack('pagination_end')

View File

@ -39,6 +39,8 @@
{{ Form::textareaGroup('company_address', trans('settings.company.address')) }}
{{ Form::fileGroup('company_logo', trans('settings.company.logo')) }}
{!! Form::hidden('wizard', null, ['id' => 'wizard']) !!}
</div>
<div class="tab-pane tab-margin" id="localisation">

View File

@ -0,0 +1,131 @@
@extends('layouts.wizard')
@section('title', trans('general.wizard'))
@section('content')
<!-- Default box -->
<div class="box box-solid">
<div class="box-body">
<div class="stepwizard">
<div class="stepwizard-row setup-panel">
<div class="stepwizard-step col-xs-3">
<a href="#step-1" type="button" class="btn btn-success btn-circle">1</a>
<p><small>{{ trans_choice('general.companies', 1) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<button type="button" class="btn btn-default btn-circle" disabled="disabled">2</button>
<p><small>{{ trans_choice('general.currencies', 2) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<button type="button" class="btn btn-default btn-circle" disabled="disabled">3</button>
<p><small>{{ trans_choice('general.taxes', 2) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<button type="button" class="btn btn-default btn-circle" disabled="disabled">4</button>
<p><small>{{ trans_choice('general.finish', 1) }}</small></p>
</div>
</div>
</div>
</div>
</div>
<div class="box box-success">
<div id="wizard-loading"></div>
{!! Form::model($company, ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/companies'], 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="box-header with-border">
<h3 class="box-title">{{ trans_choice('general.companies', 1) }}</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="col-md-12 {!! (!setting('general.api_token', null)) ?: 'hidden' !!}">
<div class="form-group required {{ $errors->has('api_token') ? 'has-error' : ''}}">
{!! Form::label('sale_price', trans('modules.api_token'), ['class' => 'control-label']) !!}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
{!! Form::text('api_token', setting('general.api_token', null), ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.enter', ['field' => trans('modules.api_token')])]) !!}
</div>
{!! $errors->first('api_token', '<p class="help-block">:message</p>') !!}
</div>
<p>
{!! trans('modules.token_link') !!}
</p>
</br>
</div>
{{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }}
{{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }}
{{ Form::textareaGroup('company_address', trans('settings.company.address')) }}
{{ Form::fileGroup('company_logo', trans('settings.company.logo')) }}
</div>
<!-- /.box-body -->
<div class="box-footer">
<div class="col-md-12">
<div class="form-group no-margin">
{!! Form::button('<span class="fa fa-save"></span> &nbsp;' . trans('general.save'), ['type' => 'submit', 'class' => 'btn btn-success button-submit', 'data-loading-text' => trans('general.loading')]) !!}
<a href="{{ url('wizard/currencies') }}" id="wizard-skip" class="btn btn-default"><span class="fa fa-share"></span> &nbsp;{{ trans('general.skip') }}</a>
</div>
</div>
</div>
<!-- /.box-footer -->
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function() {
$('#company_logo').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
@if($company->company_logo)
placeholder : '{{ $company->company_logo->basename }}',
@else
placeholder : '{{ trans('general.form.no_file_selected') }}',
@endif
});
@if($company->company_logo)
company_logo_html = '<span class="company_logo">';
company_logo_html += ' <a href="{{ url('uploads/' . $company->company_logo->id . '/download') }}">';
company_logo_html += ' <span id="download-company_logo" class="text-primary">';
company_logo_html += ' <i class="fa fa-file-{{ $company->company_logo->aggregate_type }}-o"></i> {{ $company->company_logo->basename }}';
company_logo_html += ' </span>';
company_logo_html += ' </a>';
company_logo_html += ' {!! Form::open(['id' => 'company_logo-' . $company->company_logo->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $company->company_logo->id)], 'style' => 'display:inline']) !!}';
company_logo_html += ' <a id="remove-company_logo" href="javascript:void();">';
company_logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
company_logo_html += ' </a>';
company_logo_html += ' <input type="hidden" name="page" value="setting" />';
company_logo_html += ' <input type="hidden" name="key" value="general.company_logo" />';
company_logo_html += ' <input type="hidden" name="value" value="{{ $company->company_logo->id }}" />';
company_logo_html += ' {!! Form::close() !!}';
company_logo_html += '</span>';
$('.form-group.col-md-6 .fancy-file .fake-file').append(company_logo_html);
$(document).on('click', '#remove-company_logo', function (e) {
confirmDelete("#company_logo-{!! $company->company_logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $company->company_logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endif
});
</script>
@endpush

View File

@ -0,0 +1,30 @@
<tr id="currency-create">
<td>
{{ Form::textGroup('name', trans('general.name'), 'id-card-o', ['required' => 'required'], null, '') }}
</td>
<td class="hidden-xs">
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, null, ['required' => 'required'], '') }}
</td>
<td>
{{ Form::textGroup('rate', trans('currencies.rate'), 'money', ['required' => 'required'], null, '') }}
</td>
<td class="hidden-xs">
{{ Form::radioGroup('enabled', trans('general.enabled'), trans('general.yes'), trans('general.no'), [], 'col-md-12 currency-enabled-radio-group') }}
</td>
<td class="text-center">
{!! Form::button('<span class="fa fa-save"></span>', ['type' => 'button', 'class' => 'btn btn-success currency-submit', 'data-loading-text' => trans('general.loading'), 'data-href' => url('wizard/currencies/'), 'style' => 'padding: 9px 14px; margin-top: 10px;']) !!}
</td>
<td class="hidden">
{{ 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', []) }}
{{ Form::radioGroup('default_currency', trans('currencies.default')) }}
</td>
</tr>

View File

@ -0,0 +1,32 @@
<tr id="currency-edit">
<td>
{{ Form::textGroup('name', trans('general.name'), 'id-card-o', [], $item->name, '') }}
</td>
<td class="hidden-xs">
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, $item->code, [], '') }}
</td>
<td>
{{ Form::textGroup('rate', trans('currencies.rate'), 'money', [], $item->rate, '') }}
</td>
<td class="hidden-xs">
{{ Form::radioGroup('enabled', trans('general.enabled'), trans('general.yes'), trans('general.no'), [], 'col-md-12') }}
</td>
<td class="text-center">
{!! Form::button('<span class="fa fa-save"></span>', ['type' => 'button', 'class' => 'btn btn-success currency-updated', 'data-loading-text' => trans('general.loading'), 'data-href' => url('wizard/currencies/' . $item->id), 'style' => 'padding: 9px 14px; margin-top: 10px;']) !!}
</td>
<td class="hidden">
{{ Form::numberGroup('precision', trans('currencies.precision'), 'bullseye', [], $item->precision) }}
{{ Form::textGroup('symbol', trans('currencies.symbol.symbol'), 'font', [], $item->symbol, '') }}
{{ Form::selectGroup('symbol_first', trans('currencies.symbol.position'), 'text-width', ['1' => trans('currencies.symbol.before'), '0' => trans('currencies.symbol.after')], $item->symbol_first) }}
{{ Form::textGroup('decimal_mark', trans('currencies.decimal_mark'), 'columns', [], $item->decimal_mark, '') }}
{{ Form::textGroup('thousands_separator', trans('currencies.thousands_separator'), 'columns', [], $item->thousands_separator) }}
{{ Form::radioGroup('default_currency', trans('currencies.default')) }}
{{ Form::hidden('id', $item->id) }}
</td>
</tr>

View File

@ -0,0 +1,379 @@
@extends('layouts.wizard')
@section('title', trans('general.wizard'))
@section('content')
<!-- Default box -->
<div class="box box-solid">
<div class="box-body">
<div class="stepwizard">
<div class="stepwizard-row setup-panel">
<div class="stepwizard-step col-xs-3">
<a href="{{ url('wizard/companies') }}" type="button" class="btn btn-default btn-circle">1</a>
<p><small>{{ trans_choice('general.companies', 1) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<a href="#step-2" type="button" class="btn btn-success btn-circle">2</a>
<p><small>{{ trans_choice('general.currencies', 2) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<button type="button" class="btn btn-default btn-circle" disabled="disabled">3</button>
<p><small>{{ trans_choice('general.taxes', 2) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<button type="button" class="btn btn-default btn-circle" disabled="disabled">4</button>
<p><small>{{ trans_choice('general.finish', 1) }}</small></p>
</div>
</div>
</div>
</div>
</div>
<div class="box box-success">
<div id="wizard-loading"></div>
<div class="box-header with-border">
<h3 class="box-title">{{ trans_choice('general.currencies', 1) }}</h3>
<span class="new-button"><a href="javascript:void(0);" data-href="{{ url('wizard/currencies/create') }}" class="btn btn-success btn-sm currency-create"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-currencies">
<thead>
<tr>
<th class="col-md-4">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-3 hidden-xs">@sortablelink('code', trans('currencies.code'))</th>
<th class="col-md-2">@sortablelink('rate', trans('currencies.rate'))</th>
<th class="col-md-2 hidden-xs">@sortablelink('enabled', trans_choice('general.statuses', 1))</th>
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($currencies as $item)
<tr id="currency-{{ $item->id }}" data-href="{{ url('wizard/currencies/' . $item->id . '/delete') }}">
<td class="currency-name"><a href="javascript:void(0);" data-id="{{ $item->id }}" data-href="{{ url('wizard/currencies/' . $item->id . '/edit') }}" class="currency-edit">{{ $item->name }}</a></td>
<td class="currency-code hidden-xs">{{ $item->code }}</td>
<td class="currency-rate">{{ $item->rate }}</td>
<td class="currency-status hidden-xs">
@if ($item->enabled)
<span class="label label-success">{{ trans('general.enabled') }}</span>
@else
<span class="label label-danger">{{ trans('general.disabled') }}</span>
@endif
</td>
<td class="currency-action text-center">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">
<i class="fa fa-ellipsis-h"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="javascript:void(0);" data-id="{{ $item->id }}" data-href="{{ url('wizard/currencies/' . $item->id . '/edit') }}" class="currency-edit">{{ trans('general.edit') }}</a></li>
@if ($item->enabled)
<li><a href="javascript:void(0);" data-href="{{ url('wizard/currencies/' . $item->id . '/disable') }}" class="currency-disable">{{ trans('general.disable') }}</a></li>
@else
<li><a href="javascript:void(0);" data-href="{{ url('wizard/currencies/' . $item->id . '/enable') }}" class="currency-enable">{{ trans('general.enable') }}</a></li>
@endif
@permission('delete-settings-currencies')
<li class="divider"></li>
<li>
{!! Form::button(trans('general.delete'), array(
'type' => 'button',
'class' => 'delete-link',
'title' => trans('general.delete'),
'onclick' => 'confirmCurrency("' . '#currency-' . $item->id . '", "' . trans_choice('general.currencies', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . $item->name . '</strong>', 'type' => mb_strtolower(trans_choice('general.currencies', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
)) !!}
</li>
@endpermission
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<div class="col-md-12">
<div class="form-group no-margin">
<a href="{{ url('wizard/taxes') }}" id="wizard-skip" class="btn btn-default"><span class="fa fa-share"></span> &nbsp;{{ trans('general.skip') }}</a>
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
@endsection
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).on('click', '.currency-create', function (e) {
$('#currency-create').remove();
$('#currency-edit').remove();
data_href = $(this).data('href');
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
$('#tbl-currencies tbody').append(json['html']);
$("#code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans('currencies.code')]) }}"
});
$('.currency-enabled-radio-group #enabled_1').trigger('click');
$('#name').focus();
}
}
});
});
$(document).on('click', '.currency-submit', function (e) {
$(this).html('<span class="fa fa-spinner fa-pulse"></span>');
$('.help-block').remove();
data_href = $(this).data('href');
$.ajax({
url: '{{ url("wizard/currencies") }}',
type: 'POST',
dataType: 'JSON',
data: $('#tbl-currencies input[type=\'number\'], #tbl-currencies input[type=\'text\'], #tbl-currencies input[type=\'radio\'], #tbl-currencies input[type=\'hidden\'], #tbl-currencies textarea, #tbl-currencies select').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(json) {
$('.currency-submit').html('<span class="fa fa-save"></span>');
if (json['success']) {
currency = json['data'];
$('#currency-create').remove();
$('#currency-edit').remove();
html = '<tr id="currency-' + currency.id + '" data-href="wizard/currencies/' + currency.id + '/delete">';
html += ' <td class="currency-name">';
html += ' <a href="javascript:void(0);" data-id="' + currency.id + '" data-href="wizard/currencies/' + currency.id + '/edit" class="currency-edit">' + currency.name + '</a>';
html += ' </td>';
html += ' <td class="currency-code hidden-xs">' + currency.code + '</td>';
html += ' <td class="currency-rate">' + currency.rate + '</td>';
html += ' <td class="currency-status hidden-xs">';
html += ' <span class="label label-success">Enabled</span>';
html += ' </td>';
html += ' <td class="currency-action text-center">';
html += ' <div class="btn-group">';
html += ' <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">';
html += ' <i class="fa fa-ellipsis-h"></i>';
html += ' </button>';
html += ' <ul class="dropdown-menu dropdown-menu-right">';
html += ' <li><a href="javascript:void(0);" data-id="' + currency.id + '" data-href="wizard/currencies/' + currency.id + '/edit" class="currency-edit">{{ trans('general.edit') }}</a></li>';
html += ' <li><a href="javascript:void(0);" data-href="wizard/currencies/' + currency.id + '/disable" class="currency-disable">{{ trans('general.disable') }}</a></li>';
html += ' <li class="divider"></li>';
html += ' <li>';
html += ' <button type="button" class="delete-link" title="{{ trans('general.delete') }}" onclick="confirmCurrency("#currency-' + currency.id + '", "{{ trans_choice('general.currencies', 2) }}", "{{ trans('general.delete_confirm', ['name' => '<strong>' . $item->name . '</strong>', 'type' => mb_strtolower(trans_choice('general.currencies', 1))]) }}", "{{ trans('general.cancel') }}", "{{ trans('general.delete') }}")">{{ trans('general.delete') }}</button>';
html += ' </li>';
html += ' </ul>';
html += ' </div>';
html += ' </td>';
html += '</tr>';
$('#tbl-currencies tbody').append(html);
}
},
error: function(data){
$('.currency-submit').html('<span class="fa fa-save"></span>');
var errors = data.responseJSON;
if (typeof errors !== 'undefined') {
if (errors.name) {
$('#tbl-currencies #name').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.name + '</p>');
}
if (errors.code) {
$('#tbl-currencies #code').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.code + '</p>');
}
if (errors.rate) {
$('#tbl-currencies #rate').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.rate + '</p>');
}
}
}
});
});
$(document).on('click', '.currency-edit', function (e) {
$('#currency-create').remove();
$('#currency-edit').remove();
data_href = $(this).data('href');
data_id = $(this).data('id');
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
$('#currency-' + data_id).after(json['html']);
$("#code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans('currencies.code')]) }}"
});
$('.currency-enabled-radio-group #enabled_1').trigger();
}
}
});
});
$(document).on('click', '.currency-updated', function (e) {
$(this).html('<span class="fa fa-spinner fa-pulse"></span>');
$('.help-block').remove();
data_href = $(this).data('href');
$.ajax({
url: data_href,
type: 'PATCH',
dataType: 'JSON',
data: $('#tbl-currencies input[type=\'number\'], #tbl-currencies input[type=\'text\'], #tbl-currencies input[type=\'radio\'], #tbl-currencies input[type=\'hidden\'], #tbl-currencies textarea, #tbl-currencies select').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(json) {
$('.currency-updated').html('<span class="fa fa-save"></span>');
if (json['success']) {
$('#currency-create').remove();
$('#currency-edit').remove();
}
},
error: function(data){
$('.currency-updated').html('<span class="fa fa-save"></span>');
var errors = data.responseJSON;
if (typeof errors !== 'undefined') {
if (errors.name) {
$('#tbl-currencies #name').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.name + '</p>');
}
if (errors.code) {
$('#tbl-currencies #code').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.code + '</p>');
}
if (errors.rate) {
$('#tbl-currencies #rate').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.rate + '</p>');
}
}
}
});
});
$(document).on('click', '.currency-disable', function (e) {
data_href = $(this).data('href');
currency_tr = $(this).parent().parent().parent().parent().parent();
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
currency_tr.find('.currency-status').html('<span class="label label-danger">{{ trans('general.disabled') }}</span>');
}
}
});
});
$(document).on('click', '.currency-enable', function (e) {
data_href = $(this).data('href');
currency_tr = $(this).parent().parent().parent().parent().parent();
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
currency_tr.find('.currency-status').html('<span class="label label-success">{{ trans('general.enabled') }}</span>');
}
}
});
});
$(document).on('change', '#code', function (e) {
$.ajax({
url: '{{ url("settings/currencies/config") }}',
type: 'GET',
dataType: 'JSON',
data: 'code=' + $(this).val(),
success: function(data) {
$('#precision').val(data.precision);
$('#symbol').val(data.symbol);
$('#symbol_first').val(data.symbol_first);
$('#decimal_mark').val(data.decimal_mark);
$('#thousands_separator').val(data.thousands_separator);
// This event Select2 Stylesheet
$('#symbol_first').trigger('change');
}
});
});
function confirmCurrency(tr_id, title, message, button_cancel, button_delete) {
$('#confirm-modal').remove();
var html = '';
html += '<div class="modal fade" id="confirm-modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalLabel" aria-hidden="true">';
html += ' <div class="modal-dialog">';
html += ' <div class="modal-content">';
html += ' <div class="modal-header">';
html += ' <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>';
html += ' <h4 class="modal-title" id="confirmModalLabel">' + title + '</h4>';
html += ' </div>';
html += ' <div class="modal-body">';
html += ' <p>' + message + '</p>';
html += ' <p></p>';
html += ' </div>';
html += ' <div class="modal-footer">';
html += ' <div class="pull-left">';
html += ' <button type="button" class="btn btn-danger" onclick="deleteCurrency(\'' + tr_id + '\');">' + button_delete + '</button>';
html += ' <button type="button" class="btn btn-default" data-dismiss="modal">' + button_cancel + '</button>';
html += ' </div>';
html += ' </div>';
html += ' </div>';
html += ' </div>';
html += '</div>';
$('body').append(html);
$('#confirm-modal').modal('show');
}
function deleteCurrency(tr_id) {
data_href = $(tr_id).data('href');
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
$(tr_id).remove();
}
}
});
}
</script>
@endpush

View File

@ -0,0 +1,88 @@
@extends('layouts.wizard')
@section('title', trans('general.wizard'))
@section('content')
<!-- Default box -->
<div class="box box-solid">
<div class="box-body">
<div class="stepwizard">
<div class="stepwizard-row setup-panel">
<div class="stepwizard-step col-xs-3">
<a href="{{ url('wizard/companies') }}" type="button" class="btn btn-default btn-circle">1</a>
<p><small>{{ trans_choice('general.companies', 1) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<a href="{{ url('wizard/currencies') }}" type="button" class="btn btn-default btn-circle">2</a>
<p><small>{{ trans_choice('general.currencies', 2) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<a href="{{ url('wizard/taxes') }}" type="button" class="btn btn-default btn-circle">3</a>
<p><small>{{ trans_choice('general.taxes', 2) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<a href="#step-4" type="button" class="btn btn-success btn-circle">4</a>
<p><small>{{ trans_choice('general.finish', 1) }}</small></p>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 50px;">
<div class="col-md-12 no-padding-right text-center">
<a href="{{ url('/') }}" class="btn btn-lg btn-success"><span class="fa fa-dashboard"></span> &nbsp;{{ trans('general.go_to', ['name' => trans('general.dashboard')]) }}</a>
</div>
</div>
<div class="row">
<div class="col-md-12 no-padding-right">
<div class="content-header no-padding-left">
<h3>{{ trans('modules.recommended_apps') }}</h3>
</div>
@if ($modules)
@foreach ($modules->data as $module)
@include('partials.modules.item')
@endforeach
<div class="col-md-12 no-padding-left">
<ul class="pager nomargin">
@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="box box-success">
<div class="box-body">
<p class="col-md-12" style="margin-top: 15px">
{{ trans('modules.no_apps') }}
</p>
<p class="col-md-12" style="margin-top: 20px">
<small>{!! trans('modules.developer') !!}</small>
</p>
</div>
<!-- /.box-body -->
</div>
@endif
</div>
</div>
@endsection
@push('css')
<link rel="stylesheet" href="{{ asset('public/css/modules.css?v=' . version('short')) }}">
@endpush
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function() {
});
</script>
@endpush

View File

@ -0,0 +1,14 @@
<tr id="tax-create">
<td>
{{ Form::textGroup('name', trans('general.name'), 'id-card-o', ['required' => 'required'], null, '') }}
</td>
<td>
{{ Form::textGroup('rate', trans('currencies.rate'), 'money', ['required' => 'required'], null, '') }}
</td>
<td class="hidden-xs">
{{ Form::radioGroup('enabled', trans('general.enabled'), trans('general.yes'), trans('general.no'), [], 'col-md-12 tax-enabled-radio-group') }}
</td>
<td class="text-center">
{!! Form::button('<span class="fa fa-save"></span>', ['type' => 'button', 'class' => 'btn btn-success tax-submit', 'data-loading-text' => trans('general.loading'), 'data-href' => url('wizard/taxes'), 'style' => 'padding: 9px 14px; margin-top: 10px;']) !!}
</td>
</tr>

View File

@ -0,0 +1,14 @@
<tr id="tax-edit">
<td>
{{ Form::textGroup('name', trans('general.name'), 'id-card-o', ['required' => 'required'], $item->name, '') }}
</td>
<td>
{{ Form::textGroup('rate', trans('currencies.rate'), 'money', ['required' => 'required'], $item->rate, '') }}
</td>
<td class="hidden-xs">
{{ Form::radioGroup('enabled', trans('general.enabled'), trans('general.yes'), trans('general.no'), [], 'col-md-12') }}
</td>
<td class="text-center">
{!! Form::button('<span class="fa fa-save"></span>', ['type' => 'button', 'class' => 'btn btn-success tax-updated', 'data-loading-text' => trans('general.loading'), 'data-href' => url('wizard/taxes/' . $item->id), 'style' => 'padding: 9px 14px; margin-top: 10px;']) !!}
</td>
</tr>

View File

@ -0,0 +1,377 @@
@extends('layouts.wizard')
@section('title', trans('general.wizard'))
@section('content')
<!-- Default box -->
<div class="box box-solid">
<div class="box-body">
<div class="stepwizard">
<div class="stepwizard-row setup-panel">
<div class="stepwizard-step col-xs-3">
<a href="{{ url('wizard/companies') }}" type="button" class="btn btn-default btn-circle">1</a>
<p><small>{{ trans_choice('general.companies', 1) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<a href="{{ url('wizard/currencies') }}" type="button" class="btn btn-default btn-circle">2</a>
<p><small>{{ trans_choice('general.currencies', 2) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<a href="#step-3" type="button" class="btn btn-success btn-circle">3</a>
<p><small>{{ trans_choice('general.taxes', 2) }}</small></p>
</div>
<div class="stepwizard-step col-xs-3">
<button type="button" class="btn btn-default btn-circle" disabled="disabled">4</button>
<p><small>{{ trans_choice('general.finish', 1) }}</small></p>
</div>
</div>
</div>
</div>
</div>
<div class="box box-success">
<div id="wizard-loading"></div>
<div class="box-header with-border">
<h3 class="box-title">{{ trans_choice('general.taxes', 1) }}</h3>
<span class="new-button"><a href="javascript:void(0);" data-href="{{ url('wizard/taxes/create') }}" class="btn btn-success btn-sm tax-create"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-taxes">
<thead>
<tr>
<th class="col-md-5">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-4">@sortablelink('rate', trans('taxes.rate_percent'))</th>
<th class="col-md-2 hidden-xs">@sortablelink('enabled', trans_choice('general.statuses', 1))</th>
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($taxes as $item)
<tr id="tax-{{ $item->id }}" data-href="{{ url('wizard/taxes/' . $item->id . '/delete') }}">
<td class="tax-name"><a href="javascript:void(0);" data-id="{{ $item->id }}" data-href="{{ url('wizard/taxes/' . $item->id . '/edit') }}" class="tax-edit">{{ $item->name }}</a></td>
<td class="tax-rate">{{ $item->rate }}</td>
<td class="tax-status hidden-xs">
@if ($item->enabled)
<span class="label label-success">{{ trans('general.enabled') }}</span>
@else
<span class="label label-danger">{{ trans('general.disabled') }}</span>
@endif
</td>
<td class="tax-action text-center">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">
<i class="fa fa-ellipsis-h"></i>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="javascript:void(0);" data-href="{{ url('wizard/taxes/' . $item->id . '/edit') }}" class="tax-edit">{{ trans('general.edit') }}</a></li>
@if ($item->enabled)
<li><a href="javascript:void(0);" data-href="{{ url('wizard/taxes/' . $item->id . '/disable') }}" class="tax-disable">{{ trans('general.disable') }}</a></li>
@else
<li><a href="javascript:void(0);" data-href="{{ url('wizard/taxes/' . $item->id . '/enable') }}" class="tax-enable">{{ trans('general.enable') }}</a></li>
@endif
@permission('delete-settings-taxes')
<li class="divider"></li>
<li>
{!! Form::button(trans('general.delete'), array(
'type' => 'button',
'class' => 'delete-link',
'title' => trans('general.delete'),
'onclick' => 'confirmTax("' . '#tax-' . $item->id . '", "' . trans_choice('general.taxes', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . $item->name . '</strong>', 'type' => mb_strtolower(trans_choice('general.taxes', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
)) !!}
</li>
@endpermission
</ul>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<div class="col-md-12">
<div class="form-group no-margin">
<a href="{{ url('wizard/finish') }}" id="wizard-skip" class="btn btn-default"><span class="fa fa-share"></span> &nbsp;{{ trans('general.skip') }}</a>
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
@endsection
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).on('click', '.tax-create', function (e) {
$('#tax-create').remove();
$('#tax-edit').remove();
data_href = $(this).data('href');
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
$('#tbl-taxes tbody').append(json['html']);
$("#code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans('taxes.code')]) }}"
});
$('.tax-enabled-radio-group #enabled_1').trigger('click');
$('#name').focus();
}
}
});
});
$(document).on('click', '.tax-submit', function (e) {
$(this).html('<span class="fa fa-spinner fa-pulse"></span>');
$('.help-block').remove();
data_href = $(this).data('href');
$.ajax({
url: '{{ url("wizard/taxes") }}',
type: 'POST',
dataType: 'JSON',
data: $('#tbl-taxes input[type=\'number\'], #tbl-taxes input[type=\'text\'], #tbl-taxes input[type=\'radio\'], #tbl-taxes input[type=\'hidden\'], #tbl-taxes textarea, #tbl-taxes select').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(json) {
$('.tax-submit').html('<span class="fa fa-save"></span>');
if (json['success']) {
tax = json['data'];
$('#tax-create').remove();
$('#tax-edit').remove();
html = '<tr id="tax-' + tax.id + '" data-href="wizard/taxes/' + tax.id + '/delete">';
html += ' <td class="tax-name">';
html += ' <a href="javascript:void(0);" data-id="' + tax.id + '" data-href="wizard/taxes/' + tax.id + '/edit" class="tax-edit">' + tax.name + '</a>';
html += ' </td>';
html += ' <td class="tax-rate">' + tax.rate + '</td>';
html += ' <td class="tax-status hidden-xs">';
html += ' <span class="label label-success">Enabled</span>';
html += ' </td>';
html += ' <td class="tax-action text-center">';
html += ' <div class="btn-group">';
html += ' <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">';
html += ' <i class="fa fa-ellipsis-h"></i>';
html += ' </button>';
html += ' <ul class="dropdown-menu dropdown-menu-right">';
html += ' <li><a href="javascript:void(0);" data-id="' + tax.id + '" data-href="wizard/taxes/' + tax.id + '/edit" class="tax-edit">{{ trans('general.edit') }}</a></li>';
html += ' <li><a href="javascript:void(0);" data-href="wizard/taxes/' + tax.id + '/disable" class="tax-disable">{{ trans('general.disable') }}</a></li>';
html += ' <li class="divider"></li>';
html += ' <li>';
html += ' <button type="button" class="delete-link" title="{{ trans('general.delete') }}" onclick="confirmCurrency("#tax-' + tax.id + '", "{{ trans_choice('general.taxes', 2) }}", "{{ trans('general.delete_confirm', ['name' => '<strong>' . $item->name . '</strong>', 'type' => mb_strtolower(trans_choice('general.taxes', 1))]) }}", "{{ trans('general.cancel') }}", "{{ trans('general.delete') }}")">{{ trans('general.delete') }}</button>';
html += ' </li>';
html += ' </ul>';
html += ' </div>';
html += ' </td>';
html += '</tr>';
$('#tbl-taxes tbody').append(html);
}
},
error: function(data){
$('.tax-submit').html('<span class="fa fa-save"></span>');
var errors = data.responseJSON;
if (typeof errors !== 'undefined') {
if (errors.name) {
$('#tbl-taxes #name').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.name + '</p>');
}
if (errors.code) {
$('#tbl-taxes #code').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.code + '</p>');
}
if (errors.rate) {
$('#tbl-taxes #rate').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.rate + '</p>');
}
}
}
});
});
$(document).on('click', '.tax-edit', function (e) {
$('#tax-create').remove();
$('#tax-edit').remove();
data_href = $(this).data('href');
data_id = $(this).data('id');
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
$('#tax-' + data_id).after(json['html']);
$("#code").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans('taxes.code')]) }}"
});
$('.tax-enabled-radio-group #enabled_1').trigger();
}
}
});
});
$(document).on('click', '.tax-updated', function (e) {
$(this).html('<span class="fa fa-spinner fa-pulse"></span>');
$('.help-block').remove();
data_href = $(this).data('href');
$.ajax({
url: data_href,
type: 'PATCH',
dataType: 'JSON',
data: $('#tbl-taxes input[type=\'number\'], #tbl-taxes input[type=\'text\'], #tbl-taxes input[type=\'radio\'], #tbl-taxes input[type=\'hidden\'], #tbl-taxes textarea, #tbl-taxes select').serialize(),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(json) {
$('.tax-updated').html('<span class="fa fa-save"></span>');
if (json['success']) {
$('#tax-create').remove();
$('#tax-edit').remove();
}
},
error: function(data){
$('.tax-updated').html('<span class="fa fa-save"></span>');
var errors = data.responseJSON;
if (typeof errors !== 'undefined') {
if (errors.name) {
$('#tbl-taxes #name').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.name + '</p>');
}
if (errors.code) {
$('#tbl-taxes #code').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.code + '</p>');
}
if (errors.rate) {
$('#tbl-taxes #rate').parent().after('<p class="help-block" style="color: #ca1313;">' + errors.rate + '</p>');
}
}
}
});
});
$(document).on('click', '.tax-disable', function (e) {
data_href = $(this).data('href');
tax_tr = $(this).parent().parent().parent().parent().parent();
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
tax_tr.find('.tax-status').html('<span class="label label-danger">{{ trans('general.disabled') }}</span>');
}
}
});
});
$(document).on('click', '.tax-enable', function (e) {
data_href = $(this).data('href');
tax_tr = $(this).parent().parent().parent().parent().parent();
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
tax_tr.find('.tax-status').html('<span class="label label-success">{{ trans('general.enabled') }}</span>');
}
}
});
});
$(document).on('change', '#code', function (e) {
$.ajax({
url: '{{ url("settings/taxes/config") }}',
type: 'GET',
dataType: 'JSON',
data: 'code=' + $(this).val(),
success: function(data) {
$('#precision').val(data.precision);
$('#symbol').val(data.symbol);
$('#symbol_first').val(data.symbol_first);
$('#decimal_mark').val(data.decimal_mark);
$('#thousands_separator').val(data.thousands_separator);
// This event Select2 Stylesheet
$('#symbol_first').trigger('change');
}
});
});
function confirmCurrency(tr_id, title, message, button_cancel, button_delete) {
$('#confirm-modal').remove();
var html = '';
html += '<div class="modal fade" id="confirm-modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalLabel" aria-hidden="true">';
html += ' <div class="modal-dialog">';
html += ' <div class="modal-content">';
html += ' <div class="modal-header">';
html += ' <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>';
html += ' <h4 class="modal-title" id="confirmModalLabel">' + title + '</h4>';
html += ' </div>';
html += ' <div class="modal-body">';
html += ' <p>' + message + '</p>';
html += ' <p></p>';
html += ' </div>';
html += ' <div class="modal-footer">';
html += ' <div class="pull-left">';
html += ' <button type="button" class="btn btn-danger" onclick="deleteCurrency(\'' + tr_id + '\');">' + button_delete + '</button>';
html += ' <button type="button" class="btn btn-default" data-dismiss="modal">' + button_cancel + '</button>';
html += ' </div>';
html += ' </div>';
html += ' </div>';
html += ' </div>';
html += '</div>';
$('body').append(html);
$('#confirm-modal').modal('show');
}
function deleteCurrency(tr_id) {
data_href = $(tr_id).data('href');
$.ajax({
url: data_href,
type: 'GET',
dataType: 'JSON',
success: function(json) {
if (json['success']) {
$(tr_id).remove();
}
}
});
}
</script>
@endpush