merge with master
This commit is contained in:
parent
90262c14c0
commit
1e2d7418ca
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/admin.js": "/js/admin.js?id=c70dacdf945a32e04b77",
|
||||
"/css/admin.css": "/css/admin.css?id=d40a640933cbcc121f1d"
|
||||
"/js/admin.js": "/js/admin.js",
|
||||
"/css/admin.css": "/css/admin.css"
|
||||
}
|
||||
|
|
@ -23,14 +23,7 @@
|
|||
$value = $class->$method();
|
||||
$selectedOption = core()->getConfigData($name) ?? '';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="control-group {{ $field['type'] }}" :class="[errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]') ? 'has-error' : '']">
|
||||
<label for="{{ $name }}" {{ !isset($field['validation']) || strpos('required', $field['validation']) < 0 ? '' : 'class=required' }}>
|
||||
|
||||
{{ $field['title'] }}
|
||||
|
||||
<?php
|
||||
$channel_locale = [];
|
||||
|
||||
if(isset($field['channel_based']) && $field['channel_based'])
|
||||
|
|
@ -43,6 +36,12 @@
|
|||
}
|
||||
?>
|
||||
|
||||
<div class="control-group {{ $field['type'] }}" :class="[errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]') ? 'has-error' : '']">
|
||||
|
||||
<label for="{{ $name }}" {{ !isset($field['validation']) || strpos('required', $field['validation']) < 0 ? '' : 'class=required' }}>
|
||||
|
||||
{{ $field['title'] }}
|
||||
|
||||
@if(count($channel_locale))
|
||||
<span class="locale">[{{ implode(' - ', $channel_locale) }}]</span>
|
||||
@endif
|
||||
|
|
@ -63,13 +62,12 @@
|
|||
|
||||
@if (isset($field['repository']))
|
||||
@foreach($value as $option)
|
||||
<option value="{{ $option['name'] }}" {{ $option['name'] == $selectedOption ? 'selected' : ''}} {{ in_array($option['name'], explode(',', $selectedOption)) ? 'selected' : ''}}>
|
||||
<option value="{{ $option['name'] }}" {{ $option['name'] == $selectedOption ? 'selected' : ''}}
|
||||
{{ $option['name'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
@else
|
||||
@foreach($field['options'] as $option)
|
||||
|
||||
<?php
|
||||
if($option['value'] == false) {
|
||||
$value = 0;
|
||||
|
|
@ -89,18 +87,83 @@
|
|||
</select>
|
||||
|
||||
@elseif ($field['type'] == 'multiselect')
|
||||
|
||||
<select v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}][]" data-vv-as=""{{ $field['name'] }}"" multiple>
|
||||
|
||||
@if (isset($field['repository']))
|
||||
@foreach($value as $option)
|
||||
<option value="{{ $option['name'] }}" {{ $option['name'] == $selectedOption ? 'selected' : ''}} {{ in_array($option['name'], explode(',', $selectedOption)) ? 'selected' : ''}}>
|
||||
<option value="{{ $option['name'] }}" {{ in_array($option['name'], explode(',', $selectedOption)) ? 'selected' : ''}}>
|
||||
{{ $option['name'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
@else
|
||||
@foreach($field['options'] as $option)
|
||||
|
||||
<?php
|
||||
if($option['value'] == false) {
|
||||
$value = 0;
|
||||
} else {
|
||||
$value = $option['value'];
|
||||
}
|
||||
|
||||
$selectedOption = core()->getConfigData($name) ?? '';
|
||||
?>
|
||||
|
||||
<option value="{{ $value }}" {{ $value == $selectedOption ? 'selected' : ''}}>
|
||||
{{ $option['title'] }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
|
||||
@elseif ($field['type'] == 'country')
|
||||
|
||||
<select type="text" v-validate="'required'" class="control" id="country" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" data-vv-as=""{{ __('admin::app.customers.customers.country') }}"" onchange="myFunction()">
|
||||
<option value=""></option>
|
||||
|
||||
@foreach (core()->countries() as $country)
|
||||
|
||||
<option value="{{ $country->code }}">
|
||||
{{ $country->name }}
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]')">@{{ errors.first('{!! $firstField !!}[{!! $secondField !!}][{!! $thirdField !!}][{!! $field['name'] !!}]') }}</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
|
||||
function myFunction() {
|
||||
var countryId = document.getElementById("country").value;
|
||||
var countryStates = <?php echo json_encode(core()->groupedStatesByCountries()) ;?>;
|
||||
|
||||
for (var key in countryStates) {
|
||||
if(key == countryId){
|
||||
|
||||
|
||||
for(state in countryStates[key]) {
|
||||
console.log(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
const { mix } = require("laravel-mix");
|
||||
require("laravel-mix-merge-manifest");
|
||||
|
||||
var publicPath = 'publishable/assets';
|
||||
// var publicPath = "../../../public/vendor/webkul/admin/assets";
|
||||
// var publicPath = 'publishable/assets';
|
||||
var publicPath = "../../../public/vendor/webkul/admin/assets";
|
||||
|
||||
mix.setPublicPath(publicPath).mergeManifest();
|
||||
mix.disableNotifications();
|
||||
|
|
|
|||
|
|
@ -21,13 +21,4 @@ class CountryRepository extends Repository
|
|||
{
|
||||
return 'Webkul\Core\Models\Country';
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get country
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllCountry() {
|
||||
return $this->model->get()->toArray();
|
||||
}
|
||||
}
|
||||
|
|
@ -106,22 +106,16 @@ return [
|
|||
'name' => 'Origin',
|
||||
'sort' => 0,
|
||||
'fields' => [
|
||||
// [
|
||||
// 'name' => 'country',
|
||||
// 'title' => 'Country',
|
||||
// 'type' => 'country_state',
|
||||
// 'stateName' => 'state'
|
||||
// 'validation' => 'required',
|
||||
// 'channel_based' => true,
|
||||
// 'locale_based' => true
|
||||
// ],
|
||||
[
|
||||
'name' => 'country',
|
||||
'title' => 'Country',
|
||||
'type' => 'select',
|
||||
'repository' => 'Webkul\Core\Repositories\CountryRepository@getAllCountry',
|
||||
'validation' => 'required',
|
||||
'channel_based' => true,
|
||||
'locale_based' => false
|
||||
], [
|
||||
'name' => 'state',
|
||||
'title' => 'State',
|
||||
'type' => 'text',
|
||||
'validation' => 'required',
|
||||
'channel_based' => true,
|
||||
'locale_based' => false
|
||||
], [
|
||||
'name' => 'address1',
|
||||
'title' => 'Address Line 1',
|
||||
'type' => 'text',
|
||||
|
|
|
|||
Loading…
Reference in New Issue