mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
Merge branch 'master' of https://github.com/openclassify/openclassify into muammertop
This commit is contained in:
commit
7f16e25858
@ -11,6 +11,7 @@ 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;
|
||||||
use Visiosoft\AdvsModule\Support\Command\Currency;
|
use Visiosoft\AdvsModule\Support\Command\Currency;
|
||||||
|
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
|
||||||
use Visiosoft\LocationModule\City\CityModel;
|
use Visiosoft\LocationModule\City\CityModel;
|
||||||
use Visiosoft\LocationModule\Country\CountryModel;
|
use Visiosoft\LocationModule\Country\CountryModel;
|
||||||
use Visiosoft\CartsModule\Cart\Command\GetCart;
|
use Visiosoft\CartsModule\Cart\Command\GetCart;
|
||||||
@ -527,4 +528,19 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
ARRAY_FILTER_USE_KEY
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,4 +95,6 @@ interface AdvInterface extends EntryInterface
|
|||||||
public function canEdit();
|
public function canEdit();
|
||||||
|
|
||||||
public function getCatsIDs();
|
public function getCatsIDs();
|
||||||
|
|
||||||
|
public function lastCategory();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?php namespace Visiosoft\AdvsModule\Adv\Support\MultipleFieldType;
|
||||||
|
|
||||||
|
class LookupTableBuilder extends \Anomaly\MultipleFieldType\Table\LookupTableBuilder
|
||||||
|
{
|
||||||
|
protected $columns = [
|
||||||
|
'name',
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?php namespace Visiosoft\AdvsModule\Adv\Support\MultipleFieldType;
|
||||||
|
|
||||||
|
class SelectedTableBuilder extends \Anomaly\MultipleFieldType\Table\SelectedTableBuilder
|
||||||
|
{
|
||||||
|
protected $columns = [
|
||||||
|
'name',
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?php namespace Visiosoft\AdvsModule\Adv\Support\MultipleFieldType;
|
||||||
|
|
||||||
|
class ValueTableBuilder extends \Anomaly\MultipleFieldType\Table\ValueTableBuilder
|
||||||
|
{
|
||||||
|
protected $columns = [
|
||||||
|
'name',
|
||||||
|
];
|
||||||
|
}
|
||||||
2
addons/default/visiosoft/base-theme/resources/js/sweetalert2.all.min.js
vendored
Normal file
2
addons/default/visiosoft/base-theme/resources/js/sweetalert2.all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -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') %}
|
{% if message_exists('success') %}
|
||||||
<div class="alert alert-success alert-dismissible">
|
{% for message in message_pull('success') %}
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
Toast.fire({
|
||||||
<span>×</span><span class="sr-only">Close</span>
|
icon: 'success',
|
||||||
</button>
|
title: `{{ trans(message)|markdown }}`,
|
||||||
|
})
|
||||||
{% for message in message_pull('success') %}
|
{% endfor %}
|
||||||
{{ trans(message)|markdown }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Informational Messages -->
|
// Informational Messages
|
||||||
{% if message_exists('info') %}
|
{% if message_exists('info') %}
|
||||||
<div class="alert alert-info alert-dismissible">
|
{% for message in message_pull('info') %}
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
Toast.fire({
|
||||||
<span>×</span><span class="sr-only">Close</span>
|
icon: 'info',
|
||||||
</button>
|
title: `{{ trans(message)|markdown }}`,
|
||||||
|
})
|
||||||
{% for message in message_pull('info') %}
|
{% endfor %}
|
||||||
{{ trans(message)|markdown }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
// Warning Messages
|
||||||
<!-- Warning Messages -->
|
|
||||||
{% if message_exists('warning') %}
|
{% if message_exists('warning') %}
|
||||||
<div class="alert alert-warning alert-dismissible">
|
{% for message in message_pull('warning') %}
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
Toast.fire({
|
||||||
<span>×</span><span class="sr-only">Close</span>
|
icon: 'warning',
|
||||||
</button>
|
title: `{{ trans(message)|markdown }}`,
|
||||||
|
})
|
||||||
{% for message in message_pull('warning') %}
|
{% endfor %}
|
||||||
{{ trans(message)|markdown }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
// Error Messages
|
||||||
<!-- Error Messages -->
|
|
||||||
{% if message_exists('error') %}
|
{% if message_exists('error') %}
|
||||||
<div class="alert alert-danger alert-dismissible">
|
{% for message in message_pull('error') %}
|
||||||
<button type="button" class="close" data-dismiss="alert">
|
Toast.fire({
|
||||||
<span>×</span><span class="sr-only">Close</span>
|
icon: 'error',
|
||||||
</button>
|
title: `{{ trans(message)|markdown }}`,
|
||||||
|
})
|
||||||
{% for message in message_pull('error') %}
|
{% endfor %}
|
||||||
{{ trans(message)|markdown }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</script>
|
||||||
</div>
|
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
{{ asset_style("visiosoft.theme.base::css/offline.scss") }}
|
{{ asset_style("visiosoft.theme.base::css/offline.scss") }}
|
||||||
|
|
||||||
<script src="{{ asset_path('visiosoft.theme.base::js/vendor/jquery.min.js') }}"></script>
|
<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_script('visiosoft.theme.base::js/visiosoft.js') }}
|
||||||
|
|
||||||
{{ asset_style("theme.css") }}
|
{{ asset_style("theme.css") }}
|
||||||
|
|||||||
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,6 +4,7 @@ use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
|||||||
use Visiosoft\ProfileModule\Adress\Command\GetAddress;
|
use Visiosoft\ProfileModule\Adress\Command\GetAddress;
|
||||||
use Visiosoft\ProfileModule\Adress\Command\GetAddressByUser;
|
use Visiosoft\ProfileModule\Adress\Command\GetAddressByUser;
|
||||||
use Visiosoft\ProfileModule\Profile\Command\GetProfileDetail;
|
use Visiosoft\ProfileModule\Profile\Command\GetProfileDetail;
|
||||||
|
use Visiosoft\ProfileModule\Profile\Command\GetProfilePhotoURL;
|
||||||
|
|
||||||
class ProfileModulePlugin extends Plugin
|
class ProfileModulePlugin extends Plugin
|
||||||
{
|
{
|
||||||
@ -43,6 +44,12 @@ class ProfileModulePlugin extends Plugin
|
|||||||
return $ad;
|
return $ad;
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
new \Twig_SimpleFunction(
|
||||||
|
'profilePhoto',
|
||||||
|
function ($user) {
|
||||||
|
return $this->dispatch(new GetProfilePhotoURL($user));
|
||||||
|
}
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user