mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-06 13:26:05 -06:00
Merge branch 'master' of https://github.com/openclassify/openclassify into muammertop
This commit is contained in:
commit
d883ae5993
@ -16,6 +16,7 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="preview-actions text-center">
|
<div class="preview-actions text-center">
|
||||||
{% if isActive('packages') and setting_value('visiosoft.module.packages::move_the_buy_package_to_the_end') and (auth_user().isAdmin or not auth_user().hasPermission('visiosoft.module.packages::packages.no_read')) %}
|
{% if isActive('packages') and setting_value('visiosoft.module.packages::move_the_buy_package_to_the_end') and (auth_user().isAdmin or not auth_user().hasPermission('visiosoft.module.packages::packages.no_read')) %}
|
||||||
{% set continueLink = url_route('visiosoft.module.packages::add_package', [adv.id]) %}
|
{% set continueLink = url_route('visiosoft.module.packages::add_package', [adv.id]) %}
|
||||||
@ -24,6 +25,13 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %}
|
{% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if isActive('shipping') %}
|
||||||
|
<a href="{{ url_route('visiosoft.module.shipping::create_shipping',{'id':adv.id}) }}"
|
||||||
|
class="btn btn-outline-primary shadow-sm mr-4">
|
||||||
|
<i class="fa fa-truck"></i>
|
||||||
|
{{ trans('visiosoft.module.shipping::button.create_shipping_information') }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
|
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
|
||||||
class="btn preview-edit shadow-sm border">
|
class="btn preview-edit shadow-sm border">
|
||||||
{{ trans('visiosoft.module.advs::field.edit') }}
|
{{ trans('visiosoft.module.advs::field.edit') }}
|
||||||
@ -37,6 +45,13 @@
|
|||||||
<div class="preview-overlay position-absolute"></div>
|
<div class="preview-overlay position-absolute"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="preview-actions text-center">
|
<div class="preview-actions text-center">
|
||||||
|
{% if isActive('shipping') %}
|
||||||
|
<a href="{{ url_route('visiosoft.module.shipping::create_shipping',{'id':adv.id}) }}"
|
||||||
|
class="btn btn-outline-primary shadow-sm mr-4">
|
||||||
|
{{ trans('visiosoft.module.shipping::button.create_shipping_information') }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
|
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
|
||||||
class="btn preview-edit shadow-sm border">
|
class="btn preview-edit shadow-sm border">
|
||||||
{{ trans('visiosoft.module.advs::field.edit') }}
|
{{ trans('visiosoft.module.advs::field.edit') }}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ use Anomaly\Streams\Platform\Model\Advs\AdvsCustomFieldsEntryModel;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
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\AdvsModule\OptionConfiguration\OptionConfigurationModel;
|
use Visiosoft\AdvsModule\OptionConfiguration\OptionConfigurationModel;
|
||||||
@ -514,4 +515,16 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
{
|
{
|
||||||
return $this->created_by_id == \auth()->id() || \auth()->user()->isAdmin();
|
return $this->created_by_id == \auth()->id() || \auth()->user()->isAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCatsIDs()
|
||||||
|
{
|
||||||
|
$attr = $this->getAttributes();
|
||||||
|
return array_filter(
|
||||||
|
$attr,
|
||||||
|
function ($key) use ($attr) {
|
||||||
|
return Str::startsWith($key, 'cat') && $attr[$key];
|
||||||
|
},
|
||||||
|
ARRAY_FILTER_USE_KEY
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,12 +11,13 @@ class AdvsImport implements ToModel, WithHeadingRow
|
|||||||
{
|
{
|
||||||
public function model(array $row)
|
public function model(array $row)
|
||||||
{
|
{
|
||||||
|
$row['name'] = $row['name'] ?? $row['title'];
|
||||||
if ($row['name'] !== null && $row['price'] !== null && $row['currency'] !== null) {
|
if ($row['name'] !== null && $row['price'] !== null && $row['currency'] !== null) {
|
||||||
return new AdvModel([
|
return new AdvModel([
|
||||||
'name' => $row['name'],
|
'name' => $row['name'],
|
||||||
'slug' => Str::slug($row['name']),
|
'slug' => Str::slug($row['name']),
|
||||||
'advs_desc' => $row['description'] ?? null,
|
'advs_desc' => $row['description'] ?? null,
|
||||||
'standard_price' => $row['standard_price'] ?? null,
|
'standard_price' => $row['standard_price'] ?? 0,
|
||||||
'price' => $row['price'],
|
'price' => $row['price'],
|
||||||
'currency' => $row['currency'],
|
'currency' => $row['currency'],
|
||||||
'country' => $row['country'] ?? null,
|
'country' => $row['country'] ?? null,
|
||||||
|
|||||||
@ -93,4 +93,6 @@ interface AdvInterface extends EntryInterface
|
|||||||
public function changeStatus($status);
|
public function changeStatus($status);
|
||||||
|
|
||||||
public function canEdit();
|
public function canEdit();
|
||||||
|
|
||||||
|
public function getCatsIDs();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,9 +16,11 @@ class AddTotalSales
|
|||||||
public function handle(CreatedOrderDetail $event)
|
public function handle(CreatedOrderDetail $event)
|
||||||
{
|
{
|
||||||
$item = $event->getOrderItem();
|
$item = $event->getOrderItem();
|
||||||
$adv = $this->advModel->find($event->getOrderItem()->item_id);
|
if ($item->item_type === 'adv') {
|
||||||
$total = $adv->total_sales + $item->piece;
|
$adv = $this->advModel->find($event->getOrderItem()->item_id);
|
||||||
$adv->total_sales = $total;
|
$total = $adv->total_sales + $item->piece;
|
||||||
$adv->save();
|
$adv->total_sales = $total;
|
||||||
|
$adv->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
{% extends "theme::layouts/default" %}
|
{% extends "theme::layouts/default" %}
|
||||||
|
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
|
<link rel="canonical" href="{{ url() }}"/>
|
||||||
|
|
||||||
{{ asset_style('visiosoft.theme.base::css/login.css') }}
|
{{ asset_style('visiosoft.theme.base::css/login.css') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@ -103,4 +105,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ asset_add('scripts.js','visiosoft.theme.base::js/login.js') }}
|
{{ asset_add('scripts.js','visiosoft.theme.base::js/login.js') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -240,7 +240,7 @@
|
|||||||
a {
|
a {
|
||||||
background-color: unset;
|
background-color: unset;
|
||||||
border: 0;
|
border: 0;
|
||||||
color: #DC3545;
|
color: #DC3545 !important;
|
||||||
font-family: 'Poppins', sans-serif;
|
font-family: 'Poppins', sans-serif;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user