From 5e691a23fbd85189a738aeea62f808c11ed4fefe Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 12 Apr 2023 17:18:34 +0200 Subject: [PATCH] wip #5851 @3 --- app/Console/Commands/ToolboxTranslations.php | 39 +++++++++++++++++++ app/Models/FluidbookTranslate.php | 5 ++- app/Models/ToolboxTranslate.php | 9 +++++ config/backpack/base.php | 2 + config/debugbar.php | 2 +- .../packages/fluidbook/toolbox/css/style.less | 16 ++++++++ .../base/inc/sidebar_content.blade.php | 4 +- 7 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 app/Console/Commands/ToolboxTranslations.php diff --git a/app/Console/Commands/ToolboxTranslations.php b/app/Console/Commands/ToolboxTranslations.php new file mode 100644 index 000000000..00dba7771 --- /dev/null +++ b/app/Console/Commands/ToolboxTranslations.php @@ -0,0 +1,39 @@ +setExtensions(['js']); + foreach ($paths as $path) { + $t->addPath(base_path() . '/' . $path); + } + $t->parseFiles(); + dd($t->getStringToTranslate()); + } +} diff --git a/app/Models/FluidbookTranslate.php b/app/Models/FluidbookTranslate.php index 6c9c6730b..05fc6d134 100644 --- a/app/Models/FluidbookTranslate.php +++ b/app/Models/FluidbookTranslate.php @@ -11,6 +11,7 @@ use App\Models\Traits\FluidbookPlayerBranches; use Cubist\Backpack\Facades\App; use Cubist\Backpack\Magic\Models\Translate; use Cubist\Util\PHP; + // __('!!Traduction des fluidbooks') class FluidbookTranslate extends Translate { @@ -43,7 +44,7 @@ class FluidbookTranslate extends Translate public function setFields() { - $this->addField(['name' => 'nsis', 'type' => NSISLocale::class, 'label' => __('Langue de l\'installeur'), 'translatable' => true, 'default' => 'English']); + $this->addField(['name' => 'nsis', 'type' => NSISLocale::class, 'label' => __('Langue de l\'installeur') . ' (' . __('Version offline windows') . ')', 'translatable' => true, 'default' => 'English']); parent::setFields(); } @@ -146,7 +147,7 @@ class FluidbookTranslate extends Translate public static function getFluidbookTranslation($locale) { $all = self::getAllFluidbookTranslations(); - $res= $all[$locale] ?? null; + $res = $all[$locale] ?? null; return $res; } diff --git a/app/Models/ToolboxTranslate.php b/app/Models/ToolboxTranslate.php index 261eed1fc..7ec0725bc 100644 --- a/app/Models/ToolboxTranslate.php +++ b/app/Models/ToolboxTranslate.php @@ -3,6 +3,7 @@ namespace App\Models; +use App\Models\Traits\FluidbookPlayerBranches; use Cubist\Backpack\Magic\Models\Translate; class ToolboxTranslate extends Translate @@ -14,6 +15,7 @@ class ToolboxTranslate extends Translate 'plural' => 'traductions', 'oneinstance' => true]; + protected $_enableTrackEmptyValues = true; public function getPaths() @@ -21,6 +23,13 @@ class ToolboxTranslate extends Translate return array_merge(parent::getPaths(), ['vendor/cubedesigners']); } + public function onUpdating(): bool + { + dd($this); + + return parent::onUpdating(); + } + protected function _defaultTranslations() { return ['en' => [ diff --git a/config/backpack/base.php b/config/backpack/base.php index e0eaa348d..889945f57 100644 --- a/config/backpack/base.php +++ b/config/backpack/base.php @@ -369,4 +369,6 @@ return [ */ 'token_username' => env('BACKPACK_TOKEN_USERNAME', false), + + 'locales' => explode(',', env('BACKPACK_LOCALES', 'en')), ]; diff --git a/config/debugbar.php b/config/debugbar.php index b34dbe3c0..6d9983192 100644 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -90,7 +90,7 @@ return [ | Extension, without the server-side code. It uses Debugbar collectors instead. | */ - 'clockwork' => false, + 'clockwork' => true, /* |-------------------------------------------------------------------------- diff --git a/public/packages/fluidbook/toolbox/css/style.less b/public/packages/fluidbook/toolbox/css/style.less index 8810e810b..01c396455 100644 --- a/public/packages/fluidbook/toolbox/css/style.less +++ b/public/packages/fluidbook/toolbox/css/style.less @@ -473,6 +473,22 @@ body.embeded { box-shadow: 0 0 4px rgba(0, 0, 0, 0.1); } +table.dataTable thead > tr > th.sorting_asc::before, table.dataTable thead > tr > th.sorting_desc::after, table.dataTable thead > tr > td.sorting_asc::before, table.dataTable thead > tr > td.sorting_desc::after { + opacity: 1.0 !important; +} + +table.dataTable thead .sorting::before, table.dataTable thead .sorting::after, table.dataTable thead .sorting_asc::before, table.dataTable thead .sorting_asc::after, table.dataTable thead .sorting_desc::before, table.dataTable thead .sorting_desc::after, table.dataTable thead .sorting_asc_disabled::before, table.dataTable thead .sorting_asc_disabled::after, table.dataTable thead .sorting_desc_disabled::before, table.dataTable thead .sorting_desc_disabled::after { + opacity: 0.3 !important; +} + +.table-striped tbody tr:nth-of-type(2n) { + background-color: rgba(0, 0, 0, .02); +} + +table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1):hover { + background-color: rgba(124, 124, 124, .1); +} + @import "context-menu"; @import "loader"; diff --git a/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php b/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php index f4e2d9edc..0b4419598 100644 --- a/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php +++ b/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php @@ -107,7 +107,7 @@ @endcan @can('fluidbook-translate:write') @@ -198,7 +198,7 @@