From 39f27d6370c5d280375b2e1f93de464ecf5f4f96 Mon Sep 17 00:00:00 2001 From: Simounet Date: Mon, 6 Jun 2016 20:59:20 +0200 Subject: Handling socials links into a config file --- .../CoreBundle/Controller/FooterController.php | 26 ++++++++++++++ .../CoreBundle/Controller/StaticController.php | 3 +- .../DependencyInjection/WallabagCoreExtension.php | 1 + .../CoreBundle/Resources/config/parameters.yml | 12 +++++++ .../views/themes/baggy/Static/howto.html.twig | 10 +++--- .../views/themes/material/Static/howto.html.twig | 10 +++--- .../views/themes/material/footer.html.twig | 41 +++++++++++++++++++++ .../views/themes/material/layout.html.twig | 42 +--------------------- 8 files changed, 93 insertions(+), 52 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Controller/FooterController.php create mode 100644 src/Wallabag/CoreBundle/Resources/config/parameters.yml create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/FooterController.php b/src/Wallabag/CoreBundle/Controller/FooterController.php new file mode 100644 index 00000000..de809332 --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/FooterController.php @@ -0,0 +1,26 @@ +container->getParameter('addons_url'); + $socialsUrl = $this->container->getParameter('socials_url'); + return $this->render( + 'WallabagCoreBundle::footer.html.twig', + [ + 'addonsUrl' => $addonsUrl, + 'socialsUrl' => $socialsUrl + ] + ); + } +} diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php index b41302f8..f5fcabd8 100644 --- a/src/Wallabag/CoreBundle/Controller/StaticController.php +++ b/src/Wallabag/CoreBundle/Controller/StaticController.php @@ -12,9 +12,10 @@ class StaticController extends Controller */ public function howtoAction() { + $addonsUrl = $this->container->getParameter('addons_url'); return $this->render( 'WallabagCoreBundle:Static:howto.html.twig', - [] + ['addonsUrl' => $addonsUrl] ); } diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index 84599f0d..7d08b73b 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -25,6 +25,7 @@ class WallabagCoreExtension extends Extension $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); + $loader->load('parameters.yml'); } public function getAlias() diff --git a/src/Wallabag/CoreBundle/Resources/config/parameters.yml b/src/Wallabag/CoreBundle/Resources/config/parameters.yml new file mode 100644 index 00000000..43297261 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/config/parameters.yml @@ -0,0 +1,12 @@ +parameters: + addons_url: + firefox: https://addons.mozilla.org/firefox/addon/wallabag-v2/ + chrome: https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj + f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche + google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche + ios: https://itunes.apple.com/app/wallabag/id828331015?mt=8 + windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646 + socials_url: + twitter: https://twitter.com/wallabagapp + google_plus: https://plus.google.com/+WallabagOrg/posts + facebook: https://facebook.com/Wallabag diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig index eab092c7..b529a0ac 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig @@ -11,14 +11,14 @@

{{ 'howto.top_menu.browser_addons'|trans }}

{{ 'howto.top_menu.mobile_apps'|trans }}

{{ 'howto.top_menu.bookmarklet'|trans }}

diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig index 4354a6b7..6a177d6b 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig @@ -18,17 +18,17 @@

{{ 'howto.top_menu.browser_addons'|trans }}
{{ 'howto.top_menu.mobile_apps'|trans }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig new file mode 100644 index 00000000..7cb19966 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig @@ -0,0 +1,41 @@ + diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index 33d9e08f..a5c16792 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig @@ -122,45 +122,5 @@ {% endblock %} {% block footer %} - + {{ render(controller("WallabagCoreBundle:Footer:index")) }} {% endblock %} -- cgit v1.2.3