diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2016-09-26 14:47:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-26 14:47:02 +0200 |
commit | d6de23a100221ae1afaa92a58af17a17d0c6614e (patch) | |
tree | bd105198c75ea6b8e5d37a80a9f0135942a1c5eb /src/Wallabag/ImportBundle/Resources | |
parent | 7e98ad962680fac17b3b90ae34b9c6e5afe7636f (diff) | |
parent | fefef9d41b4d1bd9efbd49011159bae70bf67528 (diff) | |
download | wallabag-d6de23a100221ae1afaa92a58af17a17d0c6614e.tar.gz wallabag-d6de23a100221ae1afaa92a58af17a17d0c6614e.tar.zst wallabag-d6de23a100221ae1afaa92a58af17a17d0c6614e.zip |
Merge pull request #2192 from wallabag/import-browser-bookmarks
Import Firefox & Chrome bookmarks into wallabag
Diffstat (limited to 'src/Wallabag/ImportBundle/Resources')
6 files changed, 160 insertions, 1 deletions
diff --git a/src/Wallabag/ImportBundle/Resources/config/rabbit.yml b/src/Wallabag/ImportBundle/Resources/config/rabbit.yml index aa049749..6ada6302 100644 --- a/src/Wallabag/ImportBundle/Resources/config/rabbit.yml +++ b/src/Wallabag/ImportBundle/Resources/config/rabbit.yml | |||
@@ -28,3 +28,17 @@ services: | |||
28 | - "@wallabag_user.user_repository" | 28 | - "@wallabag_user.user_repository" |
29 | - "@wallabag_import.wallabag_v2.import" | 29 | - "@wallabag_import.wallabag_v2.import" |
30 | - "@logger" | 30 | - "@logger" |
31 | wallabag_import.consumer.amqp.firefox: | ||
32 | class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer | ||
33 | arguments: | ||
34 | - "@doctrine.orm.entity_manager" | ||
35 | - "@wallabag_user.user_repository" | ||
36 | - "@wallabag_import.firefox.import" | ||
37 | - "@logger" | ||
38 | wallabag_import.consumer.amqp.chrome: | ||
39 | class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer | ||
40 | arguments: | ||
41 | - "@doctrine.orm.entity_manager" | ||
42 | - "@wallabag_user.user_repository" | ||
43 | - "@wallabag_import.chrome.import" | ||
44 | - "@logger" | ||
diff --git a/src/Wallabag/ImportBundle/Resources/config/redis.yml b/src/Wallabag/ImportBundle/Resources/config/redis.yml index 7d3248e5..c9c2cf26 100644 --- a/src/Wallabag/ImportBundle/Resources/config/redis.yml +++ b/src/Wallabag/ImportBundle/Resources/config/redis.yml | |||
@@ -79,3 +79,43 @@ services: | |||
79 | - "@wallabag_user.user_repository" | 79 | - "@wallabag_user.user_repository" |
80 | - "@wallabag_import.wallabag_v2.import" | 80 | - "@wallabag_import.wallabag_v2.import" |
81 | - "@logger" | 81 | - "@logger" |
82 | |||
83 | # firefox | ||
84 | wallabag_import.queue.redis.firefox: | ||
85 | class: Simpleue\Queue\RedisQueue | ||
86 | arguments: | ||
87 | - "@wallabag_core.redis.client" | ||
88 | - "wallabag.import.firefox" | ||
89 | |||
90 | wallabag_import.producer.redis.firefox: | ||
91 | class: Wallabag\ImportBundle\Redis\Producer | ||
92 | arguments: | ||
93 | - "@wallabag_import.queue.redis.firefox" | ||
94 | |||
95 | wallabag_import.consumer.redis.firefox: | ||
96 | class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer | ||
97 | arguments: | ||
98 | - "@doctrine.orm.entity_manager" | ||
99 | - "@wallabag_user.user_repository" | ||
100 | - "@wallabag_import.firefox.import" | ||
101 | - "@logger" | ||
102 | |||
103 | # chrome | ||
104 | wallabag_import.queue.redis.chrome: | ||
105 | class: Simpleue\Queue\RedisQueue | ||
106 | arguments: | ||
107 | - "@wallabag_core.redis.client" | ||
108 | - "wallabag.import.chrome" | ||
109 | |||
110 | wallabag_import.producer.redis.chrome: | ||
111 | class: Wallabag\ImportBundle\Redis\Producer | ||
112 | arguments: | ||
113 | - "@wallabag_import.queue.redis.chrome" | ||
114 | |||
115 | wallabag_import.consumer.redis.chrome: | ||
116 | class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer | ||
117 | arguments: | ||
118 | - "@doctrine.orm.entity_manager" | ||
119 | - "@wallabag_user.user_repository" | ||
120 | - "@wallabag_import.chrome.import" | ||
121 | - "@logger" | ||
diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml index f03404ae..990f336d 100644 --- a/src/Wallabag/ImportBundle/Resources/config/services.yml +++ b/src/Wallabag/ImportBundle/Resources/config/services.yml | |||
@@ -56,3 +56,22 @@ services: | |||
56 | - [ setLogger, [ "@logger" ]] | 56 | - [ setLogger, [ "@logger" ]] |
57 | tags: | 57 | tags: |
58 | - { name: wallabag_import.import, alias: readability } | 58 | - { name: wallabag_import.import, alias: readability } |
59 | |||
60 | wallabag_import.firefox.import: | ||
61 | class: Wallabag\ImportBundle\Import\FirefoxImport | ||
62 | arguments: | ||
63 | - "@doctrine.orm.entity_manager" | ||
64 | - "@wallabag_core.content_proxy" | ||
65 | calls: | ||
66 | - [ setLogger, [ "@logger" ]] | ||
67 | tags: | ||
68 | - { name: wallabag_import.import, alias: firefox } | ||
69 | wallabag_import.chrome.import: | ||
70 | class: Wallabag\ImportBundle\Import\ChromeImport | ||
71 | arguments: | ||
72 | - "@doctrine.orm.entity_manager" | ||
73 | - "@wallabag_core.content_proxy" | ||
74 | calls: | ||
75 | - [ setLogger, [ "@logger" ]] | ||
76 | tags: | ||
77 | - { name: wallabag_import.import, alias: chrome } | ||
diff --git a/src/Wallabag/ImportBundle/Resources/views/Chrome/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Chrome/index.html.twig new file mode 100644 index 00000000..ead828c6 --- /dev/null +++ b/src/Wallabag/ImportBundle/Resources/views/Chrome/index.html.twig | |||
@@ -0,0 +1,43 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ 'import.chrome.page_title'|trans }}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | <div class="row"> | ||
7 | <div class="col s12"> | ||
8 | <div class="card-panel settings"> | ||
9 | <div class="row"> | ||
10 | <blockquote>{{ import.description|trans|raw }}</blockquote> | ||
11 | <p>{{ 'import.chrome.how_to'|trans }}</p> | ||
12 | |||
13 | <div class="col s12"> | ||
14 | {{ form_start(form, {'method': 'POST'}) }} | ||
15 | {{ form_errors(form) }} | ||
16 | <div class="row"> | ||
17 | <div class="file-field input-field col s12"> | ||
18 | {{ form_errors(form.file) }} | ||
19 | <div class="btn"> | ||
20 | <span>{{ form.file.vars.label|trans }}</span> | ||
21 | {{ form_widget(form.file) }} | ||
22 | </div> | ||
23 | <div class="file-path-wrapper"> | ||
24 | <input class="file-path validate" type="text"> | ||
25 | </div> | ||
26 | </div> | ||
27 | <div class="input-field col s6 with-checkbox"> | ||
28 | <h6>{{ 'import.form.mark_as_read_title'|trans }}</h6> | ||
29 | {{ form_widget(form.mark_as_read) }} | ||
30 | {{ form_label(form.mark_as_read) }} | ||
31 | </div> | ||
32 | </div> | ||
33 | |||
34 | {{ form_widget(form.save, { 'attr': {'class': 'btn waves-effect waves-light'} }) }} | ||
35 | |||
36 | {{ form_rest(form) }} | ||
37 | </form> | ||
38 | </div> | ||
39 | </div> | ||
40 | </div> | ||
41 | </div> | ||
42 | </div> | ||
43 | {% endblock %} | ||
diff --git a/src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig new file mode 100644 index 00000000..f975da3f --- /dev/null +++ b/src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig | |||
@@ -0,0 +1,43 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ 'import.firefox.page_title'|trans }}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | <div class="row"> | ||
7 | <div class="col s12"> | ||
8 | <div class="card-panel settings"> | ||
9 | <div class="row"> | ||
10 | <blockquote>{{ import.description|trans|raw }}</blockquote> | ||
11 | <p>{{ 'import.firefox.how_to'|trans }}</p> | ||
12 | |||
13 | <div class="col s12"> | ||
14 | {{ form_start(form, {'method': 'POST'}) }} | ||
15 | {{ form_errors(form) }} | ||
16 | <div class="row"> | ||
17 | <div class="file-field input-field col s12"> | ||
18 | {{ form_errors(form.file) }} | ||
19 | <div class="btn"> | ||
20 | <span>{{ form.file.vars.label|trans }}</span> | ||
21 | {{ form_widget(form.file) }} | ||
22 | </div> | ||
23 | <div class="file-path-wrapper"> | ||
24 | <input class="file-path validate" type="text"> | ||
25 | </div> | ||
26 | </div> | ||
27 | <div class="input-field col s6 with-checkbox"> | ||
28 | <h6>{{ 'import.form.mark_as_read_title'|trans }}</h6> | ||
29 | {{ form_widget(form.mark_as_read) }} | ||
30 | {{ form_label(form.mark_as_read) }} | ||
31 | </div> | ||
32 | </div> | ||
33 | |||
34 | {{ form_widget(form.save, { 'attr': {'class': 'btn waves-effect waves-light'} }) }} | ||
35 | |||
36 | {{ form_rest(form) }} | ||
37 | </form> | ||
38 | </div> | ||
39 | </div> | ||
40 | </div> | ||
41 | </div> | ||
42 | </div> | ||
43 | {% endblock %} | ||
diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig index aebbfa20..6ea5e0f4 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig +++ b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig | |||
@@ -11,7 +11,7 @@ | |||
11 | {% for import in imports %} | 11 | {% for import in imports %} |
12 | <li> | 12 | <li> |
13 | <h5>{{ import.name }}</h5> | 13 | <h5>{{ import.name }}</h5> |
14 | <blockquote>{{ import.description|trans }}</blockquote> | 14 | <blockquote>{{ import.description|trans|raw }}</blockquote> |
15 | <p><a class="waves-effect waves-light btn" href="{{ path(import.url) }}">{{ 'import.action.import_contents'|trans }}</a></p> | 15 | <p><a class="waves-effect waves-light btn" href="{{ path(import.url) }}">{{ 'import.action.import_contents'|trans }}</a></p> |
16 | </li> | 16 | </li> |
17 | {% endfor %} | 17 | {% endfor %} |