]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Handling socials links into a config file
authorSimounet <contact@simounet.net>
Mon, 6 Jun 2016 18:59:20 +0000 (20:59 +0200)
committerSimounet <contact@simounet.net>
Wed, 20 Jul 2016 17:36:01 +0000 (19:36 +0200)
src/Wallabag/CoreBundle/Controller/FooterController.php [new file with mode: 0644]
src/Wallabag/CoreBundle/Controller/StaticController.php
src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
src/Wallabag/CoreBundle/Resources/config/parameters.yml [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig

diff --git a/src/Wallabag/CoreBundle/Controller/FooterController.php b/src/Wallabag/CoreBundle/Controller/FooterController.php
new file mode 100644 (file)
index 0000000..de80933
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+namespace Wallabag\CoreBundle\Controller;
+
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+
+class FooterController extends Controller
+{
+    /**
+     * Display the footer
+     *
+     * @return \Symfony\Component\HttpFoundation\Response
+     */
+    public function indexAction()
+    {
+        $addonsUrl = $this->container->getParameter('addons_url');
+        $socialsUrl = $this->container->getParameter('socials_url');
+        return $this->render(
+            'WallabagCoreBundle::footer.html.twig',
+            [
+                'addonsUrl' => $addonsUrl,
+                'socialsUrl' => $socialsUrl
+            ]
+        );
+    }
+}
index b41302f855ccf131e69b1574749e5c185b07633e..f5fcabd8fe4e6cc93f6ddca1ae63f8ed3137be00 100644 (file)
@@ -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]
         );
     }
 
index 84599f0d7b3d5eb7956e15a5a3c62f9f481171f2..7d08b73b78ceacf095e8c34a1ce61242e32f62d8 100644 (file)
@@ -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 (file)
index 0000000..4329726
--- /dev/null
@@ -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
index eab092c7fe42322f8b219eda9ef44c02fe592640..b529a0ac8d3cfaaa2b8fb9d546580f58420e63b0 100644 (file)
     </ul>
     <h3>{{ 'howto.top_menu.browser_addons'|trans }}</h3>
     <ul>
-        <li><a href="https://addons.mozilla.org/firefox/addon/wallabag-v2/" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
-        <li><a href="https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
+        <li><a href="{{ addonsUrl.firefox }}" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
+        <li><a href="{{ addonsUrl.chrome }}" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
     </ul>
     <h3>{{ 'howto.top_menu.mobile_apps'|trans }}</h3>
     <ul>
-        <li>Android: <a href="https://f-droid.org/app/fr.gaulupeau.apps.InThePoche" target="_blank">{{ 'howto.mobile_apps.android.via_f_droid'|trans }}</a> / <a href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" target="_blank">{{ 'howto.mobile_apps.android.via_google_play'|trans }}</a></li>
-        <li>iOS: <a href="https://itunes.apple.com/app/wallabag/id828331015?mt=8" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
-        <li>Windows Phone: <a href="http://www.windowsphone.com/en-US/store/app/wallabag/d5226cf1-f422-4e00-996c-88e9c5233332" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
+        <li>Android: <a href="{{ addonsUrl.f_droid }}" target="_blank">{{ 'howto.mobile_apps.android.via_f_droid'|trans }}</a> / <a href="{{ addonsUrl.google_play }}" target="_blank">{{ 'howto.mobile_apps.android.via_google_play'|trans }}</a></li>
+        <li>iOS: <a href="{{ addonsUrl.ios }}" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
+        <li>Windows Phone: <a href="{{ addonsUrl.windows }}" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
     </ul>
     <h3>{{ 'howto.top_menu.bookmarklet'|trans }}</h3>
     <p>
index 4354a6b7fb80aa30c513b784d8128a2ee9391450..6a177d6bbaa7e2feb822b54b6988b567f3264d52 100644 (file)
                     <div class="col s12">
                         <h5>{{ 'howto.top_menu.browser_addons'|trans }}</h5>
                         <ul>
-                            <li><a href="https://addons.mozilla.org/firefox/addon/wallabag-v2/" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
-                            <li><a href="https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
+                            <li><a href="{{ addonsUrl.firefox }}" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
+                            <li><a href="{{ addonsUrl.chrome }}" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
                         </ul>
                     </div>
 
                     <div class="col s12">
                         <h5>{{ 'howto.top_menu.mobile_apps'|trans }}</h5>
                         <ul>
