mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
commit
5a86aaa57f
@ -55,6 +55,7 @@ return [
|
|||||||
'hide_options_field',
|
'hide_options_field',
|
||||||
'hide_village_field',
|
'hide_village_field',
|
||||||
'hide_configurations',
|
'hide_configurations',
|
||||||
|
'make_all_fields_required',
|
||||||
'make_map_required',
|
'make_map_required',
|
||||||
'show_breadcrumb_when_creating_ad',
|
'show_breadcrumb_when_creating_ad',
|
||||||
'show_post_ad_agreement',
|
'show_post_ad_agreement',
|
||||||
|
|||||||
@ -147,6 +147,13 @@ return [
|
|||||||
'mode' => 'checkbox'
|
'mode' => 'checkbox'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
'make_all_fields_required' => [
|
||||||
|
'type' => 'anomaly.field_type.boolean',
|
||||||
|
'config' => [
|
||||||
|
'default_value' => false,
|
||||||
|
'mode' => 'checkbox'
|
||||||
|
]
|
||||||
|
],
|
||||||
'make_map_required' => [
|
'make_map_required' => [
|
||||||
'type' => 'anomaly.field_type.boolean',
|
'type' => 'anomaly.field_type.boolean',
|
||||||
'config' => [
|
'config' => [
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
.upper-list-banner {
|
.upper-list-banner {
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upper-list-banner img {
|
.upper-list-banner img {
|
||||||
|
|||||||
@ -111,6 +111,10 @@ return [
|
|||||||
'name' => 'Hide the Configurations Button',
|
'name' => 'Hide the Configurations Button',
|
||||||
'instructions' => 'Hide the Configurations Button in the Ad Preview Page',
|
'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' => [
|
'make_map_required' => [
|
||||||
'name' => 'Make Map Required',
|
'name' => 'Make Map Required',
|
||||||
'instructions' => 'Require the user to place a pin on the map when creating an ad',
|
'instructions' => 'Require the user to place a pin on the map when creating an ad',
|
||||||
|
|||||||
@ -20,6 +20,8 @@
|
|||||||
<div class="adpost-details">
|
<div class="adpost-details">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<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': {
|
{% set form = form('advs', 'advs').entry(id).actions({'update': {
|
||||||
'text': trans('visiosoft.module.advs::button.publish')
|
'text': trans('visiosoft.module.advs::button.publish')
|
||||||
}}).get() %}
|
}}).get() %}
|
||||||
|
|||||||
@ -1,63 +1,11 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\Adv\Form;
|
<?php namespace Visiosoft\AdvsModule\Adv\Form;
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Ui\Form\Form;
|
||||||
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||||
|
|
||||||
class AdvFormBuilder extends FormBuilder
|
class AdvFormBuilder extends FormBuilder
|
||||||
{
|
{
|
||||||
protected $fields = [
|
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 $category = null;
|
protected $category = null;
|
||||||
|
|
||||||
@ -78,4 +26,73 @@ class AdvFormBuilder extends FormBuilder
|
|||||||
protected $sections = [];
|
protected $sections = [];
|
||||||
|
|
||||||
protected $assets = [];
|
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'
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,17 +19,26 @@
|
|||||||
<ul style="padding: 0" class="list-unstyled">
|
<ul style="padding: 0" class="list-unstyled">
|
||||||
<li class="country-data" data-content="{{ adv['country_id'] }}"
|
<li class="country-data" data-content="{{ adv['country_id'] }}"
|
||||||
data-default="{{ setting_value('visiosoft.module.location::default_country') }}"
|
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'] }}"
|
<li class="city-data" data-content="{{ adv['city'] }}"
|
||||||
data-default="{{ setting_value('visiosoft.module.location::default_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'] }}"
|
<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'] }}"
|
<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') %}
|
{% if not setting_value('visiosoft.module.advs::hide_village_field') %}
|
||||||
<li class="village-data" data-content="{{ adv['village'] }}"
|
<li class="village-data" data-content="{{ adv['village'] }}" class="location-field">
|
||||||
class="location-field">{{ form.fields.village|raw }}</li>
|
{{ form.fields.village.setAttributes({'required': true})|raw }}
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
z-index: 1040;
|
z-index: 1040;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a, span {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 1.25rem;
|
margin-bottom: 1.25rem;
|
||||||
|
|||||||
@ -3,10 +3,13 @@
|
|||||||
class="ml-2">
|
class="ml-2">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-10 col-sm-6 col-md-3 profile-navigation border rounded navbar-side bg-white" id="navbarSide">
|
<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 }}
|
{{ img('visiosoft.module.profile::images/interface.svg').data|raw }}
|
||||||
<p>{{ auth_user().name }}</p>
|
<p>
|
||||||
</a>
|
<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">
|
<hr class="mt-2">
|
||||||
<a href="{{ url_route('profile::profile') }}"
|
<a href="{{ url_route('profile::profile') }}"
|
||||||
class="px-3 link-unstyled{{ app.request.pathinfo == '/profile' ? ' active' : '' }}">
|
class="px-3 link-unstyled{{ app.request.pathinfo == '/profile' ? ' active' : '' }}">
|
||||||
|
|||||||
@ -0,0 +1,6 @@
|
|||||||
|
<?php namespace Visiosoft\ProfileModule\Events;
|
||||||
|
|
||||||
|
class PasswordChanged
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@ -5,6 +5,7 @@ use Anomaly\UsersModule\User\User;
|
|||||||
use Anomaly\UsersModule\User\UserPassword;
|
use Anomaly\UsersModule\User\UserPassword;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Visiosoft\ProfileModule\Events\PasswordChanged;
|
||||||
|
|
||||||
class PasswordFormHandler
|
class PasswordFormHandler
|
||||||
{
|
{
|
||||||
@ -43,6 +44,9 @@ class PasswordFormHandler
|
|||||||
$user = User::query()->find(Auth::id());
|
$user = User::query()->find(Auth::id());
|
||||||
$user->setAttribute('password', $builder->getPostValue('new_password'));
|
$user->setAttribute('password', $builder->getPostValue('new_password'));
|
||||||
$user->save($user->toArray());
|
$user->save($user->toArray());
|
||||||
|
|
||||||
|
event(new PasswordChanged());
|
||||||
|
|
||||||
$messages->success(trans('visiosoft.module.profile::message.your_password_changed'));
|
$messages->success(trans('visiosoft.module.profile::message.your_password_changed'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user