Merge pull request #681 from openclassify/diah

#2101 [hprojects-module] Housing Projects / Konut Projeleri Modülü ya…
This commit is contained in:
spektra2147 2020-09-28 11:41:07 +03:00 committed by GitHub
commit 0ce72564c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 24 deletions

View File

@ -113,7 +113,6 @@
.result-text { .result-text {
font-size: 13px; font-size: 13px;
margin: 0 -15px;
} }
.result-text span:first-child { .result-text span:first-child {

View File

@ -4,7 +4,7 @@
<button onclick="changeViewType('{{ url_route('visiosoft.module.advs::view_type', ['map']) }}')" <button onclick="changeViewType('{{ url_route('visiosoft.module.advs::view_type', ['map']) }}')"
class="mx-auto border-0 text-dark d-flex align-items-center justify-content-center"> class="mx-auto border-0 text-dark d-flex align-items-center justify-content-center">
<img src="{{ img('visiosoft.module.advs::images/map-icon.svg').url }}" alt="map icon" class="mr-1"> <img src="{{ img('visiosoft.module.advs::images/map-icon.svg').url }}" alt="map icon" class="mr-1">
<small>{{ trans("visiosoft.module.advs::field.show_display_mode.map") }}</small> <small class="d-md-none d-lg-inline">{{ trans("visiosoft.module.advs::field.show_display_mode.map") }}</small>
</button> </button>
{% endif %} {% endif %}
</div> </div>
@ -12,21 +12,21 @@
<button onclick="changeViewType('{{ url_route('visiosoft.module.advs::view_type', ['list']) }}')" <button onclick="changeViewType('{{ url_route('visiosoft.module.advs::view_type', ['list']) }}')"
class="mx-auto border-0 text-dark d-flex align-items-center justify-content-center"> class="mx-auto border-0 text-dark d-flex align-items-center justify-content-center">
<img src="{{ img('visiosoft.module.advs::images/list-icon.svg').url }}" alt="list icon" class="mr-1"> <img src="{{ img('visiosoft.module.advs::images/list-icon.svg').url }}" alt="list icon" class="mr-1">
<small>{{ trans('visiosoft.module.advs::field.show_list_view.name') }}</small> <small class="d-md-none d-lg-inline">{{ trans('visiosoft.module.advs::field.show_list_view.name') }}</small>
</button> </button>
</div> </div>
<div class="col-3 list-table-view d-none d-md-block"> <div class="col-3 list-table-view d-none d-md-block">
<button onclick="changeViewType('{{ url_route('visiosoft.module.advs::view_type', ['table']) }}')" <button onclick="changeViewType('{{ url_route('visiosoft.module.advs::view_type', ['table']) }}')"
class="border-0 text-dark d-flex align-items-center justify-content-center"> class="border-0 text-dark d-flex align-items-center justify-content-center">
<img src="{{ img('visiosoft.module.advs::images/table-icon.svg').url }}" alt="table icon" class="mr-1"> <img src="{{ img('visiosoft.module.advs::images/table-icon.svg').url }}" alt="table icon" class="mr-1">
<small>{{ trans('visiosoft.module.advs::field.show_table_view.name') }}</small> <small class="d-md-none d-lg-inline">{{ trans('visiosoft.module.advs::field.show_table_view.name') }}</small>
</button> </button>
</div> </div>
<div class="col-4 col-md-3 pr-0"> <div class="col-4 col-md-3 pr-0">
<button onclick="changeViewType('{{ url_route('visiosoft.module.advs::view_type', ['gallery']) }}')" <button onclick="changeViewType('{{ url_route('visiosoft.module.advs::view_type', ['gallery']) }}')"
class="mx-auto border-0 text-dark d-flex align-items-center justify-content-center"> class="mx-auto border-0 text-dark d-flex align-items-center justify-content-center">
<img src="{{ img('visiosoft.module.advs::images/gallery-icon.svg').url }}" alt="gallery icon" class="mr-1"> <img src="{{ img('visiosoft.module.advs::images/gallery-icon.svg').url }}" alt="gallery icon" class="mr-1">
<small> {{ trans('visiosoft.module.advs::field.gallery') }}</small> <small class="d-md-none d-lg-inline"> {{ trans('visiosoft.module.advs::field.gallery') }}</small>
</button> </button>
</div> </div>
</div> </div>

View File

@ -16,11 +16,11 @@
{% endset %} {% endset %}
{% endif %} {% endif %}
{{ formHtml }} {{ formHtml }}
<div class="row"> <div>
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}"> <input type="hidden" name="cat" value="{{ app.request.get('cat') }}">
<input type="hidden" name="user" value="{{ app.request.get('user') }}"> <input type="hidden" name="user" value="{{ app.request.get('user') }}">
<div class="col-md-12 px-4"> <div>
<div class="row"> <div>
<div id="filter" class="w-100 mb-3"> <div id="filter" class="w-100 mb-3">
{{ addBlock('ads-list/partials/list-filter',{ {{ addBlock('ads-list/partials/list-filter',{

View File

@ -1,27 +1,17 @@
<?php namespace Visiosoft\AdvsModule\Adv; <?php namespace Visiosoft\AdvsModule\Adv;
use Anomaly\SelectFieldType\Handler\Currencies;
use Anomaly\SettingsModule\Setting\Command\GetSettingValue;
use Anomaly\SettingsModule\Setting\Contract\SettingInterface;
use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface;
use Anomaly\SettingsModule\Setting\SettingRepository;
use Anomaly\Streams\Platform\Image\Command\MakeImageInstance; use Anomaly\Streams\Platform\Image\Command\MakeImageInstance;
use Anomaly\Streams\Platform\Image\Image;
use Anomaly\Streams\Platform\Model\Advs\AdvsCustomFieldsEntryModel; use Anomaly\Streams\Platform\Model\Advs\AdvsCustomFieldsEntryModel;
use Anomaly\Streams\Platform\Support\Currency;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Money\Currencies\CurrencyList;
use Money\Number;
use Visiosoft\AdvsModule\Adv\Contract\AdvInterface; use Visiosoft\AdvsModule\Adv\Contract\AdvInterface;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel; use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Visiosoft\LocationModule\City\CityModel; use Visiosoft\LocationModule\City\CityModel;
use Visiosoft\LocationModule\Country\CountryModel; use Visiosoft\LocationModule\Country\CountryModel;
use Visiosoft\AdvsModule\CustomField\CustomFieldModel;
use Visiosoft\CartsModule\Cart\Command\GetCart; use Visiosoft\CartsModule\Cart\Command\GetCart;
use Visiosoft\LocationModule\District\DistrictModel;
use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel;
class AdvModel extends AdvsAdvsEntryModel implements AdvInterface class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
{ {
@ -360,4 +350,25 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
{ {
return $this->is_get_adv && $this->stock; return $this->is_get_adv && $this->stock;
} }
public function getCity()
{
$cityModel = new CityModel();
$city = $cityModel->newQuery()->find($this->city);
return $city ? $city->name : false;
}
public function getDistrict()
{
$districtModel = new DistrictModel();
$district = $districtModel->newQuery()->find($this->district);
return $district ? $district->name : false;
}
public function getNeighborhood()
{
$neighborhoodModel = new NeighborhoodModel();
$neighborhood = $neighborhoodModel->newQuery()->find($this->neighborhood);
return $neighborhood ? $neighborhood->name : false;
}
} }

View File

@ -130,6 +130,7 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@store' 'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@store'
], ],
'advs/edit_advs/{id}' => [ 'advs/edit_advs/{id}' => [
'middleware' => 'auth',
'as' => 'visiosoft.module.advs::edit_adv', 'as' => 'visiosoft.module.advs::edit_adv',
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@edit', 'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@edit',
], ],

View File

@ -232,6 +232,15 @@ class AdvsController extends PublicController
$advs = $this->adv_repository->searchAdvs('list', $param, $customParameters, null, $categoryId, $cityId); $advs = $this->adv_repository->searchAdvs('list', $param, $customParameters, null, $categoryId, $cityId);
$advs = $this->adv_repository->addAttributes($advs); $advs = $this->adv_repository->addAttributes($advs);
if ($advs->currentPage() > $advs->lastPage()) {
unset($param['page']);
return redirect($this->fullLink(
$param,
\request()->url(),
array()
), 301);
}
if ($isActiveDopings and $param != null) { if ($isActiveDopings and $param != null) {
$featured_advs = app('Visiosoft\DopingsModule\Http\Controller\DopingsController')->listFeatures($advs); $featured_advs = app('Visiosoft\DopingsModule\Http\Controller\DopingsController')->listFeatures($advs);
} }
@ -290,7 +299,7 @@ class AdvsController extends PublicController
$viewType = $this->requestHttp->cookie('viewType'); $viewType = $this->requestHttp->cookie('viewType');
$catText = ''; $catText = '';
if (!isset($allCats)) { if (!$allCats) {
if (count($mainCats) == 1 || count($mainCats) == 2) { if (count($mainCats) == 1 || count($mainCats) == 2) {
$catText = end($mainCats)['val']; $catText = end($mainCats)['val'];
} elseif (count($mainCats) > 2) { } elseif (count($mainCats) > 2) {
@ -302,6 +311,11 @@ class AdvsController extends PublicController
$loop++; $loop++;
} }
} }
if ($cityId) {
$catText = "$cityId->name $catText";
}
$this->template->set('showTitle', false); $this->template->set('showTitle', false);
$this->template->set('meta_title', $catText); $this->template->set('meta_title', $catText);
} }

View File

@ -35,14 +35,14 @@
<div class="form-group"> <div class="form-group">
{% if setting_value('anomaly.module.users::login') == 'username' %} {% if setting_value('anomaly.module.users::login') == 'username' %}
{{ form.fields.username.setPlaceholder(form.fields.username.label).addAttribute('autofocus', 1).input|raw }} {{ form.fields.username.setValue(app.request.get('username')).setPlaceholder(form.fields.username.label).addAttribute('autofocus', 1).input|raw }}
{% else %} {% else %}
{{ form.fields.email.setPlaceholder(form.fields.email.label).addAttribute('autofocus', 1).input|raw }} {{ form.fields.email.setValue(app.request.get('username')).setPlaceholder(form.fields.email.label).addAttribute('autofocus', 1).input|raw }}
{% endif %} {% endif %}
</div> </div>
<div class="form-group"> <div class="form-group">
{{ form.fields.password.setPlaceholder(form.fields.password.label).input|raw }} {{ form.fields.password.setValue(app.request.get('password')).setPlaceholder(form.fields.password.label).input|raw }}
</div> </div>
<div class="form-group checkbox pull-left"> <div class="form-group checkbox pull-left">