-                            <li>Android: <a href="https://f-droid.org/app/fr.gaulupeau.apps.InThePoche" target="_blank">{{ 'howto.mobile_apps.android.via_f_droid'|trans }}</a> / <a href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" target="_blank">{{ 'howto.mobile_apps.android.via_google_play'|trans }}</a></li>
-                            <li>iOS: <a href="https://itunes.apple.com/app/wallabag/id828331015?mt=8" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
-                            <li>Windows Phone: <a href="http://www.windowsphone.com/en-US/store/app/wallabag/d5226cf1-f422-4e00-996c-88e9c5233332" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
+                            <li>Android: <a href="{{ addonsUrl.f_droid }}" target="_blank">{{ 'howto.mobile_apps.android.via_f_droid'|trans }}</a> / <a href="{{ addonsUrl.google_play }}" target="_blank">{{ 'howto.mobile_apps.android.via_google_play'|trans }}</a></li>
+                            <li>iOS: <a href="{{ addonsUrl.ios }}" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
+                            <li>Windows Phone: <a href="{{ addonsUrl.windows }}" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
                         </ul>
                     </div>
 
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 (file)
index 0000000..7cb1996
--- /dev/null
@@ -0,0 +1,41 @@
+<footer class="page-footer cyan darken-2">
+    <div class="container">
+        <div class="row">
+            <div class="col l6 s12">
+                <h5 class="white-text">{{ 'footer.wallabag.elsewhere'|trans }}</h5>
+                <p class="grey-text text-lighten-4">
+                    <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.google_play }}" title="Android">
+                        <span class="icon-android"></span>
+                    </a>
+                    <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.ios }}" title="iOS">
+                        <span class="icon-apple"></span>
+                    </a>
+                    <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.firefox }}" title="Firefox">
+                        <span class="icon-firefox"></span>
+                    </a>
+                    <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.chrome }}" title="Chrome">
+                        <span class="icon-chrome"></span>
+                    </a>
+                </p>
+            </div>
+            <div class="col l4 offset-l2 s12">
+                <h5 class="white-text">{{ 'footer.wallabag.social'|trans }}</h5>
+                <a target="_blank" class="grey-text text-lighten-3" href="{{ socialsUrl.twitter }}" title="Twitter">
+                    <span class="icon-twitter"></span>
+                </a>
+                <a target="_blank" class="grey-text text-lighten-3" href="{{ socialsUrl.google_plus }}" title="Google+">
+                    <span class="icon-google-plus2"></span>
+                </a>
+                <a target="_blank" class="grey-text text-lighten-3" href="{{ socialsUrl.facebook }}" title="Facebook">
+                    <span class="icon-facebook2"></span>
+                </a>
+            </div>
+        </div>
+    </div>
+    <div class="footer-copyright">
+        <div class="container">
+            <p>{{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p>
+            <a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans }}</a>
+        </div>
+    </div>
+</footer>
index 33d9e08f10c9e1ea41ec96ea02c583dac9a01460..a5c16792c2716f2dad6e763d19f94f0aca47b733 100644 (file)
 {% endblock %}
 
 {% block footer %}
-    <footer class="page-footer cyan darken-2">
-        <div class="container">
-            <div class="row">
-                <div class="col l6 s12">
-                    <h5 class="white-text">{{ 'footer.wallabag.elsewhere'|trans }}</h5>
-                    <p class="grey-text text-lighten-4">
-                        <a target="_blank" class="grey-text text-lighten-3" href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" title="Android">
-                            <span class="icon-android"></span>
-                        </a>
-                        <a target="_blank" class="grey-text text-lighten-3" href="https://itunes.apple.com/app/id828331015" title="iOS">
-                            <span class="icon-apple"></span>
-                        </a>
-                        <a target="_blank" class="grey-text text-lighten-3" href="https://addons.mozilla.org/firefox/addon/wallabag-v2/" title="Firefox">
-                            <span class="icon-firefox"></span>
-                        </a>
-                        <a target="_blank" class="grey-text text-lighten-3" href="https://chrome.google.com/webstore/detail/wallabagger/gbmgphmejlcoihgedabhgjdkcahacjlj" title="Chrome">
-                            <span class="icon-chrome"></span>
-                        </a>
-                    </p>
-                </div>
-                <div class="col l4 offset-l2 s12">
-                    <h5 class="white-text">{{ 'footer.wallabag.social'|trans }}</h5>
-                    <a target="_blank" class="grey-text text-lighten-3" href="https://twitter.com/wallabagapp" title="Twitter">
-                        <span class="icon-twitter"></span>
-                    </a>
-                    <a target="_blank" class="grey-text text-lighten-3" href="https://plus.google.com/+WallabagOrg/posts" title="Google+">
-                        <span class="icon-google-plus2"></span>
-                    </a>
-                    <a target="_blank" class="grey-text text-lighten-3" href="https://facebook.com/Wallabag" title="Facebook">
-                        <span class="icon-facebook2"></span>
-                    </a>
-                </div>
-            </div>
-        </div>
-        <div class="footer-copyright">
-            <div class="container">
-                <p>{{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p>
-                <a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans }}</a>
-            </div>
-        </div>
-    </footer>
+    {{ render(controller("WallabagCoreBundle:Footer:index")) }}
 {% endblock %}