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 {
font-size: 13px;
margin: 0 -15px;
}
.result-text span:first-child {

View File

@ -4,7 +4,7 @@
<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">
<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>
{% endif %}
</div>
@ -12,21 +12,21 @@
<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">
<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>
</div>
<div class="col-3 list-table-view d-none d-md-block">
<button onclick="changeViewType('{{ url_route('visiosoft.module.advs::view_type', ['table']) }}')"
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">
<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>
</div>
<div class="col-4 col-md-3 pr-0">
<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">
<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>
</div>
</div>

View File

@ -16,11 +16,11 @@
{% endset %}
{% endif %}
{{ formHtml }}
<div class="row">
<div>
<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>
<div>
<div id="filter" class="w-100 mb-3">
{{ addBlock('ads-list/partials/list-filter',{

View File

@ -1,27 +1,17 @@
<?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\Image;
use Anomaly\Streams\Platform\Model\Advs\AdvsCustomFieldsEntryModel;
use Anomaly\Streams\Platform\Support\Currency;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Money\Currencies\CurrencyList;
use Money\Number;
use Visiosoft\AdvsModule\Adv\Contract\AdvInterface;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Visiosoft\LocationModule\City\CityModel;
use Visiosoft\LocationModule\Country\CountryModel;
use Visiosoft\AdvsModule\CustomField\CustomFieldModel;
use Visiosoft\CartsModule\Cart\Command\GetCart;
use Visiosoft\LocationModule\District\DistrictModel;
use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel;
class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
{
@ -360,4 +350,25 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
{
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'
],
'advs/edit_advs/{id}' => [
'middleware' => 'auth',
'as' => 'visiosoft.module.advs::edit_adv',
'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->addAttributes($advs);
if ($advs->currentPage() > $advs->lastPage()) {
unset($param['page']);
return redirect($this->fullLink(
$param,
\request()->url(),
array()
), 301);
}
if ($isActiveDopings and $param != null) {
$featured_advs = app('Visiosoft\DopingsModule\Http\Controller\DopingsController')->listFeatures($advs);
}
@ -290,7 +299,7 @@ class AdvsController extends PublicController
$viewType = $this->requestHttp->cookie('viewType');
$catText = '';
if (!isset($allCats)) {
if (!$allCats) {
if (count($mainCats) == 1 || count($mainCats) == 2) {
$catText = end($mainCats)['val'];
} elseif (count($mainCats) > 2) {
@ -302,6 +311,11 @@ class AdvsController extends PublicController
$loop++;
}
}
if ($cityId) {
$catText = "$cityId->name $catText";
}
$this->template->set('showTitle', false);
$this->template->set('meta_title', $catText);
}

View File

@ -35,14 +35,14 @@
<div class="form-group">
{% 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 %}
{{ 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 %}
</div>
<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 class="form-group checkbox pull-left">