This commit is contained in:
vedatakd 2020-02-20 11:20:04 +03:00
commit 5fbc261eb3
18 changed files with 91 additions and 31 deletions

View File

@ -97,14 +97,22 @@
style="max-height: 300px;">
<div class="row p-3 m-0">
<div class="form-check py-1">
<input class="form-check-input" type="checkbox" value="true" name="photo"
<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" value="true" name="video"
<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") }}

View File

@ -8,7 +8,7 @@
</a>
<ul class="dropdown-menu" x-placement="bottom-start">
<ul class="dropdown-menu px-2 mt-0" x-placement="bottom-start">
<li>
<a href="#" data-value="sort_price_up"
class="sort-by-item text-dark">{{ trans("visiosoft.module.advs::field.price_high") }}</a>

View File

@ -27,7 +27,6 @@ class AdvCriteria extends EntryCriteria
return $ads;
}
public function advsofDay()
{
$advModel = new AdvModel();
@ -69,6 +68,24 @@ class AdvCriteria extends EntryCriteria
return $ads;
}
public function findAdsByCategoryId($catId)
{
$advModel = new AdvModel();
$advs = AdvModel::query()
->whereDate('finish_at', '>=', date("Y-m-d H:i:s"))
->where('status', '=', 'approved')
->where('slug', '!=', '')
->where('cat1', $catId)
->get();
$ads = $advModel->getLocationNames($advs);
foreach ($ads as $index => $ad) {
$ads[$index]->detail_url = $advModel->getAdvDetailLinkByModel($ad, 'list');
$ads[$index] = $advModel->AddAdsDefaultCoverImage($ad);
}
return $ads;
}
public function getCurrentLocale()
{
return locale_get_display_name(config('app.locale'));

View File

@ -168,7 +168,8 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
public function popularAdvs()
{
return $this->getAdv()->orderBy('count_show_ad', 'desc')->limit(10)->get();
return $this->getAdv()->where('status', 'approved')
->orderBy('count_show_ad', 'desc')->limit(10)->get();
}
public function advsofDay()

View File

@ -8,7 +8,8 @@ return [
'title' => 'visiosoft.theme.base::section.catalog_mode.name',
'fields' => [
'navigation_title', 'navigation_action', 'date_fields', 'price_fields',
'breadcrumbs', 'ad_details', 'ad_details_tab','latest_and_view_all_btn'
'breadcrumbs', 'ad_details', 'ad_details_tab','latest_and_view_all_btn',
'register_page_instruction_logo'
],
],
],

View File

@ -49,5 +49,11 @@ return [
"default_value" => 1,
]
],
'register_page_instruction_logo' => [
'type' => 'anomaly.field_type.file',
"config" => [
"folders" => ['images'],
"mode" => "upload",
]
],
];

View File

@ -123,7 +123,4 @@
padding-right: 85px;
background-color: #fff;
}
#header {
display: none;
}
}

View File

@ -6,4 +6,9 @@
font-size: 18px;
position: relative;
top: 4px;
}
.personal-advantages img {
max-height: 60px;
max-width: 60px;
}

View File

@ -28,4 +28,7 @@ return [
'latest_and_view_all_btn' => [
'name' => 'Latest and View All Btn',
],
'register_page_instruction_logo' => [
'name' => 'Register Page Instruction Logo',
],
];

View File

@ -1,18 +1,8 @@
{% extends "theme::layouts/default" %}
{% block content %}
{% set logo_web = file(setting_value('visiosoft.theme.sahibinden::logo_web')).url %}
{% if logo_web is null %}
{% set logo_web = img('visiosoft.theme.sahibinden::images/logo_web.png').url %}
{% endif %}
<div class="col-12 px-5 mx-4">
<a href="{{ url("/") }}">
<img class="img-responsive d-none d-sm-block logo-web"
src="{{ logo_web }}"></a>
</div>
<div class="row justify-content-center">
<div class="col-12 text-left m-0 row justify-content-center">
<div class="col-12 col-lg-5 m-3 login-section">
{% set form = form('signIn')
.redirect(app.request.get('redirect'))

View File

@ -40,8 +40,11 @@
<div class="col-12 col-md-6 py-3 pr-0 instructions d-none d-md-block">
<div class="border personal-advantages py-5 px-5">
<div class="d-flex align-items-center mb-4">
<img src="{{ img('visiosoft.theme.base::images/register-instruction.png').url }}">
<h4 class="ml-3">
{% if setting_value('visiosoft.theme.base::register_page_instruction_logo') %}
<img class="mr-3"
src="{{ file(setting_value('visiosoft.theme.base::register_page_instruction_logo')).url }}">
{% endif %}
<h4 class="mb-0">
{{ trans('visiosoft.theme.base::field.personal_registration_header') }}
</h4>
</div>

View File

@ -137,7 +137,8 @@ class VisiosoftModuleProfileCreateProfileFields extends Migration
'folders' => ['adv_listing_page'],
'mode' => 'select',
]
]
],
'deleted_at' => 'anomaly.field_type.datetime'
];
}

