From: Nicolas LÅ“uillet Date: Fri, 23 Oct 2015 12:45:50 +0000 (+0200) Subject: create ImportController to list importers X-Git-Tag: 2.0.0-alpha.1^2~18 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=d51b38ed309c9aead938e8c8963c05c6d82b4ec2;p=github%2Fwallabag%2Fwallabag.git create ImportController to list importers --- diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php new file mode 100644 index 00000000..3569793b --- /dev/null +++ b/src/Wallabag/ImportBundle/Controller/ImportController.php @@ -0,0 +1,17 @@ +render('WallabagImportBundle:Import:index.html.twig', array()); + } +} diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index 9602c282..f851c81c 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php @@ -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() { diff --git a/src/Wallabag/ImportBundle/Import/ImportInterface.php b/src/Wallabag/ImportBundle/Import/ImportInterface.php index 88de3fa8..f07a120c 100644 --- a/src/Wallabag/ImportBundle/Import/ImportInterface.php +++ b/src/Wallabag/ImportBundle/Import/ImportInterface.php @@ -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); diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 413c9ccc..81af8e57 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -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 Pocket 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 index 00000000..bdd57e5e --- /dev/null +++ b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig @@ -0,0 +1,16 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} +{% block title %}{% trans %}import{% endtrans %}{% endblock %} + +{% block content %} + +
+
+
+ {% trans %}Welcome on wallabag importer. Please select your previous service that you want to migrate.{% endtrans %} + +
+
+
+{% endblock %}