]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add warning message for PocketImport
authorJeremy Benoist <jeremy.benoist@gmail.com>
Thu, 21 Jan 2016 09:59:21 +0000 (10:59 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sun, 31 Jan 2016 13:48:26 +0000 (14:48 +0100)
Warn user if pocket_consumer_key isn't defined

src/Wallabag/ImportBundle/Controller/PocketController.php
src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig

index 7aee302f53f2e00fd341147467376b6e215bf775..1c1b4fa889f6a1919f722cba934d07098e8a196f 100644 (file)
@@ -15,6 +15,7 @@ class PocketController extends Controller
     {
         return $this->render('WallabagImportBundle:Pocket:index.html.twig', [
             'import' => $this->get('wallabag_import.pocket.import'),
+            'has_consumer_key' => '' == trim($this->get('craue_config')->get('pocket_consumer_key')) ? false : true,
         ]);
     }
 
index 643ad77548f698848f3b61faf0163184a807f570..e0e36f387e68508cee9e1736eb74cf7286169516 100644 (file)
@@ -5,6 +5,12 @@
 <div class="row">
     <div class="col s12">
         <div class="card-panel settings">
+            {% if not has_consumer_key %}
+                <div class="card-panel red darken-1">
+                    {% trans %}Pocket import isn't configured. You need to define pocket_consumer_key.{% endtrans %}
+                </div>
+            {% endif %}
+
             <blockquote>{{ import.description|trans }}</blockquote>
             <p>{% trans %}You can import your data from your Pocket account. You just have to click on the below button and authorize the application to connect to getpocket.com.{% endtrans %}</p>
             <form method="post" action="{{ path('import_pocket_auth') }}">