removed required location fields

This commit is contained in:
vedatakd 2020-01-22 18:59:08 +03:00
parent 2998fd4ca6
commit fc8d7d1e24
8 changed files with 65 additions and 42 deletions

View File

@ -55,12 +55,8 @@ class VisiosoftModuleAdvsCreateAdvsStream extends Migration
'online_payment', 'online_payment',
'is_get_adv', 'is_get_adv',
'stock', 'stock',
'country' => [ 'country',
'required' => true 'city',
],
'city' => [
'required' => true
],
'district', 'district',
'neighborhood', 'neighborhood',
'village', 'village',

View File

@ -69,15 +69,11 @@ function Locations(cat, level, name){
data: "cat=" + cat + "&level=" + level, data: "cat=" + cat + "&level=" + level,
url: "/class/ajax", url: "/class/ajax",
success: function(msg){ success: function(msg){
hideLoader()
$('select[name="'+name+'"]').find('option').remove(); $('select[name="'+name+'"]').find('option').remove();
$('select[name="'+name+'"]').append('<option value="">Choose an option...</option>'); $('select[name="'+name+'"]').append('<option value="">Choose an option...</option>');
$.each(msg, function(key, value){ $.each(msg, function(key, value){
$('select[name="'+name+'"]').append('<option value="'+value.id+'">'+value.name+'</option>'); $('select[name="'+name+'"]').append('<option value="'+value.id+'">'+value.name+'</option>');
}); });
},
beforeSend: function () {
showLoader()
} }
}).promise().done(function() { }).promise().done(function() {
setLocation(level); setLocation(level);

View File

@ -73,7 +73,29 @@ $('input[name="price"]').on('click', function () {
} }
}) })
$(document).on('ajaxComplete ready shown.bs.tab', function () { $(document).ready(function () {
$('input[data-provides="anomaly.field_type.slug"]:not([data-initialized])').each(function () {
$(this).attr('data-initialized', '');
var config = {
slug: this,
lowercase: $(this).data('lowercase')
};
/**
* Only slugify other fields if
* value is empty OR configured
* to always slugify field values.
*/
if (!$(this).val() || $(this).data('always_slugify')) {
config.slugify = '[data-field="' + $(this).data('slugify') + '"]:visible:first';
}
// Slugify slug inputs.
$(this).slugify(config);
});
// Initialize WYSIWYG editors. // Initialize WYSIWYG editors.
$('textarea[data-field="advs_desc"]:not(.hasEditor)').each(function () { $('textarea[data-field="advs_desc"]:not(.hasEditor)').each(function () {

View File

@ -107,7 +107,6 @@
</div> </div>
{{ form.close|raw }} {{ form.close|raw }}
</div> </div>
</div>
</section> </section>
<script> <script>
var default_country = "{{ setting_value('visiosoft.module.advs::default_country') }}"; var default_country = "{{ setting_value('visiosoft.module.advs::default_country') }}";
@ -119,10 +118,7 @@
var adv_id = "{{ id }}"; var adv_id = "{{ id }}";
</script> </script>
<script src="https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.advs::google_map_key') }}&callback="
type="text/javascript"></script>
{{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }} {{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }}
{{ asset_add("scripts.js", "visiosoft.module.advs::js/location.js") }}
{{ asset_add("scripts.js", "streams::js/form/form.js") }} {{ asset_add("scripts.js", "streams::js/form/form.js") }}
{{ asset_add("scripts.js", "streams::js/form/translations.js") }} {{ asset_add("scripts.js", "streams::js/form/translations.js") }}

View File

@ -19,7 +19,12 @@ return [
'default_value' => true, 'default_value' => true,
], ],
], ],
'default_country' => [ 'create_ad_page_location' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
],
], 'default_country' => [
'type' => 'anomaly.field_type.relationship', 'type' => 'anomaly.field_type.relationship',
"config" => [ "config" => [
"related" => \Visiosoft\LocationModule\Country\CountryModel::class, "related" => \Visiosoft\LocationModule\Country\CountryModel::class,

View File

@ -16,4 +16,7 @@ return [
'default_country' => [ 'default_country' => [
'name' => 'Default Country', 'name' => 'Default Country',
], ],
'create_ad_page_location' => [
'name' => 'Create Ad Page Location',
],
]; ];

View File

@ -1,3 +1,4 @@
{% if setting_value('visiosoft.module.location::create_ad_page_location') %}
<div class="row form-group location-map"> <div class="row form-group location-map">
<div class="col-sm-4"> <div class="col-sm-4">
<ul style="padding: 0"> <ul style="padding: 0">
@ -25,3 +26,7 @@
"></div> "></div>
</div> </div>
</div> </div>
<script src="https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.advs::google_map_key') }}&callback="
type="text/javascript"></script>
{{ asset_add("scripts.js", "visiosoft.module.advs::js/location.js") }}
{% endif %}

View File

@ -59,7 +59,7 @@ return [
'name' => 'Kimlik Numarası' 'name' => 'Kimlik Numarası'
], ],
'adress_name' => [ 'adress_name' => [
'name' => 'Adres Ado' 'name' => 'Adres Adı'
], ],
'adress_first_name' => [ 'adress_first_name' => [
'name' => 'İsim' 'name' => 'İsim'