aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php8
-rw-r--r--src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php87
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml22
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig2
-rw-r--r--src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig2
6 files changed, 105 insertions, 18 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 5202c524..af24e498 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -110,8 +110,8 @@ class WallabagRestController extends FOSRestController
110 110
111 $url = $request->request->get('url'); 111 $url = $request->request->get('url');
112 $title = $request->request->get('title'); 112 $title = $request->request->get('title');
113 $isArchived = (int) $request->request->get('archive'); 113 $isArchived = $request->request->get('archive');
114 $isStarred = (int) $request->request->get('starred'); 114 $isStarred = $request->request->get('starred');
115 115
116 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId()); 116 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId());
117 117
@@ -172,8 +172,8 @@ class WallabagRestController extends FOSRestController
172 $this->validateUserAccess($entry->getUser()->getId()); 172 $this->validateUserAccess($entry->getUser()->getId());
173 173
174 $title = $request->request->get('title'); 174 $title = $request->request->get('title');
175 $isArchived = (int) $request->request->get('archive'); 175 $isArchived = $request->request->get('archive');
176 $isStarred = (int) $request->request->get('starred'); 176 $isStarred = $request->request->get('starred');
177 177
178 if (!is_null($title)) { 178 if (!is_null($title)) {
179 $entry->setTitle($title); 179 $entry->setTitle($title);
diff --git a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
index 2f2d92ee..c50e4d02 100644
--- a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -423,4 +423,91 @@ class WallabagRestControllerTest extends WallabagApiTestCase
423 423
424 $this->assertEquals($this->client->getContainer()->getParameter('wallabag_core.version'), $content); 424 $this->assertEquals($this->client->getContainer()->getParameter('wallabag_core.version'), $content);
425 } 425 }
426
427 public function testSaveIsArchivedAfterPost()
428 {
429 $entry = $this->client->getContainer()
430 ->get('doctrine.orm.entity_manager')
431 ->getRepository('WallabagCoreBundle:Entry')
432 ->findOneBy(['user' => 1, 'isArchived' => true]);
433
434 if (!$entry) {
435 $this->markTestSkipped('No content found in db.');
436 }
437
438 $this->client->request('POST', '/api/entries.json', [
439 'url' => $entry->getUrl(),
440 ]);
441
442 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
443
444 $content = json_decode($this->client->getResponse()->getContent(), true);
445
446 $this->assertEquals(true, $content['is_archived']);
447 }
448
449 public function testSaveIsStarredAfterPost()
450 {
451 $entry = $this->client->getContainer()
452 ->get('doctrine.orm.entity_manager')
453 ->getRepository('WallabagCoreBundle:Entry')
454 ->findOneBy(['user' => 1, 'isStarred' => true]);
455
456 if (!$entry) {
457 $this->markTestSkipped('No content found in db.');
458 }
459
460 $this->client->request('POST', '/api/entries.json', [
461 'url' => $entry->getUrl(),
462 ]);
463
464 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
465
466 $content = json_decode($this->client->getResponse()->getContent(), true);
467
468 $this->assertEquals(true, $content['is_starred']);
469 }
470
471 public function testSaveIsArchivedAfterPatch()
472 {
473 $entry = $this->client->getContainer()
474 ->get('doctrine.orm.entity_manager')
475 ->getRepository('WallabagCoreBundle:Entry')
476 ->findOneBy(['user' => 1, 'isArchived' => true]);
477
478 if (!$entry) {
479 $this->markTestSkipped('No content found in db.');
480 }
481
482 $this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', [
483 'title' => $entry->getTitle().'++',
484 ]);
485
486 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
487
488 $content = json_decode($this->client->getResponse()->getContent(), true);
489
490 $this->assertEquals(true, $content['is_archived']);
491 }
492
493 public function testSaveIsStarredAfterPatch()
494 {
495 $entry = $this->client->getContainer()
496 ->get('doctrine.orm.entity_manager')
497 ->getRepository('WallabagCoreBundle:Entry')
498 ->findOneBy(['user' => 1, 'isStarred' => true]);
499
500 if (!$entry) {
501 $this->markTestSkipped('No content found in db.');
502 }
503 $this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', [
504 'title' => $entry->getTitle().'++',
505 ]);
506
507 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
508
509 $content = json_decode($this->client->getResponse()->getContent(), true);
510
511 $this->assertEquals(true, $content['is_starred']);
512 }
426} 513}
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index 6658baa9..ae03f809 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -81,7 +81,7 @@ config:
81 archive: 'archived' 81 archive: 'archived'
82 rss_limit: 'Number of items in the feed' 82 rss_limit: 'Number of items in the feed'
83 form_user: 83 form_user:
84 two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion" 84 two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connection."
85 name_label: 'Name' 85 name_label: 'Name'
86 email_label: 'Email' 86 email_label: 'Email'
87 twoFactorAuthentication_label: 'Two factor authentication' 87 twoFactorAuthentication_label: 'Two factor authentication'
@@ -98,9 +98,9 @@ config:
98 faq: 98 faq:
99 title: 'FAQ' 99 title: 'FAQ'
100 tagging_rules_definition_title: 'What does « tagging rules » mean?' 100 tagging_rules_definition_title: 'What does « tagging rules » mean?'
101 tagging_rules_definition_description: 'They are rules used by Wallabag to automatically tag new entries.<br />Each time a new entry is added, all the tagging rules will be used to add the tags you configured, thus saving you the trouble to manually classify your entries.' 101 tagging_rules_definition_description: 'They are rules used by Wallabag to automatically tag new entries.<br />Each time a new entry is added, all the tagging rules will be used to add the tags you configured, thus saving you the trouble of manually classifying your entries.'
102 how_to_use_them_title: 'How do I use them?' 102 how_to_use_them_title: 'How do I use them?'
103 how_to_use_them_description: 'Let assume you want to tag new entries as « <i>short reading</i> » when the reading time is inferior to 3 minutes.<br />In that case, you should put « readingTime &lt;= 3 » in the <i>Rule</i> field and « <i>short reading</i> » in the <i>Tags</i> field.<br />Several tags can added simultaneously by separating them by a comma: « <i>short reading, must read</i> »<br />Complex rules can be written by using predefined operators: if « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » then tag as « <i>long reading, github </i> »' 103 how_to_use_them_description: 'Let us assume you want to tag new entries as « <i>short reading</i> » when the reading time is under 3 minutes.<br />In that case, you should put « readingTime &lt;= 3 » in the <i>Rule</i> field and « <i>short reading</i> » in the <i>Tags</i> field.<br />Several tags can added simultaneously by separating them with a comma: « <i>short reading, must read</i> »<br />Complex rules can be written by using predefined operators: if « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » then tag as « <i>long reading, github </i> »'
104 variables_available_title: 'Which variables and operators can I use to write rules?' 104 variables_available_title: 'Which variables and operators can I use to write rules?'
105 variables_available_description: 'The following variables and operators can be used to create tagging rules:' 105 variables_available_description: 'The following variables and operators can be used to create tagging rules:'
106 meaning: 'Meaning' 106 meaning: 'Meaning'
@@ -140,7 +140,7 @@ entry:
140 archived: 'Archived entries' 140 archived: 'Archived entries'
141 filtered: 'Filtered entries' 141 filtered: 'Filtered entries'
142 list: 142 list:
143 number_on_the_page: '{0} There is no entry.|{1} There is one entry.|]1,Inf[ There are %count% entries.' 143 number_on_the_page: '{0} There are no entries.|{1} There is one entry.|]1,Inf[ There are %count% entries.'
144 reading_time: 'estimated reading time' 144 reading_time: 'estimated reading time'
145 reading_time_minutes: 'estimated reading time: %readingTime% min' 145 reading_time_minutes: 'estimated reading time: %readingTime% min'
146 reading_time_less_one_minute: 'estimated reading time: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'estimated reading time: <small class="inferieur">&lt;</small> 1 min'
@@ -223,14 +223,14 @@ about:
223 bug_reports: 'Bug reports' 223 bug_reports: 'Bug reports'
224 support: '<a href="https://support.wallabag.org">On our support website</a> or <a href="https://github.com/wallabag/wallabag/issues">on GitHub</a>' 224 support: '<a href="https://support.wallabag.org">On our support website</a> or <a href="https://github.com/wallabag/wallabag/issues">on GitHub</a>'
225 helping: 225 helping:
226 description: 'wallabag is free and opensource. You can help us:' 226 description: 'wallabag is free and open source. You can help us:'
227 by_contributing: 'by contributing to the project:' 227 by_contributing: 'by contributing to the project:'
228 by_contributing_2: 'an issue lists all our needs' 228 by_contributing_2: 'an issue lists all our needs'
229 by_paypal: 'via Paypal' 229 by_paypal: 'via Paypal'
230 contributors: 230 contributors:
231 description: 'Thank you to contributors on wallabag web application' 231 description: 'Thank you to contributors on wallabag web application'
232 third_party: 232 third_party:
233 description: 'Here are the list of third-party libraries used in wallabag (with their licenses):' 233 description: 'Here is the list of third-party libraries used in wallabag (with their licenses):'
234 package: 'Package' 234 package: 'Package'
235 license: 'License' 235 license: 'License'
236 236
@@ -259,7 +259,7 @@ quickstart:
259 page_title: 'Quickstart' 259 page_title: 'Quickstart'
260 intro: 260 intro:
261 title: 'Welcome to wallabag!' 261 title: 'Welcome to wallabag!'
262 paragraph_1: "We'll accompany you to visit wallabag and show you some features which can interest you." 262 paragraph_1: "We'll accompany you on your visit to wallabag and show you some features that might interest you."
263 paragraph_2: 'Follow us!' 263 paragraph_2: 'Follow us!'
264 configure: 264 configure:
265 title: 'Configure the application' 265 title: 'Configure the application'
@@ -291,7 +291,7 @@ quickstart:
291 title: 'Full documentation' 291 title: 'Full documentation'
292 annotate: 'Annotate your article' 292 annotate: 'Annotate your article'
293 export: 'Convert your articles into ePUB or PDF' 293 export: 'Convert your articles into ePUB or PDF'
294 search_filters: 'See how you can look for an article by using search engine and filters' 294 search_filters: 'See how you can look for an article by using the search engine and filters'
295 fetching_errors: 'What can I do if an article encounters errors during fetching?' 295 fetching_errors: 'What can I do if an article encounters errors during fetching?'
296 all_docs: 'And so many other articles!' 296 all_docs: 'And so many other articles!'
297 support: 297 support:
@@ -304,11 +304,11 @@ quickstart:
304tag: 304tag:
305 page_title: 'Tags' 305 page_title: 'Tags'
306 list: 306 list:
307 number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' 307 number_on_the_page: '{0} There are no tags.|{1} There is one tag.|]1,Inf[ There are %count% tags.'
308 308
309import: 309import:
310 page_title: 'Import' 310 page_title: 'Import'
311 page_description: 'Welcome to wallabag importer. Please select your previous service that you want to migrate.' 311 page_description: 'Welcome to wallabag importer. Please select your previous service from which you want to migrate.'
312 action: 312 action:
313 import_contents: 'Import contents' 313 import_contents: 'Import contents'
314 form: 314 form:
@@ -318,7 +318,7 @@ import:
318 save_label: 'Upload file' 318 save_label: 'Upload file'
319 pocket: 319 pocket:
320 page_title: 'Import > Pocket' 320 page_title: 'Import > Pocket'
321 description: "This importer will import all your Pocket data. Pocket doesn't allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag." 321 description: "This importer will import all of your Pocket data. Pocket doesn't allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag."
322 config_missing: 322 config_missing:
323 description: "Pocket import isn't configured." 323 description: "Pocket import isn't configured."
324 admin_message: 'You need to define %keyurls%a pocket_consumer_key%keyurle%.' 324 admin_message: 'You need to define %keyurls%a pocket_consumer_key%keyurle%.'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
index 9ce5b645..920fa933 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
@@ -32,7 +32,7 @@
32 32
33 <div class="card-content"> 33 <div class="card-content">
34 {% if not entry.previewPicture is null %} 34 {% if not entry.previewPicture is null %}
35 <i class="card-title grey-text text-darken-4 activator mdi-navigation-more-vert right"></i> 35 <i class="card-title grey-text text-darken-4 activator mdi-navigation-more-horiz right"></i>
36 {% endif %} 36 {% endif %}
37 37
38 <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|striptags|slice(0, 42)|raw }}</a></span> 38 <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|striptags|slice(0, 42)|raw }}</a></span>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
index 75170f91..25ad23dd 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
@@ -134,7 +134,7 @@
134 <a target="_blank" class="grey-text text-lighten-3" href="https://itunes.apple.com/app/id828331015" title="iOS"> 134 <a target="_blank" class="grey-text text-lighten-3" href="https://itunes.apple.com/app/id828331015" title="iOS">
135 <span class="icon-apple"></span> 135 <span class="icon-apple"></span>
136 </a> 136 </a>
137 <a target="_blank" class="grey-text text-lighten-3" href="https://addons.mozilla.org/ru/firefox/addon/wallabag/" title="Firefox"> 137 <a target="_blank" class="grey-text text-lighten-3" href="https://addons.mozilla.org/firefox/addon/wallabag/" title="Firefox">
138 <span class="icon-firefox"></span> 138 <span class="icon-firefox"></span>
139 </a> 139 </a>
140 <a target="_blank" class="grey-text text-lighten-3" href="https://chrome.google.com/webstore/detail/wallabagit/peehlcgckcnclnjlndmoddifcicdnabm" title="Chrome"> 140 <a target="_blank" class="grey-text text-lighten-3" href="https://chrome.google.com/webstore/detail/wallabagit/peehlcgckcnclnjlndmoddifcicdnabm" title="Chrome">
diff --git a/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig b/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig
index c44fcfb7..3731f13b 100644
--- a/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig
@@ -74,7 +74,7 @@
74 74
75 <table cellpadding="0" cellspacing="0" border="0" align="center" id="card"> 75 <table cellpadding="0" cellspacing="0" border="0" align="center" id="card">
76 <tr> 76 <tr>
77 <td style="padding: 20px;" width="96px" valign="top"><img class="image_fix" src="{{ wallabag_url }}/themes/material/img/logo-other_themes.png" alt="logo" title="{{ wallabag_url }}" style="width: 96px; height: 96px;" /></td> 77 <td style="padding: 20px;" width="96px" valign="top"><img class="image_fix" src="{{ asset('bundles/wallabagcore/themes/material/img/logo-other_themes.png') }}" alt="logo" title="{{ wallabag_url }}" style="width: 96px; height: 96px;" /></td>
78 <td style="padding: 20px; padding-left: 0;" valign="top" id="cell_desc"> 78 <td style="padding: 20px; padding-left: 0;" valign="top" id="cell_desc">
79 <h1>wallabag</h1> 79 <h1>wallabag</h1>
80 <h5>{{ "auth_code.on"|trans({}, 'wallabag_user') }} {{ wallabag_url }}</h5> 80 <h5>{{ "auth_code.on"|trans({}, 'wallabag_user') }} {{ wallabag_url }}</h5>