v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@@ -1,30 +0,0 @@
<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

@@ -1,32 +0,0 @@
<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), 'data-id' => $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

@@ -3,391 +3,188 @@
@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', 2) }}</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>
<div class="card">
<div class="card-body">
<div class="container-fluid">
<div class="row mb--4">
<hr class="wizard-line">
<div class="col-md-3">
<div class="text-center">
<a href="{{ url('wizard/companies') }}">
<button type="button" class="btn btn-secondary btn-lg wizard-steps wizard-steps-color-active rounded-circle">
<span class="btn-inner--icon wizard-steps-inner"><i class="fa fa-check"></i></span>
</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 -->
<p class="mt-2 text-muted step-text">{{ trans_choice('general.companies', 1) }}</p>
</a>
</div>
</div>
<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 class="col-md-3">
<div class="text-center">
<button href="#step-2" type="button" class="btn btn-default btn-lg wizard-steps rounded-circle">
<span class="btn-inner--icon wizard-steps-inner">2</span>
</button>
<p class="mt-2 after-step-text">{{ trans_choice('general.currencies', 2) }}</p>
</div>
</div>
<div class="col-md-3">
<div class="text-center">
<button type="button" class="btn btn-secondary btn-lg wizard-steps rounded-circle steps">
<span class="btn-inner--icon wizard-steps-inner wizard-steps-color">3</span>
</button>
<p class="mt-2 text-muted step-text">{{ trans_choice('general.taxes', 2) }}</p>
</div>
</div>
<div class="col-md-3">
<div class="text-center">
<button type="button" class="btn btn-secondary btn-lg wizard-steps rounded-circle steps">
<span class="btn-inner--icon wizard-steps-inner wizard-steps-color">4</span>
</button>
<p class="mt-2 text-muted step-text">{{ trans_choice('general.finish', 1) }}</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header border-bottom-0">
<div class="row">
<div class="col-6">
<h3 class="mb-0">{{ trans_choice('general.currencies', 2) }}</h3>
</div>
<div class="col-6 text-right">
<span class="new-button">
<button type="button" @click="onAddCurrency" class="btn btn-success btn-sm">
<span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}
</button>
</span>
</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',
'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-3">@sortablelink('name', trans('general.name'))</th>
<th class="col-sm-3 hidden-sm">@sortablelink('code', trans('currencies.code'))</th>
<th class="col-sm-2 hidden-sm">@sortablelink('rate', trans('currencies.rate'))</th>
<th class="col-xs-4 col-sm-2">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-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-3 currency-name">
<a href="javascript:void(0);" class="text-success" @click="onEditCurrency('{{ $item->id }}')">
{{ $item->name }}
</a>
</td>
<td class="col-sm-3 hidden-sm currency-code">{{ $item->code }}</td>
<td class="col-sm-2 hidden-sm currency-rate">{{ $item->rate }}</td>
<td class="col-xs-4 col-sm-2 currency-status">
@if (user()->can('update-settings-currencies'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
@else
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
@endif
@endif
</td>
<td class="col-xs-4 col-sm-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>
@permission('delete-settings-currencies')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'wizard/currencies') !!}
@endpermission
</div>
</div>
</td>
</tr>
@endforeach
<tr class="row align-items-center border-top-1" v-show="show">
<td class="col-xs-4 col-sm-3 currency-name">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o', [], null, '') }}
</td>
<td class="col-sm-3 hidden-sm currency-code">
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, null, ['required' => 'required', 'change' => 'onChangeCode'], '') }}
</td>
<td class="col-sm-2 hidden-sm currency-rate">
{{ Form::textGroup('rate', trans('currencies.rate'), 'money', ['required' => 'required'], null, '') }}
</td>
<td class="col-xs-4 col-sm-2 currency-status">
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</td>
<td class="col-xs-4 col-sm-2 text-center">
{!! Form::button(
'<div v-if="form.loading" :class="(form.loading) ? \'show \' : \'\'" class="aka-loader-frame d-none"><div class="aka-loader"></div></div> <span v-if="!form.loading" class="btn-inner--icon"><i class="fas fa-save"></i></span>', [
':disabled' => 'form.loading',
'type' => 'submit',
'class' => 'btn btn-success currency-submit',
'data-loading-text' => trans('general.loading'),
'style' => 'padding: 9px 14px; margin-top: 10px;'
]) !!}
<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-12 text-right">
<a href="{{ url('wizard/taxes') }}" id="wizard-skip" class="btn btn-white">
<span class="fa fa-share"></span> &nbsp;{{ trans('general.skip') }}
</a>
</div>
</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') }}';
@push('scripts_start')
<script type="text/javascript">
var currencies = {!! json_encode($currencies->items()) !!}
</script>
$(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']);
$('#enabled_1').trigger('click');
$('#name').focus();
$("#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 = $('#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();
data_href = $(this).data('href');
data_id = $(this).data('id');
$.ajax({
url: data_href,
type: 'PATCH',
dataType: 'JSON',
data: data,
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
success: function(json) {
$('.currency-updated').html('<span class="fa fa-save"></span>');
if (json['success']) {
$('#currency-' + data_id + ' .currency-name a').text($('#currency-edit #name').val());
$('#currency-' + data_id + ' .currency-code').text($('#currency-edit #code').val());
$('#currency-' + data_id + ' .currency-rate').text($('#currency-edit #rate').val());
if ($('#currency-edit #enabled').val()) {
$('#currency-' + data_id + ' .currency-status').html('<span class="label label-success">{{ trans('general.enabled') }}</span>');
} else {
$('#currency-' + data_id + ' .currency-status').html('<span class="label label-danger">{{ trans('general.disabled') }}</span>');
}
$('#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>
<script src="{{ asset('public/js/wizard/currencies.js?v=' . version('short')) }}"></script>
@endpush