This commit is contained in:
Diatrex 2020-03-20 09:44:57 +03:00
commit 5df39e1c51
67 changed files with 823 additions and 283 deletions

1
_config.yml Normal file
View File

@ -0,0 +1 @@
theme: jekyll-theme-cayman

View File

@ -114,6 +114,11 @@ class VisiosoftModuleAdvsCreateAdvsFields extends Migration
'order' => 'anomaly.field_type.integer',
'price' => [
'type' => 'visiosoft.field_type.decimal',
'config' => [
'decimal' => 2,
'separator' => '.',
'point' => ','
],
],
'currency' => [
'type' => 'anomaly.field_type.select',

View File

@ -19,6 +19,7 @@ return [
'fields' => [
'latest-limit',
'auto_approve',
'estimated_pending_time',
'default_published_time',
'default_adv_limit',
'default_GET',

View File

@ -22,6 +22,12 @@ return [
'default_value' => true,
],
],
'estimated_pending_time' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 6,
],
],
'default_published_time' => [
'type' => 'anomaly.field_type.integer',
'bind' => 'adv.default_published_time',

View File

@ -1,4 +1,16 @@
.ad-detail-tabs .nav-link.active {
background-color: #FFC106 !important;
border-color: #ffc107 #ffc107 #ffc107;
}
/* Pending screen */
.pending-screen {
background-color: #f2f2f2;
color: #b31901;
}
.pending-screen img {
height: 7em;
}
.pending-screen p {
font-weight: 500;
}

View File

@ -1,6 +1,6 @@
.dropleft-edit {
right: 0;
top: 50%;
top: 40%;
}
.dropleft-edit button {
transform: rotate(-90deg) translate(0, -100%);

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

View File

@ -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 () {
});
})();
}
});

View File

