]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
create ImportController to list importers
authorNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>
Fri, 23 Oct 2015 12:45:50 +0000 (14:45 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 2 Jan 2016 22:24:17 +0000 (23:24 +0100)
src/Wallabag/ImportBundle/Controller/ImportController.php [new file with mode: 0644]
src/Wallabag/ImportBundle/Controller/PocketController.php
src/Wallabag/ImportBundle/Import/ImportInterface.php
src/Wallabag/ImportBundle/Import/PocketImport.php
src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig [new file with mode: 0644]

diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php
new file mode 100644 (file)
index 0000000..3569793
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+namespace Wallabag\ImportBundle\Controller;
+
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
+
+class ImportController extends Controller
+{
+    /**
+     * @Route("/import", name="import")
+     */
+    public function importAction()
+    {
+        return $this->render('WallabagImportBundle:Import:index.html.twig', array());
+    }
+}
index 9602c2823b621092bbefc6ce8e31402b0bb0cf30..f851c81cf105225abf4fd3fe9f02a56ee721ba43 100644 (file)
@@ -4,20 +4,19 @@ namespace Wallabag\ImportBundle\Controller;
 
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
-use Wallabag\ImportBundle\Import\PocketImport;
 
 class PocketController extends Controller
 {
     /**
-     * @Route("/import", name="import")
+     * @Route("/import/pocket", name="pocket")
      */
-    public function importAction()
+    public function indexAction()
     {
         return $this->render('WallabagImportBundle:Pocket:index.html.twig', array());
     }
 
     /**
-     * @Route("/auth-pocket", name="authpocket")
+     * @Route("/import/pocket/auth", name="authpocket")
      */
     public function authAction()
     {
@@ -28,7 +27,7 @@ class PocketController extends Controller
     }
 
     /**
-     * @Route("/callback-pocket", name="callbackpocket")
+     * @Route("/import/pocket/callback", name="callbackpocket")
      */
     public function callbackAction()
     {
index 88de3fa8b8f26ccb7fe3da3029dbb9fa44bc980d..f07a120cf5cd8b7262e8985f08818c8e470771b1 100644 (file)
@@ -4,6 +4,8 @@ namespace Wallabag\ImportBundle\Import;
 
 interface ImportInterface
 {
+    public function getName();
+    public function getDescription();
     public function oAuthRequest($redirectUri, $callbackUri);
     public function oAuthAuthorize();
     public function import($accessToken);
index 413c9ccc7ece071e3f01340782afaf5065ed4ded..81af8e5758a9fb0e73abe976f668c62d759288be 100644 (file)
@@ -23,6 +23,16 @@ class PocketImport implements ImportInterface
         $this->consumerKey = $consumerKey;
     }
 
+    public function getName()
+    {
+        return 'Pocket';
+    }
+
+    public function getDescription()
+    {
+        return 'This importer will import all your <a href="https://getpocket.com">Pocket</a> data.';
+    }
+
     /**
      * Create a new Client.
      *
diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig
new file mode 100644 (file)
index 0000000..bdd57e5
--- /dev/null
@@ -0,0 +1,16 @@
+{% extends "WallabagCoreBundle::layout.html.twig" %}
+{% block title %}{% trans %}import{% endtrans %}{% endblock %}
+
+{% block content %}
+
+<div class="row">
+    <div class="col s12">
+        <div class="card-panel settings">
+            {% trans %}Welcome on wallabag importer. Please select your previous service that you want to migrate.{% endtrans %}
+            <ul>
+                <li><a href="{{ path('pocket') }}">Pocket</a></li>
+            </ul>
+        </div>
+    </div>
+</div>
+{% endblock %}