mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #429 from openclassify/dia
#1101 if there is more then 7 no next button
This commit is contained in:
commit
0925191de7
@ -7,11 +7,12 @@ function hideLoader() {
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('select[name="cat1"], select[name="cat2"], select[name="cat3"], ' +
|
||||
'select[name="cat4"], select[name="cat5"], select[name="cat6"], select[name="cat7"]').on('change', function () {
|
||||
$('select[name="cat1"], select[name="cat2"], select[name="cat3"], select[name="cat4"], select[name="cat5"], ' +
|
||||
'select[name="cat6"], select[name="cat7"], select[name="cat8"], select[name="cat9"], select[name="cat10"]')
|
||||
.on('change', function () {
|
||||
var all = $(this).val();
|
||||
$(this).val(all[all.length-1])
|
||||
})
|
||||
});
|
||||
|
||||
var filter = {};
|
||||
filter.getCats = (catId, divId) => {
|
||||
@ -19,11 +20,10 @@ $(document).ready(function () {
|
||||
type: 'get',
|
||||
url: '/class/getcats/'+ divId,
|
||||
success: function (response) {
|
||||
hideLoader()
|
||||
hideLoader();
|
||||
if(response['title'] != undefined){
|
||||
var btn = '<button type="submit" class="btn-1">'+response['nextBtn']+'</button>'
|
||||
if(response['link'] != "")
|
||||
{
|
||||
if(response['link'] != "") {
|
||||
btn = "<a class='btn btn-primary' href='/profile' role='button'>"+response['nextBtn']+"</a>";
|
||||
}
|
||||
$('.cat-item-3').html(
|
||||
@ -51,7 +51,7 @@ $(document).ready(function () {
|
||||
|
||||
filter.hideCats = (num) => {
|
||||
var startNo = num;
|
||||
var endNo = 6;
|
||||
var endNo = 9;
|
||||
|
||||
while (startNo <= endNo) {
|
||||
$('#cat'+ startNo).html("").closest('.cat-item-2').hide();
|
||||
@ -60,7 +60,7 @@ $(document).ready(function () {
|
||||
}
|
||||
};
|
||||
|
||||
for (var i = 1; i <= 6; i++) {
|
||||
for (var i = 1; i <= 10; i++) {
|
||||
(function(){
|
||||
var ii = i;
|
||||
$('#cat'+i).on('change', function (i,e) {
|
||||
@ -73,5 +73,4 @@ $(document).ready(function () {
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@ -32,6 +32,9 @@
|
||||
<input type="hidden" name="cat5" value="{{ request.cat5 }}">
|
||||
<input type="hidden" name="cat6" value="{{ request.cat6 }}">
|
||||
<input type="hidden" name="cat7" value="{{ request.cat7 }}">
|
||||
<input type="hidden" name="cat8" value="{{ request.cat8 }}">
|
||||
<input type="hidden" name="cat9" value="{{ request.cat9 }}">
|
||||
<input type="hidden" name="cat10" value="{{ request.cat10 }}">
|
||||
<input type="hidden" id="currencies" name="currencies" value="">
|
||||
<input type="hidden" name="update_id" value="{{ id }}">
|
||||
<fieldset>
|
||||
|
||||
@ -69,6 +69,30 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6 cat-item mb-2 cat-item-2">
|
||||
<div class="section cat-option select-category post-option card p-2">
|
||||
<h5>{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}</h5>
|
||||
<select class="cat-select" name="cat8" id="cat8" multiple>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6 cat-item mb-2 cat-item-2">
|
||||
<div class="section cat-option select-category post-option card p-2">
|
||||
<h5>{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}</h5>
|
||||
<select class="cat-select" name="cat9" id="cat9" multiple>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6 cat-item mb-2 cat-item-2">
|
||||
<div class="section cat-option select-category post-option card p-2">
|
||||
<h5>{{ trans('visiosoft.module.advs::field.select_a_sub_category') }}</h5>
|
||||
<select class="cat-select" name="cat10" id="cat10" multiple>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-12 cat-item mb-2">
|
||||
<div class="card cat-item-3 p-2">
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Adv\Form;
|
||||
|
||||
use Visiosoft\AdvsModule\Category\Contract\CategoryInterface;
|
||||
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||
|
||||
class AdvFormBuilder extends FormBuilder
|
||||
@ -29,6 +28,9 @@ class AdvFormBuilder extends FormBuilder
|
||||
'cat5',
|
||||
'cat6',
|
||||
'cat7',
|
||||
'cat8',
|
||||
'cat9',
|
||||
'cat10',
|
||||
'currency',
|
||||
'online_payment',
|
||||
'stock',
|
||||
|
||||
@ -319,7 +319,7 @@ class AdvsController extends PublicController
|
||||
$recommended_advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
|
||||
}
|
||||
|
||||
for ($i = 1; $i < 7; $i++) {
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$cat = "cat" . $i;
|
||||
if ($adv->$cat != null) {
|
||||
$item = $this->category_repository->getItem($adv->$cat);
|
||||
@ -417,7 +417,6 @@ class AdvsController extends PublicController
|
||||
$count_user_ads = count($this->adv_model->userAdv()->get());
|
||||
|
||||
if (empty($cats->toArray())) {
|
||||
|
||||
$cats = trans('visiosoft.module.advs::message.create_ad_with_post_cat');
|
||||
|
||||
if (setting_value('visiosoft.module.advs::default_adv_limit') <= $count_user_ads) {
|
||||
@ -433,8 +432,6 @@ class AdvsController extends PublicController
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return $cats;
|
||||
}
|
||||
@ -504,8 +501,9 @@ class AdvsController extends PublicController
|
||||
if ($package != null)
|
||||
$this->messages->error(trans('visiosoft.module.advs::message.please_buy_package'));
|
||||
|
||||
} else
|
||||
} else {
|
||||
$this->messages->error(trans('visiosoft.module.advs::message.max_ad_limit.title'));
|
||||
}
|
||||
|
||||
return redirect('/');
|
||||
}
|
||||
@ -540,7 +538,6 @@ class AdvsController extends PublicController
|
||||
app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->store($adv, $request);
|
||||
}
|
||||
|
||||
|
||||
$form->render($request->update_id);
|
||||
$post = $form->getPostData();
|
||||
$post['id'] = $request->update_id;
|
||||
@ -577,7 +574,6 @@ class AdvsController extends PublicController
|
||||
$events->dispatch(new EditAd($request->update_id, $settings, $adv));//Update Notify
|
||||
}
|
||||
|
||||
|
||||
if ($isActiveDopings) {
|
||||
return redirect(route('add_doping', [$request->update_id]));
|
||||
} else {
|
||||
@ -615,7 +611,7 @@ class AdvsController extends PublicController
|
||||
$cat = 'cat';
|
||||
$cats = array();
|
||||
|
||||
for ($i = 1; $i < 7; $i++) {
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
if ($adv[$cat . $i] != null) {
|
||||
$name = $categoryRepository->getSingleCat($adv[$cat . $i]);
|
||||
if (!is_null($name)) {
|
||||
@ -699,7 +695,6 @@ class AdvsController extends PublicController
|
||||
$main_cats = $this->category_repository->mainCats();
|
||||
|
||||
return $this->view->make('visiosoft.module.advs::new-ad/post-cat', compact('main_cats'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -722,7 +717,7 @@ class AdvsController extends PublicController
|
||||
$params = $this->requestHttp->all();
|
||||
unset($params['action']);
|
||||
|
||||
for ($i = 2; $i <= 7; $i++) {
|
||||
for ($i = 2; $i <= 10; $i++) {
|
||||
if (!isset($params['cat' . $i])) {
|
||||
$params['cat' . $i] = NULL;
|
||||
}
|
||||
|
||||
@ -11,4 +11,19 @@
|
||||
.personal-advantages img {
|
||||
max-height: 60px;
|
||||
max-width: 60px;
|
||||
}
|
||||
|
||||
.approved-phone {
|
||||
background-color: #ebf2e5 !important;
|
||||
border-color: #4a7c20 !important;
|
||||
}
|
||||
|
||||
.rejected-phone {
|
||||
background-color: #f8e6e9 !important;
|
||||
border-color: #ba7b84 !important;
|
||||
}
|
||||
|
||||
.phone-validation-error {
|
||||
color: #c75050;
|
||||
font-size: 14px;
|
||||
}
|
||||
@ -1 +1,48 @@
|
||||
phoneMask("input[name='phone'],input[name='land_phone']");
|
||||
|
||||
// Phone register validation
|
||||
//setup before functions
|
||||
let typingTimer;
|
||||
let doneTypingInterval = 650;
|
||||
let phoneInput = $(".validate-phone input[name='phone']");
|
||||
|
||||
//on keyup, start the countdown
|
||||
phoneInput.on('keyup', function () {
|
||||
clearTimeout(typingTimer);
|
||||
typingTimer = setTimeout(function () {
|
||||
doneTyping(phoneInput.val())
|
||||
}, doneTypingInterval)
|
||||
});
|
||||
|
||||
//on keydown, clear the countdown
|
||||
phoneInput.on('keydown', function () {
|
||||
clearTimeout(typingTimer);
|
||||
});
|
||||
|
||||
function doneTyping(phoneNum) {
|
||||
if (!phoneNum.includes('_') && phoneNum !== "") {
|
||||
let countryCode = $(".iti__selected-flag").attr('title').split("+");
|
||||
countryCode = '+' + countryCode[countryCode.length - 1];
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
data: {'phoneNumber': countryCode + phoneNum.substr(1)},
|
||||
url: 'ajax/phone-validation',
|
||||
success: function (response) {
|
||||
if (response.userExists) {
|
||||
phoneInput.addClass('rejected-phone');
|
||||
phoneInput.removeClass('approved-phone');
|
||||
$('.phone-validation-error').removeClass('d-none')
|
||||
} else {
|
||||
phoneInput.addClass('approved-phone');
|
||||
phoneInput.removeClass('rejected-phone');
|
||||
$('.phone-validation-error').addClass('d-none')
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
phoneInput.removeClass('approved-phone');
|
||||
phoneInput.removeClass('rejected-phone');
|
||||
$('.phone-validation-error').addClass('d-none')
|
||||
}
|
||||
}
|
||||
@ -31,6 +31,9 @@ return [
|
||||
'personal_registration_list_3' => 'Send messages to the ad owners on the site.',
|
||||
'register_information_note' => 'The information on this page is taken for ' . env('APPLICATION_DOMAIN') . ' membership. You can find detailed information about the protection of personal data here.',
|
||||
|
||||
// Register page
|
||||
'phone_validation_error' => 'This email address is in use by another member.',
|
||||
|
||||
// Forgot Password
|
||||
'create_new_password' => 'Create New Password',
|
||||
];
|
||||
@ -47,6 +47,25 @@
|
||||
'class' :'hidden',
|
||||
}).input|raw }}
|
||||
{% endif %}
|
||||
<div class="col-12">
|
||||
<div class="form-group email-field phone-field_type register-phone mb-2">
|
||||
<label class="control-label">
|
||||
{{ trans('visiosoft.theme.base::field.phone_number') }}
|
||||
<span class="required">*</span>
|
||||
</label>
|
||||
|
||||
<div class="input-wrapper validate-phone">
|
||||
{{ form.fields.phone.setValue(form.fields.phone.value).input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 mb-3">
|
||||
<p class="phone-validation-error mb-0 d-none">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
{{ trans('visiosoft.theme.base::field.phone_validation_error') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="form-group password-field password-field_type">
|
||||
<label class="control-label">
|
||||
@ -58,16 +77,4 @@
|
||||
{{ form.fields.password.setPlaceholder(trans('visiosoft.theme.base::field.password')).input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-group email-field phone-field_type register-phone">
|
||||
<label class="control-label">
|
||||
{{ trans('visiosoft.theme.base::field.phone_number') }}
|
||||
<span class="required">*</span>
|
||||
</label>
|
||||
|
||||
<div class="input-wrapper">
|
||||
{{ form.fields.phone.setValue(form.fields.phone.value).input|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -69,8 +69,8 @@ class CategoryController extends AdminController
|
||||
$k++;
|
||||
}
|
||||
}
|
||||
if ($i >= 7) {
|
||||
$this->messages->error('You have reached your sub-category limit, you can only add 5 sub-categories.');
|
||||
if ($i > 10) {
|
||||
$this->messages->error('You have reached your sub-category limit, you can only add 9 sub-categories.');
|
||||
|
||||
return $this->redirect->back();
|
||||
}
|
||||
|
||||
@ -224,4 +224,15 @@ class UserAuthenticator
|
||||
{
|
||||
return response()->json(['status' => $type, 'message' => $message]);
|
||||
}
|
||||
|
||||
public function phoneValidation(Request $request, UserRepositoryInterface $userRepository)
|
||||
{
|
||||
$phoneNum = str_replace(' ', '', $request->phoneNumber);
|
||||
$userExists = $userRepository->findBy('gsm_phone', $phoneNum);
|
||||
if ($userExists) {
|
||||
return response()->json(['userExists' => true]);
|
||||
} else {
|
||||
return response()->json(['userExists' => false]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,6 +111,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
||||
\Barryvdh\Cors\HandleCors::class,
|
||||
]
|
||||
],
|
||||
'ajax/phone-validation' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@phoneValidation',
|
||||
|
||||
/* Login */
|
||||
'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user