mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 23:36:08 -06:00
ad detail twig function created && amazon update
This commit is contained in:
parent
e8b6218d7f
commit
41fd3d516b
@ -35,6 +35,11 @@
|
||||
<div class="row">
|
||||
<!-- carousel -->
|
||||
<div class="col-md-7 slider-box">
|
||||
|
||||
{% if entries('advs').isEnabled('getamazon') %}
|
||||
{% set product_amazon = entries('getamazon','products').where('slug',adv.slug).first() %}
|
||||
{% endif %}
|
||||
|
||||
{% if blocks('ad-item-picture-block-area') is null %}
|
||||
{% include "visiosoft.module.advs::advs/partials/blocks/ads-item-picture-block" %}
|
||||
{% else %}
|
||||
@ -48,66 +53,12 @@
|
||||
{% if entries('advs').isEnabled('favs') %}
|
||||
<a class="favorites" href="#"><i id="heart-icon-adv" class="far fa-heart"></i></a>
|
||||
{% endif %}
|
||||
<h3 class="title">{{ adv.title }}</h3>
|
||||
<h2 class="ad-price">
|
||||
<b>{{ adv.price.format() }}</b> {{ adv.currency }}
|
||||
{% if app.auth.id == adv.created_by_id %}
|
||||
<a class="btn btn-info edit-adv-btn" href="/advs/edit_advs/{{ adv.id }}"><i
|
||||
class="fa fa-pencil-square-o"></i>
|
||||
<font>{{ trans('visiosoft.module.advs::field.edit') }}</font></a>
|
||||
{% if adv.status != "pending_admin" and adv.status != "approved" %}
|
||||
<a class="btn btn-success approve-adv-btn"
|
||||
href="{{ url_route('visiosoft.module.advs::status',[adv.id,"pending_admin"]) }}"><i
|
||||
class="fa fa-eye"></i>
|
||||
<font>{{ trans('visiosoft.module.advs::field.approve') }}</font></a>
|
||||
{% else %}
|
||||
<a class="btn btn-danger passive-adv-btn"
|
||||
href="{{ url_route('visiosoft.module.advs::status',[adv.id,"passive"]) }}"><i
|
||||
class="fa fa-ban"></i>
|
||||
<font>{{ trans('visiosoft.module.advs::field.passive') }}</font></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</h2>
|
||||
<div class="user-interactions">
|
||||
|
||||
{% if adv.is_get_adv == "1" and adv.stock != "0" and entries('advs').isEnabled('carts') %}
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 add-cart-row">
|
||||
<div class="add-cart-quantity-field">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 add-cart-reduce">
|
||||
<button type="button" class="btn btn-default btn-number bg-secondary"
|
||||
data-type="minus"
|
||||
data-field="quant[1]" disabled="true">
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-2 col-xs-1 add-cart-quantity">
|
||||
<input type="text" name="quant[1]" data-id="{{ adv.id }}"
|
||||
class="form-control add-cart-quantity-input" value="1"
|
||||
min="1" max="10">
|
||||
<span>{{ trans('visiosoft.module.advs::field.quantity') }}</span>
|
||||
{#Trans yapılacak#}
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 add-cart-upgrade">
|
||||
<button type="button" class="btn btn-default btn-number"
|
||||
data-type="plus"
|
||||
data-field="quant[1]" {% if adv.stock < "2" %} disabled="true" {% endif %}>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="add-cart-button-field">
|
||||
|
||||
<a class="btn btn-success add-cart-button"
|
||||
href="{{ url_route('addCart',[adv.id]) }}"><i
|
||||
class="fa fa-shopping-cart"></i> {{ trans('visiosoft.module.orders::field.addcart') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if blocks('ad-item-details-block-area') is null %}
|
||||
{% include "visiosoft.module.advs::advs/partials/blocks/ads-item-details-block" %}
|
||||
{% else %}
|
||||
{{ blocks('ad-item-details-block-area') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div><!-- slider-text -->
|
||||
</div>
|
||||
</div>
|
||||
@ -125,7 +76,7 @@
|
||||
{% if blocks('ad-item-content-block-area') is null %}
|
||||
{% include "visiosoft.module.advs::advs/partials/blocks/ads-item-content-block" %}
|
||||
{% else %}
|
||||
{{ blocks('ad-item-content-block-area') }}
|
||||
{{ blocks('ad-item-content-block-area','adasdasda') }}
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
@ -1,3 +1,56 @@
|
||||
<h3 class="title">{{ adv.title }}</h3>
|
||||
<h2 class="ad-price">
|
||||
<b>{{ adv.price.format() }}</b> {{ adv.currency }}
|
||||
{% if app.auth.id == adv.created_by_id %}
|
||||
<a class="btn btn-info edit-adv-btn" href="/advs/edit_advs/{{ adv.id }}"><i
|
||||
class="fa fa-pencil-square-o"></i>
|
||||
<font>{{ trans('visiosoft.module.advs::field.edit') }}</font></a>
|
||||
{% if adv.status != "pending_admin" and adv.status != "approved" %}
|
||||
<a class="btn btn-success approve-adv-btn"
|
||||
href="{{ url_route('visiosoft.module.advs::status',[adv.id,"pending_admin"]) }}"><i
|
||||
class="fa fa-eye"></i>
|
||||
<font>{{ trans('visiosoft.module.advs::field.approve') }}</font></a>
|
||||
{% else %}
|
||||
<a class="btn btn-danger passive-adv-btn"
|
||||
href="{{ url_route('visiosoft.module.advs::status',[adv.id,"passive"]) }}"><i
|
||||
class="fa fa-ban"></i>
|
||||
<font>{{ trans('visiosoft.module.advs::field.passive') }}</font></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</h2>
|
||||
<div class="user-interactions">
|
||||
{% if adv.is_get_adv == "1" and adv.stock != "0" and entries('advs').isEnabled('carts') %}
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 add-cart-row">
|
||||
<div class="add-cart-quantity-field">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 add-cart-reduce">
|
||||
<button type="button" class="btn btn-default btn-number bg-secondary"
|
||||
data-type="minus"
|
||||
data-field="quant[1]" disabled="true">
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-2 col-xs-1 add-cart-quantity">
|
||||
<input type="text" name="quant[1]" data-id="{{ adv.id }}"
|
||||
class="form-control add-cart-quantity-input" value="1"
|
||||
min="1" max="10">
|
||||
<span>{{ trans('visiosoft.module.advs::field.quantity') }}</span>
|
||||
{#Trans yapılacak#}
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 add-cart-upgrade">
|
||||
<button type="button" class="btn btn-default btn-number"
|
||||
data-type="plus"
|
||||
data-field="quant[1]" {% if adv.stock < "2" %} disabled="true" {% endif %}>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="add-cart-button-field">
|
||||
|
||||
<a class="btn btn-success add-cart-button"
|
||||
href="{{ url_route('addCart',[adv.id]) }}"><i
|
||||
class="fa fa-shopping-cart"></i> {{ trans('visiosoft.module.orders::field.addcart') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 offered-field offered-row">
|
||||
{% if entries('advs').isEnabled('favs') %}
|
||||
<a id="owner-fav" href="#"><i id="heart-icon-seller" class="far fa-heart"></i></a>
|
||||
@ -106,3 +159,4 @@
|
||||
</ul>
|
||||
</div>
|
||||
<!-- social-links -->
|
||||
</div>
|
||||
@ -0,0 +1,34 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Adv\Command;
|
||||
|
||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||
|
||||
class GetAd
|
||||
{
|
||||
|
||||
/**
|
||||
* @var $id
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* GetProduct constructor.
|
||||
* @param $id
|
||||
*/
|
||||
public function __construct($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param AdvRepositoryInterface $groups
|
||||
* @return |null
|
||||
*/
|
||||
public function handle(AdvRepositoryInterface $groups)
|
||||
{
|
||||
if ($this->id) {
|
||||
return $groups->findById($this->id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
<?php namespace Visiosoft\AdvsModule;
|
||||
|
||||
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
||||
use Visiosoft\AdvsModule\Adv\Command\GetAd;
|
||||
|
||||
class AdvsModulePlugin extends Plugin
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new \Twig_SimpleFunction(
|
||||
'adDetail',
|
||||
function ($id) {
|
||||
|
||||
if (!$ad = $this->dispatch(new GetAd($id))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $ad;
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -27,7 +27,9 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
*
|
||||
* @type array|null
|
||||
*/
|
||||
protected $plugins = [];
|
||||
protected $plugins = [
|
||||
AdvsModulePlugin::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The addon Artisan commands.
|
||||
|
||||
@ -67,7 +67,8 @@
|
||||
"anomaly/html_block-extension": "~1.0.0",
|
||||
"anomaly/wysiwyg_block-extension": "~1.0.0",
|
||||
"ammadeuss/laravel-html-dom-parser": "^1.1",
|
||||
"guzzlehttp/guzzle": "~6.3.3"
|
||||
"guzzlehttp/guzzle": "~6.3.3",
|
||||
"paquettg/php-html-parser": "^2.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"filp/whoops": "~2.0",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user