diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index d5873ca8d..5841f4da7 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -43,6 +43,16 @@ class ConfigController extends Controller $configForm->handleRequest($request); if ($configForm->isSubmitted() && $configForm->isValid()) { + // force theme to material to avoid using baggy + if ('baggy' === $config->getTheme()) { + $config->setTheme('material'); + + $this->addFlash( + 'notice', + 'Baggy is deprecated, forced to Material theme.' + ); + } + $em->persist($config); $em->flush(); diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 6901fa08e..af916b29f 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -24,7 +24,13 @@ class ConfigType extends AbstractType $this->themes = array_combine( $themes, array_map(function ($s) { - return ucwords(strtolower(str_replace('-', ' ', $s))); + $cleanTheme = ucwords(strtolower(str_replace('-', ' ', $s))); + + if ('Baggy' === $cleanTheme) { + $cleanTheme = 'Baggy (DEPRECATED)'; + } + + return $cleanTheme; }, $themes) ); diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig index 33b0ac8b7..d0be1e5cc 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig @@ -57,6 +57,11 @@ {% endblock %} {% block messages %} + <div style="margin-top: 10px; color: #e01a15; border-left: 20px #e01a15 solid; padding-left: 10px; border-bottom: 6px #e01a15 solid; border-bottom-left-radius: 10px;"> + <h3>⚠️ You are using the Baggy theme which is now deprecated.</h3> + <p>It will be removed in the next version. You can use the Material theme by <a href="{{ path('config') }}">updating the theme config</a>.</p> + </div> + {% for flashMessage in app.session.flashbag.get('notice') %} <div class="messages success"> <a href="#" class="closeMessage">×</a>