Merge pull request #968 from openclassify/dia

#3231 [recommendedads-module] Table buttons disappear if recommended-…
This commit is contained in:
Muammer Top 2021-02-26 20:26:01 +03:00 committed by GitHub
commit b9a736cc55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 24 deletions

View File

@ -11,7 +11,7 @@
</p>
</div>
<div class="preview-actions text-center">
{% if isActive('packages') and setting_value('visiosoft.module.packages::move_the_buy_package_to_the_end') %}
{% 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]) %}
{% elseif isActive('dopings') %}
{% set continueLink = url_route('add_doping', [adv.id]) %}

View File

@ -1,13 +1,12 @@
<?php namespace Visiosoft\AdvsModule\Adv\Table;
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
use Anomaly\Streams\Platform\Entry\EntryModel;
class AdvTableButtons
{
public function handle(AdvTableBuilder $builder)
{
$builder->setButtons([
$buttons = [
'status' => [
'text' => function (EntryInterface $entry) {
$text_type = ($entry->getStatus() == 'approved') ? 'decline' : 'approve';
@ -50,9 +49,13 @@ class AdvTableButtons
'create_configration' => [
'text' => trans('visiosoft.module.advs::button.create_configurations'),
'href' => route('visiosoft.module.advs::configrations.create') . "?ad={entry.id}"]
]
]
]
]);
];
$builder->setButtons($buttons);
return $buttons;
}
}

View File

@ -43,15 +43,6 @@ class AdvsController extends AdminController
$table->addAsset("styles.css", "visiosoft.module.advs::css/custom.css");
$table->addAsset('scripts.js', 'visiosoft.module.advs::js/list.js');
if ($this->model->is_enabled('recommendedads')) {
$table->addButton('add_recommended', [
'type' => 'default',
'icon' => 'fa fa-gg',
'text' => 'Add Recommended',
'href' => '/admin/recommendedads/create/{entry.id}',
]);
}
return $table->render();
}

View File

@ -17,12 +17,6 @@ use Visiosoft\DefaultadminTheme\Listener\ApplySorting;
*/
class DefaultadminThemeServiceProvider extends AddonServiceProvider
{
/**
* The addon listeners.
*
* @var array
*/
protected $listeners = [
SortNavigation::class => [
ApplySorting::class,
@ -33,9 +27,6 @@ class DefaultadminThemeServiceProvider extends AddonServiceProvider
],
];
/**
* Register the addon.
*/
public function register()
{
AbstractPaginator::$defaultView = 'visiosoft.theme.defaultadmin::pagination/bootstrap-4';

View File

@ -45,7 +45,7 @@ class ProfileModulePlugin extends Plugin
return $ad;
}
)
),
];
}
}