From 0919e32155bea6144172dbfbd62846ccbf78a0a6 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 11 Dec 2020 20:25:01 +0100 Subject: [PATCH] wip #3753 @2 --- app/Models/FluidbookQuote.php | 4 +++- app/Models/Quiz.php | 6 ++++-- app/Models/Signature.php | 2 ++ config/backpack/crud.php | 2 +- public/packages/fluidbook/toolbox/css/style.less | 13 ++++++++++--- .../backpack/crud/inc/datatables_logic.blade.php | 11 +++++++++++ 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/app/Models/FluidbookQuote.php b/app/Models/FluidbookQuote.php index 0c5289598..dfaa518d8 100644 --- a/app/Models/FluidbookQuote.php +++ b/app/Models/FluidbookQuote.php @@ -24,7 +24,7 @@ class FluidbookQuote extends CubistMagicAbstractModel protected $_operations = [ShowOperation::class, AssignOperation::class, CreateFromWebsite::class, ConfirmAssignmentOperation::class]; protected $_enableClone = false; protected $_enableCreation = false; - + protected $_enableBulk = false; public static function addOwnerClause(Builder $builder) { @@ -97,6 +97,8 @@ class FluidbookQuote extends CubistMagicAbstractModel 4 => __('Déjà client'), ], 'column' => true, 'filter' => true]); + $this->addField('notes', 'Textarea', __('Notes')); + $this->addField('origin_column', FluidbookQuoteOrigin::class, __('Origine'), ['column' => true, 'filter' => true]); $this->addField('fluidbooks', 'ModelAttribute', __('Fluidbooks'), ['column' => true, 'column_label' => '', 'attribute' => 'user.e1_ws_count']); } diff --git a/app/Models/Quiz.php b/app/Models/Quiz.php index 5afed8393..32ead26eb 100644 --- a/app/Models/Quiz.php +++ b/app/Models/Quiz.php @@ -21,6 +21,7 @@ class Quiz extends CubistMagicAbstractModel 'singular' => 'quiz', 'plural' => 'quizzes']; + protected $_enableBulk = false; protected static function _getColors() { @@ -96,8 +97,9 @@ class Quiz extends CubistMagicAbstractModel 'label' => __('Propriétaire'), 'type' => User::class, 'column' => true, - 'can' => 'toolbox:quiz:edit_ownership', - 'attribute' => 'companyWithNameOnTwoLines', + 'can' => 'quiz:admin', + 'column_attribute' => 'companyWithNameOnTwoLines', + 'attribute' => 'companyWithName', 'tab' => __('Projet')]); $this->addField(['name' => 'title', diff --git a/app/Models/Signature.php b/app/Models/Signature.php index 985dea9a3..25914ee3f 100644 --- a/app/Models/Signature.php +++ b/app/Models/Signature.php @@ -9,6 +9,8 @@ use Cubist\Backpack\Magic\Models\CubistMagicAbstractModel; class Signature extends CubistMagicAbstractModel { + protected $_enableBulk = false; + protected $table = 'signature'; protected $_options = ['name' => 'signature', diff --git a/config/backpack/crud.php b/config/backpack/crud.php index bedb94af8..d544593a6 100644 --- a/config/backpack/crud.php +++ b/config/backpack/crud.php @@ -51,7 +51,7 @@ return [ // - 1 - as important as bulk buttons // - 2-3 - more important than the rest of the columns // - 4 - less important than most columns - 'actionsColumnPriority' => 1, + 'actionsColumnPriority' => 0, ], /* diff --git a/public/packages/fluidbook/toolbox/css/style.less b/public/packages/fluidbook/toolbox/css/style.less index cd4f73ca0..57fe0a2bc 100644 --- a/public/packages/fluidbook/toolbox/css/style.less +++ b/public/packages/fluidbook/toolbox/css/style.less @@ -282,17 +282,24 @@ a, a.btn-link { } } + &.dtr-inline.collapsed { + td.dtr-control, th.dtr-control { + padding-left: 30px !important; + } + } + td { - padding: 0.4em 0.5em 0.4em 0.3em; + line-height: 1.1em; + padding: 0.4em 0.5em; } th { - padding-left: 0.3em; + padding-left: 0.5em; } th, td { - &:first-child, &:nth-child(2), &:nth-child(3), &:last-child { + &:first-child, &:last-child { width: 1px; } } diff --git a/resources/views/vendor/backpack/crud/inc/datatables_logic.blade.php b/resources/views/vendor/backpack/crud/inc/datatables_logic.blade.php index 7906ebd5c..3d91ff806 100644 --- a/resources/views/vendor/backpack/crud/inc/datatables_logic.blade.php +++ b/resources/views/vendor/backpack/crud/inc/datatables_logic.blade.php @@ -1,4 +1,6 @@ + + @@ -302,6 +304,15 @@ if (crud.table.responsive.hasHidden()) { $("#crudTable").addClass('has-hidden-columns'); crud.table.responsive.recalc(); + + $("#crudTable .btn-link").each(function () { + tippy(this, { + content: $(this).contents() + .filter(function () { + return this.nodeType === 3; //Node.TEXT_NODE + }).text(), + }) + }); } }); @else -- 2.39.5