diff --git a/assets/css/app.scss b/assets/css/app.scss index a235e8b..7b154ce 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -119,10 +119,18 @@ pre[class*="language-"] { margin: 0; } +.avatar { + width: 50%; +} + .navigation { padding-top: 35px; font-size: 15px; + &.navigation-with-avatar { + padding-top: 5px; + } + .deblan-icon { margin-right: 9px; } diff --git a/composer.json b/composer.json index c599b56..d8220c2 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "friendsofsymfony/jsrouting-bundle": "^2.7", "knplabs/knp-markdown-bundle": "^1.9", "knplabs/knp-menu-bundle": "^3.1", - "murph/murph-core": "^1.0" + "murph/murph-core": "dev-master" }, "require-dev": { "symfony/browser-kit": "^5.2", diff --git a/src/EventSubscriber/SettingEventSubscriber.php b/src/EventSubscriber/SettingEventSubscriber.php index 103de95..91674cd 100644 --- a/src/EventSubscriber/SettingEventSubscriber.php +++ b/src/EventSubscriber/SettingEventSubscriber.php @@ -8,6 +8,7 @@ use App\Core\Setting\SettingManager; use Symfony\Component\Form\Extension\Core\Type\EmailType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextType; +use App\Core\Form\FileManager\FilePickerType; /** * class SettingEventSubscriber. @@ -27,6 +28,8 @@ class SettingEventSubscriber extends EventSubscriber { $this->manager->init('blog_footer', '🥾 Pied de page', 'Contenu', ''); + $this->manager->init('avatar_image', '👦 Avatar', 'Image', ''); + $this->manager->init('email_sender', '🤖 E-mail', 'Expéditeur', ''); $this->manager->init('email_contact', '🤖 E-mail', 'Destinataire formulaire de contact', ''); $this->manager->init('email_comment', '🤖 E-mail', 'Destinataire nouveau commentaire', ''); @@ -53,6 +56,16 @@ class SettingEventSubscriber extends EventSubscriber ); } + if (in_array($entity->getCode(), ['avatar_image'])) { + $builder->add( + 'value', + FilePickerType::class, + [ + 'label' => $entity->getLabel(), + ] + ); + } + if (in_array($entity->getCode(), ['giphy_api_key', 'stats_umami_url'])) { $builder->add( 'value', diff --git a/templates/module/_navigation.html.twig b/templates/module/_navigation.html.twig index 8bbb434..c1b60dd 100644 --- a/templates/module/_navigation.html.twig +++ b/templates/module/_navigation.html.twig @@ -1,5 +1,6 @@ {% set menu = _navigation.menu('menu') %} {% set network = _navigation.menu('network') %} +{% set avatar = setting('avatar_image') %}
@@ -7,12 +8,16 @@ {{ include('module/_logo.html.twig') }} + {% if avatar %} + {{ avatar|file_attribute('title') }} + {% endif %} + Accueil Deblan Blog
{% if menu %} -