View File

@ -13,7 +13,7 @@ class VisiosoftModuleProfileCreateAdressStream extends Migration
protected $stream = [
'slug' => 'adress',
'title_column' => 'id',
'translatable' => true,
'translatable' => false,
'trashable' => false,
'searchable' => false,
'sortable' => false,
@ -50,6 +50,7 @@ class VisiosoftModuleProfileCreateAdressStream extends Migration
'adress_gsm_phone' => [
'required' => true,
],
'deleted_at'
];
}

View File

@ -119,6 +119,9 @@ return [
'edit' => [
'name' => 'Edit'
],
'delete' => [
'name' => 'Delete'
],
'list' => [
'name' => 'List'
],

View File

@ -33,6 +33,12 @@
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
{{ trans("visiosoft.module.profile::field.edit.name") }}
</a>
<a class="btn btn-sm btn-danger"
href="{{ url_route('visiosoft.module.profile::address_soft_delete', [adress.id]) }}"
role="button">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
{{ trans("visiosoft.module.profile::field.delete.name") }}
</a>
</td>
</tr>
{% endfor %}

View File

@ -11,7 +11,7 @@ class AdressModel extends ProfileAdressEntryModel implements AdressInterface
{
return AdressModel::query();
}
return AdressModel::query()->where('id',$id);
return AdressModel::query()->where('id',$id)->whereNull('deleted_at');
}
public function getAdressFirst($id) {
@ -20,12 +20,10 @@ class AdressModel extends ProfileAdressEntryModel implements AdressInterface
public function getUserAdress($id = null)
{
if($id != null)
{
return $this->query()->where('user_id',$id)->get();
if ($id != null) {
return $this->query()->where('user_id',$id)->whereNull('deleted_at')->get();
}
return $this->query()->where('user_id',Auth::id())->get();
return $this->query()->where('user_id', Auth::id())->whereNull('deleted_at')->get();
}

View File

@ -39,6 +39,7 @@ use Visiosoft\MessagesModule\Message\MessageModel;
use Visiosoft\PackagesModule\Package\PackageModel;
use Visiosoft\PackagesModule\User\UserModel;
use Visiosoft\ProfileModule\Adress\AdressModel;
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
use Visiosoft\ProfileModule\Adress\Form\AdressFormBuilder;
use Visiosoft\ProfileModule\Profile\Contract\ProfileRepositoryInterface;
use Visiosoft\ProfileModule\Profile\Form\ProfileFormBuilder;
@ -49,12 +50,16 @@ use Illuminate\Contracts\Events\Dispatcher;
class MyProfileController extends PublicController
{
public function __construct()
private $adressRepository;
public function __construct(AdressRepositoryInterface $adressRepository)
{
parent::__construct();
if (!Auth::user()) {
redirect('/login?redirect=' . url()->current())->send();
}
$this->adressRepository = $adressRepository;
}
protected $user;
@ -169,6 +174,17 @@ class MyProfileController extends PublicController
}
}
public function adressSoftDelete($id)
{
$address = $this->adressRepository->find($id);
if ($address->user_id == Auth::id()) {
$address->update([
'deleted_at' => date('Y-m-d H:i:s')
]);
}
return $this->redirect->back();
}
public function adressUpdate(AdressFormBuilder $form, Request $request, $id)
{
$error = $form->build()->validate()->getFormErrors()->getMessages();

View File

@ -86,6 +86,10 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
'as' => 'visiosoft.module.profile::address_edit',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressEdit'
],
'profile/adress/soft-del/{id}' => [
'as' => 'visiosoft.module.profile::address_soft_delete',
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@adressSoftDelete'
],
/* Profile */
'admin/profile' => 'Visiosoft\ProfileModule\Http\Controller\Admin\ProfileController@index',