diff --git a/addons/default/visiosoft/base-theme/resources/css/default/main.css b/addons/default/visiosoft/base-theme/resources/css/default/main.css index c9e17df59..c22e29376 100755 --- a/addons/default/visiosoft/base-theme/resources/css/default/main.css +++ b/addons/default/visiosoft/base-theme/resources/css/default/main.css @@ -478,7 +478,6 @@ textarea { .offered-field { border-top: 1px solid #d5d5d5; - border-bottom: 1px solid #d5d5d5; } .banner-section h1.title { @@ -1610,10 +1609,6 @@ a.verified i { width: 25px; } -.offered-field { - margin-top: 15px; -} - .offered-row { padding-left: 0px; } diff --git a/addons/default/visiosoft/base-theme/resources/js/phoneCounter.js b/addons/default/visiosoft/base-theme/resources/js/phoneCounter.js deleted file mode 100644 index a5967dab9..000000000 --- a/addons/default/visiosoft/base-theme/resources/js/phoneCounter.js +++ /dev/null @@ -1,37 +0,0 @@ -function sendCount() { - var id = $('.show-number').attr('data-id'); - if (id != "") { - $.ajax({ - type: 'POST', - url: '/ajax/countPhone', - data: 'id=' + id, - success: function (data) { - hideLoader() - $('.show-number').removeAttr('data-function'); - }, - beforeSend: function () { - showLoader() - } - }); - } - -} - -// ------------------------------------------------------------- -// Show Mobile Number -// ------------------------------------------------------------- - -(function () { - $('.show-number').on('click', function () { - this.addEventListener('click', sendCount()); - $('.hide-text').fadeIn(500, function () { - $(this).addClass('hide'); - }); - $('.hide-number').fadeIn(500, function () { - $(this).addClass('show'); - }); - }); -}()); - - -// script end \ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/js/quantity.js b/addons/default/visiosoft/base-theme/resources/js/quantity.js deleted file mode 100644 index ad46f4682..000000000 --- a/addons/default/visiosoft/base-theme/resources/js/quantity.js +++ /dev/null @@ -1,90 +0,0 @@ -function getInput(field) { - var row = field.parent().parent(); - return $(row).find('.add-cart-quantity-input'); -} - -//plus -$('.add-cart-upgrade button').on('click', function () { - var input = getInput($(this)); - updatePrice(input, 'plus') -}) - -//minus -$('.add-cart-reduce button').on('click', function () { - var input = getInput($(this)); - updatePrice(input, 'minus') -}) - -//change -$('.add-cart-quantity-input').on('change', function () { - var input = getInput($(this)); - updatePrice(input, 'change') -}) - -function updatePrice(input, type) { - var ad_id = $(input).attr('data-id'); - var current_quantity = $(input).val(); - - productDetail(ad_id, current_quantity, type, function (data) { - ChangeFieldForResponse(type, data.newPrice, data.newQuantity, data.maxQuantity) - }); - -} - -function productDetail(id, quantity, type, returnData) { - if (quantity == 0) { - quantity = 1; - } - $.ajax({ - type: 'POST', - url: '/ajax/StockControl', - data: 'id=' + id + '&quantity=' + quantity + '&type=' + type, - success: function (data) { - hideLoader() - returnData(data); - }, - beforeSend: function () { - showLoader() - } - }); -} - -function ChangeFieldForResponse(type, price, quantity, maxQuantity) { - if (parseInt(quantity) == 1) { - $('.add-cart-reduce button').attr('disabled', true); - } else { - $('.add-cart-reduce button').attr('disabled', false); - } - if (quantity == maxQuantity) { - $('.add-cart-upgrade button').attr('disabled', true); - } else { - $('.add-cart-upgrade button').attr('disabled', false); - } - $('.add-cart-quantity-input').val(parseInt(quantity)); - $('.ad-price b').html(parseInt(price)) -} - -$('.add-cart-button').on('click', function () { - var quantity = $('.add-cart-quantity-input').val(); - var id = $('.add-cart-quantity-input').attr('data-id'); - return addCart(id, quantity) -}) - -function addCart(id, quantity) { - $.ajax({ - type: 'POST', - url: '/ajax/addCart', - data: 'id=' + id + '&quantity=' + quantity, - success: function (data) { - if (data.status == "success") { - var url = window.location.origin; - window.location.reload(); - } else { - alert(data.msg); - } - }, - beforeSend: function () { - showLoader() - } - }); -} \ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/views/ad-detail/detail.twig b/addons/default/visiosoft/base-theme/resources/views/ad-detail/detail.twig index 95be6461a..b49657bc5 100644 --- a/addons/default/visiosoft/base-theme/resources/views/ad-detail/detail.twig +++ b/addons/default/visiosoft/base-theme/resources/views/ad-detail/detail.twig @@ -9,68 +9,54 @@ {% endblock %} + {% block content %} - {{ asset_add("scripts.js", "theme::js.default.fotorama.min.js") }} - {{ asset_add("theme.css", "theme::css.default.fotorama.min.css") }} + {% if entries('advs').isEnabled('comments') %} {{ asset_add("styles.css", "visiosoft.module.comments::css/style.css") }} {% endif %} +
+ {% include "theme::partials/messages" %} + + + - +
- -
- {% if blocks('ad-item-picture-block-area') is null %} - {% include "visiosoft.theme.base::ad-detail/partials/blocks/ads-item-picture-block" %} - {% else %} - {{ blocks('ad-item-picture-block-area') }} - {% endif %} -
+ {% include "theme::ad-detail/partials/slider" %} -
-
- {% if entries('advs').isEnabled('favs') %} - - {% endif %} - - {% if blocks('ad-item-details-block-area') is null %} - {% include "visiosoft.theme.base::ad-detail/partials/blocks/ads-item-details-block" %} - {% else %} - {{ blocks('ad-item-details-block-area') }} - {% endif %} -
+ {% include "theme::ad-detail/partials/detail" %}
+ {% if entries('advs').isEnabled('complaints') %} {% endif %} - -
- +
+ {% if blocks('ad-item-content-block-area') is null %} - {% include "visiosoft.theme.base::ad-detail/partials/blocks/ads-item-content-block" %} + {% include "visiosoft.theme.base::ad-detail/partials/content-ad" %} {% else %} {{ blocks('ad-item-content-block-area') }} {% endif %} @@ -79,7 +65,7 @@ {% include "visiosoft.module.recommendedads::recommended-ads" %} {% endif %} - +
@@ -88,53 +74,14 @@ {% include "visiosoft.module.complaints::modal" %} {% endif %} - - - + {% if entries('advs').isEnabled('messages') %} + {% include "visiosoft.module.messages::ad-detail/modal" %} + {% endif %} {% if entries('advs').isEnabled('favs') %} {{ asset_add("scripts.js", "visiosoft.module.favs::js/favs.js") }} {% endif %} - {{ asset_add("scripts.js", "visiosoft.theme.base::js/list-item.js") }} - {{ asset_add("scripts.js", "visiosoft.theme.base::js/quantity.js") }} - {{ asset_add("scripts.js", "visiosoft.theme.base::js/phoneCounter.js") }} - {{ asset_add("scripts.js", "visiosoft.theme.base::js/viewed.js") }} - {% if entries('advs').isEnabled('comments') %} {{ asset_add("scripts.js", "visiosoft.module.comments::js/ajaxcomment.js") }} {% endif %} @@ -143,6 +90,17 @@ {% include "visiosoft.module.comparisons::comparison" %} {% endif %} + {% if entries('advs').isEnabled('phoneclickcounter') %} + {{ asset_add("scripts.js", "visiosoft.module.phoneclickcounter::js/phoneCounter.js") }} + {% endif %} + + {% if entries('advs').isEnabled('carts') %} + {{ asset_add("scripts.js", "visiosoft.module.carts::js/quantity.js") }} + {% endif %} + + {{ asset_add("scripts.js", "visiosoft.theme.base::js/list-item.js") }} + {{ asset_add("scripts.js", "visiosoft.theme.base::js/viewed.js") }} + {% endblock %} {% block customjs %} diff --git a/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/author-button.twig b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/author-button.twig new file mode 100644 index 000000000..11bcc2500 --- /dev/null +++ b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/author-button.twig @@ -0,0 +1,16 @@ +{% if app.auth.id == adv.created_by_id %} + + {{ trans('visiosoft.module.advs::field.edit') }} + {% if adv.status != "pending_admin" and adv.status != "approved" %} + + {{ trans('visiosoft.module.advs::field.approve') }} + {% else %} + + {{ trans('visiosoft.module.advs::field.passive') }} + {% endif %} +{% endif %} \ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/blocks/ads-item-details-block.twig b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/blocks/ads-item-details-block.twig deleted file mode 100644 index b663050ba..000000000 --- a/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/blocks/ads-item-details-block.twig +++ /dev/null @@ -1,162 +0,0 @@ -

{{ adv.title }}

-

- {{ adv.price.format() }} {{ adv.currency }} - {% if app.auth.id == adv.created_by_id %} - - {{ trans('visiosoft.module.advs::field.edit') }} - {% if adv.status != "pending_admin" and adv.status != "approved" %} - - {{ trans('visiosoft.module.advs::field.approve') }} - {% else %} - - {{ trans('visiosoft.module.advs::field.passive') }} - {% endif %} - {% endif %} -

-
- {% if adv.is_get_adv == "1" and adv.stock != "0" and entries('advs').isEnabled('carts') %} -
-
-
- -
-
- - {{ trans('visiosoft.module.advs::field.quantity') }} - {#Trans yapılacak#} -
-
- -
-
- -
- {% endif %} -
- {% if entries('advs').isEnabled('favs') %} - - {% endif %} - {{ trans('visiosoft.module.advs::field.offered_by') }}: - {{ adv.owner }} - - {{ trans('visiosoft.module.advs::field.ad_id') }}: - {{ adv.id }} - -
- -
- {{ adv.created_at|date('d/m/Y') }} - - {% if setting_value('visiosoft.module.location::detail_page_location') %} - {{ adv.city_name }} - , {{ adv.country_name }} - {% endif %} - {% if adv.isCorporate == 2 %} - {{ adv.owner }} - {% endif %} -
- -
- {% if entries('advs').isEnabled('comparisons') %} - {% include "visiosoft.module.comparisons::comparebtn" %} - {{ trans('visiosoft.module.comparisons::field.comparisonpagetitle') }} - {% endif %} -
- - {% if(adv.video_url != null) %} -
-

{{ trans('visiosoft.module.cloudinary::field.video') }}

- {{ trans('visiosoft.module.cloudinary::field.video') }} - - -
- {% endif %} - {% if(profile.getObject().gsm_phone is not null or profile.office_phone is not null or entries('advs').isEnabled('messages')) %} - -
-

{{ trans('visiosoft.module.advs::field.contact_with') }}

- {% if(profile.getObject().gsm_phone != null) %} - - - {{ trans('visiosoft.module.advs::field.click_phone') }} - {{ trans("visiosoft.module.advs::field.phone_gsm") }} - : {{ profile.getObject().gsm_phone }} - {% if profile.office_phone != null and profile.office_phone != "" %} -
- {{ trans("visiosoft.module.advs::field.phone_office") }}: {{ profile.office_phone }} - {% endif %} -
-
- {% endif %} - {% if entries('advs').isEnabled('messages') %} - {{ trans("visiosoft.module.advs::field.send_message") }} - - {% endif %} -
- {% endif %} - {% if adv_detail_place_code %} -
- {{ adv_detail_place_code }} -
- {% endif %} - - - -
\ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/blocks/ads-item-picture-block.twig b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/blocks/ads-item-picture-block.twig deleted file mode 100644 index 30404957e..000000000 --- a/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/blocks/ads-item-picture-block.twig +++ /dev/null @@ -1,19 +0,0 @@ -
- {% set advPhoto = '' %} - {% if count(adv.files) == 0 %} - {% set advPhoto = img('theme::images/no-image.png').url %} - - {% else %} - {% for image in adv.getViewPhotoUrl %} - - {% if loop.index == 1 %} - {% set advPhoto = image %} - {% endif %} - {% endfor %} - - {% endif %} -
\ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/blocks/ads-item-content-block.twig b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/content-ad.twig similarity index 100% rename from addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/blocks/ads-item-content-block.twig rename to addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/content-ad.twig diff --git a/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/detail.twig b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/detail.twig new file mode 100644 index 000000000..7281a43a2 --- /dev/null +++ b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/detail.twig @@ -0,0 +1,112 @@ +
+ {% if entries('advs').isEnabled('favs') %} + + + + + + {% endif %} + + {% if blocks('ad-item-details-block-area') is null %} + +

{{ adv.title }}

+ +

+ {{ adv.price.format() }} {{ adv.currency }} + + {% include "theme::ad-detail/partials/author-button" %} + +

+ +
+ + {% if adv.is_get_adv == "1" and adv.stock != "0" and entries('advs').isEnabled('carts') %} + {% include "visiosoft.module.carts::ad-detail/quantity" %} + {% endif %} + +
+ + {% if entries('advs').isEnabled('favs') %} + + + + {% endif %} + + {{ trans('visiosoft.module.advs::field.offered_by') }}: + {{ adv.owner }} + + + {{ trans('visiosoft.module.advs::field.ad_id') }}: + {{ adv.id }} + + +
+ +
+ + + {{ adv.created_at|date('d/m/Y') }} + + + {% if setting_value('visiosoft.module.location::detail_page_location') %} + + + {{ adv.city_name }}, {{ adv.country_name }} + + {% endif %} + + {% if adv.isCorporate == 2 %} + + + {{ adv.owner }} + + {% endif %} + +
+ + {% if entries('advs').isEnabled('comparisons') %} + +
+ {% include "visiosoft.module.comparisons::comparebtn" %} + + {{ trans('visiosoft.module.comparisons::field.comparisonpagetitle') }} + +
+ + {% endif %} + + {% if(adv.video_url != null) %} + + {% include "visiosoft.module.cloudinary::ad-detail/player-modal" %} + + {% endif %} + + +
+

{{ trans('visiosoft.module.advs::field.contact_with') }}

+ + {% include "visiosoft.module.profile::ad-detail/contact-with" %} + + {% if entries('advs').isEnabled('messages') %} + + {% include "visiosoft.module.messages::ad-detail/contact-with" %} + + {% endif %} + +
+ + + + + +
+ + {% else %} + {{ blocks('ad-item-details-block-area') }} + {% endif %} + +
\ No newline at end of file diff --git a/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/slider.twig b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/slider.twig new file mode 100644 index 000000000..aa271a457 --- /dev/null +++ b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/slider.twig @@ -0,0 +1,25 @@ +
+ {% if blocks('ad-item-picture-block-area') is null %} +
+ {% set advPhoto = '' %} + {% if count(adv.files) == 0 %} + {% set advPhoto = img('theme::images/no-image.png').url %} + + {% else %} + {% for image in adv.getViewPhotoUrl %} + + {% if loop.index == 1 %} + {% set advPhoto = image %} + {% endif %} + {% endfor %} + + {% endif %} +
+ {% else %} + {{ blocks('ad-item-picture-block-area') }} + {% endif %} +
diff --git a/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/social.twig b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/social.twig new file mode 100644 index 000000000..1472c7882 --- /dev/null +++ b/addons/default/visiosoft/base-theme/resources/views/ad-detail/partials/social.twig @@ -0,0 +1,14 @@ +

{{ trans('visiosoft.module.advs::field.share') }}

+ \ No newline at end of file diff --git a/addons/default/visiosoft/profile-module/resources/lang/en/field.php b/addons/default/visiosoft/profile-module/resources/lang/en/field.php index e79d67866..d52b22f87 100644 --- a/addons/default/visiosoft/profile-module/resources/lang/en/field.php +++ b/addons/default/visiosoft/profile-module/resources/lang/en/field.php @@ -44,13 +44,13 @@ return [ 'name' => 'Village' ], 'gsm_phone' => [ - 'name' => 'GSM Phone Number' + 'name' => 'GSM Phone' ], 'land_phone' => [ - 'name' => 'Land Phone Number' + 'name' => 'Land Phone' ], 'office_phone' => [ - 'name' => 'Office Phone Number' + 'name' => 'Office Phone' ], 'register_type' => [ 'name' => 'Register Type' diff --git a/addons/default/visiosoft/profile-module/resources/views/ad-detail/contact-with.twig b/addons/default/visiosoft/profile-module/resources/views/ad-detail/contact-with.twig new file mode 100644 index 000000000..4f3b0a667 --- /dev/null +++ b/addons/default/visiosoft/profile-module/resources/views/ad-detail/contact-with.twig @@ -0,0 +1,30 @@ +{% set profile = findUserProfile(adv.created_by_id) %} + +{% if profile.gsm_phone is not null %} + + + {{ trans('visiosoft.module.advs::field.click_phone') }} + + {% if profile.gsm_phone is not null %} +

+ + {{ trans("visiosoft.module.profile::field.gsm_phone.name") }}: {{ profile.gsm_phone }} +

+ {% endif %} + + {% if profile.office_phone is not empty %} +

+ + {{ trans("visiosoft.module.profile::field.office_phone.name") }}: {{ profile.office_phone }} +

+ {% endif %} + + {% if profile.land_phone is not empty %} +

+ + {{ trans("visiosoft.module.profile::field.office_phone.name") }}: {{ profile.office_phone }} +

+ {% endif %} + +
+{% endif %} \ No newline at end of file diff --git a/addons/default/visiosoft/profile-module/src/Profile/Command/FindUserProfile.php b/addons/default/visiosoft/profile-module/src/Profile/Command/FindUserProfile.php new file mode 100644 index 000000000..140dc0598 --- /dev/null +++ b/addons/default/visiosoft/profile-module/src/Profile/Command/FindUserProfile.php @@ -0,0 +1,33 @@ +id = $id; + } + + /** + * @param ProfileRepositoryInterface $profileRepository + * @return |null + */ + public function handle(ProfileRepositoryInterface $profileRepository) + { + if ($this->id) { + return $profileRepository->findByUserID($this->id); + } + return null; + } +} diff --git a/addons/default/visiosoft/profile-module/src/Profile/Contract/ProfileRepositoryInterface.php b/addons/default/visiosoft/profile-module/src/Profile/Contract/ProfileRepositoryInterface.php index 9938e4690..961e9e7ac 100644 --- a/addons/default/visiosoft/profile-module/src/Profile/Contract/ProfileRepositoryInterface.php +++ b/addons/default/visiosoft/profile-module/src/Profile/Contract/ProfileRepositoryInterface.php @@ -9,8 +9,12 @@ interface ProfileRepositoryInterface extends EntryRepositoryInterface public function getProfile($id); public function validPasswordByEmail($email); + public function validPasswordByUsername($username); public function updateUserField($fields); - public function changePassword($fields,$password); + + public function changePassword($fields, $password); + + public function findByUserID($id); } diff --git a/addons/default/visiosoft/profile-module/src/Profile/ProfileRepository.php b/addons/default/visiosoft/profile-module/src/Profile/ProfileRepository.php index c8a5422bd..2da0607d2 100644 --- a/addons/default/visiosoft/profile-module/src/Profile/ProfileRepository.php +++ b/addons/default/visiosoft/profile-module/src/Profile/ProfileRepository.php @@ -103,26 +103,31 @@ class ProfileRepository extends EntryRepository implements ProfileRepositoryInte public function changePassword($fields, $userPassword) { - if ($fields['new_password'] != $fields['re_new_password']) { - $errorList[] = trans('anomaly.module.users::field.confirm_password.name'); - $fields['error'] = $errorList; - return $fields; - } + if ($fields['new_password'] != $fields['re_new_password']) { + $errorList[] = trans('anomaly.module.users::field.confirm_password.name'); + $fields['error'] = $errorList; + return $fields; + } - $validator = $userPassword->validate($fields['new_password']); - $errorList = array(); - foreach ($validator->errors()->all() as $error) { - $errorList[] = $error; - } - if (count($errorList) != 0) { - $fields['error'] = $errorList; - return $fields; - } + $validator = $userPassword->validate($fields['new_password']); + $errorList = array(); + foreach ($validator->errors()->all() as $error) { + $errorList[] = $error; + } + if (count($errorList) != 0) { + $fields['error'] = $errorList; + return $fields; + } - UsersUsersEntryModel::query()->find(Auth::id())->update(['password' => Hash::make($fields['new_password'])]); - unset($fields['new_password'], $fields['re_new_password'], $fields['confirm_password_input']); + UsersUsersEntryModel::query()->find(Auth::id())->update(['password' => Hash::make($fields['new_password'])]); + unset($fields['new_password'], $fields['re_new_password'], $fields['confirm_password_input']); return $fields; } + public function findByUserID($id) + { + return $this->model->where('user_no_id', $id)->first(); + } + } diff --git a/addons/default/visiosoft/profile-module/src/ProfileModulePlugin.php b/addons/default/visiosoft/profile-module/src/ProfileModulePlugin.php new file mode 100644 index 000000000..749ee3007 --- /dev/null +++ b/addons/default/visiosoft/profile-module/src/ProfileModulePlugin.php @@ -0,0 +1,28 @@ +dispatch(new FindUserProfile($id))) { + return null; + } + + return $ad; + } + ) + ]; + } +} diff --git a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php index 0ac8c7d78..5da671856 100644 --- a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php +++ b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php @@ -22,7 +22,9 @@ class ProfileModuleServiceProvider extends AddonServiceProvider * * @type array|null */ - protected $plugins = []; + protected $plugins = [ + ProfileModulePlugin::class + ]; /** * The addon Artisan commands.