diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Resources')
4 files changed, 109 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml new file mode 100644 index 00000000..e4dde100 --- /dev/null +++ b/src/Wallabag/ImportBundle/Resources/config/services.yml | |||
@@ -0,0 +1,34 @@ | |||
1 | services: | ||
2 | wallabag_import.chain: | ||
3 | class: Wallabag\ImportBundle\Import\ImportChain | ||
4 | |||
5 | wallabag_import.pocket.client: | ||
6 | class: GuzzleHttp\Client | ||
7 | arguments: | ||
8 | - | ||
9 | defaults: | ||
10 | headers: | ||
11 | content-type: "application/json" | ||
12 | X-Accept: "application/json" | ||
13 | |||
14 | wallabag_import.pocket.import: | ||
15 | class: Wallabag\ImportBundle\Import\PocketImport | ||
16 | arguments: | ||
17 | - "@security.token_storage" | ||
18 | - "@doctrine.orm.entity_manager" | ||
19 | - "@wallabag_core.content_proxy" | ||
20 | - %pocket_consumer_key% | ||
21 | calls: | ||
22 | - [ setClient, [ "@wallabag_import.pocket.client" ] ] | ||
23 | - [ setLogger, [ "@logger" ]] | ||
24 | tags: | ||
25 | - { name: wallabag_import.import, alias: pocket } | ||
26 | |||
27 | wallabag_import.wallabag_v1.import: | ||
28 | class: Wallabag\ImportBundle\Import\WallabagV1Import | ||
29 | arguments: | ||
30 | - "@doctrine.orm.entity_manager" | ||
31 | calls: | ||
32 | - [ setLogger, [ "@logger" ]] | ||
33 | tags: | ||
34 | - { name: wallabag_import.import, alias: wallabag_v1 } | ||
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..303e6cbf --- /dev/null +++ b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig | |||
@@ -0,0 +1,21 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | {% block title %}{% trans %}Import{% endtrans %}{% endblock %} | ||
3 | |||
4 | {% block content %} | ||
5 | <div class="row"> | ||
6 | <div class="col s12"> | ||
7 | <div class="card-panel settings"> | ||
8 | {% trans %}Welcome on wallabag importer. Please select your previous service that you want to migrate.{% endtrans %} | ||
9 | <ul> | ||
10 | {% for import in imports %} | ||
11 | <li> | ||
12 | <h5>{{ import.name }}</h5> | ||
13 | <blockquote>{{ import.description|trans }}</blockquote> | ||
14 | <p><a class="waves-effect waves-light btn" href="{{ path(import.url) }}">{% trans %}Import contents{% endtrans %}</a></p> | ||
15 | </li> | ||
16 | {% endfor %} | ||
17 | </ul> | ||
18 | </div> | ||
19 | </div> | ||
20 | </div> | ||
21 | {% endblock %} | ||
diff --git a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig new file mode 100644 index 00000000..643ad775 --- /dev/null +++ b/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig | |||
@@ -0,0 +1,18 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | {% block title %}{% trans %}Import > Pocket{% endtrans %}{% endblock %} | ||
3 | |||
4 | {% block content %} | ||
5 | <div class="row"> | ||
6 | <div class="col s12"> | ||
7 | <div class="card-panel settings"> | ||
8 | <blockquote>{{ import.description|trans }}</blockquote> | ||
9 | <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> | ||
10 | <form method="post" action="{{ path('import_pocket_auth') }}"> | ||
11 | <button class="btn waves-effect waves-light" type="submit" name="action"> | ||
12 | {% trans %}Connect to Pocket and import data{% endtrans %} | ||
13 | </button> | ||
14 | </form> | ||
15 | </div> | ||
16 | </div> | ||
17 | </div> | ||
18 | {% endblock %} | ||
diff --git a/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig new file mode 100644 index 00000000..1359f2e4 --- /dev/null +++ b/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig | |||
@@ -0,0 +1,36 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | {% block title %}{% trans %}Import > Wallabag v1{% endtrans %}{% endblock %} | ||
3 | |||
4 | {% block content %} | ||
5 | <div class="row"> | ||
6 | <div class="col s12"> | ||
7 | <div class="card-panel settings"> | ||
8 | <div class="row"> | ||
9 | <blockquote>{{ import.description|trans }}</blockquote> | ||
10 | <p>{% trans %}Please select your wallabag export and click on the below button to upload and import it.{% endtrans %}</p> | ||
11 | <div class="col s12"> | ||
12 | {{ form_start(form, {'method': 'POST'}) }} | ||
13 | {{ form_errors(form) }} | ||
14 | <div class="row"> | ||
15 | <div class="file-field input-field col s12"> | ||
16 | {{ form_errors(form.file) }} | ||
17 | <div class="btn"> | ||
18 | <span>{% trans %}File{% endtrans %}</span> | ||
19 | {{ form_widget(form.file) }} | ||
20 | </div> | ||
21 | <div class="file-path-wrapper"> | ||
22 | <input class="file-path validate" type="text"> | ||
23 | </div> | ||
24 | </div> | ||
25 | </div> | ||
26 | <div class="hidden">{{ form_rest(form) }}</div> | ||
27 | <button class="btn waves-effect waves-light" type="submit" name="action"> | ||
28 | {% trans %}Upload file{% endtrans %} | ||
29 | </button> | ||
30 | </form> | ||
31 | </div> | ||
32 | </div> | ||
33 | </div> | ||
34 | </div> | ||
35 | </div> | ||
36 | {% endblock %} | ||