Merge branch 'master' of https://github.com/openclassify/openclassify into muammertop

This commit is contained in:
Muammer Top 2021-08-18 12:03:44 +03:00
commit 7f16e25858
10 changed files with 119 additions and 45 deletions

View File

@ -11,6 +11,7 @@ use Visiosoft\AdvsModule\Adv\Contract\AdvInterface;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Visiosoft\AdvsModule\OptionConfiguration\OptionConfigurationModel;
use Visiosoft\AdvsModule\Support\Command\Currency;
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
use Visiosoft\LocationModule\City\CityModel;
use Visiosoft\LocationModule\Country\CountryModel;
use Visiosoft\CartsModule\Cart\Command\GetCart;
@ -527,4 +528,19 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
ARRAY_FILTER_USE_KEY
);
}
public function lastCategory()
{
if (!$catsIDs = $this->getCatsIDs()) {
return null;
}
$lastCatID = end($catsIDs);
if (!$lastCat = app(CategoryRepositoryInterface::class)->find($lastCatID)) {
return null;
}
return $lastCat;
}
}

View File

@ -95,4 +95,6 @@ interface AdvInterface extends EntryInterface
public function canEdit();
public function getCatsIDs();
public function lastCategory();
}

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Adv\Support\MultipleFieldType;
class LookupTableBuilder extends \Anomaly\MultipleFieldType\Table\LookupTableBuilder
{
protected $columns = [
'name',
];
}

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Adv\Support\MultipleFieldType;
class SelectedTableBuilder extends \Anomaly\MultipleFieldType\Table\SelectedTableBuilder
{
protected $columns = [
'name',
];
}

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Adv\Support\MultipleFieldType;
class ValueTableBuilder extends \Anomaly\MultipleFieldType\Table\ValueTableBuilder
{
protected $columns = [
'name',
];
}

File diff suppressed because one or more lines are too long

View File

@ -1,57 +1,53 @@
<div id="messages">
<script>
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
<!-- Success Messages -->
// Success Messages
{% if message_exists('success') %}
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert">
<span>&times;</span><span class="sr-only">Close</span>
</button>
{% for message in message_pull('success') %}
{{ trans(message)|markdown }}
{% endfor %}
</div>
{% for message in message_pull('success') %}
Toast.fire({
icon: 'success',
title: `{{ trans(message)|markdown }}`,
})
{% endfor %}
{% endif %}
<!-- Informational Messages -->
// Informational Messages
{% if message_exists('info') %}
<div class="alert alert-info alert-dismissible">
<button type="button" class="close" data-dismiss="alert">
<span>&times;</span><span class="sr-only">Close</span>
</button>
{% for message in message_pull('info') %}
{{ trans(message)|markdown }}
{% endfor %}
</div>
{% for message in message_pull('info') %}
Toast.fire({
icon: 'info',
title: `{{ trans(message)|markdown }}`,
})
{% endfor %}
{% endif %}
<!-- Warning Messages -->
// Warning Messages
{% if message_exists('warning') %}
<div class="alert alert-warning alert-dismissible">
<button type="button" class="close" data-dismiss="alert">
<span>&times;</span><span class="sr-only">Close</span>
</button>
{% for message in message_pull('warning') %}
{{ trans(message)|markdown }}
{% endfor %}
</div>
{% for message in message_pull('warning') %}
Toast.fire({
icon: 'warning',
title: `{{ trans(message)|markdown }}`,
})
{% endfor %}
{% endif %}
<!-- Error Messages -->
// Error Messages
{% if message_exists('error') %}
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert">
<span>&times;</span><span class="sr-only">Close</span>
</button>
{% for message in message_pull('error') %}
{{ trans(message)|markdown }}
{% endfor %}
</div>
{% for message in message_pull('error') %}
Toast.fire({
icon: 'error',
title: `{{ trans(message)|markdown }}`,
})
{% endfor %}
{% endif %}
</div>
</script>

View File

@ -22,6 +22,7 @@
{{ asset_style("visiosoft.theme.base::css/offline.scss") }}
<script src="{{ asset_path('visiosoft.theme.base::js/vendor/jquery.min.js') }}"></script>
{{ asset_script('visiosoft.theme.base::js/sweetalert2.all.min.js') }}
{{ asset_script('visiosoft.theme.base::js/visiosoft.js') }}
{{ asset_style("theme.css") }}

View File

@ -0,0 +1,26 @@
<?php namespace Visiosoft\ProfileModule\Profile\Command;
use Anomaly\Streams\Platform\Image\Command\MakeImageInstance;
use Illuminate\Foundation\Bus\DispatchesJobs;
class GetProfilePhotoURL
{
use DispatchesJobs;
protected $user;
public function __construct($user)
{
$this->user = $user;
}
public function handle()
{
return $this->user->file ? $this->user->file->make()->url() : $this->dispatchNow(
new MakeImageInstance(
'visiosoft.module.profile::images/profile-default.png',
'img'
)
)->url();
}
}

View File

@ -4,6 +4,7 @@ use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
use Visiosoft\ProfileModule\Adress\Command\GetAddress;
use Visiosoft\ProfileModule\Adress\Command\GetAddressByUser;
use Visiosoft\ProfileModule\Profile\Command\GetProfileDetail;
use Visiosoft\ProfileModule\Profile\Command\GetProfilePhotoURL;
class ProfileModulePlugin extends Plugin
{
@ -43,6 +44,12 @@ class ProfileModulePlugin extends Plugin
return $ad;
}
),
new \Twig_SimpleFunction(
'profilePhoto',
function ($user) {
return $this->dispatch(new GetProfilePhotoURL($user));
}
),
];
}
}