@ -8,10 +8,12 @@ return [
'new_district' => 'حي جديد',
'new_neighborhood' => 'حي جديد',
'new_village' => 'قرية جديدة',
'edit' => "تعديل",
'approve' => "يوافق",
'decline' => 'انخفاض',
'extend' => 'تمديد',
'extend_all' => 'تمديد الكل',
'categories' => 'التصنيفات',
'sub_category' => 'الفئات الفرعية',
'add_sub_category' => 'إضافة فئة فرعية',
'sub_cities' => 'مدن فرعية',
@ -23,6 +25,7 @@ return [
'sub_neighborhoods' => 'الأحياء الفرعية',
'sub_village' => 'قرية فرعية',
'general_settings' => 'الاعدادات العامة',
'save_category' => 'حفظ الفئة',
'update_category' => [
'name' => 'تحديث الفئة'
],

View File

@ -95,9 +95,6 @@ return [
'pending_adv' => [
'name' => 'اعلانات معلقة'
],
'archived_adv' => [
'name' => 'الإعلانات المؤرشفة'
],
'finish_at' => [
'name' => 'ينتهي عند'
],
@ -126,6 +123,8 @@ return [
'list-page' => 'قائمة الصفحة',
'search' => 'بحث',
'recommended' => 'الإعلانات الموصى بها لك',
'filter' => 'منقي',
'sort' => 'فرز',
'sort_by' => 'ترتيب حسب',
'pick_option' => 'اختيار خيار',
'pick_ordering' => 'تنظيم',
@ -236,6 +235,7 @@ return [
'name' => 'بيعت كلها',
],
'edit_category' => 'تحرير الفئة',
'set_category' => 'حدد الفئة',
'max' => [
'name' => 'ماكس',
],
@ -263,4 +263,12 @@ return [
"no_location" => "لا يوجد موقع محدد.",
"continue" => 'استمر',
"gallery" => 'صالة عرض',
// Pending screen
'pending_message_1' => 'الإعلان قيد عملية الموافقة',
'pending_message_2' => "تاريخ تحديث الإعلان",
'pending_message_3' => 'وقت الانتظار المقدر',
'pending_message_4' => 'سيتم إضافة الوقت المستغرق في عملية الموافقة إلى وقت تناول المنشطات.',
'pending_message_5' => 'لا يمكن إجراء معاملات من مركز الاتصال بخصوص الإعلان في عملية الموافقة.',
'hours' => 'ساعات'
];

View File

@ -27,4 +27,5 @@ return [
'success_delete' => 'تم حذف الإعلان',
'pending_ad_status' => 'إعلانك في انتظار موافقة المحرر.',
'extended' => ': تم تمديد عدد الإعلانات بنجاح.',
'category_not_exist' => 'هذه الفئة لم تعد موجودة!',
];

View File

@ -4,6 +4,10 @@ return [
'auto_approve' => [
'name' => 'الموافقة التلقائية',
],
'estimated_pending_time' => [
'name' => 'الوقت المعلق المقدر',
'instructions' => 'في ساعات',
],
'default_published_time' => [
'name' => 'وقت النشر الافتراضي',
],

View File

@ -263,4 +263,12 @@ return [
"no_location" => "No location is selected.",
"continue" => 'Continue',
"gallery" => 'Gallery',
// Pending screen
'pending_message_1' => 'The Ad is in the Approval Process',
'pending_message_2' => "Ad's Update Date",
'pending_message_3' => 'Estimated Waiting Time',
'pending_message_4' => 'The time spent in the approval process will be added to the doping time.',
'pending_message_5' => 'No transactions can be made from the call center regarding the ad in the approval process.',
'hours' => 'hours'
];

View File

@ -4,6 +4,10 @@ return [
'auto_approve' => [
'name' => 'Auto Approve',
],
'estimated_pending_time' => [
'name' => 'Estimated Pending Time',
'instructions' => 'In Hours',
],
'default_published_time' => [
'name' => 'Default Publish Time',
],

View File

@ -8,10 +8,12 @@ return [
'new_district' => 'Новый Район',
'new_neighborhood' => 'Новый район',
'new_village' => 'Новая Деревня',
'edit' => "редактировать",
'approve' => "Утвердить",
'decline' => 'снижение',
'extend' => 'простираться',
'extend_all' => 'Расширить все',
'categories' => 'категории',
'sub_category' => 'Подкатегории',
'add_sub_category' => 'Добавить подкатегорию',
'sub_cities' => 'Подгорода',
@ -23,6 +25,7 @@ return [
'sub_neighborhoods' => 'Суб соседства',
'sub_village' => 'Sub Village',
'general_settings' => 'общие настройки',
'save_category' => 'Сохранить категорию',
'update_category' => [
'name' => 'Обновить категорию'
],

View File

@ -95,9 +95,6 @@ return [
'pending_adv' => [
'name' => 'Ожидающие объявления'
],
'archived_adv' => [
'name' => 'Архивные объявления'
],
'finish_at' => [
'name' => 'Закончить в'
],
@ -126,6 +123,8 @@ return [
'list-page' => 'Страница списка',
'search' => 'Поиск',
'recommended' => 'Рекомендуемые объявления для вас',
'filter' => 'Фильтр',
'sort' => 'Сортировать',
'sort_by' => 'Сортировать по',
'pick_option' => 'Выберите опцию',
'pick_ordering' => 'заказ',
@ -237,6 +236,7 @@ return [
'name' => 'Продано',
],
'edit_category' => 'Изменить категорию',
'set_category' => 'Установить категорию',
'max' => [
'name' => 'Максимум',
],
@ -264,4 +264,12 @@ return [
"no_location" => "Местоположение не выбрано.",
"continue" => 'Продолжить',
"gallery" => 'Галерея',
// Pending screen
'pending_message_1' => 'Объявление находится в процессе одобрения',
'pending_message_2' => "Дата обновления объявления",
'pending_message_3' => 'Расчетное время ожидания',
'pending_message_4' => 'Время, потраченное на процесс утверждения, будет добавлено к времени допинга.',
'pending_message_5' => 'Никакие транзакции не могут быть сделаны из колл-центра относительно объявления в процессе одобрения.',
'hours' => 'часов'
];

View File

@ -28,4 +28,5 @@ return [
'success_delete' => 'Объявление удалено',
'pending_ad_status' => 'Ваше объявление ожидает одобрения редактором.',
'extended' => ': количество объявлений было успешно продлено.',
'category_not_exist' => 'Эта категория больше не существует!',
];

View File

@ -4,6 +4,10 @@ return [
'auto_approve' => [
'name' => 'Авто Одобрить',
],
'estimated_pending_time' => [
'name' => 'Расчетное время ожидания',
'instructions' => 'В часах',
],
'default_published_time' => [
'name' => 'Время публикации по умолчанию',
],

View File

@ -8,10 +8,12 @@ return [
'new_district' => 'Rrethi i Ri',
'new_neighborhood' => 'Lagjja e re',
'new_village' => 'Fshati i Ri',
'edit' => "redaktoj",
'approve' => "miratoj",
'decline' => 'rënie',
'extend' => 'shpreh',
'extend_all' => 'Zgjeroni të gjitha',
'categories' => 'Kategoritë',
'sub_category' => 'Nënkategoritë',
'add_sub_category' => 'Shtoni Nën Kategorinë',
'sub_cities' => 'Qytetet nën-qytet',
@ -23,6 +25,7 @@ return [
'sub_neighborhoods' => 'Nën lagjet',
'sub_village' => 'Nën fshat',
'general_settings' => 'Cilësimet e përgjithshme',
'save_category' => 'Ruaj kategorinë',
'update_category' => [
'name' => 'Kategoria e azhurnuar'
],

View File

@ -95,9 +95,6 @@ return [
'pending_adv' => [
'name' => 'Në pritje të reklamave'
],
'archived_adv' => [
'name' => 'Reklama të arkivuara'
],
'finish_at' => [
'name' => 'Mbaro At'
],
@ -126,6 +123,8 @@ return [
'list-page' => 'Faqja e listës',
'search' => 'Kërko',
'recommended' => 'Reklama të rekomanduara për ju',
'filter' => 'filtër',
'sort' => 'lloj',
'sort_by' => 'Ndaj sipas',
'pick_option' => 'Zgjidh një mundësi',
'pick_ordering' => 'renditje',
@ -236,6 +235,7 @@ return [
'name' => 'E shitur',
],
'edit_category' => 'Ndrysho kategorinë',
'set_category' => 'Vendosni Kategorinë',
'max' => [
'name' => 'Max',
],
@ -263,4 +263,12 @@ return [
"no_location" => "Asnjë vendndodhje nuk është zgjedhur.",
"continue" => 'vazhdoj',
"gallery" => 'Galeri',
// Pending screen
'pending_message_1' => 'Shpallja është në Procesin e Miratimit',
'pending_message_2' => "Data e azhurnimit të reklamës",
'pending_message_3' => 'Koha e parashikuar e pritjes',
'pending_message_4' => 'Koha e kaluar në procesin e miratimit do t\'i shtohet kohës së dopingut.',
'pending_message_5' => 'Asnjë transaksion nuk mund të bëhet nga qendra e thirrjeve në lidhje me reklamën në procesin e miratimit.',
'hours' => 'orë'
];

View File

@ -27,4 +27,5 @@ return [
'success_delete' => 'Shpallja është fshirë',
'pending_ad_status' => 'Reklama juaj është në pritje të aprovimit nga Redaktori.',
'extended' => ': reklamat e numrave janë zgjeruar me sukses.',
'category_not_exist' => 'Kjo kategori nuk ekziston më!',
];

View File

@ -4,6 +4,10 @@ return [
'auto_approve' => [
'name' => 'Miratimi automatik',
],
'estimated_pending_time' => [
'name' => 'Koha e parashikuar e pritjes',
'instructions' => 'Në Orë',
],
'default_published_time' => [
'name' => 'Koha e publikimit të paracaktuar',
],

View File

@ -8,10 +8,12 @@ return [
'new_district' => 'Yeni bölge',
'new_neighborhood' => 'Yeni mahalle',
'new_village' => 'Yeni köy',
'edit' => "Düzenle",
'approve' => "Onayla",
'decline' => 'Reddet',
'extend' => 'Uzat',
'extend_all' => 'Tümünün Tarihini Güncelle',
'categories' => 'Kategoriler',
'sub_category' => 'Alt Kategoriler',
'add_sub_category' => 'Alt Kategori Ekle',
'sub_cities' => 'Alt Şehirler',
@ -23,6 +25,7 @@ return [
'sub_neighborhoods' => 'Alt Mahalleler',
'sub_village' => 'Alt Köy',
'general_settings' => 'Genel Ayarlar',
'save_category' => 'Kategoriyi Kaydet',
'update_category' => [
'name' => 'Kategori Güncelle'
],

View File

@ -123,6 +123,8 @@ return [
'list-page' => 'Liste Sayfası',
'search' => 'Arama',
'recommended' => 'Sizin için Önerilen İlanlar',
'filter' => 'filtre',
'sort' => 'Çeşit',
'sort_by' => 'Sırala',
'pick_option' => 'Bir seçenek seçin',
'pick_ordering' => 'Sıralama Seç',
@ -235,6 +237,7 @@ return [
'name' => 'Tükendi',
],
'edit_category' => 'Kategori Düzenle',
'set_category' => 'Kategoriyi Ayarla',
'max' => [
'name' => 'Maksimum',
],
@ -262,4 +265,12 @@ return [
"no_location" => "Lokasyon eklenmemiş.",
"continue" => 'Devam Et',
"gallery" => 'Galeri',
// Pending screen
'pending_message_1' => 'Reklam Onay Sürecinde',
'pending_message_2' => "Reklamın Güncelleme Tarihi",
'pending_message_3' => 'Tahmini Bekleme Süresi',
'pending_message_4' => 'Onay sürecinde geçirilen süre doping zamanına eklenecektir.',
'pending_message_5' => 'Onay sürecinde reklamla ilgili çağrı merkezinden hiçbir işlem yapılamaz.',
'hours' => 'saatler'
];

View File

@ -27,4 +27,5 @@ return [
'success_delete' => 'İlan Silindi',
'pending_ad_status' => 'İlanınız Editör tarafından onay beklemektedir.',
'extended' => ':number ilan süresi uzatıldı.',
'category_not_exist' => 'Bu kategori artık mevcut değil!',
];

View File

@ -4,6 +4,10 @@ return [
'auto_approve' => [
'name' => 'Otomatik Onaylama',
],
'estimated_pending_time' => [
'name' => 'Tahmini Bekleme Süresi',
'instructions' => 'Saatlerde',
],
'default_published_time' => [
'name' => 'Varsayılan Yayın Süresi',
],

View File

@ -1,6 +1,19 @@
{% if adv.status == "pending_user" or adv.status == "pending_admin" %}
<div class="alert bg-info text-white alert-dismissible">
<i class="fas fa-exclamation-triangle"></i>
{{ trans('visiosoft.module.advs::message.pending_ad_status') }}
</div>
<div class="pending-screen mt-3 text-center py-5 rounded px-2">
<img src="{{ img('visiosoft.module.advs::images/alarm.png').url }}" alt="pending icon">
<h5 class="my-3">{{ trans('visiosoft.module.advs::field.pending_message_1') }}</h5>
<div class="row">
<div class="col-6 text-right">{{ trans('visiosoft.module.advs::field.pending_message_2') }}</div>
<div class="col-6 text-left pl-0">: {{ adv.updated_at|date('d M Y H:i') }}</div>
</div>
<div class="row">
<div class="col-6 text-right">{{ trans('visiosoft.module.advs::field.pending_message_3') }}</div>
<div class="col-6 text-left pl-0">
: {{ setting_value('visiosoft.module.advs::estimated_pending_time') }} {{ trans('visiosoft.module.advs::field.hours') }}
</div>
</div>
<p class="text-dark mb-0 mt-3">{{ trans('visiosoft.module.advs::field.pending_message_4') }}</p>
<p class="text-dark">{{ trans('visiosoft.module.advs::field.pending_message_5') }}</p>
</div>
{% endif %}

View File

@ -1,188 +1,188 @@
{% set formHtml %}
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get">
{% endset %}
{% if 'cat' in param|keys %}
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get">
{% endset %}
{% if 'cat' in param|keys %}
{% if not param['cat'] is empty %}
{% set catId = entries('cats', 'category').find(param['cat']) %}
{% set cityId = null %}
{% if 'city' in param|keys %}
{% set citiesArray = param['city'][0]|split(',') %}
{% if count(citiesArray) is same as(1) %}
{% set cityId = entries('location', 'cities').find(param['city'][0]) %}
{% set catId = entries('cats', 'category').find(param['cat']) %}
{% set cityId = null %}
{% if 'city' in param|keys %}
{% set citiesArray = param['city'][0]|split(',') %}
{% if count(citiesArray) is same as(1) %}
{% set cityId = entries('location', 'cities').find(param['city'][0]) %}
{% endif %}
{% endif %}
{% endif %}
{% set formHtml %}
<form action="{{ url_route('adv_list_seo', [catId.slug, cityId.slug]) }}" method="get">
{% set formHtml %}
<form action="{{ url_route('adv_list_seo', [catId.slug, cityId.slug]) }}" method="get">
{% endset %}
{% endif %}
{% endif %}
{{ formHtml }}
<div class="row">
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}">
<input type="hidden" name="user" value="{{ app.request.get('user') }}">
<div class="col-md-12 px-4">
<div class="row">
<div id="filter" class="w-100 mb-3">
{% endif %}
{% endif %}
{{ formHtml }}
<div class="row">
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}">
<input type="hidden" name="user" value="{{ app.request.get('user') }}">
<div class="col-md-12 px-4">
<div class="row">
<div id="filter" class="w-100 mb-3">
{{ addBlock('ads-list/partials/list-filter',{
'mainCats':mainCats,
'subCats':subCats,
'ranges':ranges,
'checkboxes':checkboxes,
'topfields' : topfields,
'radio':radio,
'countries':countries,
'cities':cities,
'districts':districts,
'neighborhoods':neighborhoods,
'villages':villages,
'param':param
})|raw }}
{{ addBlock('ads-list/partials/list-filter',{
'mainCats':mainCats,
'subCats':subCats,
'ranges':ranges,
'checkboxes':checkboxes,
'topfields' : topfields,
'radio':radio,
'countries':countries,
'cities':cities,
'districts':districts,
'neighborhoods':neighborhoods,
'villages':villages,
'param':param
})|raw }}
<!-- Price Filter Start -->
{% include 'visiosoft.module.advs::list/partials/price-filter' %}
<!-- Price Filter End -->
<!-- Price Filter Start -->
{% include 'visiosoft.module.advs::list/partials/price-filter' %}
<!-- Price Filter End -->
<!-- Date Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="dateHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse" data-target="#date"
aria-expanded="true" aria-controls="date">
<i class="fa fa-calendar"></i>
{{ trans("visiosoft.module.advs::field.date.name") }}
</button>
</h5>
</div>
<div id="dateContainer" class="collapse show overflow-auto" aria-labelledby="dateHeading"
data-parent="#filter"
style="max-height: 300px;">
<div class="d-flex flex-column p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'day' %}
checked
{% endif %}
type="radio" name="date" id="dateDay"
value="day">
<label class="form-check-label" for="dateDay">
{{ trans("visiosoft.module.advs::field.in_the_last_24_hours.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'week' %}
checked
{% endif %}
type="radio" name="date" id="dateWeek"
value="week">
<label class="form-check-label" for="dateWeek">
{{ trans("visiosoft.module.advs::field.in_the_last_week.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'month' %}
checked
{% endif %}
type="radio" name="date" id="dateMonth"
value="month">
<label class="form-check-label" for="dateMonth">
{{ trans("visiosoft.module.advs::field.in_the_last_month.name") }}
</label>
</div>
</div>
</div>
<!-- Date Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="dateHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse" data-target="#date"
aria-expanded="true" aria-controls="date">
<i class="fa fa-calendar"></i>
{{ trans("visiosoft.module.advs::field.date.name") }}
</button>
</h5>
</div>
<!-- Date Filter End -->
<!-- Media Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="mediaHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse" data-target="#media"
aria-expanded="true" aria-controls="media">
<i class="fa fa-camera"></i>
{{ trans("visiosoft.module.advs::field.photo.name") }}
, {{ trans("visiosoft.module.advs::field.video.name") }}
</button>
</h5>
</div>
<div id="mediaContainer" class="collapse show overflow-auto" aria-labelledby="mediaHeading"
data-parent="#filter"
style="max-height: 300px;">
<div class="d-flex p-3 m-0 flex-column">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('photo') == true %}
<div id="dateContainer" class="collapse show overflow-auto" aria-labelledby="dateHeading"
data-parent="#filter"
style="max-height: 300px;">
<div class="d-flex flex-column p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'day' %}
checked
{% endif %}
value="true" name="photo"
id="photo">
<label class="form-check-label" for="photo">
{{ trans("visiosoft.module.advs::field.ads_with_photo.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('video') == true %}
checked
{% endif %}
value="true" name="video"
id="video">
<label class="form-check-label" for="video">
{{ trans("visiosoft.module.advs::field.ads_with_video.name") }}
</label>
</div>
type="radio" name="date" id="dateDay"
value="day">
<label class="form-check-label" for="dateDay">
{{ trans("visiosoft.module.advs::field.in_the_last_24_hours.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'week' %}
checked
{% endif %}
type="radio" name="date" id="dateWeek"
value="week">
<label class="form-check-label" for="dateWeek">
{{ trans("visiosoft.module.advs::field.in_the_last_week.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input"
{% if app.request.get('date') == 'month' %}
checked
{% endif %}
type="radio" name="date" id="dateMonth"
value="month">
<label class="form-check-label" for="dateMonth">
{{ trans("visiosoft.module.advs::field.in_the_last_month.name") }}
</label>
</div>
</div>
</div>
<!-- Media Filter End -->
</div>
<!-- Date Filter End -->
<!-- Map Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="mapHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse"
data-target="#mapFilter"
aria-expanded="true" aria-controls="mapFilter">
<i class="fa fa-map"></i>
{{ trans("visiosoft.module.advs::field.map.name") }}
</button>
</h5>
</div>
<div id="mapContainer" class="collapse show overflow-auto" aria-labelledby="mapHeading"
data-parent="#filter"
style="max-height: 300px;">
<div class="row p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('map') == true %}
checked
{% endif %}
value="true" name="map"
id="mapFilter">
<label class="form-check-label" for="mapFilter">
{{ trans("visiosoft.module.advs::field.yes.name") }}
</label>
</div>
<!-- Media Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="mediaHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse" data-target="#media"
aria-expanded="true" aria-controls="media">
<i class="fa fa-camera"></i>
{{ trans("visiosoft.module.advs::field.photo.name") }}
, {{ trans("visiosoft.module.advs::field.video.name") }}
</button>
</h5>
</div>
<div id="mediaContainer" class="collapse show overflow-auto" aria-labelledby="mediaHeading"
data-parent="#filter"
style="max-height: 300px;">
<div class="d-flex p-3 m-0 flex-column">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('photo') == true %}
checked
{% endif %}
value="true" name="photo"
id="photo">
<label class="form-check-label" for="photo">
{{ trans("visiosoft.module.advs::field.ads_with_photo.name") }}
</label>
</div>
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('video') == true %}
checked
{% endif %}
value="true" name="video"
id="video">
<label class="form-check-label" for="video">
{{ trans("visiosoft.module.advs::field.ads_with_video.name") }}
</label>
</div>
</div>
</div>
<!-- Map Filter End -->
</div>
<!-- Media Filter End -->
<div class="card">
<div class="card-header bg-primary text-center" id="submitHeading">
<h5 class="mb-0">
<button class="btn btn-link text-white w-100">
<i class="fas fa-search"></i>
{{ trans("visiosoft.module.advs::field.search") }}
</button>
</h5>
<!-- Map Filter Start -->
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="mapHeading">
<h5 class="mb-0">
<button class="btn btn-link text-dark" data-toggle="collapse"
data-target="#mapFilter"
aria-expanded="true" aria-controls="mapFilter">
<i class="fa fa-map"></i>
{{ trans("visiosoft.module.advs::field.map.name") }}
</button>
</h5>
</div>
<div id="mapContainer" class="collapse show overflow-auto" aria-labelledby="mapHeading"
data-parent="#filter"
style="max-height: 300px;">
<div class="row p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox"
{% if app.request.get('map') == true %}
checked
{% endif %}
value="true" name="map"
id="mapFilter">
<label class="form-check-label" for="mapFilter">
{{ trans("visiosoft.module.advs::field.yes.name") }}
</label>
</div>
</div>
</div>
</div>
<!-- Map Filter End -->
<div class="card">
<div class="card-header bg-primary text-center" id="submitHeading">
<h5 class="mb-0">
<button class="btn btn-link text-white w-100">
<i class="fas fa-search"></i>
{{ trans("visiosoft.module.advs::field.search") }}
</button>
</h5>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</form>

View File

@ -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>

View File

@ -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">

View File

@ -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',

View File

@ -13,7 +13,6 @@ use Visiosoft\LocationModule\Village\VillageRepository;
use Visiosoft\LocationModule\Village\VillageModel;
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
use Visiosoft\CatsModule\Category\CategoryRepository;
use Anomaly\Streams\Platform\Model\Advs\AdvsCategoriesEntryModel;
use Visiosoft\CatsModule\Category\CategoryModel;
use Illuminate\Routing\Router;
use Visiosoft\LocationModule\Country\Contract\CountryRepositoryInterface;
@ -111,11 +110,11 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
'getlocations' => 'Visiosoft\AdvsModule\Http\Controller\advsController@getLocations',
'advs/main' => 'Visiosoft\AdvsModule\Http\Controller\advsController@advsMainPage',
'advs/adv/{id}' => [
'as' => 'adv_detail',
'as' => 'adv_detail_backup',
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@view'
],
'advs/adv/{id}/{seo}' => [
'as' => 'adv_detail_seo',
'as' => 'adv_detail_seo_backup',
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@view'
],
'ad/{id}' => [

View File

@ -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;
}

View File

@ -0,0 +1,25 @@
@media only screen and (min-width: 768px) {
.forgot-wrapper {
padding-top: 4em;
padding-bottom: 4em;
padding-left: 4.25em;
border: 1px solid #dee2e6!important;
}
}
@media only screen and (min-width: 768px) {
.forgot-form-wrapper {
width: 20em !important;
}
}
.forgot-img {
height: 11em;
width: 10em;
}
.forgot-wrapper label {
font-size: 14px;
}
@media only screen and (min-width: 768px) {
.forgot-form-wrapper button {
width: initial !important;
}
}

View File

@ -111,10 +111,9 @@
background: #fafafa;
color: #489ae8;
}
@media only screen and (min-width: 470px) {
.login-section {
padding: 70px 78px 148px 77px;
padding: 70px 30px 148px;
}
.register-section {
@ -123,4 +122,9 @@
padding-right: 85px;
background-color: #fff;
}
}
@media only screen and (min-width: 1200px) {
.login-section {
padding: 70px 78px 148px 77px;
}
}

View File

@ -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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -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')
}
}

View File

@ -30,4 +30,13 @@ return [
'personal_registration_list_2' => 'أضف الإعلانات التي تهتم بها ، واتبع تغيرات الأسعار بعد إضافتها إلى مفضلاتك ، وإنشاء عمليات بحث مفضلة تلبي معاييرك ،',
'personal_registration_list_3' => 'أرسل رسائل إلى مالكي الإعلانات على الموقع.',
'register_information_note' => 'تؤخذ المعلومات على هذه الصفحة ل ' . env('APPLICATION_DOMAIN') . ' عضوية. يمكنك العثور على معلومات مفصلة حول حماية البيانات الشخصية هنا.',
// Register page
'phone_validation_error' => 'رقم الهاتف هذا قيد الاستخدام من قبل عضو آخر.',
// Forgot Password
'create_new_password' => 'إنشاء كلمة مرور جديدة',
// Login page
'or' => 'أو'
];

View File

@ -30,4 +30,13 @@ return [
'personal_registration_list_2' => 'Add the ads you are interested in, follow the price changes after adding them to your favorites, create favorite searches that meet your criteria,',
'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 phone number is in use by another member.',
// Forgot Password
'create_new_password' => 'Create New Password',
// Login page
'or' => 'or'
];

View File

@ -30,4 +30,13 @@ return [
'personal_registration_list_2' => 'Добавьте объявления, которые вас интересуют, следите за изменениями цен после добавления их в избранное, создавайте избранные поиски, которые соответствуют вашим критериям,',
'personal_registration_list_3' => 'Отправляйте сообщения владельцам рекламы на сайте.',
'register_information_note' => 'Информация на этой странице принимается за ' . env('APPLICATION_DOMAIN') . ' членство. Вы можете найти подробную информацию о защите персональных данных здесь.',
// Register page
'phone_validation_error' => 'Этот номер телефона используется другим участником.',
// Forgot Password
'create_new_password' => 'Создать новый пароль',
// Login page
'or' => 'или'
];

View File

@ -30,4 +30,13 @@ return [
'personal_registration_list_2' => 'Shtoni reklamat që ju interesojnë, ndiqni ndryshimet e çmimeve pasi t\'i shtoni ato në të preferuarat tuaja, krijoni kërkime të preferuara që plotësojnë kriteret tuaja,',
'personal_registration_list_3' => 'Dërgoni mesazhe pronarëve të reklamave në faqe.',
'register_information_note' => 'Informacioni në këtë faqe merret për ' . env('APPLICATION_DOMAIN') . ' anëtarësimi. Mund të gjeni informacione të hollësishme në lidhje me mbrojtjen e të dhënave personale këtu.',
// Register page
'phone_validation_error' => 'Ky numër telefoni është në përdorim nga një anëtar tjetër.',
// Forgot Password
'create_new_password' => 'Krijoni fjalëkalimin e ri',
// Login page
'or' => 'ose'
];

View File

@ -30,4 +30,13 @@ return [
'personal_registration_list_2' => 'İlgilendiğiniz reklamları ekleyin, favorilerinize ekledikten sonra fiyat değişikliklerini takip edin, kriterlerinize uygun favori aramalar oluşturun,',
'personal_registration_list_3' => 'Sitedeki reklam sahiplerine mesaj gönderin.',
'register_information_note' => 'Bu sayfadaki bilgiler ' . env('APPLICATION_DOMAIN') . ' üyelik. Kişisel verilerin korunması hakkında ayrıntılı bilgiyi burada bulabilirsiniz.',
// Register page
'phone_validation_error' => 'Bu telefon numarası başka bir üye tarafından kullanılıyor.',
// Forgot Password
'create_new_password' => 'Yeni Şifre Oluştur',
// Login page
'or' => 'veya'
];

View File

@ -58,17 +58,19 @@
<div class="col-12 py-0">
<label class="c-input c-checkbox remember_me">
<input value="0" type="hidden" name="remember_me">
<input type="checkbox" name="remember_me">
<input type="checkbox" name="remember_me" class="align-middle">
<span class="c-indicator"></span>
{{ trans('visiosoft.theme.base::field.remember_me') }}
</label>
</div>
<div class="social-login py-2 row">
{{ addBlock('login/oauth')|raw }}
</div>
{% if addBlock('login/oauth') %}
<div class="text-center text-muted">- {{ trans('visiosoft.theme.base::field.or') }} -</div>
<div class="social-login py-2 px-3">
{{ addBlock('login/oauth')|raw }}
</div>
{% endif %}
</div>
<div class="col-12 col-lg-5 m-3 py-4 row register-section align-items-center">
<div class="col-12 text-center">
<h3 class="py-0">{{ trans('visiosoft.theme.base::field.not_a_member_yet') }}?</h3>

View File

@ -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>

View File

@ -1,21 +1,27 @@
{% extends "theme::layouts/default" %}
{% block content %}
<div class="row justify-content-center">
<div class="col-12 col-sm-8 col-md-6 col-lg-4 text-left bg-light p-3 m-0">
{% set form = form('forgot_password').redirect(request_get('redirect', '/'))
<div class="d-flex mt-4 forgot-wrapper">
<div class="d-none d-md-block">
<img src="{{ img('visiosoft.theme.base::images/forgot-password.png').url }}" class="forgot-img"
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': 'row form ' ~ form.options.class ,
'class': 'form ' ~ form.options.class ,
'url':form.options.url
})|raw }}
<div class="col-12">
<h4>{{ trans('visiosoft.theme.base::field.forgot_password') }}</h4>
<div class="form-group email-field email-field_type">
<label class="control-label">
{{ trans('visiosoft.theme.base::field.email') }}
<div>
<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>
@ -25,11 +31,12 @@
</div>
</div>
<div class="col-12 row m-0">
<button class="btn btn-sm btn-primary w-100 py-2">
<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') }}
{% endblock %}

View File

@ -1,44 +1,24 @@
{% extends "theme::layouts/default" %}
{% block content %}
<div class="row justify-content-center">
<div class="col-12 col-sm-8 col-md-6 col-lg-4 text-left bg-light p-3 m-0">
<div class="d-flex mt-4 forgot-wrapper">
<div class="d-none d-md-block">
<img src="{{ img('visiosoft.theme.base::images/forgot-password.png').url }}" class="forgot-img"
alt="forgot password icon">
</div>
<div class="m-0 ml-md-5 forgot-form-wrapper w-100">
{% set form = form('reset_password').redirect(request_get('redirect', '/'))
.get() %}
{{ form_open({
'class': 'row form ' ~ form.options.class ,
'class': 'form ' ~ form.options.class ,
'url':form.options.url
})|raw }}
<div class="col-12">
<h4>{{ trans('visiosoft.theme.base::button.reset_password') }}</h4>
<div class="form-group email-field email-field_type">
<label class="control-label">
{{ trans('visiosoft.theme.base::field.email') }}
<span class="required">*</span>
</label>
<div class="input-wrapper">
{{ form.fields.email.input|raw }}
</div>
</div>
</div>
<div class="col-12">
<div class="form-group email-field code-field_type">
<label class="control-label">
{{ trans('visiosoft.theme.base::field.reset_code') }}
<span class="required">*</span>
</label>
<div class="input-wrapper">
{{ form.fields.code.input|raw }}
</div>
</div>
</div>
<div class="col-12">
<div class="form-group email-field password-field_type">
<label class="control-label">
<div>
<h5 class="d-none d-md-block">{{ trans('visiosoft.theme.base::field.create_new_password') }}</h5>
<div class="form-group email-field password-field_type mb-2 text-center text-md-left">
<label class="control-label mb-0">
{{ trans('visiosoft.theme.base::field.password') }}
<span class="required">*</span>
</label>
@ -46,11 +26,8 @@
<div class="input-wrapper">
{{ form.fields.password.input|raw }}
</div>
</div>
</div>
<div class="col-12">
<div class="form-group email-field password_confirmation-field_type">
<label class="control-label">
</div><div class="form-group email-field password_confirmation-field_type text-center text-md-left">
<label class="control-label mb-0">
{{ trans('visiosoft.theme.base::field.password_confirmation') }}
<span class="required">*</span>
</label>
@ -61,11 +38,12 @@
</div>
</div>
<div class="col-12 row m-0">
<button class="btn btn-sm btn-primary w-100 py-2">
{{ trans('visiosoft.theme.base::button.reset_password') }}
<div class="m-0 text-center text-md-left">
<button class="btn btn-sm btn-primary py-2 px-3">
{{ trans('visiosoft.theme.base::button.continue') }}
</button>
</div>
</div>
</div>
{{ asset_add('styles.css', 'visiosoft.theme.base::css/forgot.css') }}
{% endblock %}

View File

@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="{{ config_get('streams::distribution.name') }}"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="{{ trans(template.meta_description) }}"/>
<meta name="description" content="{{ setting_value('streams::description') }}"/>
<!-- Meta Tags -->
<title>

View File

@ -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();
}

View File

@ -1,5 +1,6 @@
<?php namespace Visiosoft\DefaultadminTheme\Listener;
use Anomaly\Streams\Platform\Support\Collection;
use Anomaly\Streams\Platform\Ui\Table\Component\Filter\Type\SearchFilter;
use Anomaly\Streams\Platform\Ui\Table\Event\TableIsQuerying;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
@ -48,6 +49,19 @@ class AddGsmFilter
$filter->setSlug('gsm_phone');
$builder->getTable()->addFilter($filter);
$builder->setColumns([
'email',
'gsm_phone',
'status' => [
'value' => 'entry.status_label',
],]
);
$c = Collection::make([
['heading' => 'anomaly.module.users::field.email.name'],
['heading' => 'visiosoft.module.profile::field.gsm_phone.name'],
['heading' => 'anomaly.module.users::field.status.name'],
]);
$builder->getTable()->setHeaders($c);
}
/**

View File

@ -8,7 +8,7 @@ var village;
$('.filter-country-btn').on('click', function () {
if (countries == undefined) {
var promiseForCountries = new Promise(function (resolve, reject) {
crud('', '/ajax/getCountry', 'POST', beforeSend(), function (callback) {
locationCrud('', '/ajax/getCountry', 'POST', beforeSend(), function (callback) {
countries = callback;
resetValue('country', true, false)
$.each(countries, function (index, value) {
@ -39,7 +39,7 @@ $('.filter-city-btn').on('click', function () {
if (cities == undefined || $(this).attr('data-parent') != countries_value) {
$(this).attr('data-parent', countries_value)
var promiseForCities = new Promise(function (resolve, reject) {
crud('id=' + countries_value, '/ajax/getCities', 'POST', beforeSend(), function (callback) {
locationCrud('id=' + countries_value, '/ajax/getCities', 'POST', beforeSend(), function (callback) {
cities = callback;
resetValue('city', true, false)
$.each(cities, function (index, value) {
@ -73,7 +73,7 @@ $('.filter-district-btn').on('click', function () {
if (districts == undefined || $(this).attr('data-parent') != city_value) {
$(this).attr('data-parent', city_value)
var promiseForDistricts = new Promise(function (resolve, reject) {
crud('id=' + city_value, '/ajax/getDistricts', 'POST', beforeSend(), function (callback) {
locationCrud('id=' + city_value, '/ajax/getDistricts', 'POST', beforeSend(), function (callback) {
districts = callback;
resetValue('district', true, false)
$.each(districts, function (index, value) {
@ -107,7 +107,7 @@ $('.filter-neighborhood-btn').on('click', function () {
if (neighborhoods == undefined || $(this).attr('data-parent') != district_value) {
$(this).attr('data-parent', district_value)
var promiseForNeighborhoods = new Promise(function (resolve, reject) {
crud('id=' + district_value, '/ajax/getNeighborhoods', 'POST', beforeSend(), function (callback) {
locationCrud('id=' + district_value, '/ajax/getNeighborhoods', 'POST', beforeSend(), function (callback) {
neighborhoods = callback;
resetValue('neighborhood', true, false)
$.each(neighborhoods, function (index, value) {
@ -141,7 +141,7 @@ $('.filter-village-btn').on('click', function () {
if (village == undefined || $(this).attr('data-parent') != neighborhood_value) {
$(this).attr('data-parent', neighborhood_value)
var promiseForVillage = new Promise(function (resolve, reject) {
crud('id=' + neighborhood_value, '/ajax/getVillage', 'POST', beforeSend(), function (callback) {
locationCrud('id=' + neighborhood_value, '/ajax/getVillage', 'POST', beforeSend(), function (callback) {
village = callback;
$('.filter-location-modal .village').html("");
$.each(village, function (index, value) {
@ -225,7 +225,7 @@ function SelectOnClick() {
}
function crud(params, url, type, beforeSend, callback) {
function locationCrud(params, url, type, beforeSend, callback) {
$.ajax({
type: type,
data: params,

View File

@ -0,0 +1,34 @@
<?php namespace Visiosoft\LocationModule\City\Command;
use Visiosoft\LocationModule\City\CityModel;
class GetCities
{
/**
* @var $country
*/
protected $country;
/**
* GetProduct constructor.
* @param $country
*/
public function __construct($country)
{
$this->country = $country;
}
/**
* @param CityModel $groups
* @return |null
*/
public function handle(CityModel $groups)
{
if ($this->country) {
return $groups->where('parent_country_id', $this->country)->get();
}
return $groups::query()->get();
}
}

View File

@ -0,0 +1,12 @@
<?php namespace Visiosoft\LocationModule\Country\Command;
use Visiosoft\LocationModule\Country\CountryModel;
class GetCountries
{
public function handle(CountryModel $groups)
{
return $groups::query()->get();
}
}

View File

@ -1,7 +1,9 @@
<?php namespace Visiosoft\LocationModule;
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
use Visiosoft\LocationModule\City\Command\GetCities;
use Visiosoft\LocationModule\City\Command\GetCity;
use Visiosoft\LocationModule\Country\Command\GetCountries;
use Visiosoft\LocationModule\Country\Command\GetCountry;
use Visiosoft\LocationModule\District\Command\GetDistrict;
use Visiosoft\LocationModule\Neighborhood\Command\GetNeighborhood;
@ -49,6 +51,17 @@ class LocationModulePlugin extends Plugin
return $ad;
}
),
new \Twig_SimpleFunction(
'getCities',
function ($country = null) {
if (!$ad = $this->dispatch(new GetCities($country))) {
return null;
}
return $ad;
}
),
new \Twig_SimpleFunction(
'getCountry',
function ($id) {
@ -60,6 +73,16 @@ class LocationModulePlugin extends Plugin
return $ad;
}
),
new \Twig_SimpleFunction(
'getCountries',
function () {
if (!$ad = $this->dispatch(new GetCountries())) {
return null;
}
return $ad;
}
),
new \Twig_SimpleFunction(
'getVillage',
function ($id) {

View File

@ -27,4 +27,7 @@ return [
'registered_phone' => 'تم تسجيل رقم الهاتف هذا بالفعل.',
'ajax_address_error' => 'لا يوجد عنوان أو غير مصرح له بالمشاهدة.',
'empty_password_sms_message' => 'نظرًا لمشاكل الأمان ، قمنا بتغيير كلمة المرور الخاصة بك! كلمة المرور الجديدة:',
// Forgot Password
'email_phone_not_found' => 'البريد الإلكتروني ، رقم الهاتف غير صحيح!'
];

View File

@ -27,4 +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:',
// Forgot Password
'email_phone_not_found' => 'The E-mail, Phone Number is not correct!'
];

View File

@ -30,4 +30,7 @@ return [
'registered_phone' => 'Этот номер телефона уже зарегистрирован.',
'ajax_address_error' => 'Нет адреса или не авторизован для просмотра.',
'empty_password_sms_message' => 'Из-за проблем безопасности мы изменили ваш пароль! Ваш новый пароль:',
// Forgot Password
'email_phone_not_found' => 'E-mail, номер телефона неверен!'
];

View File

@ -27,4 +27,7 @@ return [
'registered_phone' => 'Ky numër i telefonit është regjistruar tashmë.',
'ajax_address_error' => 'Asnjë adresë ose jo e autorizuar për të parë.',
'empty_password_sms_message' => 'Për shkak të çështjeve të sigurisë, ne ndryshuam fjalëkalimin tuaj! Fjalëkalimi juaj i ri është:',
// Forgot Password
'email_phone_not_found' => 'E-maili, numri i telefonit nuk është i saktë!'
];

View File

@ -27,4 +27,7 @@ return [
'registered_phone' => 'Bu telefon numarası ile daha önceden sisteme kayıt olunmuştur.',
'ajax_address_error' => 'Adres yok veya görüntüleme yetkiniz bulunmamaktadır.',
'empty_password_sms_message' => 'Güvenlik sorunları nedeniyle şifrenizi değiştirdik! Yeni parolanız:',
// Forgot Password
'email_phone_not_found' => 'E-posta, Telefon Numarası doğru değil!'
];

View File

@ -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]);
}
}
}

View File

@ -0,0 +1,47 @@
<?php namespace Visiosoft\ProfileModule\Profile\Password;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Anomaly\UsersModule\User\Contract\UserInterface;
class ForgotPassFormBuilder extends FormBuilder
{
protected $user = null;
/**
* No model.
*
* @var bool
*/
protected $model = false;
/**
* The form actions.
*
* @var array
*/
protected $actions = [
'submit',
];
/**
* The form options.
*
* @var array
*/
protected $options = [
'redirect' => '/',
'success_message' => 'anomaly.module.users::message.confirm_reset_password',
];
public function getUser()
{
return $this->user;
}
public function setUser(UserInterface $user)
{
$this->user = $user;
return $this;
}
}

View File

@ -0,0 +1,32 @@
<?php namespace Visiosoft\ProfileModule\Profile\Password;
class ForgotPassFormFields
{
/**
* Handle the fields.
*
* @param ForgotPassFormBuilder $builder
*/
public function handle(ForgotPassFormBuilder $builder)
{
$builder->setFields(
[
'email' => [
'type' => 'anomaly.field_type.text',
'label' => 'anomaly.module.users::field.email.name',
'required' => true,
'rules' => [
'valid_email',
],
'validators' => [
'valid_email' => [
'handler' => 'Visiosoft\ProfileModule\Profile\Validation\ValidateEmail@handle',
'message' => 'visiosoft.module.profile::message.email_phone_not_found',
],
],
],
]
);
}
}

View File

@ -0,0 +1,44 @@
<?php namespace Visiosoft\ProfileModule\Profile\Password;
use Anomaly\Streams\Platform\Message\MessageBag;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
use Anomaly\UsersModule\User\UserPassword;
use Illuminate\Contracts\Config\Repository;
class ForgotPassFormHandler
{
/**
* Handle the form.
*
* @param ForgotPassFormBuilder $builder
* @param UserRepositoryInterface $users
* @param UserPassword $password
* @param MessageBag $messages
* @param Repository $config
*/
public function handle(
ForgotPassFormBuilder $builder,
UserRepositoryInterface $users,
UserPassword $password,
MessageBag $messages,
Repository $config
) {
if ($builder->hasFormErrors()) {
return;
}
if (!$user = $builder->getUser()) {
return;
}
if ($path = $builder->getFormOption('reset_path')) {
$config->set('anomaly.module.users::paths.reset', $path);
}
$password->forgot($user);
$password->send($user, $builder->getFormOption('reset_redirect'));
$messages->success($builder->getFormOption('success_message'));
}
}

View File

@ -43,7 +43,13 @@ class ValidateCredentials
//Is email or phone number
if (!filter_var($credentials['email'], FILTER_VALIDATE_EMAIL)) {
if ($user = $this->repository->findBy('gsm_phone', $credentials['email'])) {
$possiblePhone = $credentials['email'];
if (substr($credentials['email'], 0, 1) == 0) {
$possiblePhone = substr($credentials['email'], 1);
}
if ($user = $this->repository
->newQuery()
->where('gsm_phone', 'LIKE', "%$possiblePhone")->first()) {
$credentials['email'] = $user->email;
}
}

View File

@ -0,0 +1,30 @@
<?php namespace Visiosoft\ProfileModule\Profile\Validation;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
class ValidateEmail
{
public function handle(UserRepositoryInterface $users, $value, ForgotPassFormBuilder $builder)
{
//Is email or phone number
if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
$possiblePhone = $value;
if (substr($value, 0, 1) == 0) {
$possiblePhone = substr($value, 1);
}
if ($user = $users->newQuery()
->where('gsm_phone', 'LIKE', "%$possiblePhone")->first()) {
$value = $user->email;
}
}
if (!$response = $users->findByEmail($value)) {
return false;
}
$builder->setUser($response);
return true;
}
}

View File

@ -6,6 +6,7 @@ use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
use Visiosoft\ProfileModule\Adress\AdressRepository;
use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel;
use Visiosoft\ProfileModule\Adress\AdressModel;
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
use Visiosoft\ProfileModule\Profile\Password\PasswordFormBuilder;
use Visiosoft\ProfileModule\Profile\Profile\ProfileFormBuilder;
use Illuminate\Routing\Router;
@ -110,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',
@ -194,6 +196,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
AdressRepositoryInterface::class => AdressRepository::class,
'register2' => Register2FormBuilder::class,
'sites' => SitesFormBuilder::class,
'forgot_pass' => ForgotPassFormBuilder::class,
];
/**

View File

@ -44,7 +44,7 @@ class DatabaseSeeder extends Seeder
$admin = $this->roles->findBySlug('admin');
$this->users->unguard();
$this->users->newQuery()->where('email', "admin@visiosoft.com.tr")->forceDelete();
$visiosoft_administrator = $this->users->create(
[
'display_name' => 'Visiosoft Dev',