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 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 From 40288b7166d35ce8433c9720a5278356dac617aa Mon Sep 17 00:00:00 2001 From: Simounet Date: Wed, 20 Jul 2016 22:55:43 +0200 Subject: Chrome extension URL updated --- src/Wallabag/CoreBundle/Resources/config/parameters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wallabag/CoreBundle/Resources/config/parameters.yml b/src/Wallabag/CoreBundle/Resources/config/parameters.yml index 43297261..abd9ab68 100644 --- a/src/Wallabag/CoreBundle/Resources/config/parameters.yml +++ b/src/Wallabag/CoreBundle/Resources/config/parameters.yml @@ -1,7 +1,7 @@ parameters: addons_url: firefox: https://addons.mozilla.org/firefox/addon/wallabag-v2/ - chrome: https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj + chrome: https://chrome.google.com/webstore/detail/wallabagit/peehlcgckcnclnjlndmoddifcicdnabm 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 -- cgit v1.2.3 From 57c608fa94cdc148f5fc48b7c1e984bbf507e34b Mon Sep 17 00:00:00 2001 From: Simounet Date: Wed, 20 Jul 2016 23:08:04 +0200 Subject: php-cs-fixer pass --- src/Wallabag/CoreBundle/Controller/FooterController.php | 5 +++-- src/Wallabag/CoreBundle/Controller/StaticController.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Wallabag/CoreBundle/Controller/FooterController.php b/src/Wallabag/CoreBundle/Controller/FooterController.php index de809332..fd93c436 100644 --- a/src/Wallabag/CoreBundle/Controller/FooterController.php +++ b/src/Wallabag/CoreBundle/Controller/FooterController.php @@ -7,7 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; class FooterController extends Controller { /** - * Display the footer + * Display the footer. * * @return \Symfony\Component\HttpFoundation\Response */ @@ -15,11 +15,12 @@ class FooterController extends Controller { $addonsUrl = $this->container->getParameter('addons_url'); $socialsUrl = $this->container->getParameter('socials_url'); + return $this->render( 'WallabagCoreBundle::footer.html.twig', [ 'addonsUrl' => $addonsUrl, - 'socialsUrl' => $socialsUrl + 'socialsUrl' => $socialsUrl, ] ); } diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php index f5fcabd8..2a57f06f 100644 --- a/src/Wallabag/CoreBundle/Controller/StaticController.php +++ b/src/Wallabag/CoreBundle/Controller/StaticController.php @@ -13,6 +13,7 @@ class StaticController extends Controller public function howtoAction() { $addonsUrl = $this->container->getParameter('addons_url'); + return $this->render( 'WallabagCoreBundle:Static:howto.html.twig', ['addonsUrl' => $addonsUrl] -- cgit v1.2.3