#3567 emlak24 bug ve düzenlemeler

This commit is contained in:
Diatrex 2021-03-26 16:47:26 +03:00
parent 77962cbbbd
commit 1569ac2d90
9 changed files with 108 additions and 64 deletions

View File

@ -55,6 +55,7 @@ return [
'hide_options_field',
'hide_village_field',
'hide_configurations',
'make_all_fields_required',
'make_map_required',
'show_breadcrumb_when_creating_ad',
'show_post_ad_agreement',

View File

@ -147,6 +147,13 @@ return [
'mode' => 'checkbox'
]
],
'make_all_fields_required' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
'mode' => 'checkbox'
]
],
'make_map_required' => [
'type' => 'anomaly.field_type.boolean',
'config' => [

View File

@ -24,6 +24,7 @@
.upper-list-banner {
min-height: 300px;
background-size: cover;
background-position: center;
}
.upper-list-banner img {

View File

@ -111,6 +111,10 @@ return [
'name' => 'Hide the Configurations Button',
'instructions' => 'Hide the Configurations Button in the Ad Preview Page',
],
'make_all_fields_required' => [
'name' => 'Make All Fields Required',
'instructions' => 'Require the user to fill the Price, Description and Location fields when creating an ad',
],
'make_map_required' => [
'name' => 'Make Map Required',
'instructions' => 'Require the user to place a pin on the map when creating an ad',

View File

@ -20,6 +20,8 @@
<div class="adpost-details">
<div class="row">
<div class="col-md-12">
{% set requiredFields = setting_value('visiosoft.module.advs::make_all_fields_required') %}
{% set form = form('advs', 'advs').entry(id).actions({'update': {
'text': trans('visiosoft.module.advs::button.publish')
}}).get() %}

View File

@ -1,63 +1,11 @@
<?php namespace Visiosoft\AdvsModule\Adv\Form;
use Anomaly\Streams\Platform\Ui\Form\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class AdvFormBuilder extends FormBuilder
{
protected $fields = [
'name' => [
'translatable' => true,
'required' => true,
],
'slug' => [
'unique' => true,
'required' => true,
],
'price' => [
'type' => 'anomaly.field_type.text'
],
'standard_price' => [
'type' => 'anomaly.field_type.text'
],
'advs_desc',
'cat1',
'cat2',
'cat3',
'cat4',
'cat5',
'cat6',
'cat7',
'cat8',
'cat9',
'cat10',
'currency',
'online_payment',
'stock',
'country' => [
'class' => 'form-control countryselect'
],
'city' => [
'class' => 'form-control cityselect'
],
'district' => [
'class' => 'form-control districtselect'
],
'neighborhood' => [
'class' => 'form-control neighborhoodselect'
],
'village' => [
'class' => 'form-control villageselect'
],
'map_Val' => [
'label' => false,
'class' => 'hidden d-none mapVal'
],
'files',
'doc_files',
'popular_adv',
'adv_day',
'product_options_value'
];
protected $fields;
protected $category = null;
@ -78,4 +26,73 @@ class AdvFormBuilder extends FormBuilder
protected $sections = [];
protected $assets = [];
public function __construct(Form $form)
{
parent::__construct($form);
$this->fields = $this->settingFields();
}
private function settingFields()
{
$requiredFields = setting_value('visiosoft.module.advs::make_all_fields_required');
return [
'name' => [
'translatable' => true,
'required' => true,
],
'slug' => [
'unique' => true,
'required' => true,
],
'price' => [
'type' => 'anomaly.field_type.text',
'required' => $requiredFields
],
'standard_price' => [
'type' => 'anomaly.field_type.text'
],
'advs_desc' => [
'required' => $requiredFields
],
'cat1',
'cat2',
'cat3',
'cat4',
'cat5',
'cat6',
'cat7',
'cat8',
'cat9',
'cat10',
'currency',
'online_payment',
'stock',
'country' => [
'class' => 'form-control countryselect'
],
'city' => [
'class' => 'form-control cityselect'
],
'district' => [
'class' => 'form-control districtselect'
],
'neighborhood' => [
'class' => 'form-control neighborhoodselect'
],
'village' => [
'class' => 'form-control villageselect'
],
'map_Val' => [
'label' => false,
'class' => 'hidden d-none mapVal'
],
'files',
'doc_files',
'popular_adv',
'adv_day',
'product_options_value'
];
}
}

View File

@ -19,17 +19,26 @@
<ul style="padding: 0" class="list-unstyled">
<li class="country-data" data-content="{{ adv['country_id'] }}"
data-default="{{ setting_value('visiosoft.module.location::default_country') }}"
class="location-field country-data">{{ form.fields.country.setOptions({})|raw }}</li>
class="location-field country-data">
{{ form.fields.country.setAttributes({'required': true}).setOptions({})|raw }}
</li>
<li class="city-data" data-content="{{ adv['city'] }}"
data-default="{{ setting_value('visiosoft.module.location::default_city') }}"
class="location-field city-data">{{ form.fields.city|raw }}</li>
class="location-field city-data">
{{ form.fields.city.setAttributes({'required': true})|raw }}
</li>
<li class="district-data" data-content="{{ adv['district'] }}"
class="location-field district-data">{{ form.fields.district|raw }}</li>
class="location-field district-data">
{{ form.fields.district.setAttributes({'required': true})|raw }}
</li>
<li class="neighborhood-data" data-content="{{ adv['neighborhood'] }}"
class="location-field neighborhood-data">{{ form.fields.neighborhood|raw }}</li>
class="location-field neighborhood-data">
{{ form.fields.neighborhood.setAttributes({'required': true})|raw }}
</li>
{% if not setting_value('visiosoft.module.advs::hide_village_field') %}
<li class="village-data" data-content="{{ adv['village'] }}"
class="location-field">{{ form.fields.village|raw }}</li>
<li class="village-data" data-content="{{ adv['village'] }}" class="location-field">
{{ form.fields.village.setAttributes({'required': true})|raw }}
</li>
{% endif %}
</ul>
</div>

View File

@ -41,7 +41,7 @@
z-index: 1040;
}
a {
a, span {
display: flex;
align-items: center;
margin-bottom: 1.25rem;

View File

@ -3,10 +3,13 @@
class="ml-2">
</div>
<div class="col-10 col-sm-6 col-md-3 profile-navigation border rounded navbar-side bg-white" id="navbarSide">
<a href="{{ url_route('profile::profile') }}" class="px-3 mb-2 link-unstyled">
<span class="px-3 mb-2 link-unstyled">
{{ img('visiosoft.module.profile::images/interface.svg').data|raw }}
<p>{{ auth_user().name }}</p>
</a>
<p>
<a href="{{ url_route('profile::profile') }}" class="link-unstyled mb-0">{{ auth_user().name }}</a>
{{ addBlock('profile/navigation/username')|raw }}
</p>
</span>
<hr class="mt-2">
<a href="{{ url_route('profile::profile') }}"
class="px-3 link-unstyled{{ app.request.pathinfo == '/profile' ? ' active' : '' }}">