mirror of
https://github.com/wallabag/wallabag.git
synced 2025-02-19 20:16:18 +00:00
Merge pull request #5742 from wallabag/fix/deprecated-baggy-theme
This commit is contained in:
commit
e90a7c20e2
3 changed files with 22 additions and 1 deletions
|
@ -43,6 +43,16 @@ class ConfigController extends Controller
|
||||||
$configForm->handleRequest($request);
|
$configForm->handleRequest($request);
|
||||||
|
|
||||||
if ($configForm->isSubmitted() && $configForm->isValid()) {
|
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->persist($config);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,13 @@ class ConfigType extends AbstractType
|
||||||
$this->themes = array_combine(
|
$this->themes = array_combine(
|
||||||
$themes,
|
$themes,
|
||||||
array_map(function ($s) {
|
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)
|
}, $themes)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,11 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block messages %}
|
{% 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') %}
|
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||||
<div class="messages success">
|
<div class="messages success">
|
||||||
<a href="#" class="closeMessage">×</a>
|
<a href="#" class="closeMessage">×</a>
|
||||||
|
|
Loading…
Reference in a new issue