mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#1358 [Sahibinden-Theme] address editing form does not work
This commit is contained in:
parent
7316045e74
commit
7a72ac3895
@ -1,30 +1,48 @@
|
||||
phoneMask("input[name='gsm_phone'],input[name='office_phone'],input[name='land_phone']")
|
||||
$('.formEditInfo').on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const oldBtnHtml = $(this).find('.btn-success').html();
|
||||
$(this).find('.btn-success').attr('disabled', true).html(`
|
||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
`);
|
||||
|
||||
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');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: form.serialize() + "&action=update",
|
||||
url: '/ajax/update-user-info',
|
||||
success: function (response) {
|
||||
if (response.status == "success") {
|
||||
var profile = response.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');
|
||||
|
||||
$('.formEditInfo .btn-success').attr('disabled', false).html(oldBtnHtml);
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
$('.editInformationUser').on('click', function () {
|
||||
$('#editMyInfo').modal('show');
|
||||
crud({}, '/ajax/update-user-info', 'POST', function (callback) {
|
||||
if (callback.status == "success") {
|
||||
var profile = callback.data;
|
||||
$('input[name="first_name"]').val(profile.first_name)
|
||||
$('input[name="last_name"]').val(profile.last_name)
|
||||
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)
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/ajax/update-user-info',
|
||||
success: function (response) {
|
||||
if (response.status == "success") {
|
||||
var profile = response.data;
|
||||
$('input[name="first_name"]').val(profile.first_name)
|
||||
$('input[name="last_name"]').val(profile.last_name)
|
||||
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)
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
})
|
||||
@ -1,8 +1,8 @@
|
||||
{% extends layout('new-create') %}
|
||||
|
||||
{% block content %}
|
||||
<section id="main" class="clearfix home-default">
|
||||
<div class="container">
|
||||
<section class="clearfix home-default">
|
||||
<div>
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
{% for cat in cats_d %}
|
||||
@ -39,56 +39,7 @@
|
||||
<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>
|
||||
|
||||
{% include 'visiosoft.module.advs::new-ad/partials/contact-info' %}
|
||||
|
||||
<h5 class="mt-5 pb-1 border-bottom">{{ trans('visiosoft.module.advs::field.ad_info') }}</h5>
|
||||
<div class="section postdetails">
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
<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>
|
||||
@ -58,5 +58,3 @@
|
||||
</div>
|
||||
</div>
|
||||
{{ asset_add("scripts.js", "visiosoft.module.advs::js/editContactInformation.js") }}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user