Merge pull request #63 from openclassify/vedat

Fixed Home Add Cart Icon
This commit is contained in:
Fatih Alp 2019-08-09 00:51:36 +03:00 committed by GitHub
commit 262d472e31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 66 additions and 10 deletions

View File

@ -1,9 +1,5 @@
$('#complaints').on('click', function () {
$('#complaints_modal').modal('toggle');
});
$('#message').on('click', function () {
if ($('#adv_id').data('content') == $('#message').data('content')) {
alert("You can't send messages to your own ad.")
@ -32,9 +28,6 @@ $('#message-button').on('click', function () {
});
});
$('#complaint-radio').on('click', function () {
$(this).closest("textarea").toggle();
});
function openVideo(){

View File

@ -33,5 +33,8 @@ return [
],
'fields' => [
'title' => 'Custom Fields'
],
'assets_clear' => [
'name' => 'Assets Clear'
]
];

View File

@ -32,6 +32,10 @@ class AdvsModule extends Module
],
],
],
'assets_clear' => [
'title' => 'visiosoft.module.advs::section.assets_clear.name',
'href' => '/admin/assets/clear',
]
// 'custom_fields' => [
// 'buttons' => [
// 'new_custom_field',

View File

@ -161,6 +161,10 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
'advs/delete/{id}' => 'Visiosoft\AdvsModule\Http\Controller\advsController@softDeleteAdv',
'check_user' => 'Visiosoft\AdvsModule\Http\Controller\advsController@checkUser',
'keySearch' => 'Visiosoft\AdvsModule\Http\Controller\AjaxController@keySearch',
'adv/addCart/{id}' => [
'as' => 'adv_AddCart',
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@advAddCart',
],
'ajax/StockControl' => [
'as' => 'adv_stock_control_ajax',
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@stockControl',
@ -177,6 +181,10 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
'as' => 'visiosoft.module.advs::view_type',
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@viewType',
],
'admin/assets/clear' => [
'as' => 'assets_clear',
'uses' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@assetsClear',
],
];
/**
@ -309,7 +317,13 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
'title' => 'visiosoft.module.advs::button.general_settings',
'href' => '/admin/settings/modules/visiosoft.module.advs',
];
$slug2 = 'assets_clear';
$section2 = [
'title' => 'visiosoft.module.advs::section.assets_clear.name',
'href' => '/admin/assets/clear',
];
$addonCollection->get('anomaly.module.settings')->addSection($slug, $section);
$addonCollection->get('anomaly.module.settings')->addSection($slug2, $section2);
}
/**

View File

@ -2,10 +2,12 @@
use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface;
use Anomaly\Streams\Platform\Application\Application;
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Anomaly\Streams\Platform\Model\Cats\CatsCategoryEntryModel;
use Anomaly\Streams\Platform\Model\Users\UsersUsersEntryModel;
use Illuminate\Filesystem\Filesystem;
use Visiosoft\AdvsModule\Adv\Table\Filter\CategoryFilterQuery;
use Visiosoft\AdvsModule\Adv\Table\Filter\CityFilterQuery;
use Visiosoft\AdvsModule\Adv\Table\Filter\UserFilterQuery;
@ -169,4 +171,12 @@ class AdvsController extends AdminController
$events->dispatch(new ChangeStatusAd($id, $settings));//Create Notify
return back();
}
public function assetsClear(Filesystem $files, Application $application)
{
$directory = 'assets';
$files->deleteDirectory($directory = $application->getAssetsPath($directory), true);
echo "<h1>Success</h1>" . "<br>";
echo "<a href='/admin'><b>Return Admin Panel</b></a>";
}
}

View File

@ -812,6 +812,22 @@ class AdvsController extends PublicController
}
}
public function advAddCart($id)
{
$quantity = 1;
$thisModel = new AdvModel();
$adv = $thisModel->isAdv($id);
$response = array();
if ($adv) {
$cart = $thisModel->addCart($adv, $quantity);
$response['status'] = "success";
} else {
$response['status'] = "error";
$response['msg'] = trans('visiosoft.module.advs::message.error_added_cart');
}
return redirect('/cart/');
}
public function addCart(Request $request)
{
$id = $request->id;

View File

@ -146,7 +146,7 @@
<!-- item-info-right -->
<div class="user-option pull-right">
{% if adv.is_get_adv == "1" %}
<a href="#" data-toggle="tooltip" data-placement="top"
<a href="{{ url_route('adv_AddCart',[adv.id]) }}" data-toggle="tooltip" data-placement="top"
title="{{ trans('visiosoft.module.advs::field.online_shopping') }}"><i
class="fa fa-shopping-cart"></i> </a>
{% endif %}
@ -235,7 +235,7 @@
<!-- item-info-right -->
<div class="user-option pull-right">
{% if adv.is_get_adv == "1" %}
<a href="#" data-toggle="tooltip" data-placement="top"
<a href="{{ url_route('adv_AddCart',[adv.id]) }}" data-toggle="tooltip" data-placement="top"
title="{{ adv.city_name }}, {{ adv.country_name }}"><i
class="fa fa-shopping-cart"></i> </a>
{% endif %}
@ -297,7 +297,7 @@
<!-- item-info-right -->
<div class="user-option pull-right">
{% if adv.is_get_adv == "1" %}
<a href="#" data-toggle="tooltip" data-placement="top"
<a href="{{ url_route('adv_AddCart',[adv.id]) }}" data-toggle="tooltip" data-placement="top"
title="{{ trans('visiosoft.module.advs::field.online_shopping') }}"><i
class="fa fa-shopping-cart"></i> </a>
{% endif %}

View File

@ -3,6 +3,9 @@
use Anomaly\FilesModule\Disk\Contract\DiskRepositoryInterface;
use Anomaly\FilesModule\Folder\Contract\FolderRepositoryInterface;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Illuminate\Database\Eloquent\Model;
use Chumper\Zipper\Zipper;
use Illuminate\Support\Facades\DB;
@ -57,6 +60,19 @@ class ProfileModuleSeeder extends Seeder
],
]
);
$repository = "https://raw.githubusercontent.com/openclassify/Openclassify-Demo-Data/master/";
file_put_contents(__DIR__ . "/advListingPage.sql", fopen($repository . "advListingPage.sql", 'r'));
file_put_contents("adv_listing_page.zip", fopen($repository . "adv_listing_page.zip", 'r'));
$zipper = new Zipper();
$zipper->make('adv_listing_page.zip')->folder('adv_listing_page')->extractTo(base_path() . '/public/app/default/files-module/local/adv_listing_page/');
$zipper->close();
Model::unguard();
DB::unprepared(file_get_contents(__DIR__ . '/advListingPage.sql'));
Model::reguard();
}
}