mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge branch 'master' of https://github.com/openclassify/openclassify into basetheme
This commit is contained in:
commit
a25c0c444a
@ -42,6 +42,9 @@ return [
|
||||
'currencies' => [
|
||||
'name' => 'Active Currencies',
|
||||
],
|
||||
'latest-limit' => [
|
||||
'name' => 'Latest Limit',
|
||||
],
|
||||
'site_address' => [
|
||||
'name' => 'Site address',
|
||||
'warning' => 'Auto added www. www.<strong>sitename.com</strong> ',
|
||||
|
||||
@ -47,6 +47,8 @@
|
||||
{{ blocks('ad-item-content-block-area') }}
|
||||
{% endif %}
|
||||
|
||||
{{ addBlock('ad-detail/widget', {'price': adv.price, 'id': adv.id})|raw }}
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@ -33,7 +33,9 @@
|
||||
{% block listContent %}
|
||||
{% include "visiosoft.module.advs::list/partials/ads" %}
|
||||
{% endblock %}
|
||||
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
{{ advs.appends(request_query()).links()|raw }}
|
||||
</div>
|
||||
{# <div class="category-tabs"></div>#}
|
||||
</div>
|
||||
|
||||
@ -1,25 +1,30 @@
|
||||
{% if app.request.get('user') != null or app.request.get('user') != "" %}
|
||||
|
||||
{% if userProfile.adv_listing_banner.url == '' %}
|
||||
{% set background_user = img('visiosoft.module.advs::images/user_section_back.png').url %}
|
||||
{% else %}
|
||||
{% set background_user = userProfile.adv_listing_banner.url %}
|
||||
{% set store = entries('store','store').where('user_id', user.id).first() %}
|
||||
{% if store is null %}
|
||||
{% set user = entries('store','user').where('user_id', user.id).first() %}
|
||||
{% set store = user.store %}
|
||||
{% endif %}
|
||||
<div class="col-md-12 upper-list-banner" style="background-image: url('{{ background_user }}');">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-xs-3">
|
||||
<div class="card m-4">
|
||||
{% if user.file is null %}
|
||||
<img src="{{ img('visiosoft.module.advs::images/sample-logo.jpg').url }}"
|
||||
class="card-img-top">
|
||||
{% else %}
|
||||
<img src="{{ user.file.url }}" class="card-img-top">
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ user.first_name }} {{ user.last_name }}</h5>
|
||||
{% if store is not null %}
|
||||
{% if store.store_banner is null %}
|
||||
{% set background_image = img('visiosoft.module.advs::images/user_section_back.png').url %}
|
||||
{% else %}
|
||||
{% set background_image = store.store_banner.url %}
|
||||
{% endif %}
|
||||
<div class="col-md-12 upper-list-banner" style="background-image: url('{{ background_image }}');">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-xs-3">
|
||||
<div class="card m-4">
|
||||
{% if store.file is null %}
|
||||
<img src="{{ img('visiosoft.theme.base::images/no-image.png').url }}" class="card-img-top">
|
||||
{% else %}
|
||||
<img src="{{ store.file.url }}" class="card-img-top">
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<h5 class="card-title text-center mb-0">{{ store.name }}</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@ -48,8 +48,6 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
|
||||
public function searchAdvs($type, $param = null, $customParameters = null, $limit = null)
|
||||
{
|
||||
//dd($param);
|
||||
|
||||
$isActiveDopings = new AdvModel();
|
||||
$isActiveDopings = $isActiveDopings->is_enabled('dopings');
|
||||
|
||||
@ -125,11 +123,9 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
if (!empty($param['photo'])) {
|
||||
$query = $query->whereNotNull('cover_photo');
|
||||
}
|
||||
// if (!empty($param['video'])) {
|
||||
// $int = (int)$num;
|
||||
// $column = "JSON_EXTRACT(foreign_currencies, '$." . $param['currency'] . "') <=" . $int;
|
||||
// $query = $query->whereRaw($column);
|
||||
// }
|
||||
if (!empty($param['video'])) {
|
||||
$query = $query->where('cover_photo', 'like', '%video/upload/w_400,e_loop%');
|
||||
}
|
||||
if (!empty($param['map']) && $param['map'] == true) {
|
||||
$query = $query->whereNotNull('map_Val');
|
||||
}
|
||||
@ -246,7 +242,6 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
$query = $query->select('advs_advs.*', 'advs_advs_translations.name as name', 'advs_advs_translations.advs_desc as advs_desc');
|
||||
}
|
||||
|
||||
|
||||
if ($type == "list") {
|
||||
return $query->paginate($this->settings->value('streams::per_page'));
|
||||
} else {
|
||||
|
||||
@ -207,6 +207,7 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
'as' => 'ajax::getAds',
|
||||
'uses' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@getMyAds'
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Http\Controller;
|
||||
|
||||
use Anomaly\Streams\Platform\Http\Controller\PublicController;
|
||||
use Anomaly\UsersModule\User\UserModel;
|
||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||
use Illuminate\Http\Request;
|
||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||
@ -9,14 +10,17 @@ use Visiosoft\LocationModule\District\DistrictModel;
|
||||
use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel;
|
||||
use Visiosoft\LocationModule\Village\VillageModel;
|
||||
use Visiosoft\CatsModule\Category\CategoryModel;
|
||||
use Visiosoft\NotificationsModule\Notify\Notification\SendLoanApplicationMail;
|
||||
|
||||
class AjaxController extends PublicController
|
||||
{
|
||||
private $adv_model;
|
||||
private $userModel;
|
||||
|
||||
public function __construct(AdvModel $advModel)
|
||||
public function __construct(AdvModel $advModel, UserModel $userModel)
|
||||
{
|
||||
$this->adv_model = $advModel;
|
||||
$this->userModel = $userModel;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
@ -465,14 +465,6 @@ class AdvsController extends PublicController
|
||||
return redirect('/');
|
||||
}
|
||||
|
||||
if ($advModel->is_enabled('store')) {
|
||||
$StoreAdModel = new AdModel();
|
||||
if ($request->store != "0" and $request->store != null) {
|
||||
$StoreAdModel->createStoreAdLoggedInUser($request->store, $request->update_id);
|
||||
} else {
|
||||
$StoreAdModel->removeAdStore($request->update_id);
|
||||
}
|
||||
}
|
||||
$adv->is_get_adv = $request->is_get_adv;
|
||||
$adv->save();
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ class CategoryController extends AdminController
|
||||
return $this->redirect->back();
|
||||
}
|
||||
|
||||
$locale = $this->getRequestLang($all);
|
||||
$locale = config('streams::locales.enabled');
|
||||
|
||||
$translatable = array();
|
||||
foreach ($all as $key => $value) {
|
||||
@ -171,31 +171,6 @@ class CategoryController extends AdminController
|
||||
return substr_compare($string, $test, $strlen - $testlen, $testlen) === 0;
|
||||
}
|
||||
|
||||
public function getRequestLang($request) {
|
||||
$locale = array();
|
||||
foreach ($request as $key => $field) {
|
||||
$locale[] = substr($key, 0, -2);
|
||||
}
|
||||
$notTrans = array();
|
||||
$trans = array();
|
||||
foreach ($locale as $translatable) {
|
||||
if (!in_array($translatable, $notTrans)) {
|
||||
$notTrans[] = $translatable;
|
||||
} else {
|
||||
$trans[] = $translatable;
|
||||
}
|
||||
}
|
||||
$locale = array();
|
||||
foreach ($request as $key => $field) {
|
||||
foreach (array_unique($trans) as $entry) {
|
||||
if (strpos($key, $entry) === 0) {
|
||||
$locale[] = substr($key, -2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $locale;
|
||||
}
|
||||
|
||||
public function edit(CategoryFormBuilder $form, Request $request, $id)
|
||||
{
|
||||
if ($request->action == "update") {
|
||||
|
||||
@ -10,4 +10,7 @@ return [
|
||||
'detail_page_location' => [
|
||||
'name' => 'Detail Page Location Field',
|
||||
],
|
||||
'show_search_location_btn' => [
|
||||
'name' => 'Show Search Location Button',
|
||||
],
|
||||
];
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
function crud(params, url, type, callback) {
|
||||
$.ajax({
|
||||
type: type,
|
||||
data: params,
|
||||
url: url,
|
||||
success: function (response) {
|
||||
console.log(response)
|
||||
callback(response);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function getMyMessages(type) {
|
||||
crud({'type': type}, '/api/messages', 'GET', function (response) {
|
||||
$('#nav-' + type).html("");
|
||||
$.each(response, function (index, message) {
|
||||
$('#nav-' + type).append(
|
||||
addMessagesRow(
|
||||
message.id,
|
||||
message.sender_name,
|
||||
message.receiver_name,
|
||||
message.sent_at
|
||||
)
|
||||
);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
$('.profile-ads-tab a').on('click', function () {
|
||||
getMyMessages($(this).attr('data-type'))
|
||||
});
|
||||
|
||||
getMyMessages('inbox');
|
||||
|
||||
function addMessagesRow(id, senderName, receiverName, sentAt) {
|
||||
return `
|
||||
<a href="/message/${id}/detail">
|
||||
<div class="alert alert-success">
|
||||
<h5 class="alert-heading">${from}:<small class="pl-1">${senderName}</small></h5>
|
||||
<h5 class="alert-heading">${to}:<small class="pl-1">${receiverName}</small></h5>
|
||||
<small class="mb-0">${sentAt}</small>
|
||||
</div>
|
||||
</a>
|
||||
`
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user