mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
commit
564fc65f91
@ -0,0 +1,3 @@
|
||||
.editContact {
|
||||
font-size: 13px;
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
// phoneMask("input[name='gsm_phone'],input[name='office_phone'],input[name='land_phone']")
|
||||
$('.formEditInfo').on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
var form = $(this);
|
||||
|
||||
crud(form.serialize() + "&action=update", '/ajax/update-user-info', 'POST', function (callback) {
|
||||
if (callback.status == "success") {
|
||||
var profile = callback.data;
|
||||
$('.infoName').html(profile.first_name + " " + profile.last_name);
|
||||
$('.infoGsmPhone').html(profile.gsm_phone);
|
||||
$('.infoOfficePhone').html(profile.office_phone);
|
||||
$('.infoLandPhone').html(profile.land_phone);
|
||||
$('#editMyInfo').modal('hide');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
$('.editInformationUser').on('click', function () {
|
||||
$('#editMyInfo').modal('show');
|
||||
crud({}, '/ajax/update-user-info', 'POST', function (callback) {
|
||||
if (callback.status == "success") {
|
||||
var profile = callback.data;
|
||||
intlTelInput(document.querySelector("input[name='gsm_phone']"), {
|
||||
setNumber: profile.gsm_phone
|
||||
})
|
||||
intlTelInput(document.querySelector("input[name='office_phone']"), {
|
||||
setNumber: profile.office_phone
|
||||
})
|
||||
intlTelInput(document.querySelector("input[name='land_phone']"), {
|
||||
setNumber: profile.land_phone
|
||||
})
|
||||
$('input[name="first_name"]').val(profile.first_name)
|
||||
$('input[name="last_name"]').val(profile.last_name)
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -280,5 +280,9 @@ return [
|
||||
'views' => 'Views',
|
||||
|
||||
// Detail page
|
||||
"no_street_view" => "No street view image in this location"
|
||||
"no_street_view" => "No street view image in this location",
|
||||
'edit_my_contact_info' => 'Edit My Contact Information',
|
||||
'update_my_contact_info' => 'update my contact info',
|
||||
'contact_info' => 'Contact information',
|
||||
'ad_info' => 'Ad Information',
|
||||
];
|
||||
|
||||
@ -38,6 +38,59 @@
|
||||
<input type="hidden" id="currencies" name="currencies" value="">
|
||||
<input type="hidden" name="update_id" value="{{ id }}">
|
||||
<fieldset>
|
||||
|
||||
|
||||
<h5 class="pb-1 border-bottom">{{ trans('visiosoft.module.advs::field.contact_info') }}</h5>
|
||||
<div class="col-12 bg-light row m-0">
|
||||
<div class="col-12 col-md-6 border my-4 bg-white py-3 row m-0 px-0 editContact rounded">
|
||||
<div class="col-12 row m-0 border-bottom py-2">
|
||||
<div class="col-12 col-md-4 pl-0">
|
||||
<label class="mb-0 font-weight-bold">
|
||||
{{ trans('visiosoft.module.profile::field.first_name.name') }}
|
||||
{{ trans('visiosoft.module.profile::field.last_name.name') }}:
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-12 col-md-8 infoName">
|
||||
{{ getProfileDetail(auth_user().id).first_name }}
|
||||
{{ getProfileDetail(auth_user().id).last_name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 row m-0 border-bottom py-1">
|
||||
<div class="col-12 col-md-4 pl-0">
|
||||
<label class="mb-0 font-weight-bold">{{ trans('visiosoft.module.profile::field.gsm_phone.name') }}</label>
|
||||
</div>
|
||||
<div class="col-12 col-md-8 infoGsmPhone">
|
||||
{{ getProfileDetail(auth_user().id).gsm_phone }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 row m-0 border-bottom py-1">
|
||||
<div class="col-12 col-md-4 pl-0">
|
||||
<label class="mb-0 font-weight-bold">{{ trans('visiosoft.module.profile::field.office_phone.name') }}</label>
|
||||
</div>
|
||||
<div class="col-12 col-md-8 infoOfficePhone">
|
||||
{{ getProfileDetail(auth_user().id).office_phone }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 row m-0 py-1">
|
||||
<div class="col-12 col-md-4 pl-0">
|
||||
<label class="mb-0 font-weight-bold">{{ trans('visiosoft.module.profile::field.land_phone.name') }}</label>
|
||||
</div>
|
||||
<div class="col-12 col-md-8 infoLandPhone">
|
||||
{{ getProfileDetail(auth_user().id).land_phone }}
|
||||
</div>
|
||||
</div>
|
||||
<p class="px-3 py-2">
|
||||
<a href="#" class="editInformationUser">
|
||||
<i class="fas fa-pen"></i>
|
||||
{{ trans('visiosoft.module.advs::field.update_my_contact_info') }}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h5 class="mt-5 pb-1 border-bottom">{{ trans('visiosoft.module.advs::field.ad_info') }}</h5>
|
||||
<div class="section postdetails">
|
||||
<div class="row form-group add-title">
|
||||
{% set fields = form.fields.base().pluck('field_name').all() %}
|
||||
@ -69,7 +122,8 @@
|
||||
<input class="form-control priceField" value="{{ PriceValue|first }}">
|
||||
</div>
|
||||
<div class="col-4 col-md-1">
|
||||
<input class="form-control priceDecimalField" placeholder="00" maxlength="2" value="{{ PriceValue[1] }}">
|
||||
<input class="form-control priceDecimalField" placeholder="00" maxlength="2"
|
||||
value="{{ PriceValue[1] }}">
|
||||
</div>
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
{{ form.fields.currency.setAttributes({
|
||||
@ -120,6 +174,8 @@
|
||||
{{ form.close|raw }}
|
||||
</div>
|
||||
</section>
|
||||
{% include "visiosoft.module.advs::new-ad/partials/modals" %}
|
||||
{{ addBlock('new-ad/modals')|raw }}
|
||||
<script>
|
||||
var default_country = "{{ setting_value('visiosoft.module.location::default_country') }}";
|
||||
var default_city = "{{ setting_value('visiosoft.module.location::default_city') }}";
|
||||
@ -133,5 +189,6 @@
|
||||
{{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }}
|
||||
{{ asset_add("scripts.js", "streams::js/form/form.js") }}
|
||||
{{ asset_add("scripts.js", "streams::js/form/translations.js") }}
|
||||
{{ asset_add("styles.css", "visiosoft.module.advs::css/new-create.js") }}
|
||||
|
||||
{% endblock %}
|
||||
@ -0,0 +1,62 @@
|
||||
<!-- The modal -->
|
||||
<div class="modal fade" id="editMyInfo" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
<i class="fas fa-pen"></i>
|
||||
{{ trans('visiosoft.module.advs::field.edit_my_contact_info') }}
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{% set profileForm = form('profile').entry(user.id).get() %}
|
||||
<fieldset>
|
||||
<div class="section">
|
||||
<form class="formEditInfo">
|
||||
<div class="row">
|
||||
<div class="col-12 py-2">
|
||||
<label class="font-weight-bold">{{ trans('visiosoft.module.profile::field.first_name.name') }}</label>
|
||||
<input class="form-control" name="first_name" required>
|
||||
</div>
|
||||
<div class="col-12 py-2">
|
||||
<label class="font-weight-bold">{{ trans('visiosoft.module.profile::field.last_name.name') }}</label>
|
||||
<input class="form-control" name="last_name" required>
|
||||
</div>
|
||||
<div class="form-group required-profile-phone-field col-12">
|
||||
<label class="control-label font-weight-bold">
|
||||
{{ profileForm.fields.gsm_phone.label }}
|
||||
</label>
|
||||
{{ profileForm.fields.gsm_phone.input|raw }}
|
||||
</div>
|
||||
<div class="form-group required-profile-phone-field col-12">
|
||||
<label class="control-label font-weight-bold">
|
||||
{{ profileForm.fields.office_phone.label }}
|
||||
</label>
|
||||
{{ profileForm.fields.office_phone.input|raw }}
|
||||
</div>
|
||||
<div class="form-group required-profile-phone-field col-12">
|
||||
<label class="control-label font-weight-bold">
|
||||
{{ profileForm.fields.land_phone.label }}
|
||||
</label>
|
||||
{{ profileForm.fields.land_phone.input|raw }}
|
||||
</div>
|
||||
<div class="col-12 py-2">
|
||||
<button class="btn btn-sm btn-success" type="submit" name="action" value="update">
|
||||
<i class="fas fa-save"></i>
|
||||
{{ trans('streams::button.update') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ asset_add("scripts.js", "visiosoft.module.advs::js/editContactInformation.js") }}
|
||||
|
||||
|
||||
@ -50,9 +50,16 @@ class AdvsController extends AdminController
|
||||
'status' => [
|
||||
'text' => function (EntryInterface $entry) {
|
||||
if ($entry->status == 'approved') {
|
||||
return "visiosoft.module.advs::button.decline";
|
||||
return "<font class='hidden-xs-down'>" . trans('visiosoft.module.advs::button.decline') . "</font>";
|
||||
} else {
|
||||
return "visiosoft.module.advs::button.approve";
|
||||
return "<font class='hidden-xs-down'>" . trans('visiosoft.module.advs::button.approve') . "</font>";
|
||||
}
|
||||
},
|
||||
'icon' => function (EntryInterface $entry) {
|
||||
if ($entry->status == 'approved') {
|
||||
return "fa fa-eye-slash";
|
||||
} else {
|
||||
return "fa fa-eye";
|
||||
}
|
||||
},
|
||||
'href' => function (EntryInterface $entry) {
|
||||
@ -72,10 +79,13 @@ class AdvsController extends AdminController
|
||||
],
|
||||
'edit' => [
|
||||
'href' => '/advs/edit_advs/{entry.id}',
|
||||
'text' => "<font class='hidden-xs-down'>" . trans('streams::button.edit') . "</font>",
|
||||
],
|
||||
'change_owner' => [
|
||||
'data-toggle' => 'modal',
|
||||
'data-target' => '#modal',
|
||||
'text' => "<font class='hidden-xs-down'>" . trans('visiosoft.module.advs::button.change_owner') . "</font>",
|
||||
'icon' => 'fa fa-users',
|
||||
'href' => 'admin/advs-users/choose/{entry.id}',
|
||||
]
|
||||
]);
|
||||
|
||||
@ -15,6 +15,7 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Cookie;
|
||||
use Visiosoft\LocationModule\City\CityRepository;
|
||||
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
|
||||
use function PMA\Util\get;
|
||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||
use Visiosoft\AdvsModule\Adv\Event\priceChange;
|
||||
@ -528,6 +529,7 @@ class AdvsController extends PublicController
|
||||
CategoryRepositoryInterface $categoryRepository,
|
||||
Dispatcher $events,
|
||||
AdvModel $advModel,
|
||||
AdressRepositoryInterface $address,
|
||||
CategoryModel $categoryModel
|
||||
)
|
||||
{
|
||||
@ -601,6 +603,16 @@ class AdvsController extends PublicController
|
||||
}
|
||||
|
||||
$form->render($request->update_id);
|
||||
if ($this->request->address_id != "") {
|
||||
$adv = $form->getFormEntry();
|
||||
$address = $address->find($this->request->address_id);
|
||||
$adv->country_id = $address->country_id;
|
||||
$adv->city = $address->city;
|
||||
$adv->district = $address->district;
|
||||
$adv->neighborhood = null;
|
||||
$adv->village = null;
|
||||
$adv->save();
|
||||
}
|
||||
$post = $form->getPostData();
|
||||
$post['id'] = $request->update_id;
|
||||
$events->dispatch(new priceChange($post));//price history
|
||||
@ -682,7 +694,6 @@ class AdvsController extends PublicController
|
||||
if (count($Cloudinary) > 0) {
|
||||
$Cloudinary = $Cloudinary->first()->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$request = $cats;
|
||||
|
||||
@ -0,0 +1 @@
|
||||
phoneMask(".forgotPhone")
|
||||
@ -8,4 +8,6 @@ return [
|
||||
'register' => 'Register',
|
||||
'continue' => 'Continue',
|
||||
'reset_password' => 'Reset Password',
|
||||
'email' => 'Email',
|
||||
'phone' => 'Phone',
|
||||
];
|
||||
@ -11,6 +11,7 @@ return [
|
||||
],
|
||||
'profile' => 'Profile',
|
||||
'email' => 'Email Address',
|
||||
'phone' => 'Phone Number',
|
||||
'reset_code' => 'Reset Code',
|
||||
'password_confirmation' => 'Password Confirmation',
|
||||
'password' => 'Password',
|
||||
|
||||
@ -7,36 +7,88 @@
|
||||
alt="forgot password icon">
|
||||
</div>
|
||||
|
||||
<div class="m-0 ml-md-5 forgot-form-wrapper w-100">
|
||||
{% set form = form('forgot_pass').redirect(request_get('redirect', '/'))
|
||||
.get() %}
|
||||
{{ form_open({
|
||||
'class': 'form ' ~ form.options.class ,
|
||||
'url':form.options.url
|
||||
})|raw }}
|
||||
<div class="m-0 ml-md-5 w-100">
|
||||
|
||||
<div>
|
||||
<div class="col-12 m-0 p-0">
|
||||
<h5 class="d-none d-md-block">{{ trans('visiosoft.theme.base::field.create_new_password') }}</h5>
|
||||
<div class="form-group email-field email-field_type text-center text-md-left">
|
||||
<label class="control-label mb-3 mb-md-0">
|
||||
<span>
|
||||
{{ trans('visiosoft.theme.base::field.email_or_phone_number') }}
|
||||
</span>
|
||||
<span class="required">*</span>
|
||||
</label>
|
||||
<nav>
|
||||
<div class="nav nav-tabs nav-fill" id="nav-tab" role="tablist">
|
||||
<a class="nav-item nav-link active" id="nav-email-tab" data-toggle="tab" href="#nav-email"
|
||||
role="tab" aria-controls="nav-email" aria-selected="true">
|
||||
{{ trans('visiosoft.theme.base::button.email') }}
|
||||
</a>
|
||||
<a class="nav-item nav-link" id="nav-phone-tab" data-toggle="tab" href="#nav-phone" role="tab"
|
||||
aria-controls="nav-phone" aria-selected="false">
|
||||
{{ trans('visiosoft.theme.base::button.phone') }}
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="tab-content py-3 px-3 px-sm-0" id="nav-tabContent">
|
||||
<div class="tab-pane fade show active" id="nav-email" role="tabpanel"
|
||||
aria-labelledby="nav-home-tab">
|
||||
{% set form = form('forgot_pass').redirect(request_get('redirect', '/'))
|
||||
.get() %}
|
||||
{{ form_open({
|
||||
'class': 'form ' ~ form.options.class ,
|
||||
'url':form.options.url
|
||||
})|raw }}
|
||||
|
||||
<div class="input-wrapper">
|
||||
{{ form.fields.email.input|raw }}
|
||||
<div>
|
||||
<div class="form-group email-field email-field_type text-center text-md-left">
|
||||
|
||||
<div class="input-wrapper col-12 col-md-5">
|
||||
<label class="control-label">
|
||||
<span>
|
||||
{{ trans('visiosoft.theme.base::field.email') }}
|
||||
</span>
|
||||
<span class="required">*</span>
|
||||
</label>
|
||||
{{ form.fields.email.input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-0 col-12 col-md-5">
|
||||
<button class="btn btn-sm btn-primary py-2 px-5 w-100">
|
||||
{{ trans('visiosoft.theme.base::button.continue') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_close() }}
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-phone" role="tabpanel" aria-labelledby="nav-profile-tab">
|
||||
{% set form = form('forgot_pass').redirect(request_get('redirect', '/'))
|
||||
.get() %}
|
||||
{{ form_open({
|
||||
'class': 'form ' ~ form.options.class ,
|
||||
'url':form.options.url
|
||||
})|raw }}
|
||||
<div>
|
||||
<div class="form-group email-field email-field_type text-center text-md-left">
|
||||
|
||||
<div class="input-wrapper col-12 col-md-5">
|
||||
<label class="control-label">
|
||||
<span>
|
||||
{{ trans('visiosoft.theme.base::field.phone') }}
|
||||
</span>
|
||||
<span class="required">*</span>
|
||||
</label>
|
||||
{{ form.fields.email.setAttributes({
|
||||
'class' :'forgotPhone form-control',
|
||||
}).input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-0 col-12 col-md-5">
|
||||
<button class="btn btn-sm btn-primary py-2 px-5 w-100">
|
||||
{{ trans('visiosoft.theme.base::button.continue') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="m-0">
|
||||
<button class="btn btn-sm btn-primary py-2 px-5 w-100">
|
||||
{{ trans('visiosoft.theme.base::button.continue') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ asset_add('styles.css', 'visiosoft.theme.base::css/forgot.css') }}
|
||||
{{ asset_add('scripts.js', 'visiosoft.theme.base::js/forgot.js') }}
|
||||
{% endblock %}
|
||||
@ -0,0 +1,91 @@
|
||||
phoneMask("input[name='adress_gsm_phone']")
|
||||
|
||||
$('.selectAddress').on('click', function () {
|
||||
var id = $(this).attr('data-id')
|
||||
var old_selected = $("#my_address").find('.selected');
|
||||
old_selected.find("b").html(chooseAddressText);
|
||||
old_selected.removeClass('selected')
|
||||
$('input[name="address_id"]').val(id);
|
||||
$(this).find("b").html(selectedAddressText);
|
||||
$(this).addClass('selected');
|
||||
});
|
||||
|
||||
$('.locationSection').on('click', function () {
|
||||
var old_selected = $("#my_address").find('.selected');
|
||||
old_selected.find("b").html(chooseAddressText);
|
||||
old_selected.removeClass('selected')
|
||||
$('input[name="address_id"]').val("");
|
||||
})
|
||||
|
||||
|
||||
//Edit Address Modal Get Field Value
|
||||
$('.edit-this-address').on('click', function () {
|
||||
var edit_address_id = $(this).data('id');
|
||||
|
||||
resetForm();
|
||||
|
||||
//Set Update Form Action
|
||||
$("#newAdd-address").attr("action", '/profile/adress/ajaxUpdate/' + edit_address_id);
|
||||
|
||||
//Get Address Detail
|
||||
crud({"id": edit_address_id}, '/profile/adress/ajaxDetail', 'POST', function (callback) {
|
||||
var address_detail = callback.data;
|
||||
var address_field = ['adress_name', 'adress_gsm_phone', 'adress_first_name', 'adress_last_name'];
|
||||
|
||||
//Each Value for Fields
|
||||
$.each(address_field, function (index, field) {
|
||||
$('input[name="' + field + '"]').val(address_detail[field])
|
||||
});
|
||||
|
||||
var iti = intlTelInput(document.querySelector("input[name='adress_gsm_phone']"), {
|
||||
setNumber: address_detail.adress_gsm_phone
|
||||
})
|
||||
$("#newAdd-address").find('textarea[name="adress_content"]').html(address_detail.adress_content)
|
||||
$("#newAdd-address").find('select[name="country"]').val(address_detail.country_id)
|
||||
|
||||
//Get City Options
|
||||
var cat = default_country;
|
||||
var level = 1;
|
||||
var name = 'city';
|
||||
Locations(cat, level, name);
|
||||
|
||||
//Get District Options
|
||||
var selectedCity = new Promise(function (resolve) {
|
||||
$("#newAdd-address").find('select[name="city"]').val(address_detail.city)
|
||||
var cat = address_detail.city;
|
||||
var level = 2;
|
||||
var name = 'district';
|
||||
Locations(cat, level, name);
|
||||
resolve();
|
||||
});
|
||||
//Selected District
|
||||
selectedCity.then(function (categories_list) {
|
||||
$("#newAdd-address").find('select[name="district"]').val(address_detail.district)
|
||||
})
|
||||
|
||||
})
|
||||
//Open Edit Address Modal
|
||||
$('#editAddress').modal('show')
|
||||
})
|
||||
|
||||
function resetForm() {
|
||||
$("#newAdd-address").trigger("reset");
|
||||
$("#newAdd-address").find("textarea").html('');
|
||||
$("#newAdd-address").find('select[name="district"]').html('')
|
||||
}
|
||||
|
||||
$("#newAdd-address").submit(function (e) {
|
||||
|
||||
e.preventDefault(); // avoid to execute the actual submit of the form.
|
||||
var form = $(this);
|
||||
var url = form.attr('action');
|
||||
crud(form.serialize(), url, "POST", function (response) {
|
||||
if (response.status == "updated") {
|
||||
$('.row-address' + response.data.id).find(".address-title").html(response.data.adress_name)
|
||||
$('#editAddress').modal('hide');
|
||||
resetForm();
|
||||
} else {
|
||||
alert(response.msg)
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -34,4 +34,5 @@ return [
|
||||
'address' => [
|
||||
'name' => 'Address',
|
||||
],
|
||||
'selected' => 'Selected'
|
||||
];
|
||||
|
||||
@ -1,32 +1,91 @@
|
||||
{% if setting_value('visiosoft.module.location::create_ad_page_location') %}
|
||||
<div class="row form-group location-map">
|
||||
<div class="col-sm-4">
|
||||
<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|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>
|
||||
<li class="district-data" data-content="{{ adv['district'] }}"
|
||||
class="location-field district-data">{{ form.fields.district|raw }}</li>
|
||||
<li class="neighborhood-data" data-content="{{ adv['neighborhood'] }}"
|
||||
class="location-field neighborhood-data">{{ form.fields.neighborhood|raw }}</li>
|
||||
<li class="village-data" data-content="{{ adv['village'] }}"
|
||||
class="location-field">{{ form.fields.village|raw }}</li>
|
||||
<div class="col-12 m-0 p-0">
|
||||
<ul class="nav nav-tabs p-1 bg-dark border-bottom py-2" role="tablist">
|
||||
<li role="presentation" class="p-0 m-0">
|
||||
<a href="#location" class="text-dark py-1 px-4 border bg-white locationSection"
|
||||
aria-controls="location"
|
||||
role="tab" data-toggle="tab">{{ trans('visiosoft.module.location::addon.title') }}</a>
|
||||
</li>
|
||||
<li role="presentation" class="p-0 m-0 ml-1">
|
||||
<a href="#my_address" class="text-dark py-1 px-4 border bg-white" aria-controls="my_address"
|
||||
role="tab" data-toggle="tab">{{ trans('visiosoft.module.profile::field.my_address') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div id="map-canvas" style="
|
||||
<div class="tab-content bg-light">
|
||||
<div role="tabpanel" class="tab-pane m-0 pt-2" id="location">
|
||||
<div class="col-12 row">
|
||||
<div class="col-sm-4">
|
||||
<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|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>
|
||||
<li class="district-data" data-content="{{ adv['district'] }}"
|
||||
class="location-field district-data">{{ form.fields.district|raw }}</li>
|
||||
<li class="neighborhood-data" data-content="{{ adv['neighborhood'] }}"
|
||||
class="location-field neighborhood-data">{{ form.fields.neighborhood|raw }}</li>
|
||||
<li class="village-data" data-content="{{ adv['village'] }}"
|
||||
class="location-field">{{ form.fields.village|raw }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div id="map-canvas" style="
|
||||
position: relative; overflow: hidden;
|
||||
transform: translateZ(0px) translateZ(0px) translateZ(0px) translateZ(0px) translateZ(0px) translateZ(0px);
|
||||
width: 100%;
|
||||
height:550px;
|
||||
background-color: rgb(229, 227, 223);
|
||||
"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane active" id="my_address">
|
||||
<div class="col-md-12">
|
||||
<input type="hidden" name="address_id">
|
||||
<table class="table addressSelect">
|
||||
<tbody>
|
||||
{% for key,adress in getAddressByUser(auth_user().id) %}
|
||||
<tr class="row-address{{ adress.id }}">
|
||||
<td class="address-title">{{ adress.adress_name }}</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-info selectAddress text-white"
|
||||
data-id="{{ adress.id }}"
|
||||
role="button">
|
||||
<i class="fas fa-check" aria-hidden="true"></i>
|
||||
<b>{{ trans("visiosoft.module.profile::field.choose.name") }}</b>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-success text-white edit-this-address"
|
||||
data-id="{{ adress.id }}"
|
||||
role="button">
|
||||
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
|
||||
{{ trans("visiosoft.module.profile::field.edit.name") }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var selectedAddressText = "{{ trans('visiosoft.module.location::field.selected') }}";
|
||||
var chooseAddressText = '{{ trans("visiosoft.module.profile::field.choose.name") }}';
|
||||
</script>
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.location::google_map_key') }}&callback="
|
||||
type="text/javascript"></script>
|
||||
{{ asset_add("scripts.js", "visiosoft.module.advs::js/location.js") }}
|
||||
{% endif %}
|
||||
{{ asset_add("scripts.js", "visiosoft.module.location::js/addressSelect.js") }}
|
||||
{% endif %}
|
||||
<style>
|
||||
.location-map .nav-tabs .active {
|
||||
background-color: #e5e5e5;
|
||||
}
|
||||
</style>
|
||||
108
addons/default/visiosoft/location-module/resources/views/new-ad/modals.twig
Executable file
108
addons/default/visiosoft/location-module/resources/views/new-ad/modals.twig
Executable file
@ -0,0 +1,108 @@
|
||||
<!-- The modal -->
|
||||
<div class="modal fade" id="editAddress" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
{{ trans("visiosoft.module.profile::field.create.name") }}
|
||||
{{ trans("visiosoft.module.profile::field.menu_address.name") }}
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<fieldset>
|
||||
<div class="section">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{% include "visiosoft.theme.base::partials/messages" %}
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
{% set form = form('profile', 'adress').get() %}
|
||||
{{ form_open({
|
||||
'class': 'form ' ~ form.options.class ,
|
||||
'enctype': 'multipart/form-data',
|
||||
'id': 'newAdd-address',
|
||||
'url': url_route('visiosoft.module.profile::adress_ajax_create'),
|
||||
})|raw }}
|
||||
<fieldset>
|
||||
<div class="section postdetails">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{{ form.fields.adress_name|raw }}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{{ form.fields.adress_gsm_phone|raw }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{{ form.fields.adress_first_name|raw }}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{{ form.fields.adress_last_name|raw }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group location-map">
|
||||
<div class="col-sm-4">
|
||||
<label class="control-label">{{ trans("visiosoft.module.profile::field.country.name") }}</label>
|
||||
<div class="input-wrapper">
|
||||
<select name="country" class="custom-select form-control"
|
||||
data-content="{{ adress.country.id }}"
|
||||
data-field_name="adress_country_id"
|
||||
data-provides="anomaly.field_type.select">
|
||||
{% for countryField in getCountries() %}
|
||||
<option value="{{ countryField.id }}">{{ countryField.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ form.fields.city|raw }}
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ form.fields.district|raw }}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row form-group location-map">
|
||||
<div class="col-sm-12">
|
||||
<div class="add-title">
|
||||
{{ form.fields.adress_content|raw }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<button class="btn btn-sm btn-success" value="save" type="submit">
|
||||
<i class="fa fa-save "></i>
|
||||
{{ trans('streams::button.save') }}
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary"
|
||||
data-dismiss="modal">{{ trans("visiosoft.module.carts::button.close") }}</button>
|
||||
|
||||
</div>
|
||||
</div><!-- section -->
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
{{ form.close|raw }}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var default_country = "{{ setting_value('visiosoft.module.location::default_country') }}"
|
||||
</script>
|
||||
{{ asset_add("scripts.js", "visiosoft.module.profile::assets/js/country.js") }}
|
||||
{{ asset_add("scripts.js", "visiosoft.module.carts::js/phoneField.js") }}
|
||||
|
||||
|
||||
@ -428,5 +428,8 @@ return [
|
||||
'details' => [
|
||||
'name' => 'Details'
|
||||
],
|
||||
|
||||
'choose' => [
|
||||
'name' => 'Choose'
|
||||
],
|
||||
'my_address' => 'My Address'
|
||||
];
|
||||
|
||||
@ -27,6 +27,7 @@ return [
|
||||
'registered_phone' => 'This phone number has already been registered.',
|
||||
'ajax_address_error' => 'No address or not authorized to view.',
|
||||
'empty_password_sms_message' => 'Due to security issues, we changed your password! Your new password is:',
|
||||
'required_all' => "All Field is Required!",
|
||||
|
||||
// Forgot Password
|
||||
'email_phone_not_found' => 'The E-mail, Phone Number is not correct!',
|
||||
|
||||
@ -22,4 +22,9 @@ class AdressRepository extends EntryRepository implements AdressRepositoryInterf
|
||||
{
|
||||
$this->model = $model;
|
||||
}
|
||||
|
||||
public function findByUser($user_id)
|
||||
{
|
||||
return $this->newQuery()->where('user_id', $user_id)->get();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Adress\Command;
|
||||
|
||||
|
||||
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
|
||||
|
||||
class GetAddressByUser
|
||||
{
|
||||
|
||||
/**
|
||||
* @var $id
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* GetProduct constructor.
|
||||
* @param $id
|
||||
*/
|
||||
public function __construct($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AdressRepositoryInterface $adressRepository
|
||||
* @return \Anomaly\Streams\Platform\Model\EloquentModel|null
|
||||
*/
|
||||
public function handle(AdressRepositoryInterface $adressRepository)
|
||||
{
|
||||
if ($this->id) {
|
||||
return $adressRepository->findByUser($this->id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -4,5 +4,5 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface;
|
||||
|
||||
interface AdressRepositoryInterface extends EntryRepositoryInterface
|
||||
{
|
||||
|
||||
public function findByUser($user_id);
|
||||
}
|
||||
|
||||
@ -324,4 +324,19 @@ class MyProfileController extends PublicController
|
||||
return $this->view->make('visiosoft.module.profile::profile/ads');
|
||||
}
|
||||
|
||||
public function updateAjaxProfile(UserRepositoryInterface $user)
|
||||
{
|
||||
$profile = $user->find(Auth::id());
|
||||
if (isset($this->request->action) and $this->request->action == "update") {
|
||||
$profile->update([
|
||||
'first_name' => $this->request->first_name,
|
||||
'last_name' => $this->request->last_name,
|
||||
'gsm_phone' => $this->request->gsm_phone,
|
||||
'office_phone' => $this->request->office_phone,
|
||||
'land_phone' => $this->request->land_phone,
|
||||
]);
|
||||
}
|
||||
return response()->json(['status' => 'success', 'data' => $profile]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
<?php namespace Visiosoft\ProfileModule\Profile\Command;
|
||||
|
||||
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
|
||||
|
||||
class GetProfileDetail
|
||||
{
|
||||
|
||||
/**
|
||||
* @var $id
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* GetProduct constructor.
|
||||
* @param $id
|
||||
*/
|
||||
public function __construct($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function handle(UserRepositoryInterface $user)
|
||||
{
|
||||
if ($this->id) {
|
||||
return $user->find($this->id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,7 @@ class ValidateEmail
|
||||
//Is email or phone number
|
||||
if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
|
||||
$possiblePhone = $value;
|
||||
if (substr($value, 0, 1) == 0) {
|
||||
if (substr($value, 0, 1) == "+") {
|
||||
$possiblePhone = substr($value, 1);
|
||||
}
|
||||
if ($user = $users->newQuery()
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
||||
use Visiosoft\ProfileModule\Adress\Command\GetAddress;
|
||||
use Visiosoft\ProfileModule\Adress\Command\GetAddressByUser;
|
||||
use Visiosoft\ProfileModule\Profile\Command\GetProfileDetail;
|
||||
|
||||
class ProfileModulePlugin extends Plugin
|
||||
{
|
||||
@ -19,6 +21,28 @@ class ProfileModulePlugin extends Plugin
|
||||
return null;
|
||||
}
|
||||
|
||||
return $ad;
|
||||
}
|
||||
),
|
||||
new \Twig_SimpleFunction(
|
||||
'getAddressByUser',
|
||||
function ($user_id) {
|
||||
|
||||
if (!$ad = $this->dispatch(new GetAddressByUser($user_id))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $ad;
|
||||
}
|
||||
),
|
||||
new \Twig_SimpleFunction(
|
||||
'getProfileDetail',
|
||||
function ($user_id) {
|
||||
|
||||
if (!$ad = $this->dispatch(new GetProfileDetail($user_id))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $ad;
|
||||
}
|
||||
)
|
||||
|
||||
@ -117,8 +117,10 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
||||
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@notification',
|
||||
],
|
||||
|
||||
'ajax/update-user-info' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@updateAjaxProfile',
|
||||
|
||||
// Cache links
|
||||
'ajax/get-user-info' => 'Visiosoft\ProfileModule\Http\Controller\CacheController@getUserInfo'
|
||||
'ajax/get-user-info' => 'Visiosoft\ProfileModule\Http\Controller\CacheController@getUserInfo',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user