aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php17
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php329
-rw-r--r--src/Wallabag/ApiBundle/Controller/TagRestController.php8
-rw-r--r--src/Wallabag/ApiBundle/Controller/UserRestController.php146
-rw-r--r--src/Wallabag/ApiBundle/Resources/config/routing_rest.yml5
-rw-r--r--src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php119
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php189
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php63
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php16
-rw-r--r--src/Wallabag/CoreBundle/Controller/TagController.php7
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php164
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php7
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/Configuration.php16
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php3
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php114
-rw-r--r--src/Wallabag/CoreBundle/Entity/TaggingRule.php4
-rw-r--r--src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php5
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EditEntryType.php6
-rw-r--r--src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php71
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php137
-rw-r--r--src/Wallabag/CoreBundle/Helper/DownloadImages.php9
-rw-r--r--src/Wallabag/CoreBundle/Helper/HttpClientFactory.php29
-rw-r--r--src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php5
-rw-r--r--src/Wallabag/CoreBundle/Helper/Redirect.php10
-rw-r--r--src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php10
-rw-r--r--src/Wallabag/CoreBundle/Helper/TagsAssigner.php75
-rw-r--r--src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php25
-rw-r--r--src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php21
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php40
-rw-r--r--src/Wallabag/CoreBundle/Repository/TagRepository.php20
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml24
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml12
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml145
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.it.yml83
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml25
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig5
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig14
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig29
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig6
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig27
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig40
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig4
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/edit.html.twig5
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig8
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig103
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig10
-rw-r--r--src/Wallabag/ImportBundle/Command/ImportCommand.php18
-rw-r--r--src/Wallabag/ImportBundle/Import/AbstractImport.php27
-rw-r--r--src/Wallabag/ImportBundle/Import/BrowserImport.php5
-rw-r--r--src/Wallabag/ImportBundle/Import/InstapaperImport.php19
-rw-r--r--src/Wallabag/ImportBundle/Import/PinboardImport.php4
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php5
-rw-r--r--src/Wallabag/ImportBundle/Import/ReadabilityImport.php2
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagImport.php4
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagV1Import.php18
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagV2Import.php4
-rw-r--r--src/Wallabag/ImportBundle/Resources/config/services.yml10
-rw-r--r--src/Wallabag/UserBundle/Controller/ManageController.php71
-rw-r--r--src/Wallabag/UserBundle/Entity/User.php38
-rw-r--r--src/Wallabag/UserBundle/EventListener/CreateConfigListener.php3
-rw-r--r--src/Wallabag/UserBundle/Form/SearchUserType.php29
-rw-r--r--src/Wallabag/UserBundle/Repository/UserRepository.php13
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig77
72 files changed, 1796 insertions, 851 deletions
diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
index 8d3f07ee..da361308 100644
--- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
+++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
@@ -122,4 +122,21 @@ class AnnotationRepository extends EntityRepository
122 ->setParameter('userId', $userId) 122 ->setParameter('userId', $userId)
123 ->execute(); 123 ->execute();
124 } 124 }
125
126 /**
127 * Find all annotations related to archived entries.
128 *
129 * @param $userId
130 *
131 * @return mixed
132 */
133 public function findAllArchivedEntriesByUser($userId)
134 {
135 return $this->createQueryBuilder('a')
136 ->leftJoin('a.entry', 'e')
137 ->where('a.user = :userid')->setParameter(':userid', $userId)
138 ->andWhere('e.isArchived = true')
139 ->getQuery()
140 ->getResult();
141 }
125} 142}
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index 54c1747c..93c8157e 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -5,6 +5,7 @@ namespace Wallabag\ApiBundle\Controller;
5use Hateoas\Configuration\Route; 5use Hateoas\Configuration\Route;
6use Hateoas\Representation\Factory\PagerfantaFactory; 6use Hateoas\Representation\Factory\PagerfantaFactory;
7use Nelmio\ApiDocBundle\Annotation\ApiDoc; 7use Nelmio\ApiDocBundle\Annotation\ApiDoc;
8use Symfony\Component\HttpKernel\Exception\HttpException;
8use Symfony\Component\HttpFoundation\Request; 9use Symfony\Component\HttpFoundation\Request;
9use Symfony\Component\HttpFoundation\JsonResponse; 10use Symfony\Component\HttpFoundation\JsonResponse;
10use Symfony\Component\Routing\Generator\UrlGeneratorInterface; 11use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
@@ -41,12 +42,10 @@ class EntryRestController extends WallabagRestController
41 ->getRepository('WallabagCoreBundle:Entry') 42 ->getRepository('WallabagCoreBundle:Entry')
42 ->findByUrlAndUserId($url, $this->getUser()->getId()); 43 ->findByUrlAndUserId($url, $this->getUser()->getId());
43 44
44 $results[$url] = false === $res ? false : true; 45 $results[$url] = $res instanceof Entry ? $res->getId() : false;
45 } 46 }
46 47
47 $json = $this->get('serializer')->serialize($results, 'json'); 48 return $this->sendResponse($results);
48
49 return (new JsonResponse())->setJson($json);
50 } 49 }
51 50
52 // let's see if it is a simple url? 51 // let's see if it is a simple url?
@@ -60,11 +59,9 @@ class EntryRestController extends WallabagRestController
60 ->getRepository('WallabagCoreBundle:Entry') 59 ->getRepository('WallabagCoreBundle:Entry')
61 ->findByUrlAndUserId($url, $this->getUser()->getId()); 60 ->findByUrlAndUserId($url, $this->getUser()->getId());
62 61
63 $exists = false === $res ? false : true; 62 $exists = $res instanceof Entry ? $res->getId() : false;
64
65 $json = $this->get('serializer')->serialize(['exists' => $exists], 'json');
66 63
67 return (new JsonResponse())->setJson($json); 64 return $this->sendResponse(['exists' => $exists]);
68 } 65 }
69 66
70 /** 67 /**
@@ -125,9 +122,7 @@ class EntryRestController extends WallabagRestController
125 ) 122 )
126 ); 123 );
127 124
128 $json = $this->get('serializer')->serialize($paginatedCollection, 'json'); 125 return $this->sendResponse($paginatedCollection);
129
130 return (new JsonResponse())->setJson($json);
131 } 126 }
132 127
133 /** 128 /**
@@ -146,9 +141,7 @@ class EntryRestController extends WallabagRestController
146 $this->validateAuthentication(); 141 $this->validateAuthentication();
147 $this->validateUserAccess($entry->getUser()->getId()); 142 $this->validateUserAccess($entry->getUser()->getId());
148 143
149 $json = $this->get('serializer')->serialize($entry, 'json'); 144 return $this->sendResponse($entry);
150
151 return (new JsonResponse())->setJson($json);
152 } 145 }
153 146
154 /** 147 /**
@@ -174,8 +167,116 @@ class EntryRestController extends WallabagRestController
174 } 167 }
175 168
176 /** 169 /**
170 * Handles an entries list and delete URL.
171 *
172 * @ApiDoc(
173 * parameters={
174 * {"name"="urls", "dataType"="string", "required"=true, "format"="A JSON array of urls [{'url': 'http://...'}, {'url': 'http://...'}]", "description"="Urls (as an array) to delete."}
175 * }
176 * )
177 *
178 * @return JsonResponse
179 */
180 public function deleteEntriesListAction(Request $request)
181 {
182 $this->validateAuthentication();
183
184 $urls = json_decode($request->query->get('urls', []));
185
186 if (empty($urls)) {
187 return $this->sendResponse([]);
188 }
189
190 $results = [];
191
192 // handle multiple urls
193 foreach ($urls as $key => $url) {
194 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
195 $url,
196 $this->getUser()->getId()
197 );
198
199 $results[$key]['url'] = $url;
200
201 if (false !== $entry) {
202 $em = $this->getDoctrine()->getManager();
203 $em->remove($entry);
204 $em->flush();
205
206 // entry deleted, dispatch event about it!
207 $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
208 }
209
210 $results[$key]['entry'] = $entry instanceof Entry ? true : false;
211 }
212
213 return $this->sendResponse($results);
214 }
215
216 /**
217 * Handles an entries list and create URL.
218 *
219 * @ApiDoc(
220 * parameters={
221 * {"name"="urls", "dataType"="string", "required"=true, "format"="A JSON array of urls [{'url': 'http://...'}, {'url': 'http://...'}]", "description"="Urls (as an array) to create."}
222 * }
223 * )
224 *
225 * @return JsonResponse
226 *
227 * @throws HttpException When limit is reached
228 */
229 public function postEntriesListAction(Request $request)
230 {
231 $this->validateAuthentication();
232
233 $urls = json_decode($request->query->get('urls', []));
234
235 $limit = $this->container->getParameter('wallabag_core.api_limit_mass_actions');
236
237 if (count($urls) > $limit) {
238 throw new HttpException(400, 'API limit reached');
239 }
240
241 $results = [];
242 if (empty($urls)) {
243 return $this->sendResponse($results);
244 }
245
246 // handle multiple urls
247 foreach ($urls as $key => $url) {
248 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
249 $url,
250 $this->getUser()->getId()
251 );
252
253 $results[$key]['url'] = $url;
254
255 if (false === $entry) {
256 $entry = new Entry($this->getUser());
257
258 $this->get('wallabag_core.content_proxy')->updateEntry($entry, $url);
259 }
260
261 $em = $this->getDoctrine()->getManager();
262 $em->persist($entry);
263 $em->flush();
264
265 $results[$key]['entry'] = $entry instanceof Entry ? $entry->getId() : false;
266
267 // entry saved, dispatch event about it!
268 $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
269 }
270
271 return $this->sendResponse($results);
272 }
273
274 /**
177 * Create an entry. 275 * Create an entry.
178 * 276 *
277 * If you want to provide the HTML content (which means wallabag won't fetch it from the url), you must provide `content`, `title` & `url` fields **non-empty**.
278 * Otherwise, content will be fetched as normal from the url and values will be overwritten.
279 *
179 * @ApiDoc( 280 * @ApiDoc(
180 * parameters={ 281 * parameters={
181 * {"name"="url", "dataType"="string", "required"=true, "format"="http://www.test.com/article.html", "description"="Url for the entry."}, 282 * {"name"="url", "dataType"="string", "required"=true, "format"="http://www.test.com/article.html", "description"="Url for the entry."},
@@ -183,6 +284,11 @@ class EntryRestController extends WallabagRestController
183 * {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."}, 284 * {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."},
184 * {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="entry already starred"}, 285 * {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="entry already starred"},
185 * {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="entry already archived"}, 286 * {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="entry already archived"},
287 * {"name"="content", "dataType"="string", "required"=false, "description"="Content of the entry"},
288 * {"name"="language", "dataType"="string", "required"=false, "description"="Language of the entry"},
289 * {"name"="preview_picture", "dataType"="string", "required"=false, "description"="Preview picture of the entry"},
290 * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"},
291 * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"},
186 * } 292 * }
187 * ) 293 * )
188 * 294 *
@@ -194,34 +300,48 @@ class EntryRestController extends WallabagRestController
194 300
195 $url = $request->request->get('url'); 301 $url = $request->request->get('url');
196 $title = $request->request->get('title'); 302 $title = $request->request->get('title');
303 $tags = $request->request->get('tags', []);
197 $isArchived = $request->request->get('archive'); 304 $isArchived = $request->request->get('archive');
198 $isStarred = $request->request->get('starred'); 305 $isStarred = $request->request->get('starred');
306 $content = $request->request->get('content');
307 $language = $request->request->get('language');
308 $picture = $request->request->get('preview_picture');
309 $publishedAt = $request->request->get('published_at');
310 $authors = $request->request->get('authors', '');
199 311
200 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId()); 312 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId());
201 313
202 if (false === $entry) { 314 if (false === $entry) {
203 $entry = new Entry($this->getUser()); 315 $entry = new Entry($this->getUser());
204 try {
205 $entry = $this->get('wallabag_core.content_proxy')->updateEntry(
206 $entry,
207 $url
208 );
209 } catch (\Exception $e) {
210 $this->get('logger')->error('Error while saving an entry', [
211 'exception' => $e,
212 'entry' => $entry,
213 ]);
214 $entry->setUrl($url);
215 }
216 } 316 }
217 317
218 if (!is_null($title)) { 318 try {
219 $entry->setTitle($title); 319 $this->get('wallabag_core.content_proxy')->updateEntry(
320 $entry,
321 $url,
322 [
323 'title' => $title,
324 'html' => $content,
325 'url' => $url,
326 'language' => $language,
327 'date' => $publishedAt,
328 // faking the preview picture
329 'open_graph' => [
330 'og_image' => $picture,
331 ],
332 'authors' => explode(',', $authors),
333 ]
334 );
335 } catch (\Exception $e) {
336 $this->get('logger')->error('Error while saving an entry', [
337 'exception' => $e,
338 'entry' => $entry,
339 ]);
340 $entry->setUrl($url);
220 } 341 }
221 342
222 $tags = $request->request->get('tags', '');
223 if (!empty($tags)) { 343 if (!empty($tags)) {
224 $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags); 344 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
225 } 345 }
226 346
227 if (!is_null($isStarred)) { 347 if (!is_null($isStarred)) {
@@ -239,9 +359,7 @@ class EntryRestController extends WallabagRestController
239 // entry saved, dispatch event about it! 359 // entry saved, dispatch event about it!
240 $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); 360 $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
241 361
242 $json = $this->get('serializer')->serialize($entry, 'json'); 362 return $this->sendResponse($entry);
243
244 return (new JsonResponse())->setJson($json);
245 } 363 }
246 364
247 /** 365 /**
@@ -284,15 +402,13 @@ class EntryRestController extends WallabagRestController
284 402
285 $tags = $request->request->get('tags', ''); 403 $tags = $request->request->get('tags', '');
286 if (!empty($tags)) { 404 if (!empty($tags)) {
287 $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags); 405 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
288 } 406 }
289 407
290 $em = $this->getDoctrine()->getManager(); 408 $em = $this->getDoctrine()->getManager();
291 $em->flush(); 409 $em->flush();
292 410
293 $json = $this->get('serializer')->serialize($entry, 'json'); 411 return $this->sendResponse($entry);
294
295 return (new JsonResponse())->setJson($json);
296 } 412 }
297 413
298 /** 414 /**
@@ -313,7 +429,7 @@ class EntryRestController extends WallabagRestController
313 $this->validateUserAccess($entry->getUser()->getId()); 429 $this->validateUserAccess($entry->getUser()->getId());
314 430
315 try { 431 try {
316 $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl()); 432 $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
317 } catch (\Exception $e) { 433 } catch (\Exception $e) {
318 $this->get('logger')->error('Error while saving an entry', [ 434 $this->get('logger')->error('Error while saving an entry', [
319 'exception' => $e, 435 'exception' => $e,
@@ -335,9 +451,7 @@ class EntryRestController extends WallabagRestController
335 // entry saved, dispatch event about it! 451 // entry saved, dispatch event about it!
336 $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); 452 $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
337 453
338 $json = $this->get('serializer')->serialize($entry, 'json'); 454 return $this->sendResponse($entry);
339
340 return (new JsonResponse())->setJson($json);
341 } 455 }
342 456
343 /** 457 /**
@@ -363,9 +477,7 @@ class EntryRestController extends WallabagRestController
363 // entry deleted, dispatch event about it! 477 // entry deleted, dispatch event about it!
364 $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); 478 $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
365 479
366 $json = $this->get('serializer')->serialize($entry, 'json'); 480 return $this->sendResponse($entry);
367
368 return (new JsonResponse())->setJson($json);
369 } 481 }
370 482
371 /** 483 /**
@@ -384,9 +496,7 @@ class EntryRestController extends WallabagRestController
384 $this->validateAuthentication(); 496 $this->validateAuthentication();
385 $this->validateUserAccess($entry->getUser()->getId()); 497 $this->validateUserAccess($entry->getUser()->getId());
386 498
387 $json = $this->get('serializer')->serialize($entry->getTags(), 'json'); 499 return $this->sendResponse($entry->getTags());
388
389 return (new JsonResponse())->setJson($json);
390 } 500 }
391 501
392 /** 502 /**
@@ -410,16 +520,14 @@ class EntryRestController extends WallabagRestController
410 520
411 $tags = $request->request->get('tags', ''); 521 $tags = $request->request->get('tags', '');
412 if (!empty($tags)) { 522 if (!empty($tags)) {
413 $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags); 523 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
414 } 524 }
415 525
416 $em = $this->getDoctrine()->getManager(); 526 $em = $this->getDoctrine()->getManager();
417 $em->persist($entry); 527 $em->persist($entry);
418 $em->flush(); 528 $em->flush();
419 529
420 $json = $this->get('serializer')->serialize($entry, 'json'); 530 return $this->sendResponse($entry);
421
422 return (new JsonResponse())->setJson($json);
423 } 531 }
424 532
425 /** 533 /**
@@ -444,7 +552,124 @@ class EntryRestController extends WallabagRestController
444 $em->persist($entry); 552 $em->persist($entry);
445 $em->flush(); 553 $em->flush();
446 554
447 $json = $this->get('serializer')->serialize($entry, 'json'); 555 return $this->sendResponse($entry);
556 }
557
558 /**
559 * Handles an entries list delete tags from them.
560 *
561 * @ApiDoc(
562 * parameters={
563 * {"name"="list", "dataType"="string", "required"=true, "format"="A JSON array of urls [{'url': 'http://...','tags': 'tag1, tag2'}, {'url': 'http://...','tags': 'tag1, tag2'}]", "description"="Urls (as an array) to handle."}
564 * }
565 * )
566 *
567 * @return JsonResponse
568 */
569 public function deleteEntriesTagsListAction(Request $request)
570 {
571 $this->validateAuthentication();
572
573 $list = json_decode($request->query->get('list', []));
574
575 if (empty($list)) {
576 return $this->sendResponse([]);
577 }
578
579 // handle multiple urls
580 $results = [];
581
582 foreach ($list as $key => $element) {
583 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
584 $element->url,
585 $this->getUser()->getId()
586 );
587
588 $results[$key]['url'] = $element->url;
589 $results[$key]['entry'] = $entry instanceof Entry ? $entry->getId() : false;
590
591 $tags = $element->tags;
592
593 if (false !== $entry && !(empty($tags))) {
594 $tags = explode(',', $tags);
595 foreach ($tags as $label) {
596 $label = trim($label);
597
598 $tag = $this->getDoctrine()
599 ->getRepository('WallabagCoreBundle:Tag')
600 ->findOneByLabel($label);
601
602 if (false !== $tag) {
603 $entry->removeTag($tag);
604 }
605 }
606
607 $em = $this->getDoctrine()->getManager();
608 $em->persist($entry);
609 $em->flush();
610 }
611 }
612
613 return $this->sendResponse($results);
614 }
615
616 /**
617 * Handles an entries list and add tags to them.
618 *
619 * @ApiDoc(
620 * parameters={
621 * {"name"="list", "dataType"="string", "required"=true, "format"="A JSON array of urls [{'url': 'http://...','tags': 'tag1, tag2'}, {'url': 'http://...','tags': 'tag1, tag2'}]", "description"="Urls (as an array) to handle."}
622 * }
623 * )
624 *
625 * @return JsonResponse
626 */
627 public function postEntriesTagsListAction(Request $request)
628 {
629 $this->validateAuthentication();
630
631 $list = json_decode($request->query->get('list', []));
632
633 if (empty($list)) {
634 return $this->sendResponse([]);
635 }
636
637 $results = [];
638
639 // handle multiple urls
640 foreach ($list as $key => $element) {
641 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
642 $element->url,
643 $this->getUser()->getId()
644 );
645
646 $results[$key]['url'] = $element->url;
647 $results[$key]['entry'] = $entry instanceof Entry ? $entry->getId() : false;
648
649 $tags = $element->tags;
650
651 if (false !== $entry && !(empty($tags))) {
652 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
653
654 $em = $this->getDoctrine()->getManager();
655 $em->persist($entry);
656 $em->flush();
657 }
658 }
659
660 return $this->sendResponse($results);
661 }
662
663 /**
664 * Shortcut to send data serialized in json.
665 *
666 * @param mixed $data
667 *
668 * @return JsonResponse
669 */
670 private function sendResponse($data)
671 {
672 $json = $this->get('serializer')->serialize($data, 'json');
448 673
449 return (new JsonResponse())->setJson($json); 674 return (new JsonResponse())->setJson($json);
450 } 675 }
diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php
index bc6d4e64..354187a0 100644
--- a/src/Wallabag/ApiBundle/Controller/TagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php
@@ -31,7 +31,7 @@ class TagRestController extends WallabagRestController
31 } 31 }
32 32
33 /** 33 /**
34 * Permanently remove one tag from **every** entry. 34 * Permanently remove one tag from **every** entry by passing the Tag label.
35 * 35 *
36 * @ApiDoc( 36 * @ApiDoc(
37 * requirements={ 37 * requirements={
@@ -44,7 +44,7 @@ class TagRestController extends WallabagRestController
44 public function deleteTagLabelAction(Request $request) 44 public function deleteTagLabelAction(Request $request)
45 { 45 {
46 $this->validateAuthentication(); 46 $this->validateAuthentication();
47 $label = $request->request->get('tag', ''); 47 $label = $request->get('tag', '');
48 48
49 $tag = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($label); 49 $tag = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($label);
50 50
@@ -78,7 +78,7 @@ class TagRestController extends WallabagRestController
78 { 78 {
79 $this->validateAuthentication(); 79 $this->validateAuthentication();
80 80
81 $tagsLabels = $request->request->get('tags', ''); 81 $tagsLabels = $request->get('tags', '');
82 82
83 $tags = []; 83 $tags = [];
84 84
@@ -106,7 +106,7 @@ class TagRestController extends WallabagRestController
106 } 106 }
107 107
108 /** 108 /**
109 * Permanently remove one tag from **every** entry. 109 * Permanently remove one tag from **every** entry by passing the Tag ID.
110 * 110 *
111 * @ApiDoc( 111 * @ApiDoc(
112 * requirements={ 112 * requirements={
diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php
new file mode 100644
index 00000000..8f675b8d
--- /dev/null
+++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php
@@ -0,0 +1,146 @@
1<?php
2
3namespace Wallabag\ApiBundle\Controller;
4
5use FOS\UserBundle\Event\UserEvent;
6use FOS\UserBundle\FOSUserEvents;
7use JMS\Serializer\SerializationContext;
8use Nelmio\ApiDocBundle\Annotation\ApiDoc;
9use Symfony\Component\HttpFoundation\Request;
10use Symfony\Component\HttpFoundation\JsonResponse;
11use Wallabag\UserBundle\Entity\User;
12
13class UserRestController extends WallabagRestController
14{
15 /**
16 * Retrieve current logged in user informations.
17 *
18 * @ApiDoc()
19 *
20 * @return JsonResponse
21 */
22 public function getUserAction()
23 {
24 $this->validateAuthentication();
25
26 return $this->sendUser($this->getUser());
27 }
28
29 /**
30 * Register an user.
31 *
32 * @ApiDoc(
33 * requirements={
34 * {"name"="username", "dataType"="string", "required"=true, "description"="The user's username"},
35 * {"name"="password", "dataType"="string", "required"=true, "description"="The user's password"},
36 * {"name"="email", "dataType"="string", "required"=true, "description"="The user's email"}
37 * }
38 * )
39 *
40 * @todo Make this method (or the whole API) accessible only through https
41 *
42 * @return JsonResponse
43 */
44 public function putUserAction(Request $request)
45 {
46 if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) {
47 $json = $this->get('serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json');
48
49 return (new JsonResponse())
50 ->setJson($json)
51 ->setStatusCode(JsonResponse::HTTP_FORBIDDEN);
52 }
53
54 $userManager = $this->get('fos_user.user_manager');
55 $user = $userManager->createUser();
56 // user will be disabled BY DEFAULT to avoid spamming account to be enabled
57 $user->setEnabled(false);
58
59 $form = $this->createForm('Wallabag\UserBundle\Form\NewUserType', $user, [
60 'csrf_protection' => false,
61 ]);
62
63 // simulate form submission
64 $form->submit([
65 'username' => $request->request->get('username'),
66 'plainPassword' => [
67 'first' => $request->request->get('password'),
68 'second' => $request->request->get('password'),
69 ],
70 'email' => $request->request->get('email'),
71 ]);
72
73 if ($form->isSubmitted() && false === $form->isValid()) {
74 $view = $this->view($form, 400);
75 $view->setFormat('json');
76
77 // handle errors in a more beautiful way than the default view
78 $data = json_decode($this->handleView($view)->getContent(), true)['children'];
79 $errors = [];
80
81 if (isset($data['username']['errors'])) {
82 $errors['username'] = $this->translateErrors($data['username']['errors']);
83 }
84
85 if (isset($data['email']['errors'])) {
86 $errors['email'] = $this->translateErrors($data['email']['errors']);
87 }
88
89 if (isset($data['plainPassword']['children']['first']['errors'])) {
90 $errors['password'] = $this->translateErrors($data['plainPassword']['children']['first']['errors']);
91 }
92
93 $json = $this->get('serializer')->serialize(['error' => $errors], 'json');
94
95 return (new JsonResponse())
96 ->setJson($json)
97 ->setStatusCode(JsonResponse::HTTP_BAD_REQUEST);
98 }
99
100 $userManager->updateUser($user);
101
102 // dispatch a created event so the associated config will be created
103 $event = new UserEvent($user, $request);
104 $this->get('event_dispatcher')->dispatch(FOSUserEvents::USER_CREATED, $event);
105
106 return $this->sendUser($user, JsonResponse::HTTP_CREATED);
107 }
108
109 /**
110 * Send user response.
111 *
112 * @param User $user
113 * @param int $status HTTP Status code to send
114 *
115 * @return JsonResponse
116 */
117 private function sendUser(User $user, $status = JsonResponse::HTTP_OK)
118 {
119 $json = $this->get('serializer')->serialize(
120 $user,
121 'json',
122 SerializationContext::create()->setGroups(['user_api'])
123 );
124
125 return (new JsonResponse())
126 ->setJson($json)
127 ->setStatusCode($status);
128 }
129
130 /**
131 * Translate errors message.
132 *
133 * @param array $errors
134 *
135 * @return array
136 */
137 private function translateErrors($errors)
138 {
139 $translatedErrors = [];
140 foreach ($errors as $error) {
141 $translatedErrors[] = $this->get('translator')->trans($error);
142 }
143
144 return $translatedErrors;
145 }
146}
diff --git a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml
index 57d37f4b..c0283e71 100644
--- a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml
+++ b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml
@@ -17,3 +17,8 @@ misc:
17 type: rest 17 type: rest
18 resource: "WallabagApiBundle:WallabagRest" 18 resource: "WallabagApiBundle:WallabagRest"
19 name_prefix: api_ 19 name_prefix: api_
20
21user:
22 type: rest
23 resource: "WallabagApiBundle:UserRest"
24 name_prefix: api_
diff --git a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
new file mode 100644
index 00000000..65f35d8e
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
@@ -0,0 +1,119 @@
1<?php
2
3namespace Wallabag\CoreBundle\Command;
4
5use Doctrine\ORM\NoResultException;
6use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
7use Symfony\Component\Console\Input\InputArgument;
8use Symfony\Component\Console\Input\InputInterface;
9use Symfony\Component\Console\Output\OutputInterface;
10use Wallabag\CoreBundle\Entity\Entry;
11use Wallabag\UserBundle\Entity\User;
12
13class CleanDuplicatesCommand extends ContainerAwareCommand
14{
15 /** @var OutputInterface */
16 protected $output;
17
18 protected $duplicates = 0;
19
20 protected function configure()
21 {
22 $this
23 ->setName('wallabag:clean-duplicates')
24 ->setDescription('Cleans the database for duplicates')
25 ->setHelp('This command helps you to clean your articles list in case of duplicates')
26 ->addArgument(
27 'username',
28 InputArgument::OPTIONAL,
29 'User to clean'
30 );
31 }
32
33 protected function execute(InputInterface $input, OutputInterface $output)
34 {
35 $this->output = $output;
36
37 $username = $input->getArgument('username');
38
39 if ($username) {
40 try {
41 $user = $this->getUser($username);
42 $this->cleanDuplicates($user);
43 } catch (NoResultException $e) {
44 $output->writeln(sprintf('<error>User "%s" not found.</error>', $username));
45
46 return 1;
47 }
48 } else {
49 $users = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findAll();
50
51 $output->writeln(sprintf('Cleaning through %d user accounts', count($users)));
52
53 foreach ($users as $user) {
54 $output->writeln(sprintf('Processing user %s', $user->getUsername()));
55 $this->cleanDuplicates($user);
56 }
57 $output->writeln(sprintf('Finished cleaning. %d duplicates found in total', $this->duplicates));
58 }
59
60 return 0;
61 }
62
63 /**
64 * @param User $user
65 */
66 private function cleanDuplicates(User $user)
67 {
68 $em = $this->getContainer()->get('doctrine.orm.entity_manager');
69 $repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
70
71 $entries = $repo->getAllEntriesIdAndUrl($user->getId());
72
73 $duplicatesCount = 0;
74 $urls = [];
75 foreach ($entries as $entry) {
76 $url = $this->similarUrl($entry['url']);
77
78 /* @var $entry Entry */
79 if (in_array($url, $urls)) {
80 ++$duplicatesCount;
81
82 $em->remove($repo->find($entry['id']));
83 $em->flush(); // Flushing at the end of the loop would require the instance not being online
84 } else {
85 $urls[] = $entry['url'];
86 }
87 }
88
89 $this->duplicates += $duplicatesCount;
90
91 $this->output->writeln(sprintf('Cleaned %d duplicates for user %s', $duplicatesCount, $user->getUserName()));
92 }
93
94 private function similarUrl($url)
95 {
96 if (in_array(substr($url, -1), ['/', '#'])) { // get rid of "/" and "#" and the end of urls
97 return substr($url, 0, strlen($url));
98 }
99
100 return $url;
101 }
102
103 /**
104 * Fetches a user from its username.
105 *
106 * @param string $username
107 *
108 * @return \Wallabag\UserBundle\Entity\User
109 */
110 private function getUser($username)
111 {
112 return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username);
113 }
114
115 private function getDoctrine()
116 {
117 return $this->getContainer()->get('doctrine');
118 }
119}
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index f0738b91..0f119377 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -63,6 +63,7 @@ class InstallCommand extends ContainerAwareCommand
63 ->setupDatabase() 63 ->setupDatabase()
64 ->setupAdmin() 64 ->setupAdmin()
65 ->setupConfig() 65 ->setupConfig()
66 ->runMigrations()
66 ; 67 ;
67 68
68 $output->writeln('<info>wallabag has been successfully installed.</info>'); 69 $output->writeln('<info>wallabag has been successfully installed.</info>');
@@ -71,7 +72,7 @@ class InstallCommand extends ContainerAwareCommand
71 72
72 protected function checkRequirements() 73 protected function checkRequirements()
73 { 74 {
74 $this->defaultOutput->writeln('<info><comment>Step 1 of 4.</comment> Checking system requirements.</info>'); 75 $this->defaultOutput->writeln('<info><comment>Step 1 of 5.</comment> Checking system requirements.</info>');
75 $doctrineManager = $this->getContainer()->get('doctrine')->getManager(); 76 $doctrineManager = $this->getContainer()->get('doctrine')->getManager();
76 77
77 $rows = []; 78 $rows = [];
@@ -175,11 +176,11 @@ class InstallCommand extends ContainerAwareCommand
175 176
176 protected function setupDatabase() 177 protected function setupDatabase()
177 { 178 {
178 $this->defaultOutput->writeln('<info><comment>Step 2 of 4.</comment> Setting up database.</info>'); 179 $this->defaultOutput->writeln('<info><comment>Step 2 of 5.</comment> Setting up database.</info>');
179 180
180 // user want to reset everything? Don't care about what is already here 181 // user want to reset everything? Don't care about what is already here
181 if (true === $this->defaultInput->getOption('reset')) { 182 if (true === $this->defaultInput->getOption('reset')) {
182 $this->defaultOutput->writeln('Droping database, creating database and schema, clearing the cache'); 183 $this->defaultOutput->writeln('Dropping database, creating database and schema, clearing the cache');
183 184
184 $this 185 $this
185 ->runCommand('doctrine:database:drop', ['--force' => true]) 186 ->runCommand('doctrine:database:drop', ['--force' => true])
@@ -211,7 +212,7 @@ class InstallCommand extends ContainerAwareCommand
211 $question = new ConfirmationQuestion('It appears that your database already exists. Would you like to reset it? (y/N)', false); 212 $question = new ConfirmationQuestion('It appears that your database already exists. Would you like to reset it? (y/N)', false);
212 213
213 if ($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) { 214 if ($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) {
214 $this->defaultOutput->writeln('Droping database, creating database and schema'); 215 $this->defaultOutput->writeln('Dropping database, creating database and schema');
215 216
216 $this 217 $this
217 ->runCommand('doctrine:database:drop', ['--force' => true]) 218 ->runCommand('doctrine:database:drop', ['--force' => true])
@@ -221,7 +222,7 @@ class InstallCommand extends ContainerAwareCommand
221 } elseif ($this->isSchemaPresent()) { 222 } elseif ($this->isSchemaPresent()) {
222 $question = new ConfirmationQuestion('Seems like your database contains schema. Do you want to reset it? (y/N)', false); 223 $question = new ConfirmationQuestion('Seems like your database contains schema. Do you want to reset it? (y/N)', false);
223 if ($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) { 224 if ($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) {
224 $this->defaultOutput->writeln('Droping schema and creating schema'); 225 $this->defaultOutput->writeln('Dropping schema and creating schema');
225 226
226 $this 227 $this
227 ->runCommand('doctrine:schema:drop', ['--force' => true]) 228 ->runCommand('doctrine:schema:drop', ['--force' => true])
@@ -246,7 +247,7 @@ class InstallCommand extends ContainerAwareCommand
246 247
247 protected function setupAdmin() 248 protected function setupAdmin()
248 { 249 {
249 $this->defaultOutput->writeln('<info><comment>Step 3 of 4.</comment> Administration setup.</info>'); 250 $this->defaultOutput->writeln('<info><comment>Step 3 of 5.</comment> Administration setup.</info>');
250 251
251 $questionHelper = $this->getHelperSet()->get('question'); 252 $questionHelper = $this->getHelperSet()->get('question');
252 $question = new ConfirmationQuestion('Would you like to create a new admin user (recommended) ? (Y/n)', true); 253 $question = new ConfirmationQuestion('Would you like to create a new admin user (recommended) ? (Y/n)', true);
@@ -285,161 +286,13 @@ class InstallCommand extends ContainerAwareCommand
285 286
286 protected function setupConfig() 287 protected function setupConfig()
287 { 288 {
288 $this->defaultOutput->writeln('<info><comment>Step 4 of 4.</comment> Config setup.</info>'); 289 $this->defaultOutput->writeln('<info><comment>Step 4 of 5.</comment> Config setup.</info>');
289 $em = $this->getContainer()->get('doctrine.orm.entity_manager'); 290 $em = $this->getContainer()->get('doctrine.orm.entity_manager');
290 291
291 // cleanup before insert new stuff 292 // cleanup before insert new stuff
292 $em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute(); 293 $em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute();
293 294
294 $settings = [ 295 foreach ($this->getContainer()->getParameter('wallabag_core.default_internal_settings') as $setting) {
295 [
296 'name' => 'share_public',
297 'value' => '1',
298 'section' => 'entry',
299 ],
300 [
301 'name' => 'carrot',
302 'value' => '1',
303 'section' => 'entry',
304 ],
305 [
306 'name' => 'share_diaspora',
307 'value' => '1',
308 'section' => 'entry',
309 ],
310 [
311 'name' => 'diaspora_url',
312 'value' => 'http://diasporapod.com',
313 'section' => 'entry',
314 ],
315 [
316 'name' => 'share_unmark',
317 'value' => '1',
318 'section' => 'entry',
319 ],
320 [
321 'name' => 'unmark_url',
322 'value' => 'https://unmark.it',
323 'section' => 'entry',
324 ],
325 [
326 'name' => 'share_shaarli',
327 'value' => '1',
328 'section' => 'entry',
329 ],
330 [
331 'name' => 'shaarli_url',
332 'value' => 'http://myshaarli.com',
333 'section' => 'entry',
334 ],
335 [
336 'name' => 'share_mail',
337 'value' => '1',
338 'section' => 'entry',
339 ],
340 [
341 'name' => 'share_twitter',
342 'value' => '1',
343 'section' => 'entry',
344 ],
345 [
346 'name' => 'export_epub',
347 'value' => '1',
348 'section' => 'export',
349 ],
350 [
351 'name' => 'export_mobi',
352 'value' => '1',
353 'section' => 'export',
354 ],
355 [
356 'name' => 'export_pdf',
357 'value' => '1',
358 'section' => 'export',
359 ],
360 [
361 'name' => 'export_csv',
362 'value' => '1',
363 'section' => 'export',
364 ],
365 [
366 'name' => 'export_json',
367 'value' => '1',
368 'section' => 'export',
369 ],
370 [
371 'name' => 'export_txt',
372 'value' => '1',
373 'section' => 'export',
374 ],
375 [
376 'name' => 'export_xml',
377 'value' => '1',
378 'section' => 'export',
379 ],
380 [
381 'name' => 'import_with_redis',
382 'value' => '0',
383 'section' => 'import',
384 ],
385 [
386 'name' => 'import_with_rabbitmq',
387 'value' => '0',
388 'section' => 'import',
389 ],
390 [
391 'name' => 'show_printlink',
392 'value' => '1',
393 'section' => 'entry',
394 ],
395 [
396 'name' => 'wallabag_support_url',
397 'value' => 'https://www.wallabag.org/pages/support.html',
398 'section' => 'misc',
399 ],
400 [
401 'name' => 'wallabag_url',
402 'value' => '',
403 'section' => 'misc',
404 ],
405 [
406 'name' => 'piwik_enabled',
407 'value' => '0',
408 'section' => 'analytics',
409 ],
410 [
411 'name' => 'piwik_host',
412 'value' => 'v2.wallabag.org',
413 'section' => 'analytics',
414 ],
415 [
416 'name' => 'piwik_site_id',
417 'value' => '1',
418 'section' => 'analytics',
419 ],
420 [
421 'name' => 'demo_mode_enabled',
422 'value' => '0',
423 'section' => 'misc',
424 ],
425 [
426 'name' => 'demo_mode_username',
427 'value' => 'wallabag',
428 'section' => 'misc',
429 ],
430 [
431 'name' => 'download_images_enabled',
432 'value' => '0',
433 'section' => 'misc',
434 ],
435 [
436 'name' => 'restricted_access',
437 'value' => '0',
438 'section' => 'entry',
439 ],
440 ];
441
442 foreach ($settings as $setting) {
443 $newSetting = new Setting(); 296 $newSetting = new Setting();
444 $newSetting->setName($setting['name']); 297 $newSetting->setName($setting['name']);
445 $newSetting->setValue($setting['value']); 298 $newSetting->setValue($setting['value']);
@@ -454,6 +307,14 @@ class InstallCommand extends ContainerAwareCommand
454 return $this; 307 return $this;
455 } 308 }
456 309
310 protected function runMigrations()
311 {
312 $this->defaultOutput->writeln('<info><comment>Step 5 of 5.</comment> Run migrations.</info>');
313
314 $this
315 ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]);
316 }
317
457 /** 318 /**
458 * Run a command. 319 * Run a command.
459 * 320 *
@@ -480,20 +341,18 @@ class InstallCommand extends ContainerAwareCommand
480 $output = new BufferedOutput(); 341 $output = new BufferedOutput();
481 $exitCode = $this->getApplication()->run(new ArrayInput($parameters), $output); 342 $exitCode = $this->getApplication()->run(new ArrayInput($parameters), $output);
482 343
344 // PDO does not always close the connection after Doctrine commands.
345 // See https://github.com/symfony/symfony/issues/11750.
346 $this->getContainer()->get('doctrine')->getManager()->getConnection()->close();
347
483 if (0 !== $exitCode) { 348 if (0 !== $exitCode) {
484 $this->getApplication()->setAutoExit(true); 349 $this->getApplication()->setAutoExit(true);
485 350
486 $this->defaultOutput->writeln(''); 351 throw new \RuntimeException(
487 $this->defaultOutput->writeln('<error>The command "'.$command.'" generates some errors: </error>'); 352 'The command "'.$command."\" generates some errors: \n\n"
488 $this->defaultOutput->writeln($output->fetch()); 353 .$output->fetch());
489
490 die();
491 } 354 }
492 355
493 // PDO does not always close the connection after Doctrine commands.
494 // See https://github.com/symfony/symfony/issues/11750.
495 $this->getContainer()->get('doctrine')->getManager()->getConnection()->close();
496
497 return $this; 356 return $this;
498 } 357 }
499 358
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 907bf78e..0e61c642 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -248,9 +248,9 @@ class ConfigController extends Controller
248 break; 248 break;
249 249
250 case 'entries': 250 case 'entries':
251 // SQLite doesn't care about cascading remove, so we need to manually remove associated stuf 251 // SQLite doesn't care about cascading remove, so we need to manually remove associated stuff
252 // otherwise they won't be removed ... 252 // otherwise they won't be removed ...
253 if ($this->get('doctrine')->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver) { 253 if ($this->get('doctrine')->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
254 $this->getDoctrine()->getRepository('WallabagAnnotationBundle:Annotation')->removeAllByUserId($this->getUser()->getId()); 254 $this->getDoctrine()->getRepository('WallabagAnnotationBundle:Annotation')->removeAllByUserId($this->getUser()->getId());
255 } 255 }
256 256
@@ -260,6 +260,19 @@ class ConfigController extends Controller
260 $this->getDoctrine() 260 $this->getDoctrine()
261 ->getRepository('WallabagCoreBundle:Entry') 261 ->getRepository('WallabagCoreBundle:Entry')
262 ->removeAllByUserId($this->getUser()->getId()); 262 ->removeAllByUserId($this->getUser()->getId());
263 break;
264 case 'archived':
265 if ($this->get('doctrine')->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
266 $this->removeAnnotationsForArchivedByUserId($this->getUser()->getId());
267 }
268
269 // manually remove tags to avoid orphan tag
270 $this->removeTagsForArchivedByUserId($this->getUser()->getId());
271
272 $this->getDoctrine()
273 ->getRepository('WallabagCoreBundle:Entry')
274 ->removeArchivedByUserId($this->getUser()->getId());
275 break;
263 } 276 }
264 277
265 $this->get('session')->getFlashBag()->add( 278 $this->get('session')->getFlashBag()->add(
@@ -271,14 +284,13 @@ class ConfigController extends Controller
271 } 284 }
272 285
273 /** 286 /**
274 * Remove all tags for a given user and cleanup orphan tags. 287 * Remove all tags for given tags and a given user and cleanup orphan tags.
275 * 288 *
276 * @param int $userId 289 * @param array $tags
290 * @param int $userId
277 */ 291 */
278 private function removeAllTagsByUserId($userId) 292 private function removeAllTagsByStatusAndUserId($tags, $userId)
279 { 293 {
280 $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findAllTags($userId);
281
282 if (empty($tags)) { 294 if (empty($tags)) {
283 return; 295 return;
284 } 296 }
@@ -300,6 +312,43 @@ class ConfigController extends Controller
300 } 312 }
301 313
302 /** 314 /**
315 * Remove all tags for a given user and cleanup orphan tags.
316 *
317 * @param int $userId
318 */
319 private function removeAllTagsByUserId($userId)
320 {
321 $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findAllTags($userId);
322 $this->removeAllTagsByStatusAndUserId($tags, $userId);
323 }
324
325 /**
326 * Remove all tags for a given user and cleanup orphan tags.
327 *
328 * @param int $userId
329 */
330 private function removeTagsForArchivedByUserId($userId)
331 {
332 $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findForArchivedArticlesByUser($userId);
333 $this->removeAllTagsByStatusAndUserId($tags, $userId);
334 }
335
336 private function removeAnnotationsForArchivedByUserId($userId)
337 {
338 $em = $this->getDoctrine()->getManager();
339
340 $archivedEntriesAnnotations = $this->getDoctrine()
341 ->getRepository('WallabagAnnotationBundle:Annotation')
342 ->findAllArchivedEntriesByUser($userId);
343
344 foreach ($archivedEntriesAnnotations as $archivedEntriesAnnotation) {
345 $em->remove($archivedEntriesAnnotation);
346 }
347
348 $em->flush();
349 }
350
351 /**
303 * Validate that a rule can be edited/deleted by the current user. 352 * Validate that a rule can be edited/deleted by the current user.
304 * 353 *
305 * @param TaggingRule $rule 354 * @param TaggingRule $rule
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index f7398e69..fafa49f1 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -53,22 +53,17 @@ class EntryController extends Controller
53 53
54 /** 54 /**
55 * Fetch content and update entry. 55 * Fetch content and update entry.
56 * In case it fails, entry will return to avod loosing the data. 56 * In case it fails, $entry->getContent will return an error message.
57 * 57 *
58 * @param Entry $entry 58 * @param Entry $entry
59 * @param string $prefixMessage Should be the translation key: entry_saved or entry_reloaded 59 * @param string $prefixMessage Should be the translation key: entry_saved or entry_reloaded
60 *
61 * @return Entry
62 */ 60 */
63 private function updateEntry(Entry $entry, $prefixMessage = 'entry_saved') 61 private function updateEntry(Entry $entry, $prefixMessage = 'entry_saved')
64 { 62 {
65 // put default title in case of fetching content failed
66 $entry->setTitle('No title found');
67
68 $message = 'flashes.entry.notice.'.$prefixMessage; 63 $message = 'flashes.entry.notice.'.$prefixMessage;
69 64
70 try { 65 try {
71 $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl()); 66 $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
72 } catch (\Exception $e) { 67 } catch (\Exception $e) {
73 $this->get('logger')->error('Error while saving an entry', [ 68 $this->get('logger')->error('Error while saving an entry', [
74 'exception' => $e, 69 'exception' => $e,
@@ -79,8 +74,6 @@ class EntryController extends Controller
79 } 74 }
80 75
81 $this->get('session')->getFlashBag()->add('notice', $message); 76 $this->get('session')->getFlashBag()->add('notice', $message);
82
83 return $entry;
84 } 77 }
85 78
86 /** 79 /**
@@ -227,7 +220,7 @@ class EntryController extends Controller
227 public function showUnreadAction(Request $request, $page) 220 public function showUnreadAction(Request $request, $page)
228 { 221 {
229 // load the quickstart if no entry in database 222 // load the quickstart if no entry in database
230 if ($page == 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUsername($this->getUser()->getId()) == 0) { 223 if ($page == 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId()) == 0) {
231 return $this->redirect($this->generateUrl('quickstart')); 224 return $this->redirect($this->generateUrl('quickstart'));
232 } 225 }
233 226
@@ -321,8 +314,7 @@ class EntryController extends Controller
321 314
322 $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false); 315 $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);
323 316
324 $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries') 317 $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare($pagerAdapter);
325 ->prepare($pagerAdapter, $page);
326 318
327 try { 319 try {
328 $entries->setCurrentPage($page); 320 $entries->setCurrentPage($page);
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php
index 8a093289..9422bae4 100644
--- a/src/Wallabag/CoreBundle/Controller/TagController.php
+++ b/src/Wallabag/CoreBundle/Controller/TagController.php
@@ -28,7 +28,7 @@ class TagController extends Controller
28 $form->handleRequest($request); 28 $form->handleRequest($request);
29 29
30 if ($form->isSubmitted() && $form->isValid()) { 30 if ($form->isSubmitted() && $form->isValid()) {
31 $this->get('wallabag_core.content_proxy')->assignTagsToEntry( 31 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry(
32 $entry, 32 $entry,
33 $form->get('label')->getData() 33 $form->get('label')->getData()
34 ); 34 );
@@ -70,7 +70,7 @@ class TagController extends Controller
70 $em->flush(); 70 $em->flush();
71 } 71 }
72 72
73 $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer')); 73 $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true);
74 74
75 return $this->redirect($redirectUrl); 75 return $this->redirect($redirectUrl);
76 } 76 }
@@ -125,8 +125,7 @@ class TagController extends Controller
125 125
126 $pagerAdapter = new ArrayAdapter($entriesByTag); 126 $pagerAdapter = new ArrayAdapter($entriesByTag);
127 127
128 $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries') 128 $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare($pagerAdapter);
129 ->prepare($pagerAdapter, $page);
130 129
131 try { 130 try {
132 $entries->setCurrentPage($page); 131 $entries->setCurrentPage($page);
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
index a723656e..a52288e6 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
@@ -6,163 +6,27 @@ use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface; 6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager; 7use Doctrine\Common\Persistence\ObjectManager;
8use Craue\ConfigBundle\Entity\Setting; 8use Craue\ConfigBundle\Entity\Setting;
9use Symfony\Component\DependencyInjection\ContainerAwareInterface;
10use Symfony\Component\DependencyInjection\ContainerInterface;
9 11
10class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface 12class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
11{ 13{
12 /** 14 /**
15 * @var ContainerInterface
16 */
17 private $container;
18
19 public function setContainer(ContainerInterface $container = null)
20 {
21 $this->container = $container;
22 }
23
24 /**
13 * {@inheritdoc} 25 * {@inheritdoc}
14 */ 26 */
15 public function load(ObjectManager $manager) 27 public function load(ObjectManager $manager)
16 { 28 {
17 $settings = [ 29 foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) {
18 [
19 'name' => 'share_public',
20 'value' => '1',
21 'section' => 'entry',
22 ],
23 [
24 'name' => 'carrot',
25 'value' => '1',
26 'section' => 'entry',
27 ],
28 [
29 'name' => 'share_diaspora',
30 'value' => '1',
31 'section' => 'entry',
32 ],
33 [
34 'name' => 'diaspora_url',
35 'value' => 'http://diasporapod.com',
36 'section' => 'entry',
37 ],
38 [
39 'name' => 'share_unmark',
40 'value' => '1',
41 'section' => 'entry',
42 ],
43 [
44 'name' => 'unmark_url',
45 'value' => 'https://unmark.it',
46 'section' => 'entry',
47 ],
48 [
49 'name' => 'share_shaarli',
50 'value' => '1',
51 'section' => 'entry',
52 ],
53 [
54 'name' => 'shaarli_url',
55 'value' => 'http://myshaarli.com',
56 'section' => 'entry',
57 ],
58 [
59 'name' => 'share_mail',
60 'value' => '1',
61 'section' => 'entry',
62 ],
63 [
64 'name' => 'share_twitter',
65 'value' => '1',
66 'section' => 'entry',
67 ],
68 [
69 'name' => 'export_epub',
70 'value' => '1',
71 'section' => 'export',
72 ],
73 [
74 'name' => 'export_mobi',
75 'value' => '1',
76 'section' => 'export',
77 ],
78 [
79 'name' => 'export_pdf',
80 'value' => '1',
81 'section' => 'export',
82 ],
83 [
84 'name' => 'export_csv',
85 'value' => '1',
86 'section' => 'export',
87 ],
88 [
89 'name' => 'export_json',
90 'value' => '1',
91 'section' => 'export',
92 ],
93 [
94 'name' => 'export_txt',
95 'value' => '1',
96 'section' => 'export',
97 ],
98 [
99 'name' => 'export_xml',
100 'value' => '1',
101 'section' => 'export',
102 ],
103 [
104 'name' => 'import_with_redis',
105 'value' => '0',
106 'section' => 'import',
107 ],
108 [
109 'name' => 'import_with_rabbitmq',
110 'value' => '0',
111 'section' => 'import',
112 ],
113 [
114 'name' => 'show_printlink',
115 'value' => '1',
116 'section' => 'entry',
117 ],
118 [
119 'name' => 'wallabag_support_url',
120 'value' => 'https://www.wallabag.org/pages/support.html',
121 'section' => 'misc',
122 ],
123 [
124 'name' => 'wallabag_url',
125 'value' => 'http://v2.wallabag.org',
126 'section' => 'misc',
127 ],
128 [
129 'name' => 'piwik_enabled',
130 'value' => '0',
131 'section' => 'analytics',
132 ],
133 [
134 'name' => 'piwik_host',
135 'value' => 'v2.wallabag.org',
136 'section' => 'analytics',
137 ],
138 [
139 'name' => 'piwik_site_id',
140 'value' => '1',
141 'section' => 'analytics',
142 ],
143 [
144 'name' => 'demo_mode_enabled',
145 'value' => '0',
146 'section' => 'misc',
147 ],
148 [
149 'name' => 'demo_mode_username',
150 'value' => 'wallabag',
151 'section' => 'misc',
152 ],
153 [
154 'name' => 'download_images_enabled',
155 'value' => '0',
156 'section' => 'misc',
157 ],
158 [
159 'name' => 'restricted_access',
160 'value' => '0',
161 'section' => 'entry',
162 ],
163 ];
164
165 foreach ($settings as $setting) {
166 $newSetting = new Setting(); 30 $newSetting = new Setting();
167 $newSetting->setName($setting['name']); 31 $newSetting->setName($setting['name']);
168 $newSetting->setValue($setting['value']); 32 $newSetting->setValue($setting['value']);
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php
index 7efe6356..55abd63c 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php
@@ -36,6 +36,13 @@ class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInter
36 36
37 $manager->persist($tr3); 37 $manager->persist($tr3);
38 38
39 $tr4 = new TaggingRule();
40 $tr4->setRule('content notmatches "basket"');
41 $tr4->setTags(['foot']);
42 $tr4->setConfig($this->getReference('admin-config'));
43
44 $manager->persist($tr4);
45
39 $manager->flush(); 46 $manager->flush();
40 } 47 }
41 48
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
index 006a18c3..33df92d3 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
@@ -41,12 +41,28 @@ class Configuration implements ConfigurationInterface
41 ->end() 41 ->end()
42 ->scalarNode('fetching_error_message') 42 ->scalarNode('fetching_error_message')
43 ->end() 43 ->end()
44 ->scalarNode('fetching_error_message_title')
45 ->end()
44 ->scalarNode('action_mark_as_read') 46 ->scalarNode('action_mark_as_read')
45 ->defaultValue(1) 47 ->defaultValue(1)
46 ->end() 48 ->end()
47 ->scalarNode('list_mode') 49 ->scalarNode('list_mode')
48 ->defaultValue(1) 50 ->defaultValue(1)
49 ->end() 51 ->end()
52 ->scalarNode('api_limit_mass_actions')
53 ->defaultValue(10)
54 ->end()
55 ->arrayNode('default_internal_settings')
56 ->prototype('array')
57 ->children()
58 ->scalarNode('name')->end()
59 ->scalarNode('value')->end()
60 ->enumNode('section')
61 ->values(['entry', 'misc', 'api', 'analytics', 'export', 'import'])
62 ->end()
63 ->end()
64 ->end()
65 ->end()
50 ->end() 66 ->end()
51 ; 67 ;
52 68
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index aa9ee339..b4d8a386 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -26,6 +26,9 @@ class WallabagCoreExtension extends Extension
26 $container->setParameter('wallabag_core.action_mark_as_read', $config['action_mark_as_read']); 26 $container->setParameter('wallabag_core.action_mark_as_read', $config['action_mark_as_read']);
27 $container->setParameter('wallabag_core.list_mode', $config['list_mode']); 27 $container->setParameter('wallabag_core.list_mode', $config['list_mode']);
28 $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']); 28 $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']);
29 $container->setParameter('wallabag_core.fetching_error_message_title', $config['fetching_error_message_title']);
30 $container->setParameter('wallabag_core.api_limit_mass_actions', $config['api_limit_mass_actions']);
31 $container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']);
29 32
30 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 33 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
31 $loader->load('services.yml'); 34 $loader->load('services.yml');
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index 7276b437..9a7dd4e7 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -122,6 +122,24 @@ class Entry
122 private $updatedAt; 122 private $updatedAt;
123 123
124 /** 124 /**
125 * @var \DateTime
126 *
127 * @ORM\Column(name="published_at", type="datetime", nullable=true)
128 *
129 * @Groups({"entries_for_user", "export_all"})
130 */
131 private $publishedAt;
132
133 /**
134 * @var array
135 *
136 * @ORM\Column(name="published_by", type="array", nullable=true)
137 *
138 * @Groups({"entries_for_user", "export_all"})
139 */
140 private $publishedBy;
141
142 /**
125 * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"}) 143 * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"})
126 * @ORM\JoinTable 144 * @ORM\JoinTable
127 * 145 *
@@ -175,22 +193,22 @@ class Entry
175 private $previewPicture; 193 private $previewPicture;
176 194
177 /** 195 /**
178 * @var bool 196 * @var string
179 * 197 *
180 * @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false}) 198 * @ORM\Column(name="http_status", type="string", length=3, nullable=true)
181 * 199 *
182 * @Groups({"export_all"}) 200 * @Groups({"entries_for_user", "export_all"})
183 */ 201 */
184 private $isPublic; 202 private $httpStatus;
185 203
186 /** 204 /**
187 * @var string 205 * @var array
188 * 206 *
189 * @ORM\Column(name="http_status", type="string", length=3, nullable=true) 207 * @ORM\Column(name="headers", type="array", nullable=true)
190 * 208 *
191 * @Groups({"entries_for_user", "export_all"}) 209 * @Groups({"entries_for_user", "export_all"})
192 */ 210 */
193 private $httpStatus; 211 private $headers;
194 212
195 /** 213 /**
196 * @Exclude 214 * @Exclude
@@ -532,23 +550,7 @@ class Entry
532 } 550 }
533 551
534 /** 552 /**
535 * @return bool 553 * @return ArrayCollection
536 */
537 public function isPublic()
538 {
539 return $this->isPublic;
540 }
541
542 /**
543 * @param bool $isPublic
544 */
545 public function setIsPublic($isPublic)
546 {
547 $this->isPublic = $isPublic;
548 }
549
550 /**
551 * @return ArrayCollection<Tag>
552 */ 554 */
553 public function getTags() 555 public function getTags()
554 { 556 {
@@ -683,7 +685,7 @@ class Entry
683 } 685 }
684 686
685 /** 687 /**
686 * @return int 688 * @return string
687 */ 689 */
688 public function getHttpStatus() 690 public function getHttpStatus()
689 { 691 {
@@ -691,7 +693,7 @@ class Entry
691 } 693 }
692 694
693 /** 695 /**
694 * @param int $httpStatus 696 * @param string $httpStatus
695 * 697 *
696 * @return Entry 698 * @return Entry
697 */ 699 */
@@ -701,4 +703,64 @@ class Entry
701 703
702 return $this; 704 return $this;
703 } 705 }
706
707 /**
708 * @return \Datetime
709 */
710 public function getPublishedAt()
711 {
712 return $this->publishedAt;
713 }
714
715 /**
716 * @param \Datetime $publishedAt
717 *
718 * @return Entry
719 */
720 public function setPublishedAt(\Datetime $publishedAt)
721 {
722 $this->publishedAt = $publishedAt;
723
724 return $this;
725 }
726
727 /**
728 * @return array
729 */
730 public function getPublishedBy()
731 {
732 return $this->publishedBy;
733 }
734
735 /**
736 * @param array $publishedBy
737 *
738 * @return Entry
739 */
740 public function setPublishedBy($publishedBy)
741 {
742 $this->publishedBy = $publishedBy;
743
744 return $this;
745 }
746
747 /**
748 * @return array
749 */
750 public function getHeaders()
751 {
752 return $this->headers;
753 }
754
755 /**
756 * @param array $headers
757 *
758 * @return Entry
759 */
760 public function setHeaders($headers)
761 {
762 $this->headers = $headers;
763
764 return $this;
765 }
704} 766}
diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
index 72651b19..84e11e26 100644
--- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php
+++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
@@ -31,7 +31,7 @@ class TaggingRule
31 * @Assert\Length(max=255) 31 * @Assert\Length(max=255)
32 * @RulerZAssert\ValidRule( 32 * @RulerZAssert\ValidRule(
33 * allowed_variables={"title", "url", "isArchived", "isStared", "content", "language", "mimetype", "readingTime", "domainName"}, 33 * allowed_variables={"title", "url", "isArchived", "isStared", "content", "language", "mimetype", "readingTime", "domainName"},
34 * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches"} 34 * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches", "notmatches"}
35 * ) 35 * )
36 * @ORM\Column(name="rule", type="string", nullable=false) 36 * @ORM\Column(name="rule", type="string", nullable=false)
37 */ 37 */
@@ -87,7 +87,7 @@ class TaggingRule
87 /** 87 /**
88 * Set tags. 88 * Set tags.
89 * 89 *
90 * @param array<string> $tags 90 * @param array <string> $tags
91 * 91 *
92 * @return TaggingRule 92 * @return TaggingRule
93 */ 93 */
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php
index 3b4c4cf9..5e6af8cc 100644
--- a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php
+++ b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php
@@ -45,9 +45,8 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber
45 public function preRemove(LifecycleEventArgs $args) 45 public function preRemove(LifecycleEventArgs $args)
46 { 46 {
47 $entity = $args->getEntity(); 47 $entity = $args->getEntity();
48 48 if (!$this->doctrine->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform
49 if (!$this->doctrine->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOSqlite\Driver || 49 || !$entity instanceof Entry) {
50 !$entity instanceof Entry) {
51 return; 50 return;
52 } 51 }
53 52
diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
index c3715646..1627cc44 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
@@ -3,7 +3,6 @@
3namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType; 6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\Extension\Core\Type\TextType; 7use Symfony\Component\Form\Extension\Core\Type\TextType;
9use Symfony\Component\Form\FormBuilderInterface; 8use Symfony\Component\Form\FormBuilderInterface;
@@ -18,11 +17,6 @@ class EditEntryType extends AbstractType
18 'required' => true, 17 'required' => true,
19 'label' => 'entry.edit.title_label', 18 'label' => 'entry.edit.title_label',
20 ]) 19 ])
21 ->add('is_public', CheckboxType::class, [
22 'required' => false,
23 'label' => 'entry.edit.is_public_label',
24 'property_path' => 'isPublic',
25 ])
26 ->add('url', TextType::class, [ 20 ->add('url', TextType::class, [
27 'disabled' => true, 21 'disabled' => true,
28 'required' => false, 22 'required' => false,
diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php
index 6d4129e8..1c56fa9f 100644
--- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php
+++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php
@@ -5,39 +5,39 @@ namespace Wallabag\CoreBundle\GuzzleSiteAuthenticator;
5use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfig; 5use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfig;
6use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfigBuilder; 6use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfigBuilder;
7use Graby\SiteConfig\ConfigBuilder; 7use Graby\SiteConfig\ConfigBuilder;
8use OutOfRangeException; 8use Psr\Log\LoggerInterface;
9 9
10class GrabySiteConfigBuilder implements SiteConfigBuilder 10class GrabySiteConfigBuilder implements SiteConfigBuilder
11{ 11{
12 /** 12 /**
13 * @var \Graby\SiteConfig\ConfigBuilder 13 * @var ConfigBuilder
14 */ 14 */
15 private $grabyConfigBuilder; 15 private $grabyConfigBuilder;
16 /** 16 /**
17 * @var array 17 * @var array
18 */ 18 */
19 private $credentials; 19 private $credentials;
20 /**
21 * @var LoggerInterface
22 */
23 private $logger;
20 24
21 /** 25 /**
22 * GrabySiteConfigBuilder constructor. 26 * GrabySiteConfigBuilder constructor.
23 * 27 *
24 * @param \Graby\SiteConfig\ConfigBuilder $grabyConfigBuilder 28 * @param ConfigBuilder $grabyConfigBuilder
25 * @param array $credentials 29 * @param array $credentials
30 * @param LoggerInterface $logger
26 */ 31 */
27 public function __construct(ConfigBuilder $grabyConfigBuilder, array $credentials = []) 32 public function __construct(ConfigBuilder $grabyConfigBuilder, array $credentials, LoggerInterface $logger)
28 { 33 {
29 $this->grabyConfigBuilder = $grabyConfigBuilder; 34 $this->grabyConfigBuilder = $grabyConfigBuilder;
30 $this->credentials = $credentials; 35 $this->credentials = $credentials;
36 $this->logger = $logger;
31 } 37 }
32 38
33 /** 39 /**
34 * Builds the SiteConfig for a host. 40 * {@inheritdoc}
35 *
36 * @param string $host The "www." prefix is ignored
37 *
38 * @return SiteConfig
39 *
40 * @throws OutOfRangeException If there is no config for $host
41 */ 41 */
42 public function buildForHost($host) 42 public function buildForHost($host)
43 { 43 {
@@ -47,6 +47,12 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
47 $host = substr($host, 4); 47 $host = substr($host, 4);
48 } 48 }
49 49
50 if (empty($this->credentials[$host])) {
51 $this->logger->debug('Auth: no credentials available for host.', ['host' => $host]);
52
53 return false;
54 }
55
50 $config = $this->grabyConfigBuilder->buildForHost($host); 56 $config = $this->grabyConfigBuilder->buildForHost($host);
51 $parameters = [ 57 $parameters = [
52 'host' => $host, 58 'host' => $host,
@@ -54,15 +60,46 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
54 'loginUri' => $config->login_uri ?: null, 60 'loginUri' => $config->login_uri ?: null,
55 'usernameField' => $config->login_username_field ?: null, 61 'usernameField' => $config->login_username_field ?: null,
56 'passwordField' => $config->login_password_field ?: null, 62 'passwordField' => $config->login_password_field ?: null,
57 'extraFields' => is_array($config->login_extra_fields) ? $config->login_extra_fields : [], 63 'extraFields' => $this->processExtraFields($config->login_extra_fields),
58 'notLoggedInXpath' => $config->not_logged_in_xpath ?: null, 64 'notLoggedInXpath' => $config->not_logged_in_xpath ?: null,
65 'username' => $this->credentials[$host]['username'],
66 'password' => $this->credentials[$host]['password'],
59 ]; 67 ];
60 68
61 if (isset($this->credentials[$host])) { 69 $config = new SiteConfig($parameters);
62 $parameters['username'] = $this->credentials[$host]['username']; 70
63 $parameters['password'] = $this->credentials[$host]['password']; 71 // do not leak password in log
72 $parameters['password'] = '**masked**';
73
74 $this->logger->debug('Auth: add parameters.', ['host' => $host, 'parameters' => $parameters]);
75
76 return $config;
77 }
78
79 /**
80 * Processes login_extra_fields config, transforming an '=' separated array of strings
81 * into a key/value array.
82 *
83 * @param array|mixed $extraFieldsStrings
84 *
85 * @return array
86 */
87 protected function processExtraFields($extraFieldsStrings)
88 {
89 if (!is_array($extraFieldsStrings)) {
90 return [];
91 }
92
93 $extraFields = [];
94 foreach ($extraFieldsStrings as $extraField) {
95 if (strpos($extraField, '=') === false) {
96 continue;
97 }
98
99 list($fieldName, $fieldValue) = explode('=', $extraField, 2);
100 $extraFields[$fieldName] = $fieldValue;
64 } 101 }
65 102
66 return new SiteConfig($parameters); 103 return $extraFields;
67 } 104 }
68} 105}
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index f222dd88..bfaa1976 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -5,9 +5,7 @@ namespace Wallabag\CoreBundle\Helper;
5use Graby\Graby; 5use Graby\Graby;
6use Psr\Log\LoggerInterface; 6use Psr\Log\LoggerInterface;
7use Wallabag\CoreBundle\Entity\Entry; 7use Wallabag\CoreBundle\Entity\Entry;
8use Wallabag\CoreBundle\Entity\Tag;
9use Wallabag\CoreBundle\Tools\Utils; 8use Wallabag\CoreBundle\Tools\Utils;
10use Wallabag\CoreBundle\Repository\TagRepository;
11use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeExtensionGuesser; 9use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeExtensionGuesser;
12 10
13/** 11/**
@@ -19,37 +17,34 @@ class ContentProxy
19 protected $graby; 17 protected $graby;
20 protected $tagger; 18 protected $tagger;
21 protected $logger; 19 protected $logger;
22 protected $tagRepository;
23 protected $mimeGuesser; 20 protected $mimeGuesser;
24 protected $fetchingErrorMessage; 21 protected $fetchingErrorMessage;
22 protected $eventDispatcher;
25 23
26 public function __construct(Graby $graby, RuleBasedTagger $tagger, TagRepository $tagRepository, LoggerInterface $logger, $fetchingErrorMessage) 24 public function __construct(Graby $graby, RuleBasedTagger $tagger, LoggerInterface $logger, $fetchingErrorMessage)
27 { 25 {
28 $this->graby = $graby; 26 $this->graby = $graby;
29 $this->tagger = $tagger; 27 $this->tagger = $tagger;
30 $this->logger = $logger; 28 $this->logger = $logger;
31 $this->tagRepository = $tagRepository;
32 $this->mimeGuesser = new MimeTypeExtensionGuesser(); 29 $this->mimeGuesser = new MimeTypeExtensionGuesser();
33 $this->fetchingErrorMessage = $fetchingErrorMessage; 30 $this->fetchingErrorMessage = $fetchingErrorMessage;
34 } 31 }
35 32
36 /** 33 /**
37 * Fetch content using graby and hydrate given entry with results information. 34 * Update entry using either fetched or provided content.
38 * In case we couldn't find content, we'll try to use Open Graph data.
39 * 35 *
40 * We can also force the content, in case of an import from the v1 for example, so the function won't 36 * @param Entry $entry Entry to update
41 * fetch the content from the website but rather use information given with the $content parameter. 37 * @param string $url Url of the content
42 * 38 * @param array $content Array with content provided for import with AT LEAST keys title, html, url to skip the fetchContent from the url
43 * @param Entry $entry Entry to update 39 * @param bool $disableContentUpdate Whether to skip trying to fetch content using Graby
44 * @param string $url Url to grab content for
45 * @param array $content An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url
46 *
47 * @return Entry
48 */ 40 */
49 public function updateEntry(Entry $entry, $url, array $content = []) 41 public function updateEntry(Entry $entry, $url, array $content = [], $disableContentUpdate = false)
50 { 42 {
51 // do we have to fetch the content or the provided one is ok? 43 if (!empty($content['html'])) {
52 if (empty($content) || false === $this->validateContent($content)) { 44 $content['html'] = $this->graby->cleanupHtml($content['html'], $url);
45 }
46
47 if ((empty($content) || false === $this->validateContent($content)) && false === $disableContentUpdate) {
53 $fetchedContent = $this->graby->fetchContent($url); 48 $fetchedContent = $this->graby->fetchContent($url);
54 49
55 // when content is imported, we have information in $content 50 // when content is imported, we have information in $content
@@ -59,8 +54,24 @@ class ContentProxy
59 } 54 }
60 } 55 }
61 56
57 // be sure to keep the url in case of error
58 // so we'll be able to refetch it in the future
59 $content['url'] = !empty($content['url']) ? $content['url'] : $url;
60
61 $this->stockEntry($entry, $content);
62 }
63
64 /**
65 * Stock entry with fetched or imported content.
66 * Will fall back to OpenGraph data if available.
67 *
68 * @param Entry $entry Entry to stock
69 * @param array $content Array with at least title, url & html
70 */
71 private function stockEntry(Entry $entry, array $content)
72 {
62 $title = $content['title']; 73 $title = $content['title'];
63 if (!$title && isset($content['open_graph']['og_title'])) { 74 if (!$title && !empty($content['open_graph']['og_title'])) {
64 $title = $content['open_graph']['og_title']; 75 $title = $content['open_graph']['og_title'];
65 } 76 }
66 77
@@ -68,17 +79,40 @@ class ContentProxy
68 if (false === $html) { 79 if (false === $html) {
69 $html = $this->fetchingErrorMessage; 80 $html = $this->fetchingErrorMessage;
70 81
71 if (isset($content['open_graph']['og_description'])) { 82 if (!empty($content['open_graph']['og_description'])) {
72 $html .= '<p><i>But we found a short description: </i></p>'; 83 $html .= '<p><i>But we found a short description: </i></p>';
73 $html .= $content['open_graph']['og_description']; 84 $html .= $content['open_graph']['og_description'];
74 } 85 }
75 } 86 }
76 87
77 $entry->setUrl($content['url'] ?: $url); 88 $entry->setUrl($content['url']);
78 $entry->setTitle($title); 89 $entry->setTitle($title);
79 $entry->setContent($html); 90 $entry->setContent($html);
80 $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); 91 $entry->setHttpStatus(isset($content['status']) ? $content['status'] : '');
81 92
93 if (!empty($content['date'])) {
94 $date = $content['date'];
95
96 // is it a timestamp?
97 if (filter_var($date, FILTER_VALIDATE_INT) !== false) {
98 $date = '@'.$content['date'];
99 }
100
101 try {
102 $entry->setPublishedAt(new \DateTime($date));
103 } catch (\Exception $e) {
104 $this->logger->warning('Error while defining date', ['e' => $e, 'url' => $content['url'], 'date' => $content['date']]);
105 }
106 }
107
108 if (!empty($content['authors'])) {
109 $entry->setPublishedBy($content['authors']);
110 }
111
112 if (!empty($content['all_headers'])) {
113 $entry->setHeaders($content['all_headers']);
114 }
115
82 $entry->setLanguage(isset($content['language']) ? $content['language'] : ''); 116 $entry->setLanguage(isset($content['language']) ? $content['language'] : '');
83 $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : ''); 117 $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : '');
84 $entry->setReadingTime(Utils::getReadingTime($html)); 118 $entry->setReadingTime(Utils::getReadingTime($html));
@@ -88,12 +122,12 @@ class ContentProxy
88 $entry->setDomainName($domainName); 122 $entry->setDomainName($domainName);
89 } 123 }
90 124
91 if (isset($content['open_graph']['og_image']) && $content['open_graph']['og_image']) { 125 if (!empty($content['open_graph']['og_image'])) {
92 $entry->setPreviewPicture($content['open_graph']['og_image']); 126 $entry->setPreviewPicture($content['open_graph']['og_image']);
93 } 127 }
94 128
95 // if content is an image define as a preview too 129 // if content is an image define as a preview too
96 if (isset($content['content_type']) && in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { 130 if (!empty($content['content_type']) && in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) {
97 $entry->setPreviewPicture($content['url']); 131 $entry->setPreviewPicture($content['url']);
98 } 132 }
99 133
@@ -101,65 +135,14 @@ class ContentProxy
101 $this->tagger->tag($entry); 135 $this->tagger->tag($entry);
102 } catch (\Exception $e) { 136 } catch (\Exception $e) {
103 $this->logger->error('Error while trying to automatically tag an entry.', [ 137 $this->logger->error('Error while trying to automatically tag an entry.', [
104 'entry_url' => $url, 138 'entry_url' => $content['url'],
105 'error_msg' => $e->getMessage(), 139 'error_msg' => $e->getMessage(),
106 ]); 140 ]);
107 } 141 }
108
109 return $entry;
110 }
111
112 /**
113 * Assign some tags to an entry.
114 *
115 * @param Entry $entry
116 * @param array|string $tags An array of tag or a string coma separated of tag
117 * @param array $entitiesReady Entities from the EntityManager which are persisted but not yet flushed
118 * It is mostly to fix duplicate tag on import @see http://stackoverflow.com/a/7879164/569101
119 */
120 public function assignTagsToEntry(Entry $entry, $tags, array $entitiesReady = [])
121 {
122 if (!is_array($tags)) {
123 $tags = explode(',', $tags);
124 }
125
126 // keeps only Tag entity from the "not yet flushed entities"
127 $tagsNotYetFlushed = [];
128 foreach ($entitiesReady as $entity) {
129 if ($entity instanceof Tag) {
130 $tagsNotYetFlushed[$entity->getLabel()] = $entity;
131 }
132 }
133
134 foreach ($tags as $label) {
135 $label = trim($label);
136
137 // avoid empty tag
138 if (0 === strlen($label)) {
139 continue;
140 }
141
142 if (isset($tagsNotYetFlushed[$label])) {
143 $tagEntity = $tagsNotYetFlushed[$label];
144 } else {
145 $tagEntity = $this->tagRepository->findOneByLabel($label);
146
147 if (is_null($tagEntity)) {
148 $tagEntity = new Tag();
149 $tagEntity->setLabel($label);
150 }
151 }
152
153 // only add the tag on the entry if the relation doesn't exist
154 if (false === $entry->getTags()->contains($tagEntity)) {
155 $entry->addTag($tagEntity);
156 }
157 }
158 } 142 }
159 143
160 /** 144 /**
161 * Validate that the given content as enough value to be used 145 * Validate that the given content has at least a title, an html and a url.
162 * instead of fetch the content from the url.
163 * 146 *
164 * @param array $content 147 * @param array $content
165 * 148 *
@@ -167,6 +150,6 @@ class ContentProxy
167 */ 150 */
168 private function validateContent(array $content) 151 private function validateContent(array $content)
169 { 152 {
170 return isset($content['title']) && isset($content['html']) && isset($content['url']) && isset($content['language']) && isset($content['content_type']); 153 return !empty($content['title']) && !empty($content['html']) && !empty($content['url']);
171 } 154 }
172} 155}
diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php
index 0d330d2a..54e23a05 100644
--- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php
+++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php
@@ -54,7 +54,7 @@ class DownloadImages
54 $crawler = new Crawler($html); 54 $crawler = new Crawler($html);
55 $result = $crawler 55 $result = $crawler
56 ->filterXpath('//img') 56 ->filterXpath('//img')
57 ->extract(array('src')); 57 ->extract(['src']);
58 58
59 $relativePath = $this->getRelativePath($entryId); 59 $relativePath = $this->getRelativePath($entryId);
60 60
@@ -66,6 +66,11 @@ class DownloadImages
66 continue; 66 continue;
67 } 67 }
68 68
69 // if image contains "&" and we can't find it in the html it might be because it's encoded as &amp;
70 if (false !== stripos($image, '&') && false === stripos($html, $image)) {
71 $image = str_replace('&', '&amp;', $image);
72 }
73
69 $html = str_replace($image, $imagePath, $html); 74 $html = str_replace($image, $imagePath, $html);
70 } 75 }
71 76
@@ -114,7 +119,7 @@ class DownloadImages
114 $ext = $this->mimeGuesser->guess($res->getHeader('content-type')); 119 $ext = $this->mimeGuesser->guess($res->getHeader('content-type'));
115 $this->logger->debug('DownloadImages: Checking extension', ['ext' => $ext, 'header' => $res->getHeader('content-type')]); 120 $this->logger->debug('DownloadImages: Checking extension', ['ext' => $ext, 'header' => $res->getHeader('content-type')]);
116 if (!in_array($ext, ['jpeg', 'jpg', 'gif', 'png'], true)) { 121 if (!in_array($ext, ['jpeg', 'jpg', 'gif', 'png'], true)) {
117 $this->logger->error('DownloadImages: Processed image with not allowed extension. Skipping '.$imagePath); 122 $this->logger->error('DownloadImages: Processed image with not allowed extension. Skipping: '.$imagePath);
118 123
119 return false; 124 return false;
120 } 125 }
diff --git a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
index 1ac8feb1..43f5b119 100644
--- a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
+++ b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
@@ -13,8 +13,8 @@ use Psr\Log\LoggerInterface;
13 */ 13 */
14class HttpClientFactory 14class HttpClientFactory
15{ 15{
16 /** @var \GuzzleHttp\Event\SubscriberInterface */ 16 /** @var [\GuzzleHttp\Event\SubscriberInterface] */
17 private $authenticatorSubscriber; 17 private $subscribers = [];
18 18
19 /** @var \GuzzleHttp\Cookie\CookieJar */ 19 /** @var \GuzzleHttp\Cookie\CookieJar */
20 private $cookieJar; 20 private $cookieJar;
@@ -25,14 +25,12 @@ class HttpClientFactory
25 /** 25 /**
26 * HttpClientFactory constructor. 26 * HttpClientFactory constructor.
27 * 27 *
28 * @param \GuzzleHttp\Event\SubscriberInterface $authenticatorSubscriber 28 * @param \GuzzleHttp\Cookie\CookieJar $cookieJar
29 * @param \GuzzleHttp\Cookie\CookieJar $cookieJar 29 * @param string $restrictedAccess This param is a kind of boolean. Values: 0 or 1
30 * @param string $restrictedAccess this param is a kind of boolean. Values: 0 or 1 30 * @param LoggerInterface $logger
31 * @param LoggerInterface $logger
32 */ 31 */
33 public function __construct(SubscriberInterface $authenticatorSubscriber, CookieJar $cookieJar, $restrictedAccess, LoggerInterface $logger) 32 public function __construct(CookieJar $cookieJar, $restrictedAccess, LoggerInterface $logger)
34 { 33 {
35 $this->authenticatorSubscriber = $authenticatorSubscriber;
36 $this->cookieJar = $cookieJar; 34 $this->cookieJar = $cookieJar;
37 $this->restrictedAccess = $restrictedAccess; 35 $this->restrictedAccess = $restrictedAccess;
38 $this->logger = $logger; 36 $this->logger = $logger;
@@ -53,8 +51,21 @@ class HttpClientFactory
53 $this->cookieJar->clear(); 51 $this->cookieJar->clear();
54 // need to set the (shared) cookie jar 52 // need to set the (shared) cookie jar
55 $client = new Client(['handler' => new SafeCurlHandler(), 'defaults' => ['cookies' => $this->cookieJar]]); 53 $client = new Client(['handler' => new SafeCurlHandler(), 'defaults' => ['cookies' => $this->cookieJar]]);
56 $client->getEmitter()->attach($this->authenticatorSubscriber); 54
55 foreach ($this->subscribers as $subscriber) {
56 $client->getEmitter()->attach($subscriber);
57 }
57 58
58 return $client; 59 return $client;
59 } 60 }
61
62 /**
63 * Adds a subscriber to the HTTP client.
64 *
65 * @param SubscriberInterface $subscriber
66 */
67 public function addSubscriber(SubscriberInterface $subscriber)
68 {
69 $this->subscribers[] = $subscriber;
70 }
60} 71}
diff --git a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php
index 7d3798b9..df579ebd 100644
--- a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php
+++ b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php
@@ -20,16 +20,15 @@ class PreparePagerForEntries
20 20
21 /** 21 /**
22 * @param AdapterInterface $adapter 22 * @param AdapterInterface $adapter
23 * @param int $page
24 * 23 *
25 * @return null|Pagerfanta 24 * @return null|Pagerfanta
26 */ 25 */
27 public function prepare(AdapterInterface $adapter, $page = 1) 26 public function prepare(AdapterInterface $adapter)
28 { 27 {
29 $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; 28 $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
30 29
31 if (null === $user || !is_object($user)) { 30 if (null === $user || !is_object($user)) {
32 return null; 31 return;
33 } 32 }
34 33
35 $entries = new Pagerfanta($adapter); 34 $entries = new Pagerfanta($adapter);
diff --git a/src/Wallabag/CoreBundle/Helper/Redirect.php b/src/Wallabag/CoreBundle/Helper/Redirect.php
index f78b7fe0..abc84d08 100644
--- a/src/Wallabag/CoreBundle/Helper/Redirect.php
+++ b/src/Wallabag/CoreBundle/Helper/Redirect.php
@@ -21,12 +21,13 @@ class Redirect
21 } 21 }
22 22
23 /** 23 /**
24 * @param string $url URL to redirect 24 * @param string $url URL to redirect
25 * @param string $fallback Fallback URL if $url is null 25 * @param string $fallback Fallback URL if $url is null
26 * @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read
26 * 27 *
27 * @return string 28 * @return string
28 */ 29 */
29 public function to($url, $fallback = '') 30 public function to($url, $fallback = '', $ignoreActionMarkAsRead = false)
30 { 31 {
31 $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null; 32 $user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
32 33
@@ -34,7 +35,8 @@ class Redirect
34 return $url; 35 return $url;
35 } 36 }
36 37
37 if (Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) { 38 if (!$ignoreActionMarkAsRead &&
39 Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) {
38 return $this->router->generate('homepage'); 40 return $this->router->generate('homepage');
39 } 41 }
40 42
diff --git a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
index b490e209..509d0dec 100644
--- a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
+++ b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
@@ -8,18 +8,21 @@ use Wallabag\CoreBundle\Entity\Tag;
8use Wallabag\CoreBundle\Repository\EntryRepository; 8use Wallabag\CoreBundle\Repository\EntryRepository;
9use Wallabag\CoreBundle\Repository\TagRepository; 9use Wallabag\CoreBundle\Repository\TagRepository;
10use Wallabag\UserBundle\Entity\User; 10use Wallabag\UserBundle\Entity\User;
11use Psr\Log\LoggerInterface;
11 12
12class RuleBasedTagger 13class RuleBasedTagger
13{ 14{
14 private $rulerz; 15 private $rulerz;
15 private $tagRepository; 16 private $tagRepository;
16 private $entryRepository; 17 private $entryRepository;
18 private $logger;
17 19
18 public function __construct(RulerZ $rulerz, TagRepository $tagRepository, EntryRepository $entryRepository) 20 public function __construct(RulerZ $rulerz, TagRepository $tagRepository, EntryRepository $entryRepository, LoggerInterface $logger)
19 { 21 {
20 $this->rulerz = $rulerz; 22 $this->rulerz = $rulerz;
21 $this->tagRepository = $tagRepository; 23 $this->tagRepository = $tagRepository;
22 $this->entryRepository = $entryRepository; 24 $this->entryRepository = $entryRepository;
25 $this->logger = $logger;
23 } 26 }
24 27
25 /** 28 /**
@@ -36,6 +39,11 @@ class RuleBasedTagger
36 continue; 39 continue;
37 } 40 }
38 41
42 $this->logger->info('Matching rule.', [
43 'rule' => $rule->getRule(),
44 'tags' => $rule->getTags(),
45 ]);
46
39 foreach ($rule->getTags() as $label) { 47 foreach ($rule->getTags() as $label) {
40 $tag = $this->getTag($label); 48 $tag = $this->getTag($label);
41 49
diff --git a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php
new file mode 100644
index 00000000..a2fb0b9a
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php
@@ -0,0 +1,75 @@
1<?php
2
3namespace Wallabag\CoreBundle\Helper;
4
5use Wallabag\CoreBundle\Entity\Entry;
6use Wallabag\CoreBundle\Entity\Tag;
7use Wallabag\CoreBundle\Repository\TagRepository;
8
9class TagsAssigner
10{
11 /**
12 * @var TagRepository
13 */
14 protected $tagRepository;
15
16 public function __construct(TagRepository $tagRepository)
17 {
18 $this->tagRepository = $tagRepository;
19 }
20
21 /**
22 * Assign some tags to an entry.
23 *
24 * @param Entry $entry
25 * @param array|string $tags An array of tag or a string coma separated of tag
26 * @param array $entitiesReady Entities from the EntityManager which are persisted but not yet flushed
27 * It is mostly to fix duplicate tag on import @see http://stackoverflow.com/a/7879164/569101
28 *
29 * @return Tag[]
30 */
31 public function assignTagsToEntry(Entry $entry, $tags, array $entitiesReady = [])
32 {
33 $tagsEntities = [];
34
35 if (!is_array($tags)) {
36 $tags = explode(',', $tags);
37 }
38
39 // keeps only Tag entity from the "not yet flushed entities"
40 $tagsNotYetFlushed = [];
41 foreach ($entitiesReady as $entity) {
42 if ($entity instanceof Tag) {
43 $tagsNotYetFlushed[$entity->getLabel()] = $entity;
44 }
45 }
46
47 foreach ($tags as $label) {
48 $label = trim($label);
49
50 // avoid empty tag
51 if (0 === strlen($label)) {
52 continue;
53 }
54
55 if (isset($tagsNotYetFlushed[$label])) {
56 $tagEntity = $tagsNotYetFlushed[$label];
57 } else {
58 $tagEntity = $this->tagRepository->findOneByLabel($label);
59
60 if (null === $tagEntity) {
61 $tagEntity = new Tag();
62 $tagEntity->setLabel($label);
63 }
64 }
65
66 // only add the tag on the entry if the relation doesn't exist
67 if (false === $entry->getTags()->contains($tagEntity)) {
68 $entry->addTag($tagEntity);
69 $tagsEntities[] = $tagEntity;
70 }
71 }
72
73 return $tagsEntities;
74 }
75}
diff --git a/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php
new file mode 100644
index 00000000..b7f9da57
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php
@@ -0,0 +1,25 @@
1<?php
2
3namespace Wallabag\CoreBundle\Operator\Doctrine;
4
5/**
6 * Provides a "notmatches" operator used for tagging rules.
7 *
8 * It asserts that a given pattern is not contained in a subject, in a
9 * case-insensitive way.
10 *
11 * This operator will be used to compile tagging rules in DQL, usable
12 * by Doctrine ORM.
13 * It's registered in RulerZ using a service (wallabag.operator.doctrine.notmatches);
14 */
15class NotMatches
16{
17 public function __invoke($subject, $pattern)
18 {
19 if ($pattern[0] === "'") {
20 $pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1));
21 }
22
23 return sprintf('UPPER(%s) NOT LIKE UPPER(%s)', $subject, $pattern);
24 }
25}
diff --git a/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php
new file mode 100644
index 00000000..68b2676f
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php
@@ -0,0 +1,21 @@
1<?php
2
3namespace Wallabag\CoreBundle\Operator\PHP;
4
5/**
6 * Provides a "notmatches" operator used for tagging rules.
7 *
8 * It asserts that a given pattern is not contained in a subject, in a
9 * case-insensitive way.
10 *
11 * This operator will be used to compile tagging rules in PHP, usable
12 * directly on Entry objects for instance.
13 * It's registered in RulerZ using a service (wallabag.operator.array.notmatches);
14 */
15class NotMatches
16{
17 public function __invoke($subject, $pattern)
18 {
19 return stripos($subject, $pattern) === false;
20 }
21}
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index 4071301d..6972e974 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -328,7 +328,7 @@ class EntryRepository extends EntityRepository
328 * 328 *
329 * @return int 329 * @return int
330 */ 330 */
331 public function countAllEntriesByUsername($userId) 331 public function countAllEntriesByUser($userId)
332 { 332 {
333 $qb = $this->createQueryBuilder('e') 333 $qb = $this->createQueryBuilder('e')
334 ->select('count(e)') 334 ->select('count(e)')
@@ -371,4 +371,42 @@ class EntryRepository extends EntityRepository
371 ->setParameter('userId', $userId) 371 ->setParameter('userId', $userId)
372 ->execute(); 372 ->execute();
373 } 373 }
374
375 public function removeArchivedByUserId($userId)
376 {
377 $this->getEntityManager()
378 ->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.user = :userId AND e.isArchived = TRUE')
379 ->setParameter('userId', $userId)
380 ->execute();
381 }
382
383 /**
384 * Get id and url from all entries
385 * Used for the clean-duplicates command.
386 */
387 public function getAllEntriesIdAndUrl($userId)
388 {
389 $qb = $this->createQueryBuilder('e')
390 ->select('e.id, e.url')
391 ->where('e.user = :userid')->setParameter(':userid', $userId);
392
393 return $qb->getQuery()->getArrayResult();
394 }
395
396 /**
397 * Find all entries by url and owner.
398 *
399 * @param $url
400 * @param $userId
401 *
402 * @return array
403 */
404 public function findAllByUrlAndUserId($url, $userId)
405 {
406 return $this->createQueryBuilder('e')
407 ->where('e.url = :url')->setParameter('url', urldecode($url))
408 ->andWhere('e.user = :user_id')->setParameter('user_id', $userId)
409 ->getQuery()
410 ->getResult();
411 }
374} 412}
diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php
index 2182df25..6c63a6a2 100644
--- a/src/Wallabag/CoreBundle/Repository/TagRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php
@@ -76,4 +76,24 @@ class TagRepository extends EntityRepository
76 ->getQuery() 76 ->getQuery()
77 ->getSingleResult(); 77 ->getSingleResult();
78 } 78 }
79
80 public function findForArchivedArticlesByUser($userId)
81 {
82 $ids = $this->createQueryBuilder('t')
83 ->select('t.id')
84 ->leftJoin('t.entries', 'e')
85 ->where('e.user = :userId')->setParameter('userId', $userId)
86 ->andWhere('e.isArchived = true')
87 ->groupBy('t.id')
88 ->orderBy('t.slug')
89 ->getQuery()
90 ->getArrayResult();
91
92 $tags = [];
93 foreach ($ids as $id) {
94 $tags[] = $this->find($id);
95 }
96
97 return $tags;
98 }
79} 99}
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 51d6ab47..a9b0d2d5 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -41,6 +41,7 @@ services:
41 arguments: 41 arguments:
42 - 42 -
43 error_message: '%wallabag_core.fetching_error_message%' 43 error_message: '%wallabag_core.fetching_error_message%'
44 error_message_title: '%wallabag_core.fetching_error_message_title%'
44 - "@wallabag_core.guzzle.http_client" 45 - "@wallabag_core.guzzle.http_client"
45 - "@wallabag_core.graby.config_builder" 46 - "@wallabag_core.graby.config_builder"
46 calls: 47 calls:
@@ -63,6 +64,9 @@ services:
63 arguments: 64 arguments:
64 - "@wallabag_core.graby.config_builder" 65 - "@wallabag_core.graby.config_builder"
65 - "%sites_credentials%" 66 - "%sites_credentials%"
67 - '@logger'
68 tags:
69 - { name: monolog.logger, channel: graby }
66 70
67 # service alias override 71 # service alias override
68 bd_guzzle_site_authenticator.site_config_builder: 72 bd_guzzle_site_authenticator.site_config_builder:
@@ -71,10 +75,11 @@ services:
71 wallabag_core.guzzle.http_client_factory: 75 wallabag_core.guzzle.http_client_factory:
72 class: Wallabag\CoreBundle\Helper\HttpClientFactory 76 class: Wallabag\CoreBundle\Helper\HttpClientFactory
73 arguments: 77 arguments:
74 - "@bd_guzzle_site_authenticator.authenticator_subscriber"
75 - "@wallabag_core.guzzle.cookie_jar" 78 - "@wallabag_core.guzzle.cookie_jar"
76 - '@=service(''craue_config'').get(''restricted_access'')' 79 - '@=service(''craue_config'').get(''restricted_access'')'
77 - '@logger' 80 - '@logger'
81 calls:
82 - ["addSubscriber", ["@bd_guzzle_site_authenticator.authenticator_subscriber"]]
78 83
79 wallabag_core.guzzle.cookie_jar: 84 wallabag_core.guzzle.cookie_jar:
80 class: GuzzleHttp\Cookie\FileCookieJar 85 class: GuzzleHttp\Cookie\FileCookieJar
@@ -85,16 +90,21 @@ services:
85 arguments: 90 arguments:
86 - "@wallabag_core.graby" 91 - "@wallabag_core.graby"
87 - "@wallabag_core.rule_based_tagger" 92 - "@wallabag_core.rule_based_tagger"
88 - "@wallabag_core.tag_repository"
89 - "@logger" 93 - "@logger"
90 - '%wallabag_core.fetching_error_message%' 94 - '%wallabag_core.fetching_error_message%'
91 95
96 wallabag_core.tags_assigner:
97 class: Wallabag\CoreBundle\Helper\TagsAssigner
98 arguments:
99 - "@wallabag_core.tag_repository"
100
92 wallabag_core.rule_based_tagger: 101 wallabag_core.rule_based_tagger:
93 class: Wallabag\CoreBundle\Helper\RuleBasedTagger 102 class: Wallabag\CoreBundle\Helper\RuleBasedTagger
94 arguments: 103 arguments:
95 - "@rulerz" 104 - "@rulerz"
96 - "@wallabag_core.tag_repository" 105 - "@wallabag_core.tag_repository"
97 - "@wallabag_core.entry_repository" 106 - "@wallabag_core.entry_repository"
107 - "@logger"
98 108
99 # repository as a service 109 # repository as a service
100 wallabag_core.entry_repository: 110 wallabag_core.entry_repository:
@@ -125,6 +135,16 @@ services:
125 tags: 135 tags:
126 - { name: rulerz.operator, target: doctrine, operator: matches, inline: true } 136 - { name: rulerz.operator, target: doctrine, operator: matches, inline: true }
127 137
138 wallabag.operator.array.notmatches:
139 class: Wallabag\CoreBundle\Operator\PHP\NotMatches
140 tags:
141 - { name: rulerz.operator, target: native, operator: notmatches }
142
143 wallabag.operator.doctrine.notmatches:
144 class: Wallabag\CoreBundle\Operator\Doctrine\NotMatches
145 tags:
146 - { name: rulerz.operator, target: doctrine, operator: notmatches, inline: true }
147
128 wallabag_core.helper.redirect: 148 wallabag_core.helper.redirect:
129 class: Wallabag\CoreBundle\Helper\Redirect 149 class: Wallabag\CoreBundle\Helper\Redirect
130 arguments: 150 arguments:
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index 67421942..3e64af8f 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -110,6 +110,7 @@ config:
110 # annotations: Remove ALL annotations 110 # annotations: Remove ALL annotations
111 # tags: Remove ALL tags 111 # tags: Remove ALL tags
112 # entries: Remove ALL entries 112 # entries: Remove ALL entries
113 # archived: Remove ALL archived entries
113 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) 114 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE)
114 form_password: 115 form_password:
115 # description: "You can change your password here. Your new password should by at least 8 characters long." 116 # description: "You can change your password here. Your new password should by at least 8 characters long."
@@ -154,7 +155,7 @@ config:
154 # or: 'One rule OR another' 155 # or: 'One rule OR another'
155 # and: 'One rule AND another' 156 # and: 'One rule AND another'
156 # matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>' 157 # matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
157 158 # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
158entry: 159entry:
159 page_titles: 160 page_titles:
160 # unread: 'Unread entries' 161 # unread: 'Unread entries'
@@ -223,6 +224,8 @@ entry:
223 original_article: 'original' 224 original_article: 'original'
224 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations' 225 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
225 created_at: 'Oprettelsesdato' 226 created_at: 'Oprettelsesdato'
227 # published_at: 'Publication date'
228 # published_by: 'Published by'
226 new: 229 new:
227 page_title: 'Gem ny artikel' 230 page_title: 'Gem ny artikel'
228 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
@@ -234,10 +237,12 @@ entry:
234 # page_title: 'Edit an entry' 237 # page_title: 'Edit an entry'
235 # title_label: 'Title' 238 # title_label: 'Title'
236 url_label: 'Url' 239 url_label: 'Url'
237 # is_public_label: 'Public'
238 save_label: 'Gem' 240 save_label: 'Gem'
239 public: 241 public:
240 # shared_by_wallabag: "This article has been shared by <a href=%wallabag_instance%'>wallabag</a>" 242 # shared_by_wallabag: "This article has been shared by <a href=%wallabag_instance%'>wallabag</a>"
243 confirm:
244 # delete: "Are you sure you want to remove that article?"
245 # delete_tag: "Are you sure you want to remove that tag from that article?"
241 246
242about: 247about:
243 page_title: 'Om' 248 page_title: 'Om'
@@ -510,6 +515,8 @@ user:
510 # delete: Delete 515 # delete: Delete
511 # delete_confirm: Are you sure? 516 # delete_confirm: Are you sure?
512 # back_to_list: Back to list 517 # back_to_list: Back to list
518 search:
519 # placeholder: Filter by username or email
513 520
514error: 521error:
515 # page_title: An error occurred 522 # page_title: An error occurred
@@ -528,6 +535,7 @@ flashes:
528 # annotations_reset: Annotations reset 535 # annotations_reset: Annotations reset
529 # tags_reset: Tags reset 536 # tags_reset: Tags reset
530 # entries_reset: Entries reset 537 # entries_reset: Entries reset
538 # archived_reset: Archived entries deleted
531 entry: 539 entry:
532 notice: 540 notice:
533 # entry_already_saved: 'Entry already saved on %date%' 541 # entry_already_saved: 'Entry already saved on %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index 35cb4b5b..00468575 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -110,6 +110,7 @@ config:
110 annotations: Entferne ALLE Annotationen 110 annotations: Entferne ALLE Annotationen
111 tags: Entferne ALLE Tags 111 tags: Entferne ALLE Tags
112 entries: Entferne ALLE Einträge 112 entries: Entferne ALLE Einträge
113 archived: Entferne ALLE archivierten Einträge
113 confirm: Bist du wirklich sicher? (DIES KANN NICHT RÜCKGÄNGIG GEMACHT WERDEN) 114 confirm: Bist du wirklich sicher? (DIES KANN NICHT RÜCKGÄNGIG GEMACHT WERDEN)
114 form_password: 115 form_password:
115 description: "Hier kannst du dein Kennwort ändern. Dieses sollte mindestens acht Zeichen enthalten." 116 description: "Hier kannst du dein Kennwort ändern. Dieses sollte mindestens acht Zeichen enthalten."
@@ -154,6 +155,7 @@ config:
154 or: 'Eine Regel ODER die andere' 155 or: 'Eine Regel ODER die andere'
155 and: 'Eine Regel UND eine andere' 156 and: 'Eine Regel UND eine andere'
156 matches: 'Testet, ob eine <i>Variable</i> auf eine <i>Suche</i> zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).<br />Beispiel: <code>title matches "Fußball"</code>' 157 matches: 'Testet, ob eine <i>Variable</i> auf eine <i>Suche</i> zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).<br />Beispiel: <code>title matches "Fußball"</code>'
158 notmatches: 'Testet, ob ein <i>Titel</i> nicht auf eine <i>Suche</i> zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).<br />Beispiel: <code>title notmatches "Fußball"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -223,6 +225,8 @@ entry:
223 original_article: 'original' 225 original_article: 'original'
224 annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %count% Anmerkungen' 226 annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %count% Anmerkungen'
225 created_at: 'Erstellungsdatum' 227 created_at: 'Erstellungsdatum'
228 published_at: 'Erscheinungsdatum'
229 published_by: 'Veröffentlicht von'
226 new: 230 new:
227 page_title: 'Neuen Artikel speichern' 231 page_title: 'Neuen Artikel speichern'
228 placeholder: 'https://website.de' 232 placeholder: 'https://website.de'
@@ -234,10 +238,12 @@ entry:
234 page_title: 'Eintrag bearbeiten' 238 page_title: 'Eintrag bearbeiten'
235 title_label: 'Titel' 239 title_label: 'Titel'
236 url_label: 'URL' 240 url_label: 'URL'
237 is_public_label: 'Öffentlich'
238 save_label: 'Speichern' 241 save_label: 'Speichern'
239 public: 242 public:
240 shared_by_wallabag: "Dieser Artikel wurde mittels <a href='%wallabag_instance%'>wallabag</a> geteilt" 243 shared_by_wallabag: "Dieser Artikel wurde mittels <a href='%wallabag_instance%'>wallabag</a> geteilt"
244 confirm:
245 delete: "Bist du sicher, dass du diesen Artikel löschen möchtest?"
246 delete_tag: "Bist du sicher, dass du diesen Tag vom Artikel entfernen möchtest?"
241 247
242about: 248about:
243 page_title: 'Ãœber' 249 page_title: 'Ãœber'
@@ -510,6 +516,8 @@ user:
510 delete: Löschen 516 delete: Löschen
511 delete_confirm: Bist du sicher? 517 delete_confirm: Bist du sicher?
512 back_to_list: Zurück zur Liste 518 back_to_list: Zurück zur Liste
519 search:
520 placeholder: Filtere nach Benutzer oder E-Mail-Adresse
513 521
514error: 522error:
515 page_title: Ein Fehler ist aufgetreten 523 page_title: Ein Fehler ist aufgetreten
@@ -528,6 +536,7 @@ flashes:
528 annotations_reset: Anmerkungen zurücksetzen 536 annotations_reset: Anmerkungen zurücksetzen
529 tags_reset: Tags zurücksetzen 537 tags_reset: Tags zurücksetzen
530 entries_reset: Einträge zurücksetzen 538 entries_reset: Einträge zurücksetzen
539 archived_reset: Archiverte Einträge zurücksetzen
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: 'Eintrag bereits am %date% gespeichert' 542 entry_already_saved: 'Eintrag bereits am %date% gespeichert'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index e0ef3212..8703a0e5 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -110,6 +110,7 @@ config:
110 annotations: Remove ALL annotations 110 annotations: Remove ALL annotations
111 tags: Remove ALL tags 111 tags: Remove ALL tags
112 entries: Remove ALL entries 112 entries: Remove ALL entries
113 archived: Remove ALL archived entries
113 confirm: Are you really sure? (THIS CAN'T BE UNDONE) 114 confirm: Are you really sure? (THIS CAN'T BE UNDONE)
114 form_password: 115 form_password:
115 description: "You can change your password here. Your new password should by at least 8 characters long." 116 description: "You can change your password here. Your new password should by at least 8 characters long."
@@ -154,6 +155,7 @@ config:
154 or: 'One rule OR another' 155 or: 'One rule OR another'
155 and: 'One rule AND another' 156 and: 'One rule AND another'
156 matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>' 157 matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
158 notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -223,6 +225,8 @@ entry:
223 original_article: 'original' 225 original_article: 'original'
224 annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations' 226 annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
225 created_at: 'Creation date' 227 created_at: 'Creation date'
228 published_at: 'Publication date'
229 published_by: 'Published by'
226 new: 230 new:
227 page_title: 'Save new entry' 231 page_title: 'Save new entry'
228 placeholder: 'http://website.com' 232 placeholder: 'http://website.com'
@@ -234,10 +238,12 @@ entry:
234 page_title: 'Edit an entry' 238 page_title: 'Edit an entry'
235 title_label: 'Title' 239 title_label: 'Title'
236 url_label: 'Url' 240 url_label: 'Url'
237 is_public_label: 'Public'
238 save_label: 'Save' 241 save_label: 'Save'
239 public: 242 public:
240 shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>" 243 shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
244 confirm:
245 delete: "Are you sure you want to remove that article?"
246 delete_tag: "Are you sure you want to remove that tag from that article?"
241 247
242about: 248about:
243 page_title: 'About' 249 page_title: 'About'
@@ -510,6 +516,8 @@ user:
510 delete: Delete 516 delete: Delete
511 delete_confirm: Are you sure? 517 delete_confirm: Are you sure?
512 back_to_list: Back to list 518 back_to_list: Back to list
519 search:
520 placeholder: Filter by username or email
513 521
514error: 522error:
515 page_title: An error occurred 523 page_title: An error occurred
@@ -528,6 +536,7 @@ flashes:
528 annotations_reset: Annotations reset 536 annotations_reset: Annotations reset
529 tags_reset: Tags reset 537 tags_reset: Tags reset
530 entries_reset: Entries reset 538 entries_reset: Entries reset
539 archived_reset: Archived entries deleted
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: 'Entry already saved on %date%' 542 entry_already_saved: 'Entry already saved on %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index 2f769b7e..0f2a4a7b 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -110,6 +110,7 @@ config:
110 annotations: Eliminar TODAS las anotaciones 110 annotations: Eliminar TODAS las anotaciones
111 tags: Eliminar TODAS las etiquetas 111 tags: Eliminar TODAS las etiquetas
112 entries: Eliminar TODOS los artículos 112 entries: Eliminar TODOS los artículos
113 # archived: Remove ALL archived entries
113 confirm: ¿Estás completamente seguro? (NO SE PUEDE DESHACER) 114 confirm: ¿Estás completamente seguro? (NO SE PUEDE DESHACER)
114 form_password: 115 form_password:
115 description: "Puedes cambiar la contraseña aquí. Tu nueva contraseña debe tener al menos 8 caracteres." 116 description: "Puedes cambiar la contraseña aquí. Tu nueva contraseña debe tener al menos 8 caracteres."
@@ -154,6 +155,7 @@ config:
154 or: 'Una regla U otra' 155 or: 'Una regla U otra'
155 and: 'Una regla Y la otra' 156 and: 'Una regla Y la otra'
156 matches: 'Prueba si un <i>sujeto</i> corresponde a una <i>búsqueda</i> (insensible a mayusculas).<br />Ejemplo : <code>title matches "fútbol"</code>' 157 matches: 'Prueba si un <i>sujeto</i> corresponde a una <i>búsqueda</i> (insensible a mayusculas).<br />Ejemplo : <code>title matches "fútbol"</code>'
158 # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -223,6 +225,8 @@ entry:
223 original_article: 'original' 225 original_article: 'original'
224 annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %count% anotaciones' 226 annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %count% anotaciones'
225 created_at: 'Fecha de creación' 227 created_at: 'Fecha de creación'
228 # published_at: 'Publication date'
229 # published_by: 'Published by'
226 new: 230 new:
227 page_title: 'Guardar un nuevo artículo' 231 page_title: 'Guardar un nuevo artículo'
228 placeholder: 'http://sitioweb.com' 232 placeholder: 'http://sitioweb.com'
@@ -234,10 +238,12 @@ entry:
234 page_title: 'Editar un artículo' 238 page_title: 'Editar un artículo'
235 title_label: 'Título' 239 title_label: 'Título'
236 url_label: 'URL' 240 url_label: 'URL'
237 is_public_label: 'Es público'
238 save_label: 'Guardar' 241 save_label: 'Guardar'
239 public: 242 public:
240 shared_by_wallabag: "Este artículo se ha compartido con <a href='%wallabag_instance%'>wallabag</a>" 243 shared_by_wallabag: "Este artículo se ha compartido con <a href='%wallabag_instance%'>wallabag</a>"
244 confirm:
245 # delete: "Are you sure you want to remove that article?"
246 # delete_tag: "Are you sure you want to remove that tag from that article?"
241 247
242about: 248about:
243 page_title: 'Acerca de' 249 page_title: 'Acerca de'
@@ -510,6 +516,8 @@ user:
510 delete: Eliminar 516 delete: Eliminar
511 delete_confirm: ¿Estás seguro? 517 delete_confirm: ¿Estás seguro?
512 back_to_list: Volver a la lista 518 back_to_list: Volver a la lista
519 search:
520 # placeholder: Filter by username or email
513 521
514error: 522error:
515 page_title: Ha ocurrido un error 523 page_title: Ha ocurrido un error
@@ -528,6 +536,7 @@ flashes:
528 annotations_reset: Anotaciones reiniciadas 536 annotations_reset: Anotaciones reiniciadas
529 tags_reset: Etiquetas reiniciadas 537 tags_reset: Etiquetas reiniciadas
530 entries_reset: Artículos reiniciados 538 entries_reset: Artículos reiniciados
539 # archived_reset: Archived entries deleted
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: 'Artículo ya guardado el %fecha%' 542 entry_already_saved: 'Artículo ya guardado el %fecha%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index d9d76b32..ec7a4362 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -110,6 +110,7 @@ config:
110 # annotations: Remove ALL annotations 110 # annotations: Remove ALL annotations
111 # tags: Remove ALL tags 111 # tags: Remove ALL tags
112 # entries: Remove ALL entries 112 # entries: Remove ALL entries
113 # archived: Remove ALL archived entries
113 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) 114 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE)
114 form_password: 115 form_password:
115 # description: "You can change your password here. Your new password should by at least 8 characters long." 116 # description: "You can change your password here. Your new password should by at least 8 characters long."
@@ -154,6 +155,7 @@ config:
154 # or: 'One rule OR another' 155 # or: 'One rule OR another'
155 # and: 'One rule AND another' 156 # and: 'One rule AND another'
156 # matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>' 157 # matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
158 # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -223,6 +225,8 @@ entry:
223 original_article: 'اصلی' 225 original_article: 'اصلی'
224 annotations_on_the_entry: '{0} بدون حاشیه|{1} یک حاشیه|]1,Inf[ %nbحاشیه% annotations' 226 annotations_on_the_entry: '{0} بدون حاشیه|{1} یک حاشیه|]1,Inf[ %nbحاشیه% annotations'
225 created_at: 'زمان ساخت' 227 created_at: 'زمان ساخت'
228 # published_at: 'Publication date'
229 # published_by: 'Published by'
226 new: 230 new:
227 page_title: 'ذخیرهٔ مقالهٔ تازه' 231 page_title: 'ذخیرهٔ مقالهٔ تازه'
228 placeholder: 'http://website.com' 232 placeholder: 'http://website.com'
@@ -234,10 +238,12 @@ entry:
234 page_title: 'ویرایش مقاله' 238 page_title: 'ویرایش مقاله'
235 title_label: 'عنوان' 239 title_label: 'عنوان'
236 url_label: 'نشانی' 240 url_label: 'نشانی'
237 is_public_label: 'عمومی'
238 save_label: 'ذخیره' 241 save_label: 'ذخیره'
239 public: 242 public:
240 # shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>" 243 # shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
244 confirm:
245 # delete: "Are you sure you want to remove that article?"
246 # delete_tag: "Are you sure you want to remove that tag from that article?"
241 247
242about: 248about:
243 page_title: 'درباره' 249 page_title: 'درباره'
@@ -510,6 +516,8 @@ user:
510 # delete: Delete 516 # delete: Delete
511 # delete_confirm: Are you sure? 517 # delete_confirm: Are you sure?
512 # back_to_list: Back to list 518 # back_to_list: Back to list
519 search:
520 # placeholder: Filter by username or email
513 521
514error: 522error:
515 # page_title: An error occurred 523 # page_title: An error occurred
@@ -528,6 +536,7 @@ flashes:
528 # annotations_reset: Annotations reset 536 # annotations_reset: Annotations reset
529 # tags_reset: Tags reset 537 # tags_reset: Tags reset
530 # entries_reset: Entries reset 538 # entries_reset: Entries reset
539 # archived_reset: Archived entries deleted
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: 'این مقاله در تاریخ %date% ذخیره شده بود' 542 entry_already_saved: 'این مقاله در تاریخ %date% ذخیره شده بود'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index efddc46a..6969b67b 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -46,7 +46,7 @@ footer:
46 social: "Social" 46 social: "Social"
47 powered_by: "propulsé par" 47 powered_by: "propulsé par"
48 about: "À propos" 48 about: "À propos"
49 stats: Depuis le %user_creation%, vous avez lu %nb_archives% articles. Ce qui fait %per_day% par jour ! 49 stats: "Depuis le %user_creation%, vous avez lu %nb_archives% articles. Ce qui fait %per_day% par jour !"
50 50
51config: 51config:
52 page_title: "Configuration" 52 page_title: "Configuration"
@@ -71,16 +71,16 @@ config:
71 300_word: "Je lis environ 300 mots par minute" 71 300_word: "Je lis environ 300 mots par minute"
72 400_word: "Je lis environ 400 mots par minute" 72 400_word: "Je lis environ 400 mots par minute"
73 action_mark_as_read: 73 action_mark_as_read:
74 label: 'Où souhaitez-vous être redirigé après avoir marqué un article comme lu ?' 74 label: "Où souhaitez-vous être redirigé après avoir marqué un article comme lu ?"
75 redirect_homepage: "À la page d'accueil" 75 redirect_homepage: "À la page d’accueil"
76 redirect_current_page: 'À la page courante' 76 redirect_current_page: "À la page courante"
77 pocket_consumer_key_label: Clé d’authentification Pocket pour importer les données 77 pocket_consumer_key_label: "Clé d’authentification Pocket pour importer les données"
78 android_configuration: Configurez votre application Android 78 android_configuration: "Configurez votre application Android"
79 help_theme: "L'affichage de wallabag est personnalisable. C'est ici que vous choisissez le thème que vous préférez." 79 help_theme: "L’affichage de wallabag est personnalisable. C’est ici que vous choisissez le thème que vous préférez."
80 help_items_per_page: "Vous pouvez définir le nombre d'articles affichés sur chaque page." 80 help_items_per_page: "Vous pouvez définir le nombre d’articles affichés sur chaque page."
81 help_reading_speed: "wallabag calcule une durée de lecture pour chaque article. Vous pouvez définir ici, grâce à cette liste déroulante, si vous lisez plus ou moins vite. wallabag recalculera la durée de lecture de chaque article." 81 help_reading_speed: "wallabag calcule une durée de lecture pour chaque article. Vous pouvez définir ici, grâce à cette liste déroulante, si vous lisez plus ou moins vite. wallabag recalculera la durée de lecture de chaque article."
82 help_language: "Vous pouvez définir la langue de l'interface de wallabag." 82 help_language: "Vous pouvez définir la langue de l’interface de wallabag."
83 help_pocket_consumer_key: "Nécessaire pour l'import depuis Pocket. Vous pouvez le créer depuis votre compte Pocket." 83 help_pocket_consumer_key: "Nécessaire pour l’import depuis Pocket. Vous pouvez le créer depuis votre compte Pocket."
84 form_rss: 84 form_rss:
85 description: "Les flux RSS fournis par wallabag vous permettent de lire vos articles sauvegardés dans votre lecteur de flux préféré. Pour pouvoir les utiliser, vous devez d’abord créer un jeton." 85 description: "Les flux RSS fournis par wallabag vous permettent de lire vos articles sauvegardés dans votre lecteur de flux préféré. Pour pouvoir les utiliser, vous devez d’abord créer un jeton."
86 token_label: "Jeton RSS" 86 token_label: "Jeton RSS"
@@ -100,17 +100,18 @@ config:
100 twoFactorAuthentication_label: "Double authentification" 100 twoFactorAuthentication_label: "Double authentification"
101 help_twoFactorAuthentication: "Si vous activez 2FA, à chaque tentative de connexion à wallabag, vous recevrez un code par email." 101 help_twoFactorAuthentication: "Si vous activez 2FA, à chaque tentative de connexion à wallabag, vous recevrez un code par email."
102 delete: 102 delete:
103 title: Supprimer mon compte (attention danger !) 103 title: "Supprimer mon compte (attention danger !)"
104 description: Si vous confirmez la suppression de votre compte, TOUS les articles, TOUS les tags, TOUTES les annotations et votre compte seront DÉFINITIVEMENT supprimé (c'est IRRÉVERSIBLE). Vous serez ensuite déconnecté. 104 description: "Si vous confirmez la suppression de votre compte, TOUS les articles, TOUS les tags, TOUTES les annotations et votre compte seront DÉFINITIVEMENT supprimé (c’est IRRÉVERSIBLE). Vous serez ensuite déconnecté."
105 confirm: Vous êtes vraiment sûr ? (C'EST IRRÉVERSIBLE) 105 confirm: "Vous êtes vraiment sûr ? (C’EST IRRÉVERSIBLE)"
106 button: 'Supprimer mon compte' 106 button: "Supprimer mon compte"
107 reset: 107 reset:
108 title: Réinitialisation (attention danger !) 108 title: "Réinitialisation (attention danger !)"
109 description: En cliquant sur les boutons ci-dessous vous avez la possibilité de supprimer certaines informations de votre compte. Attention, ces actions sont IRRÉVERSIBLES ! 109 description: "En cliquant sur les boutons ci-dessous vous avez la possibilité de supprimer certaines informations de votre compte. Attention, ces actions sont IRRÉVERSIBLES !"
110 annotations: Supprimer TOUTES les annotations 110 annotations: "Supprimer TOUTES les annotations"
111 tags: Supprimer TOUS les tags 111 tags: "Supprimer TOUS les tags"
112 entries: Supprimer TOUS les articles 112 entries: "Supprimer TOUS les articles"
113 confirm: Êtes-vous vraiment vraiment sûr ? (C'EST IRRÉVERSIBLE) 113 archived: "Supprimer TOUS les articles archivés"
114 confirm: "Êtes-vous vraiment vraiment sûr ? (C’EST IRRÉVERSIBLE)"
114 form_password: 115 form_password:
115 description: "Vous pouvez changer ici votre mot de passe. Le mot de passe doit contenir au moins 8 caractères." 116 description: "Vous pouvez changer ici votre mot de passe. Le mot de passe doit contenir au moins 8 caractères."
116 old_password_label: "Mot de passe actuel" 117 old_password_label: "Mot de passe actuel"
@@ -154,6 +155,7 @@ config:
154 or: "Une règle OU l’autre" 155 or: "Une règle OU l’autre"
155 and: "Une règle ET l’autre" 156 and: "Une règle ET l’autre"
156 matches: "Teste si un <i>sujet</i> correspond à une <i>recherche</i> (non sensible à la casse).<br />Exemple : <code>title matches \"football\"</code>" 157 matches: "Teste si un <i>sujet</i> correspond à une <i>recherche</i> (non sensible à la casse).<br />Exemple : <code>title matches \"football\"</code>"
158 notmatches: "Teste si un <i>sujet</i> ne correspond pas à une <i>recherche</i> (non sensible à la casse).<br />Exemple : <code>title notmatches \"football\"</code>"
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -162,7 +164,7 @@ entry:
162 archived: "Articles lus" 164 archived: "Articles lus"
163 filtered: "Articles filtrés" 165 filtered: "Articles filtrés"
164 filtered_tags: "Articles filtrés par tags :" 166 filtered_tags: "Articles filtrés par tags :"
165 filtered_search: 'Articles filtrés par recherche :' 167 filtered_search: "Articles filtrés par recherche :"
166 untagged: "Article sans tag" 168 untagged: "Article sans tag"
167 list: 169 list:
168 number_on_the_page: "{0} Il n’y a pas d’article.|{1} Il y a un article.|]1,Inf[ Il y a %count% articles." 170 number_on_the_page: "{0} Il n’y a pas d’article.|{1} Il y a un article.|]1,Inf[ Il y a %count% articles."
@@ -186,7 +188,7 @@ entry:
186 preview_picture_label: "A une photo" 188 preview_picture_label: "A une photo"
187 preview_picture_help: "Photo" 189 preview_picture_help: "Photo"
188 language_label: "Langue" 190 language_label: "Langue"
189 http_status_label: 'Statut HTTP' 191 http_status_label: "Statut HTTP"
190 reading_time: 192 reading_time:
191 label: "Durée de lecture en minutes" 193 label: "Durée de lecture en minutes"
192 from: "de" 194 from: "de"
@@ -223,6 +225,8 @@ entry:
223 original_article: "original" 225 original_article: "original"
224 annotations_on_the_entry: "{0} Aucune annotation|{1} Une annotation|]1,Inf[ %count% annotations" 226 annotations_on_the_entry: "{0} Aucune annotation|{1} Une annotation|]1,Inf[ %count% annotations"
225 created_at: "Date de création" 227 created_at: "Date de création"
228 published_at: "Date de publication"
229 published_by: "Publié par"
226 new: 230 new:
227 page_title: "Sauvegarder un nouvel article" 231 page_title: "Sauvegarder un nouvel article"
228 placeholder: "http://website.com" 232 placeholder: "http://website.com"
@@ -234,10 +238,12 @@ entry:
234 page_title: "Éditer un article" 238 page_title: "Éditer un article"
235 title_label: "Titre" 239 title_label: "Titre"
236 url_label: "Adresse" 240 url_label: "Adresse"
237 is_public_label: "Public"
238 save_label: "Enregistrer" 241 save_label: "Enregistrer"
239 public: 242 public:
240 shared_by_wallabag: "Cet article a été partagé par <a href=\"%wallabag_instance%\">wallabag</a>" 243 shared_by_wallabag: "Cet article a été partagé par <a href=\"%wallabag_instance%\">wallabag</a>"
244 confirm:
245 delete: "Voulez-vous vraiment supprimer cet article ?"
246 delete_tag: "Voulez-vous vraiment supprimer ce tag de cet article ?"
241 247
242about: 248about:
243 page_title: "À propos" 249 page_title: "À propos"
@@ -295,32 +301,32 @@ howto:
295 bookmarklet: 301 bookmarklet:
296 description: "Glissez et déposez ce lien dans votre barre de favoris :" 302 description: "Glissez et déposez ce lien dans votre barre de favoris :"
297 shortcuts: 303 shortcuts:
298 page_description: Voici les raccourcis disponibles dans wallabag. 304 page_description: "Voici les raccourcis disponibles dans wallabag."
299 shortcut: Raccourci 305 shortcut: "Raccourci"
300 action: Action 306 action: "Action"
301 all_pages_title: Raccourcis disponibles dans toutes les pages 307 all_pages_title: "Raccourcis disponibles dans toutes les pages"
302 go_unread: Afficher les articles non lus 308 go_unread: "Afficher les articles non lus"
303 go_starred: Afficher les articles favoris 309 go_starred: "Afficher les articles favoris"
304 go_archive: Afficher les articles lus 310 go_archive: "Afficher les articles lus"
305 go_all: Afficher tous les articles 311 go_all: "Afficher tous les articles"
306 go_tags: Afficher les tags 312 go_tags: "Afficher les tags"
307 go_config: Aller à la configuration 313 go_config: "Aller à la configuration"
308 go_import: Aller aux imports 314 go_import: "Aller aux imports"
309 go_developers: Aller à la section Développeurs 315 go_developers: "Aller à la section Développeurs"
310 go_howto: Afficher l'aide (cette page !) 316 go_howto: "Afficher l’aide (cette page !)"
311 go_logout: Se déconnecter 317 go_logout: "Se déconnecter"
312 list_title: Raccourcis disponibles dans les pages de liste 318 list_title: "Raccourcis disponibles dans les pages de liste"
313 search: Afficher le formulaire de recherche 319 search: "Afficher le formulaire de recherche"
314 article_title: Raccourcis disponibles quand on affiche un article 320 article_title: "Raccourcis disponibles quand on affiche un article"
315 open_original: Ouvrir l'URL originale de l'article 321 open_original: "Ouvrir l’URL originale de l’article"
316 toggle_favorite: Changer le statut Favori de l'article 322 toggle_favorite: "Changer le statut Favori de l’article"
317 toggle_archive: Changer le status Lu de l'article 323 toggle_archive: "Changer le status Lu de l’article"
318 delete: Supprimer l'article 324 delete: "Supprimer l’article"
319 material_title: Raccourcis disponibles avec le thème Material uniquement 325 material_title: "Raccourcis disponibles avec le thème Material uniquement"
320 add_link: Ajouter un nouvel article 326 add_link: "Ajouter un nouvel article"
321 hide_form: Masquer le formulaire courant (recherche ou nouvel article) 327 hide_form: "Masquer le formulaire courant (recherche ou nouvel article)"
322 arrows_navigation: Naviguer à travers les articles 328 arrows_navigation: "Naviguer à travers les articles"
323 open_article: Afficher l'article sélectionné 329 open_article: "Afficher l’article sélectionné"
324 330
325quickstart: 331quickstart:
326 page_title: "Pour bien débuter" 332 page_title: "Pour bien débuter"
@@ -382,8 +388,8 @@ tag:
382 number_on_the_page: "{0} Il n’y a pas de tag.|{1} Il y a un tag.|]1,Inf[ Il y a %count% tags." 388 number_on_the_page: "{0} Il n’y a pas de tag.|{1} Il y a un tag.|]1,Inf[ Il y a %count% tags."
383 see_untagged_entries: "Voir les articles sans tag" 389 see_untagged_entries: "Voir les articles sans tag"
384 new: 390 new:
385 add: 'Ajouter' 391 add: "Ajouter"
386 placeholder: 'Vous pouvez ajouter plusieurs tags, séparés par une virgule.' 392 placeholder: "Vous pouvez ajouter plusieurs tags, séparés par une virgule."
387 393
388import: 394import:
389 page_title: "Importer" 395 page_title: "Importer"
@@ -417,7 +423,7 @@ import:
417 how_to: "Choisissez le fichier de votre export Readability et cliquez sur le bouton ci-dessous pour l’importer." 423 how_to: "Choisissez le fichier de votre export Readability et cliquez sur le bouton ci-dessous pour l’importer."
418 worker: 424 worker:
419 enabled: "Les imports sont asynchrones. Une fois l’import commencé un worker externe traitera les messages un par un. Le service activé est :" 425 enabled: "Les imports sont asynchrones. Une fois l’import commencé un worker externe traitera les messages un par un. Le service activé est :"
420 download_images_warning: "Vous avez configuré le téléchagement des images pour vos articles. Combiné à l'import classique, cette opération peut être très très longue (voire échouer). Nous vous conseillons <strong>vivement</strong> d'activer les imports asynchrones." 426 download_images_warning: "Vous avez configuré le téléchagement des images pour vos articles. Combiné à l’import classique, cette opération peut être très très longue (voire échouer). Nous vous conseillons <strong>vivement</strong> d’activer les imports asynchrones."
421 firefox: 427 firefox:
422 page_title: "Import > Firefox" 428 page_title: "Import > Firefox"
423 description: "Cet outil va vous permettre d’importer tous vos marques-pages de Firefox. Ouvrez le panneau des marques-pages (Ctrl+Maj+O), puis dans « Importation et sauvegarde », choisissez « Sauvegarde… ». Vous allez récupérer un fichier .json. </p>" 429 description: "Cet outil va vous permettre d’importer tous vos marques-pages de Firefox. Ouvrez le panneau des marques-pages (Ctrl+Maj+O), puis dans « Importation et sauvegarde », choisissez « Sauvegarde… ». Vous allez récupérer un fichier .json. </p>"
@@ -486,16 +492,16 @@ developer:
486 back: "Retour" 492 back: "Retour"
487 493
488user: 494user:
489 page_title: Gestion des utilisateurs 495 page_title: "Gestion des utilisateurs"
490 new_user: Créer un nouvel utilisateur 496 new_user: "Créer un nouvel utilisateur"
491 edit_user: Éditer un utilisateur existant 497 edit_user: "Éditer un utilisateur existant"
492 description: Ici vous pouvez gérer vos utilisateurs (création, mise à jour et suppression) 498 description: "Ici vous pouvez gérer vos utilisateurs (création, mise à jour et suppression)"
493 list: 499 list:
494 actions: Actions 500 actions: "Actions"
495 edit_action: Éditer 501 edit_action: "Éditer"
496 yes: Oui 502 yes: "Oui"
497 no: Non 503 no: "Non"
498 create_new_one: Créer un nouvel utilisateur 504 create_new_one: "Créer un nouvel utilisateur"
499 form: 505 form:
500 username_label: "Nom d’utilisateur" 506 username_label: "Nom d’utilisateur"
501 name_label: "Nom" 507 name_label: "Nom"
@@ -510,9 +516,11 @@ user:
510 delete: "Supprimer" 516 delete: "Supprimer"
511 delete_confirm: "Voulez-vous vraiment ?" 517 delete_confirm: "Voulez-vous vraiment ?"
512 back_to_list: "Revenir à la liste" 518 back_to_list: "Revenir à la liste"
519 search:
520 placeholder: "Filtrer par nom d’utilisateur ou email"
513 521
514error: 522error:
515 page_title: Une erreur est survenue 523 page_title: "Une erreur est survenue"
516 524
517flashes: 525flashes:
518 config: 526 config:
@@ -525,9 +533,10 @@ flashes:
525 tagging_rules_updated: "Règles mises à jour" 533 tagging_rules_updated: "Règles mises à jour"
526 tagging_rules_deleted: "Règle supprimée" 534 tagging_rules_deleted: "Règle supprimée"
527 rss_token_updated: "Jeton RSS mis à jour" 535 rss_token_updated: "Jeton RSS mis à jour"
528 annotations_reset: Annotations supprimées 536 annotations_reset: "Annotations supprimées"
529 tags_reset: Tags supprimés 537 tags_reset: "Tags supprimés"
530 entries_reset: Articles supprimés 538 entries_reset: "Articles supprimés"
539 archived_reset: "Articles archivés supprimés"
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: "Article déjà sauvegardé le %date%" 542 entry_already_saved: "Article déjà sauvegardé le %date%"
@@ -559,6 +568,6 @@ flashes:
559 client_deleted: "Client %name% supprimé" 568 client_deleted: "Client %name% supprimé"
560 user: 569 user:
561 notice: 570 notice:
562 added: 'Utilisateur "%username%" ajouté' 571 added: "Utilisateur \"%username%\" ajouté"
563 updated: 'Utilisateur "%username%" mis à jour' 572 updated: "Utilisateur \"%username%\" mis à jour"
564 deleted: 'Utilisateur "%username%" supprimé' 573 deleted: "Utilisateur \"%username%\" supprimé"
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
index 3f7c7010..16e8072b 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -24,7 +24,7 @@ menu:
24 tags: 'Tags' 24 tags: 'Tags'
25 internal_settings: 'Strumenti' 25 internal_settings: 'Strumenti'
26 import: 'Importa' 26 import: 'Importa'
27 howto: 'How to' 27 howto: 'Come fare'
28 # developer: 'API clients management' 28 # developer: 'API clients management'
29 logout: 'Logout' 29 logout: 'Logout'
30 about: 'About' 30 about: 'About'
@@ -44,8 +44,8 @@ footer:
44 wallabag: 44 wallabag:
45 elsewhere: 'Porta wallabag con te' 45 elsewhere: 'Porta wallabag con te'
46 social: 'Social' 46 social: 'Social'
47 powered_by: 'powered by' 47 powered_by: 'Offerto da'
48 about: 'About' 48 about: 'A proposito'
49 # stats: Since %user_creation% you read %nb_archives% articles. That is about %per_day% a day! 49 # stats: Since %user_creation% you read %nb_archives% articles. That is about %per_day% a day!
50 50
51config: 51config:
@@ -55,7 +55,7 @@ config:
55 rss: 'RSS' 55 rss: 'RSS'
56 user_info: 'Informazioni utente' 56 user_info: 'Informazioni utente'
57 password: 'Password' 57 password: 'Password'
58 rules: 'Regole di tagging' 58 rules: 'Regole di etichettatura'
59 new_user: 'Aggiungi utente' 59 new_user: 'Aggiungi utente'
60 form: 60 form:
61 save: 'Salva' 61 save: 'Salva'
@@ -83,7 +83,7 @@ config:
83 # help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account." 83 # help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account."
84 form_rss: 84 form_rss:
85 description: 'I feed RSS generati da wallabag ti permettono di leggere i tuoi contenuti salvati con il tuo lettore di RSS preferito. Prima, devi generare un token.' 85 description: 'I feed RSS generati da wallabag ti permettono di leggere i tuoi contenuti salvati con il tuo lettore di RSS preferito. Prima, devi generare un token.'
86 token_label: 'RSS token' 86 token_label: 'Token RSS'
87 no_token: 'Nessun token' 87 no_token: 'Nessun token'
88 token_create: 'Crea il tuo token' 88 token_create: 'Crea il tuo token'
89 token_reset: 'Rigenera il tuo token' 89 token_reset: 'Rigenera il tuo token'
@@ -94,10 +94,10 @@ config:
94 archive: 'archiviati' 94 archive: 'archiviati'
95 rss_limit: 'Numero di elementi nel feed' 95 rss_limit: 'Numero di elementi nel feed'
96 form_user: 96 form_user:
97 two_factor_description: "Abilitando la two factor authentication riceverai una e-mail con un codice per ogni nuova connesione non verificata" 97 two_factor_description: "Abilitando l'\autenticazione a due fattori riceverai una e-mail con un codice per ogni nuova connesione non verificata"
98 name_label: 'Nome' 98 name_label: 'Nome'
99 email_label: 'E-mail' 99 email_label: 'E-mail'
100 twoFactorAuthentication_label: 'Two factor authentication' 100 twoFactorAuthentication_label: 'Autenticazione a due fattori'
101 # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." 101 # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email."
102 delete: 102 delete:
103 # title: Delete my account (a.k.a danger zone) 103 # title: Delete my account (a.k.a danger zone)
@@ -110,6 +110,7 @@ config:
110 # annotations: Remove ALL annotations 110 # annotations: Remove ALL annotations
111 # tags: Remove ALL tags 111 # tags: Remove ALL tags
112 # entries: Remove ALL entries 112 # entries: Remove ALL entries
113 # archived: Remove ALL archived entries
113 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) 114 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE)
114 form_password: 115 form_password:
115 # description: "You can change your password here. Your new password should by at least 8 characters long." 116 # description: "You can change your password here. Your new password should by at least 8 characters long."
@@ -118,19 +119,19 @@ config:
118 repeat_new_password_label: 'Ripeti la nuova password' 119 repeat_new_password_label: 'Ripeti la nuova password'
119 form_rules: 120 form_rules:
120 if_label: 'se' 121 if_label: 'se'
121 then_tag_as_label: 'allora tagga come' 122 then_tag_as_label: 'allora etichetta come'
122 delete_rule_label: 'elimina' 123 delete_rule_label: 'elimina'
123 # edit_rule_label: 'edit' 124 # edit_rule_label: 'edit'
124 rule_label: 'Regola' 125 rule_label: 'Regola'
125 tags_label: 'Tag' 126 tags_label: 'Etichetta'
126 faq: 127 faq:
127 title: 'FAQ' 128 title: 'FAQ'
128 tagging_rules_definition_title: 'Cosa significa « regole di tagging » ?' 129 tagging_rules_definition_title: 'Cosa significa « regole di etichettatura» ?'
129 tagging_rules_definition_description: 'Sono regole utilizzate da wallabag per taggare automaticamente i contenuti.<br />Ogni volta che viene aggiunto un contenuto, tutte le regole di tagging rules vengono utilizzate per aggiungere i tag configurati, risparmiandoti il lavoro di classificare i contenuti manualmente.' 130 tagging_rules_definition_description: 'Sono regole utilizzate da wallabag per etichettare automaticamente i contenuti.<br />Ogni volta che viene aggiunto un contenuto, tutte le regole di etichettatura vengono utilizzate per aggiungere le etichette configurate, risparmiandoti il lavoro di classificare i contenuti manualmente.'
130 how_to_use_them_title: 'Come si usano?' 131 how_to_use_them_title: 'Come si usano?'
131 how_to_use_them_description: 'Diciamo che vuoi taggare un contenuto come « <i>lettura veloce</i> » quando il tempo di lettura è inferiore ai 3 minuti.<br />In questo case, devi mettere « readingTime &lt;= 3 » nel campo <i>Regola</i> e « <i>lettura veloce</i> » nel campo <i>Tag</i>.<br />Molti tag si possono aggiungere contemporanemente separandoli con una virgola: « <i>lettura veloce, da leggere</i> »<br />Regole complesse possono essere scritte utilizzando gli operatori predefiniti: se « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » allora tagga « <i>lettura lunga, github </i> »' 132 how_to_use_them_description: 'Diciamo che vuoi etichettare un contenuto come « <i>lettura veloce</i> » quando il tempo di lettura è inferiore ai 3 minuti.<br />In questo case, devi mettere « readingTime &lt;= 3 » nel campo <i>Regola</i> e « <i>lettura veloce</i> » nel campo <i>Etichette</i>.<br />Molte etichette si possono aggiungere contemporanemente separandole con una virgola: « <i>lettura veloce, da leggere</i> »<br />Regole complesse possono essere scritte utilizzando gli operatori predefiniti: se « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » allora etichetta « <i>lettura lunga, github </i> »'
132 variables_available_title: 'Quali operatori e variabili posso utilizzare per scrivere delle regole?' 133 variables_available_title: 'Quali operatori e variabili posso utilizzare per scrivere delle regole?'
133 variables_available_description: 'I seguenti operatori e variabili posso essere utilizzati per scrivere regole di tagging:' 134 variables_available_description: 'I seguenti operatori e variabili posso essere utilizzati per scrivere regole di etichettatura:'
134 meaning: 'Significato' 135 meaning: 'Significato'
135 variable_description: 136 variable_description:
136 label: 'Variabile' 137 label: 'Variabile'
@@ -154,6 +155,7 @@ config:
154 or: "Una regola O un'altra" 155 or: "Una regola O un'altra"
155 and: "Una regola E un'altra" 156 and: "Una regola E un'altra"
156 matches: 'Verifica che un <i>oggetto</i> risulti in una <i>ricerca</i> (case-insensitive).<br />Esempio: <code>titolo contiene "football"</code>' 157 matches: 'Verifica che un <i>oggetto</i> risulti in una <i>ricerca</i> (case-insensitive).<br />Esempio: <code>titolo contiene "football"</code>'
158 # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -209,7 +211,7 @@ entry:
209 view_original_article: 'Contenuto originale' 211 view_original_article: 'Contenuto originale'
210 re_fetch_content: 'Ri-ottieni pagina' 212 re_fetch_content: 'Ri-ottieni pagina'
211 delete: 'Elimina' 213 delete: 'Elimina'
212 add_a_tag: 'Aggiungi un tag' 214 add_a_tag: 'Aggiungi un''etichetta'
213 share_content: 'Condividi' 215 share_content: 'Condividi'
214 share_email_label: 'E-mail' 216 share_email_label: 'E-mail'
215 # public_link: 'public link' 217 # public_link: 'public link'
@@ -220,9 +222,11 @@ entry:
220 label: 'Problemi?' 222 label: 'Problemi?'
221 description: 'Questo contenuto viene visualizzato male?' 223 description: 'Questo contenuto viene visualizzato male?'
222 edit_title: 'Modifica titolo' 224 edit_title: 'Modifica titolo'
223 original_article: 'originale' 225 original_article: 'Originale'
224 annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %count% annotazioni' 226 annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %count% annotazioni'
225 created_at: 'Data di creazione' 227 created_at: 'Data di creazione'
228 # published_at: 'Publication date'
229 # published_by: 'Published by'
226 new: 230 new:
227 page_title: 'Salva un nuovo contenuto' 231 page_title: 'Salva un nuovo contenuto'
228 placeholder: 'http://website.com' 232 placeholder: 'http://website.com'
@@ -234,13 +238,15 @@ entry:
234 page_title: 'Modifica voce' 238 page_title: 'Modifica voce'
235 title_label: 'Titolo' 239 title_label: 'Titolo'
236 url_label: 'Url' 240 url_label: 'Url'
237 is_public_label: 'Pubblico'
238 save_label: 'Salva' 241 save_label: 'Salva'
239 public: 242 public:
240 # shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>" 243 # shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
244 confirm:
245 delete: "Vuoi veramente rimuovere quell'articolo?"
246 delete_tag: "Vuoi veramente rimuovere quell'etichetta da quell'articolo?"
241 247
242about: 248about:
243 page_title: 'About' 249 page_title: 'A proposito'
244 top_menu: 250 top_menu:
245 who_behind_wallabag: "Chi c'è dietro a wallabag" 251 who_behind_wallabag: "Chi c'è dietro a wallabag"
246 getting_help: 'Ottieni aiuto' 252 getting_help: 'Ottieni aiuto'
@@ -259,7 +265,7 @@ about:
259 bug_reports: 'Bug reports' 265 bug_reports: 'Bug reports'
260 support: '<a href="https://github.com/wallabag/wallabag/issues">su GitHub</a>' 266 support: '<a href="https://github.com/wallabag/wallabag/issues">su GitHub</a>'
261 helping: 267 helping:
262 description: 'wallabag è gratuito opensource. Puoi aiutarci:' 268 description: 'wallabag è gratuito ed OpenSource. Puoi aiutarci:'
263 by_contributing: 'per contribuire al progetto:' 269 by_contributing: 'per contribuire al progetto:'
264 by_contributing_2: 'un elenco delle attività richieste' 270 by_contributing_2: 'un elenco delle attività richieste'
265 by_paypal: 'via Paypal' 271 by_paypal: 'via Paypal'
@@ -267,7 +273,7 @@ about:
267 description: 'Un grazie ai collaboratori di wallabag web application' 273 description: 'Un grazie ai collaboratori di wallabag web application'
268 third_party: 274 third_party:
269 description: 'Ecco un elenco delle librerie di terze parti utilizzate in wallabag (con le rispettive licenze):' 275 description: 'Ecco un elenco delle librerie di terze parti utilizzate in wallabag (con le rispettive licenze):'
270 package: 'Package' 276 package: 'Pacchetto'
271 license: 'Licenza' 277 license: 'Licenza'
272 278
273howto: 279howto:
@@ -293,7 +299,7 @@ howto:
293 ios: 'sullo store di iTunes' 299 ios: 'sullo store di iTunes'
294 windows: 'sullo store di Microsoft' 300 windows: 'sullo store di Microsoft'
295 bookmarklet: 301 bookmarklet:
296 description: 'Trascinando e rilasciando questo link sulla barra dei bookmark del tuo browser:' 302 description: 'Trascinando e rilasciando questo link sulla barra dei preferiti del tuo browser:'
297 shortcuts: 303 shortcuts:
298 # page_description: Here are the shortcuts available in wallabag. 304 # page_description: Here are the shortcuts available in wallabag.
299 # shortcut: Shortcut 305 # shortcut: Shortcut
@@ -327,7 +333,7 @@ quickstart:
327 # more: 'More…' 333 # more: 'More…'
328 intro: 334 intro:
329 title: 'Benvenuto su wallabag!' 335 title: 'Benvenuto su wallabag!'
330 paragraph_1: "Un tour in cui ti guideremo per scoprire e che ti mostrerà delle funzionalità che potrebbero interessarti." 336 paragraph_1: "Ti accompagneremo alla scoperta di wallabag e ti mostreremo delle funzionalità che potrebbero interessarti."
331 paragraph_2: 'Seguici!' 337 paragraph_2: 'Seguici!'
332 configure: 338 configure:
333 title: "Configura l'applicazione" 339 title: "Configura l'applicazione"
@@ -377,9 +383,9 @@ quickstart:
377 gitter: 'Su Gitter' 383 gitter: 'Su Gitter'
378 384
379tag: 385tag:
380 page_title: 'Tags' 386 page_title: 'Etichette'
381 list: 387 list:
382 number_on_the_page: "{0} Non ci sono tag.|{1} C'è un tag.|]1,Inf[ ci sono %count% tag." 388 number_on_the_page: "{0} Non ci sono etichette.|{1} C'è un'etichetta.|]1,Inf[ ci sono %count% etichette."
383 # see_untagged_entries: 'See untagged entries' 389 # see_untagged_entries: 'See untagged entries'
384 new: 390 new:
385 # add: 'Add' 391 # add: 'Add'
@@ -397,20 +403,20 @@ import:
397 save_label: 'Carica file' 403 save_label: 'Carica file'
398 pocket: 404 pocket:
399 page_title: 'Importa da > Pocket' 405 page_title: 'Importa da > Pocket'
400 description: "Questo importatore copierà tutti i tuoi dati da Pocket. Pocket non ci consente di ottenere contenuti dal loro servzio, così il contenuto leggibile di ogni articolo verrà ri-ottenuto da wallabag." 406 description: "Questo importatore copierà tutti i tuoi dati da Pocket. Pocket non ci consente di ottenere contenuti dal loro servizio, così il contenuto leggibile di ogni articolo verrà ri-ottenuto da wallabag."
401 config_missing: 407 config_missing:
402 description: "Importazione da Pocket non configurata." 408 description: "Importazione da Pocket non configurata."
403 admin_message: 'Devi definire %keyurls% una pocket_consumer_key %keyurle%.' 409 admin_message: 'Devi definire %keyurls% una pocket_consumer_key %keyurle%.'
404 user_message: 'Il tuo amministratore di server deve define una API Key per Pocket.' 410 user_message: 'Il tuo amministratore del server deve definire una API Key per Pocket.'
405 authorize_message: 'Puoi importare dati dal tuo account Pocket. Devi solo cliccare sul pulsante sottostante e autorizzare la connessione a getpocket.com.' 411 authorize_message: 'Puoi importare dati dal tuo account Pocket. Devi solo cliccare sul pulsante sottostante e autorizzare la connessione a getpocket.com.'
406 connect_to_pocket: 'Connetti a Pocket and importa i dati' 412 connect_to_pocket: 'Connetti a Pocket and importa i dati'
407 wallabag_v1: 413 wallabag_v1:
408 page_title: 'Importa da > Wallabag v1' 414 page_title: 'Importa da > Wallabag v1'
409 description: 'Questo importatore copierà tutti i tuoi dati da un wallabag v1. Nella tua pagina di configurazione, clicca su "JSON export" nella sezione "Esport i tuoi dati di wallabag". Otterrai un file "wallabag-export-1-xxxx-xx-xx.json".' 415 description: 'Questo importatore copierà tutti i tuoi dati da un wallabag v1. Nella tua pagina di configurazione, clicca su "JSON export" nella sezione "Esporta i tuoi dati di wallabag". Otterrai un file "wallabag-export-1-xxxx-xx-xx.json".'
410 how_to: 'Seleziona la tua esportazione di wallabag e clicca sul pulsante sottostante caricare il file e importare i dati.' 416 how_to: 'Seleziona la tua esportazione di wallabag e clicca sul pulsante sottostante caricare il file e importare i dati.'
411 wallabag_v2: 417 wallabag_v2:
412 page_title: 'Importa da > Wallabag v2' 418 page_title: 'Importa da > Wallabag v2'
413 description: 'Questo importatore copierà tutti i tuoi dati da un wallabag v2. Vai in "Tutti i contenuti", e, nella sidebar di esportazione, clicca su "JSON". Otterrai un file "Tutti i contenuti.json".' 419 description: 'Questo importatore copierà tutti i tuoi dati da un wallabag v2. Vai in "Tutti i contenuti", e, nella barra laterale di esportazione, clicca su "JSON". Otterrai un file "Tutti i contenuti.json'
414 readability: 420 readability:
415 page_title: 'Importa da > Readability' 421 page_title: 'Importa da > Readability'
416 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' 422 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).'
@@ -449,19 +455,19 @@ developer:
449 title: 'Client esistenti' 455 title: 'Client esistenti'
450 field_id: 'Client ID' 456 field_id: 'Client ID'
451 field_secret: 'Client secret' 457 field_secret: 'Client secret'
452 field_uris: 'Redirect URI' 458 field_uris: 'URI di reindirizzamento'
453 field_grant_types: 'Tipi di grant permessi' 459 field_grant_types: 'Tipi di permessi concessi'
454 no_client: 'Ancora nessun client.' 460 no_client: 'Ancora nessun client.'
455 remove: 461 remove:
456 warn_message_1: "Hai la possibilitò di rimuovere questo client.L'operazione è IRREVERSIBILE!" 462 warn_message_1: "Hai la possibilità di rimuovere questo client. L'operazione è IRREVERSIBILE!"
457 warn_message_2: "Se lo rimuovi, ogni app configurata con questo client non sarà più in grado di autenticarsi." 463 warn_message_2: "Se lo rimuovi, ogni app configurata con questo client non sarà più in grado di autenticarsi."
458 action: 'Rimuovi questo client' 464 action: 'Rimuovi questo client'
459 client: 465 client:
460 # page_title: 'API clients management > Nuovo client' 466 # page_title: 'API clients management > Nuovo client'
461 page_description: 'Stai per creare un nuovo client. Compila i campi sottostanti per il redirect URI della tua applicazione.' 467 page_description: 'Stai per creare un nuovo client. Compila i campi sottostanti per lo URI di reindirizzamento della tua applicazione.'
462 form: 468 form:
463 # name_label: 'Name of the client' 469 # name_label: 'Name of the client'
464 redirect_uris_label: 'Redirect URI' 470 redirect_uris_label: 'URI di reindirizzamento'
465 save_label: 'Crea un nuovo client' 471 save_label: 'Crea un nuovo client'
466 action_back: 'Indietro' 472 action_back: 'Indietro'
467 client_parameter: 473 client_parameter:
@@ -471,7 +477,7 @@ developer:
471 field_id: 'Client ID' 477 field_id: 'Client ID'
472 field_secret: 'Client secret' 478 field_secret: 'Client secret'
473 back: 'Indietro' 479 back: 'Indietro'
474 read_howto: 'Leggi howto "Come creare la mia prima applicazione"' 480 read_howto: 'Leggi "Come creare la mia prima applicazione"'
475 howto: 481 howto:
476 # page_title: 'API clients management > Come creare la mia prima applicazione' 482 # page_title: 'API clients management > Come creare la mia prima applicazione'
477 description: 483 description:
@@ -510,6 +516,8 @@ user:
510 # delete: Delete 516 # delete: Delete
511 # delete_confirm: Are you sure? 517 # delete_confirm: Are you sure?
512 # back_to_list: Back to list 518 # back_to_list: Back to list
519 search:
520 # placeholder: Filter by username or email
513 521
514error: 522error:
515 # page_title: An error occurred 523 # page_title: An error occurred
@@ -522,12 +530,13 @@ flashes:
522 password_not_updated_demo: "In modalità demo, non puoi cambiare la password dell'utente." 530 password_not_updated_demo: "In modalità demo, non puoi cambiare la password dell'utente."
523 user_updated: 'Informazioni aggiornate' 531 user_updated: 'Informazioni aggiornate'
524 rss_updated: 'Informazioni RSS aggiornate' 532 rss_updated: 'Informazioni RSS aggiornate'
525 tagging_rules_updated: 'Regole di tagging aggiornate' 533 tagging_rules_updated: 'Regole di etichettatura aggiornate'
526 tagging_rules_deleted: 'Regola di tagging aggiornate' 534 tagging_rules_deleted: 'Regole di etichettatura eliminate'
527 rss_token_updated: 'RSS token aggiornato' 535 rss_token_updated: 'Token RSS aggiornato'
528 # annotations_reset: Annotations reset 536 # annotations_reset: Annotations reset
529 # tags_reset: Tags reset 537 # tags_reset: Tags reset
530 # entries_reset: Entries reset 538 # entries_reset: Entries reset
539 # archived_reset: Archived entries deleted
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: 'Contenuto già salvato in data %date%' 542 entry_already_saved: 'Contenuto già salvato in data %date%'
@@ -543,7 +552,7 @@ flashes:
543 entry_deleted: 'Contenuto eliminato' 552 entry_deleted: 'Contenuto eliminato'
544 tag: 553 tag:
545 notice: 554 notice:
546 tag_added: 'Tag aggiunto' 555 tag_added: 'Etichetta aggiunta'
547 import: 556 import:
548 notice: 557 notice:
549 failed: 'Importazione fallita, riprova.' 558 failed: 'Importazione fallita, riprova.'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index 913e3bcb..3ac472d0 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -110,6 +110,7 @@ config:
110 annotations: Levar TOTAS las anotacions 110 annotations: Levar TOTAS las anotacions
111 tags: Levar TOTAS las etiquetas 111 tags: Levar TOTAS las etiquetas
112 entries: Levar TOTES los articles 112 entries: Levar TOTES los articles
113 archived: Levar TOTES los articles archivats
113 confirm: Sètz vertadièrament segur ? (ES IRREVERSIBLE) 114 confirm: Sètz vertadièrament segur ? (ES IRREVERSIBLE)
114 form_password: 115 form_password:
115 description: "Podètz cambiar vòstre senhal aquí. Vòstre senhal deu èsser long d'almens 8 caractèrs." 116 description: "Podètz cambiar vòstre senhal aquí. Vòstre senhal deu èsser long d'almens 8 caractèrs."
@@ -153,7 +154,8 @@ config:
153 not_equal_to: 'Diferent de…' 154 not_equal_to: 'Diferent de…'
154 or: "Una règla O l'autra" 155 or: "Una règla O l'autra"
155 and: "Una règla E l'autra" 156 and: "Una règla E l'autra"
156 matches: 'Teste se un <i>subjècte</i> correspond a una <i>recerca</i> (non sensibla a la cassa).<br />Exemple : <code>title matches \"football\"</code>' 157 matches: 'Teste se un <i>subjècte</i> correspond a una <i>recèrca</i> (non sensibla a la cassa).<br />Exemple : <code>title matches \"football\"</code>'
158 notmatches: 'Teste se <i>subjècte</i> correspond pas a una <i>recèrca</i> (sensibla a la cassa).<br />Example : <code>title notmatches "football"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -183,8 +185,8 @@ entry:
183 archived_label: 'Legits' 185 archived_label: 'Legits'
184 starred_label: 'Favorits' 186 starred_label: 'Favorits'
185 unread_label: 'Pas legits' 187 unread_label: 'Pas legits'
186 preview_picture_label: 'A una fotò' 188 preview_picture_label: 'A un imatge'
187 preview_picture_help: 'Fotò' 189 preview_picture_help: 'Imatge'
188 language_label: 'Lenga' 190 language_label: 'Lenga'
189 http_status_label: 'Estatut HTTP' 191 http_status_label: 'Estatut HTTP'
190 reading_time: 192 reading_time:
@@ -223,6 +225,8 @@ entry:
223 original_article: 'original' 225 original_article: 'original'
224 annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %count% anotacions" 226 annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %count% anotacions"
225 created_at: 'Data de creacion' 227 created_at: 'Data de creacion'
228 published_at: 'Data de publicacion'
229 published_by: 'Publicat per'
226 new: 230 new:
227 page_title: 'Enregistrar un novèl article' 231 page_title: 'Enregistrar un novèl article'
228 placeholder: 'http://website.com' 232 placeholder: 'http://website.com'
@@ -234,10 +238,12 @@ entry:
234 page_title: 'Modificar un article' 238 page_title: 'Modificar un article'
235 title_label: 'Títol' 239 title_label: 'Títol'
236 url_label: 'Url' 240 url_label: 'Url'
237 is_public_label: 'Public'
238 save_label: 'Enregistrar' 241 save_label: 'Enregistrar'
239 public: 242 public:
240 shared_by_wallabag: "Aqueste article es estat partejat per <a href='%wallabag_instance%'>wallabag</a>" 243 shared_by_wallabag: "Aqueste article es estat partejat per <a href='%wallabag_instance%'>wallabag</a>"
244 confirm:
245 # delete: "Are you sure you want to remove that article?"
246 # delete_tag: "Are you sure you want to remove that tag from that article?"
241 247
242about: 248about:
243 page_title: 'A prepaus' 249 page_title: 'A prepaus'
@@ -341,8 +347,8 @@ quickstart:
341 new_user: 'Crear un novèl utilizaire' 347 new_user: 'Crear un novèl utilizaire'
342 analytics: 'Configurar las estadisticas' 348 analytics: 'Configurar las estadisticas'
343 sharing: 'Activar de paramètres de partatge' 349 sharing: 'Activar de paramètres de partatge'
344 export: 'Configurar los expòrt' 350 export: 'Configurar los expòrts'
345 import: 'Configurar los impòrt' 351 import: 'Configurar los impòrts'
346 first_steps: 352 first_steps:
347 title: 'Primièrs passes' 353 title: 'Primièrs passes'
348 description: "Ara wallabag es ben configurat, es lo moment d'archivar lo web. Podètz clicar sul signe + a man drecha amont per ajustar un ligam." 354 description: "Ara wallabag es ben configurat, es lo moment d'archivar lo web. Podètz clicar sul signe + a man drecha amont per ajustar un ligam."
@@ -458,7 +464,7 @@ developer:
458 action: 'Suprimir aqueste client' 464 action: 'Suprimir aqueste client'
459 client: 465 client:
460 page_title: 'Gestion dels clients API > Novèl client' 466 page_title: 'Gestion dels clients API > Novèl client'
461 page_description: "Anatz crear un novèl client. Mercés de cumplir l'url de redireccion cap a vòstra aplicacion." 467 page_description: "Anatz crear un novèl client. Mercés de garnir l'url de redireccion cap a vòstra aplicacion."
462 form: 468 form:
463 name_label: "Nom del client" 469 name_label: "Nom del client"
464 redirect_uris_label: 'URLs de redireccion' 470 redirect_uris_label: 'URLs de redireccion'
@@ -469,7 +475,7 @@ developer:
469 page_description: 'Vaquí los paramètres de vòstre client.' 475 page_description: 'Vaquí los paramètres de vòstre client.'
470 field_name: 'Nom del client' 476 field_name: 'Nom del client'
471 field_id: 'ID Client' 477 field_id: 'ID Client'
472 field_secret: 'Clau secreta' 478 field_secret: 'Clau secrèta'
473 back: 'Retour' 479 back: 'Retour'
474 read_howto: 'Legir "cossí crear ma primièra aplicacion"' 480 read_howto: 'Legir "cossí crear ma primièra aplicacion"'
475 howto: 481 howto:
@@ -510,6 +516,8 @@ user:
510 delete: 'Suprimir' 516 delete: 'Suprimir'
511 delete_confirm: 'Sètz segur ?' 517 delete_confirm: 'Sètz segur ?'
512 back_to_list: 'Tornar a la lista' 518 back_to_list: 'Tornar a la lista'
519 search:
520 placeholder: "Filtrar per nom d'utilizaire o corrièl"
513 521
514error: 522error:
515 page_title: Una error s'es produsida 523 page_title: Una error s'es produsida
@@ -528,6 +536,7 @@ flashes:
528 annotations_reset: Anotacions levadas 536 annotations_reset: Anotacions levadas
529 tags_reset: Etiquetas levadas 537 tags_reset: Etiquetas levadas
530 entries_reset: Articles levats 538 entries_reset: Articles levats
539 archived_reset: Articles archivat suprimits
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: 'Article ja salvargardat lo %date%' 542 entry_already_saved: 'Article ja salvargardat lo %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index b990a6b9..fa672387 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -110,6 +110,7 @@ config:
110 annotations: Usuń WSZYSTKIE adnotacje 110 annotations: Usuń WSZYSTKIE adnotacje
111 tags: Usuń WSZYSTKIE tagi 111 tags: Usuń WSZYSTKIE tagi
112 entries: usuń WSZYTSTKIE wpisy 112 entries: usuń WSZYTSTKIE wpisy
113 archived: usuń WSZYSTKIE zarchiwizowane wpisy
113 confirm: Jesteś pewien? (tej operacji NIE MOŻNA cofnąć) 114 confirm: Jesteś pewien? (tej operacji NIE MOŻNA cofnąć)
114 form_password: 115 form_password:
115 description: "Tutaj możesz zmienić swoje hasło. Twoje nowe hasło powinno mieć conajmniej 8 znaków." 116 description: "Tutaj możesz zmienić swoje hasło. Twoje nowe hasło powinno mieć conajmniej 8 znaków."
@@ -154,6 +155,7 @@ config:
154 or: 'Jedna reguła LUB inna' 155 or: 'Jedna reguła LUB inna'
155 and: 'Jedna reguła I inna' 156 and: 'Jedna reguła I inna'
156 matches: 'Sprawdź czy <i>temat</i> pasuje <i>szukaj</i> (duże lub małe litery).<br />Przykład: <code>tytuł zawiera "piłka nożna"</code>' 157 matches: 'Sprawdź czy <i>temat</i> pasuje <i>szukaj</i> (duże lub małe litery).<br />Przykład: <code>tytuł zawiera "piłka nożna"</code>'
158 notmatches: 'Sprawdź czy <i>temat</i> nie zawiera <i>szukaj</i> (duże lub małe litery).<br />Przykład: <code>tytuł nie zawiera "piłka nożna"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -223,6 +225,8 @@ entry:
223 original_article: 'oryginalny' 225 original_article: 'oryginalny'
224 annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %count% adnotacji' 226 annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %count% adnotacji'
225 created_at: 'Czas stworzenia' 227 created_at: 'Czas stworzenia'
228 published_at: 'Data publikacji'
229 published_by: 'Opublikowane przez'
226 new: 230 new:
227 page_title: 'Zapisz nowy wpis' 231 page_title: 'Zapisz nowy wpis'
228 placeholder: 'http://website.com' 232 placeholder: 'http://website.com'
@@ -234,10 +238,12 @@ entry:
234 page_title: 'Edytuj wpis' 238 page_title: 'Edytuj wpis'
235 title_label: 'Tytuł' 239 title_label: 'Tytuł'
236 url_label: 'Adres URL' 240 url_label: 'Adres URL'
237 is_public_label: 'Publiczny'
238 save_label: 'Zapisz' 241 save_label: 'Zapisz'
239 public: 242 public:
240 shared_by_wallabag: "Ten artykuł został udostępniony przez <a href='%wallabag_instance%'>wallabag</a>" 243 shared_by_wallabag: "Ten artykuł został udostępniony przez <a href='%wallabag_instance%'>wallabag</a>"
244 confirm:
245 delete: "Czy jesteś pewien, że chcesz usunąć ten artykuł?"
246 delete_tag: "Czy jesteś pewien, że chcesz usunąć ten tag, z tego artykułu?"
241 247
242about: 248about:
243 page_title: 'O nas' 249 page_title: 'O nas'
@@ -510,6 +516,8 @@ user:
510 delete: Usuń 516 delete: Usuń
511 delete_confirm: JesteÅ› pewien? 517 delete_confirm: JesteÅ› pewien?
512 back_to_list: Powrót do listy 518 back_to_list: Powrót do listy
519 search:
520 placeholder: Filtruj po nazwie użytkownika lub adresie e-mail
513 521
514error: 522error:
515 page_title: Wystąpił błąd 523 page_title: Wystąpił błąd
@@ -528,6 +536,7 @@ flashes:
528 annotations_reset: Zresetuj adnotacje 536 annotations_reset: Zresetuj adnotacje
529 tags_reset: Zresetuj tagi 537 tags_reset: Zresetuj tagi
530 entries_reset: Zresetuj wpisy 538 entries_reset: Zresetuj wpisy
539 archived_reset: Zarchiwizowane wpisy usunięte
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: 'Wpis już został dodany %date%' 542 entry_already_saved: 'Wpis już został dodany %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
index fd87ca44..bf038ee8 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
@@ -110,6 +110,7 @@ config:
110 # annotations: Remove ALL annotations 110 # annotations: Remove ALL annotations
111 # tags: Remove ALL tags 111 # tags: Remove ALL tags
112 # entries: Remove ALL entries 112 # entries: Remove ALL entries
113 # archived: Remove ALL archived entries
113 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) 114 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE)
114 form_password: 115 form_password:
115 # description: "You can change your password here. Your new password should by at least 8 characters long." 116 # description: "You can change your password here. Your new password should by at least 8 characters long."
@@ -154,6 +155,7 @@ config:
154 or: 'Uma regra OU outra' 155 or: 'Uma regra OU outra'
155 and: 'Uma regra E outra' 156 and: 'Uma regra E outra'
156 matches: 'Testa que um <i>assunto</i> corresponde a uma <i>pesquisa</i> (maiúscula ou minúscula).<br />Exemplo: <code>título corresponde a "futebol"</code>' 157 matches: 'Testa que um <i>assunto</i> corresponde a uma <i>pesquisa</i> (maiúscula ou minúscula).<br />Exemplo: <code>título corresponde a "futebol"</code>'
158 # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -223,6 +225,8 @@ entry:
223 original_article: 'original' 225 original_article: 'original'
224 annotations_on_the_entry: '{0} Sem anotações|{1} Uma anotação|]1,Inf[ %nbAnnotations% anotações' 226 annotations_on_the_entry: '{0} Sem anotações|{1} Uma anotação|]1,Inf[ %nbAnnotations% anotações'
225 created_at: 'Data de criação' 227 created_at: 'Data de criação'
228 # published_at: 'Publication date'
229 # published_by: 'Published by'
226 new: 230 new:
227 page_title: 'Salvar nova entrada' 231 page_title: 'Salvar nova entrada'
228 placeholder: 'http://website.com' 232 placeholder: 'http://website.com'
@@ -234,10 +238,12 @@ entry:
234 page_title: 'Editar uma entrada' 238 page_title: 'Editar uma entrada'
235 title_label: 'Título' 239 title_label: 'Título'
236 url_label: 'Url' 240 url_label: 'Url'
237 is_public_label: 'Público'
238 save_label: 'Salvar' 241 save_label: 'Salvar'
239 public: 242 public:
240 shared_by_wallabag: "Este artigo foi compartilhado pelo <a href='%wallabag_instance%'>wallabag</a>" 243 shared_by_wallabag: "Este artigo foi compartilhado pelo <a href='%wallabag_instance%'>wallabag</a>"
244 confirm:
245 # delete: "Are you sure you want to remove that article?"
246 # delete_tag: "Are you sure you want to remove that tag from that article?"
241 247
242about: 248about:
243 page_title: 'Sobre' 249 page_title: 'Sobre'
@@ -510,6 +516,8 @@ user:
510 delete: 'Apagar' 516 delete: 'Apagar'
511 delete_confirm: 'Tem certeza?' 517 delete_confirm: 'Tem certeza?'
512 back_to_list: 'Voltar para a lista' 518 back_to_list: 'Voltar para a lista'
519 search:
520 # placeholder: Filter by username or email
513 521
514error: 522error:
515 # page_title: An error occurred 523 # page_title: An error occurred
@@ -528,6 +536,7 @@ flashes:
528 # annotations_reset: Annotations reset 536 # annotations_reset: Annotations reset
529 # tags_reset: Tags reset 537 # tags_reset: Tags reset
530 # entries_reset: Entries reset 538 # entries_reset: Entries reset
539 # archived_reset: Archived entries deleted
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: 'Entrada já foi salva em %date%' 542 entry_already_saved: 'Entrada já foi salva em %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index 14954b53..bd66d83a 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -110,6 +110,7 @@ config:
110 # annotations: Remove ALL annotations 110 # annotations: Remove ALL annotations
111 # tags: Remove ALL tags 111 # tags: Remove ALL tags
112 # entries: Remove ALL entries 112 # entries: Remove ALL entries
113 # archived: Remove ALL archived entries
113 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) 114 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE)
114 form_password: 115 form_password:
115 # description: "You can change your password here. Your new password should by at least 8 characters long." 116 # description: "You can change your password here. Your new password should by at least 8 characters long."
@@ -154,6 +155,7 @@ config:
154 # or: 'One rule OR another' 155 # or: 'One rule OR another'
155 # and: 'One rule AND another' 156 # and: 'One rule AND another'
156 # matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>' 157 # matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
158 # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -223,6 +225,8 @@ entry:
223 original_article: 'original' 225 original_article: 'original'
224 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations' 226 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
225 created_at: 'Data creării' 227 created_at: 'Data creării'
228 # published_at: 'Publication date'
229 # published_by: 'Published by'
226 new: 230 new:
227 page_title: 'Salvează un nou articol' 231 page_title: 'Salvează un nou articol'
228 placeholder: 'http://website.com' 232 placeholder: 'http://website.com'
@@ -234,10 +238,12 @@ entry:
234 # page_title: 'Edit an entry' 238 # page_title: 'Edit an entry'
235 # title_label: 'Title' 239 # title_label: 'Title'
236 url_label: 'Url' 240 url_label: 'Url'
237 # is_public_label: 'Public'
238 save_label: 'Salvează' 241 save_label: 'Salvează'
239 public: 242 public:
240 # shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>" 243 # shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
244 confirm:
245 # delete: "Are you sure you want to remove that article?"
246 # delete_tag: "Are you sure you want to remove that tag from that article?"
241 247
242about: 248about:
243 page_title: 'Despre' 249 page_title: 'Despre'
@@ -510,6 +516,8 @@ user:
510 # delete: Delete 516 # delete: Delete
511 # delete_confirm: Are you sure? 517 # delete_confirm: Are you sure?
512 # back_to_list: Back to list 518 # back_to_list: Back to list
519 search:
520 # placeholder: Filter by username or email
513 521
514error: 522error:
515 # page_title: An error occurred 523 # page_title: An error occurred
@@ -528,6 +536,7 @@ flashes:
528 # annotations_reset: Annotations reset 536 # annotations_reset: Annotations reset
529 # tags_reset: Tags reset 537 # tags_reset: Tags reset
530 # entries_reset: Entries reset 538 # entries_reset: Entries reset
539 # archived_reset: Archived entries deleted
531 entry: 540 entry:
532 notice: 541 notice:
533 # entry_already_saved: 'Entry already saved on %date%' 542 # entry_already_saved: 'Entry already saved on %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index 778a5515..b86c4003 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -110,6 +110,7 @@ config:
110 # annotations: Remove ALL annotations 110 # annotations: Remove ALL annotations
111 # tags: Remove ALL tags 111 # tags: Remove ALL tags
112 # entries: Remove ALL entries 112 # entries: Remove ALL entries
113 # archived: Remove ALL archived entries
113 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) 114 # confirm: Are you really really sure? (THIS CAN'T BE UNDONE)
114 form_password: 115 form_password:
115 # description: "You can change your password here. Your new password should by at least 8 characters long." 116 # description: "You can change your password here. Your new password should by at least 8 characters long."
@@ -154,6 +155,7 @@ config:
154 or: 'Bir kural veya birbaşkası' 155 or: 'Bir kural veya birbaşkası'
155 and: 'Bir kural ve diÄŸeri' 156 and: 'Bir kural ve diÄŸeri'
156 # matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>' 157 # matches: 'Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>'
158 # notmatches: 'Tests that a <i>subject</i> is not matches a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
157 159
158entry: 160entry:
159 page_titles: 161 page_titles:
@@ -223,6 +225,8 @@ entry:
223 original_article: 'orijinal' 225 original_article: 'orijinal'
224 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations' 226 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
225 created_at: 'OluÅŸturulma tarihi' 227 created_at: 'OluÅŸturulma tarihi'
228 # published_at: 'Publication date'
229 # published_by: 'Published by'
226 new: 230 new:
227 page_title: 'Yeni makaleyi kaydet' 231 page_title: 'Yeni makaleyi kaydet'
228 placeholder: 'http://website.com' 232 placeholder: 'http://website.com'
@@ -234,10 +238,12 @@ entry:
234 page_title: 'Makaleyi düzenle' 238 page_title: 'Makaleyi düzenle'
235 title_label: 'Başlık' 239 title_label: 'Başlık'
236 url_label: 'Url' 240 url_label: 'Url'
237 is_public_label: 'Herkes tarafından erişime açık olsun mu?'
238 save_label: 'Kaydet' 241 save_label: 'Kaydet'
239 public: 242 public:
240 # shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>" 243 # shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
244 confirm:
245 # delete: "Are you sure you want to remove that article?"
246 # delete_tag: "Are you sure you want to remove that tag from that article?"
241 247
242about: 248about:
243 page_title: 'Hakkımızda' 249 page_title: 'Hakkımızda'
@@ -510,6 +516,8 @@ user:
510 # delete: Delete 516 # delete: Delete
511 # delete_confirm: Are you sure? 517 # delete_confirm: Are you sure?
512 # back_to_list: Back to list 518 # back_to_list: Back to list
519 search:
520 # placeholder: Filter by username or email
513 521
514error: 522error:
515 # page_title: An error occurred 523 # page_title: An error occurred
@@ -528,6 +536,7 @@ flashes:
528 # annotations_reset: Annotations reset 536 # annotations_reset: Annotations reset
529 # tags_reset: Tags reset 537 # tags_reset: Tags reset
530 # entries_reset: Entries reset 538 # entries_reset: Entries reset
539 # archived_reset: Archived entries deleted
531 entry: 540 entry:
532 notice: 541 notice:
533 entry_already_saved: 'Entry already saved on %date%' 542 entry_already_saved: 'Entry already saved on %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
index 3548f590..01f63a7b 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
@@ -200,6 +200,11 @@
200 </a> 200 </a>
201 </li> 201 </li>
202 <li> 202 <li>
203 <a href="{{ path('config_reset', { type: 'archived'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
204 {{ 'config.reset.archived'|trans }}
205 </a>
206 </li>
207 <li>
203 <a href="{{ path('config_reset', { type: 'entries'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red"> 208 <a href="{{ path('config_reset', { type: 'entries'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
204 {{ 'config.reset.entries'|trans }} 209 {{ 'config.reset.entries'|trans }}
205 </a> 210 </a>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
index 859b166b..0ba6f4f4 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
@@ -17,9 +17,9 @@
17 <div class="results"> 17 <div class="results">
18 <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div> 18 <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
19 <div class="pagination"> 19 <div class="pagination">
20 <a href="{{ path('switch_view_mode') }}"><i class="listMode-btn material-icons md-36">{% if listMode == 0 %}list{% else %}view_module{% endif %}</i></a> 20 <a href="{{ path('switch_view_mode') }}"><i class="listMode-btn material-icons md-24">{% if listMode == 0 %}list{% else %}view_module{% endif %}</i></a>
21 <i class="btn-clickable download-btn material-icons md-36 js-export-action">file_download</i> 21 <i class="btn-clickable download-btn material-icons md-24 js-export-action">file_download</i>
22 <i class="btn-clickable filter-btn material-icons md-36 js-filters-action">filter_list</i> 22 <i class="btn-clickable filter-btn material-icons md-24 js-filters-action">filter_list</i>
23 {% if entries.getNbPages > 1 %} 23 {% if entries.getNbPages > 1 %}
24 {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} 24 {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
25 {% endif %} 25 {% endif %}
@@ -47,10 +47,10 @@
47 </div> 47 </div>
48 48
49 <ul class="tools links"> 49 <ul class="tools links">
50 <li><a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool icon-check icon {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{{ 'entry.list.toogle_as_read'|trans }}</span></a></li> 50 <li><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.list.original_article'|trans }} : {{ entry.title|e }}"><span>{{ entry.domainName|removeWww }}</span></a></li>
51 <li><a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool icon-star icon {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{{ 'entry.list.toogle_as_star'|trans }}</span></a></li> 51 <li><a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool icon {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons md-24 vertical-align-middle">check</i><span>{{ 'entry.list.toogle_as_read'|trans }}</span></a></li>
52 <li><a title="{{ 'entry.list.delete'|trans }}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.list.delete'|trans }}</span></a></li> 52 <li><a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool icon {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons md-24 vertical-align-middle">star_rate</i><span>{{ 'entry.list.toogle_as_star'|trans }}</span></a></li>
53 <li><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.list.original_article'|trans }} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName|removeWww }}</span></a></li> 53 <li><a title="{{ 'entry.list.delete'|trans }}" class="tool icon" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons md-24 vertical-align-middle">delete</i><span>{{ 'entry.list.delete'|trans }}</span></a></li>
54 </ul> 54 </ul>
55 {% if (entry.previewPicture is null or listMode == 1) %} 55 {% if (entry.previewPicture is null or listMode == 1) %}
56 <ul class="card-entry-tags"> 56 <ul class="card-entry-tags">
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
index a555691d..3d20a6bc 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
@@ -22,7 +22,7 @@
22 <li><a title="{{ markAsReadLabel|trans }}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %} markasread" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{{ markAsReadLabel|trans }}</span></a></li> 22 <li><a title="{{ markAsReadLabel|trans }}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %} markasread" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{{ markAsReadLabel|trans }}</span></a></li>
23 <li><a title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %} favorite" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span></a></li> 23 <li><a title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %} favorite" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span></a></li>
24 <li><a id="nav-btn-add-tag" class="tool icon icon-price-tags" title="{{ 'entry.view.left_menu.add_a_tag'|trans }}"><span>{{ 'entry.view.left_menu.add_a_tag'|trans }}</span></a></li> 24 <li><a id="nav-btn-add-tag" class="tool icon icon-price-tags" title="{{ 'entry.view.left_menu.add_a_tag'|trans }}"><span>{{ 'entry.view.left_menu.add_a_tag'|trans }}</span></a></li>
25 <li><a title="{{ 'entry.view.left_menu.delete'|trans }}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.delete'|trans }}</span></a></li> 25 <li><a title="{{ 'entry.view.left_menu.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.delete'|trans }}</span></a></li>
26 {% if craue_setting('share_public') %} 26 {% if craue_setting('share_public') %}
27 <li><a href="{{ path('share', {'id': entry.id }) }}" target="_blank" class="tool icon icon-eye" title="{{ 'entry.view.left_menu.public_link'|trans }}"><span>{{ 'entry.view.left_menu.public_link'|trans }}</span></a></li> 27 <li><a href="{{ path('share', {'id': entry.id }) }}" target="_blank" class="tool icon icon-eye" title="{{ 'entry.view.left_menu.public_link'|trans }}"><span>{{ 'entry.view.left_menu.public_link'|trans }}</span></a></li>
28 <li><a href="{{ path('delete_share', {'id': entry.id }) }}" class="tool icon icon-no-eye" title="{{ 'entry.view.left_menu.delete_public_link'|trans }}"><span>{{ 'entry.view.left_menu.delete_public_link'|trans }}</span></a></li> 28 <li><a href="{{ path('delete_share', {'id': entry.id }) }}" class="tool icon icon-no-eye" title="{{ 'entry.view.left_menu.delete_public_link'|trans }}"><span>{{ 'entry.view.left_menu.delete_public_link'|trans }}</span></a></li>
@@ -30,6 +30,7 @@
30 {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="Tweet"><span>Tweet</span></a></li>{% endif %} 30 {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="Tweet"><span>Tweet</span></a></li>{% endif %}
31 {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="Email"><span>Email</span></a></li>{% endif %} 31 {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="Email"><span>Email</span></a></li>{% endif %}
32 {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}&amp;tags={{ entry.tags|join(',')|url_encode }}" target="_blank" class="tool icon-image icon-image--shaarli" title="shaarli"><span>shaarli</span></a></li>{% endif %} 32 {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}&amp;tags={{ entry.tags|join(',')|url_encode }}" target="_blank" class="tool icon-image icon-image--shaarli" title="shaarli"><span>shaarli</span></a></li>{% endif %}
33 {% if craue_setting('share_scuttle') %}<li><a href="{{ craue_setting('scuttle_url') }}/bookmarks.php?action=add&amp;address={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}&amp;tags={{ entry.tags|join(',')|url_encode }}" target="_blank" class="tool icon-image icon-image--scuttle" title="scuttle"><span>scuttle</span></a></li>{% endif %}
33 {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="diaspora"><span>diaspora</span></a></li>{% endif %} 34 {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="diaspora"><span>diaspora</span></a></li>{% endif %}
34 {% if craue_setting('share_unmark') %}<li><a href="{{ craue_setting('unmark_url') }}/mark/add?url={{ entry.url|url_encode }}&amp;title={{entry.title|url_encode}}&amp;v=6" target="_blank" class="tool unmark icon-image icon-image--unmark" title="unmark"><span>unmark.it</span></a></li>{% endif %} 35 {% if craue_setting('share_unmark') %}<li><a href="{{ craue_setting('unmark_url') }}/mark/add?url={{ entry.url|url_encode }}&amp;title={{entry.title|url_encode}}&amp;v=6" target="_blank" class="tool unmark icon-image icon-image--unmark" title="unmark"><span>unmark.it</span></a></li>{% endif %}
35 {% if craue_setting('carrot') %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="carrot"><span>Carrot</span></a></li>{% endif %} 36 {% if craue_setting('carrot') %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="carrot"><span>Carrot</span></a></li>{% endif %}
@@ -43,9 +44,23 @@
43 44
44 <div id="article-informations"> 45 <div id="article-informations">
45 <i class="tool icon icon-calendar" title="{{ 'entry.view.created_at'|trans }}"> 46 <i class="tool icon icon-calendar" title="{{ 'entry.view.created_at'|trans }}">
46 {{ entry.createdAt|date('Y-m-d') }} 47 {{ entry.createdAt|date('Y-m-d H:i') }}
47 </i> 48 </i>
48 49
50 {% if entry.publishedAt is not null %}
51 <i class="tool icon icon-pencil2" title="{{ 'entry.view.published_at'|trans }}">
52 {{ entry.publishedAt|date('Y-m-d H:i') }}
53 </i>
54 {% endif %}
55
56 {% if entry.publishedBy is not empty %}
57 <i class="tool icon icon-users" title="{{ 'entry.view.published_by'|trans }}">
58 {% for author in entry.publishedBy %}
59 {{ author }}{% if not loop.last %}, {% endif %}
60 {% endfor %}
61 </i>
62 {% endif %}
63
49 <i class="tool icon icon-time"> 64 <i class="tool icon icon-time">
50 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} 65 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
51 {% if readingTime > 0 %} 66 {% if readingTime > 0 %}
@@ -59,10 +74,16 @@
59 <aside class="tags"> 74 <aside class="tags">
60 <div class="card-entry-tags"> 75 <div class="card-entry-tags">
61 {% for tag in entry.tags %} 76 {% for tag in entry.tags %}
62 <span class="label-outline"><i class="material-icons">label_outline</i> <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}" class="nostyle"><i>✘</i></a></span> 77 <span class="label-outline">
78 <i class="material-icons">label_outline</i>
79 <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
80 <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}" onclick="return confirm('{{ 'entry.confirm.delete_tag'|trans|escape('js') }}')" class="nostyle">
81 <i>✘</i>
82 </a>
83 </span>
63 {% endfor %} 84 {% endfor %}
64 </div> 85 </div>
65 <div class="input-field nav-panel-add-tag" style="display: none"> 86 <div class="input-field baggy-add-tag" style="display: none">
66 {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }} 87 {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }}
67 </div> 88 </div>
68 </aside> 89 </aside>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
index 07ff8e14..42aeace9 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
@@ -2,12 +2,14 @@
2 2
3{% block css %} 3{% block css %}
4 {{ parent() }} 4 {{ parent() }}
5 <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/themes/baggy/css/style.min.css') }}" media="screen,projection,print"/> 5 {% if not app.debug %}
6 <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/baggy.css') }}">
7 {% endif %}
6{% endblock %} 8{% endblock %}
7 9
8{% block scripts %} 10{% block scripts %}
9 {{ parent() }} 11 {{ parent() }}
10 <script src="{{ asset('bundles/wallabagcore/themes/baggy/js/baggy.min.js') }}"></script> 12 <script src="{{ asset('bundles/wallabagcore/baggy' ~ (app.debug ? '.dev' : '') ~ '.js') }}"></script>
11{% endblock %} 13{% endblock %}
12 14
13{% block header %} 15{% block header %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
index 5d411fdd..9b0816eb 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
@@ -25,9 +25,9 @@
25 25
26 <div class="row"> 26 <div class="row">
27 <div class="input-field col s11"> 27 <div class="input-field col s11">
28 {{ form_label(form.config.theme) }}
29 {{ form_errors(form.config.theme) }} 28 {{ form_errors(form.config.theme) }}
30 {{ form_widget(form.config.theme) }} 29 {{ form_widget(form.config.theme) }}
30 {{ form_label(form.config.theme) }}
31 </div> 31 </div>
32 <div class="input-field col s1"> 32 <div class="input-field col s1">
33 <a href="#" class="tooltipped" data-position="left" data-delay="50" data-tooltip="{{ 'config.form_settings.help_theme'|trans }}"> 33 <a href="#" class="tooltipped" data-position="left" data-delay="50" data-tooltip="{{ 'config.form_settings.help_theme'|trans }}">
@@ -38,9 +38,9 @@
38 38
39 <div class="row"> 39 <div class="row">
40 <div class="input-field col s11"> 40 <div class="input-field col s11">
41 {{ form_label(form.config.items_per_page) }}
42 {{ form_errors(form.config.items_per_page) }} 41 {{ form_errors(form.config.items_per_page) }}
43 {{ form_widget(form.config.items_per_page) }} 42 {{ form_widget(form.config.items_per_page) }}
43 {{ form_label(form.config.items_per_page) }}
44 </div> 44 </div>
45 <div class="input-field col s1"> 45 <div class="input-field col s1">
46 <a href="#" class="tooltipped" data-position="left" data-delay="50" data-tooltip="{{ 'config.form_settings.help_items_per_page'|trans }}"> 46 <a href="#" class="tooltipped" data-position="left" data-delay="50" data-tooltip="{{ 'config.form_settings.help_items_per_page'|trans }}">
@@ -51,9 +51,9 @@
51 51
52 <div class="row"> 52 <div class="row">
53 <div class="input-field col s11"> 53 <div class="input-field col s11">
54 {{ form_label(form.config.reading_speed) }}
55 {{ form_errors(form.config.reading_speed) }} 54 {{ form_errors(form.config.reading_speed) }}
56 {{ form_widget(form.config.reading_speed) }} 55 {{ form_widget(form.config.reading_speed) }}
56 {{ form_label(form.config.reading_speed) }}
57 <p> 57 <p>
58 {{ 'config.form_settings.reading_speed.help_message'|trans }} 58 {{ 'config.form_settings.reading_speed.help_message'|trans }}
59 <a href="http://www.myreadspeed.com/calculate/">myreadspeed</a> 59 <a href="http://www.myreadspeed.com/calculate/">myreadspeed</a>
@@ -68,17 +68,17 @@
68 68
69 <div class="row"> 69 <div class="row">
70 <div class="input-field col s12"> 70 <div class="input-field col s12">
71 {{ form_label(form.config.action_mark_as_read) }}
72 {{ form_errors(form.config.action_mark_as_read) }} 71 {{ form_errors(form.config.action_mark_as_read) }}
73 {{ form_widget(form.config.action_mark_as_read) }} 72 {{ form_widget(form.config.action_mark_as_read) }}
73 {{ form_label(form.config.action_mark_as_read) }}
74 </div> 74 </div>
75 </div> 75 </div>
76 76
77 <div class="row"> 77 <div class="row">
78 <div class="input-field col s11"> 78 <div class="input-field col s11">
79 {{ form_label(form.config.language) }}
80 {{ form_errors(form.config.language) }} 79 {{ form_errors(form.config.language) }}
81 {{ form_widget(form.config.language) }} 80 {{ form_widget(form.config.language) }}
81 {{ form_label(form.config.language) }}
82 </div> 82 </div>
83 <div class="input-field col s1"> 83 <div class="input-field col s1">
84 <a href="#" class="tooltipped" data-position="left" data-delay="50" data-tooltip="{{ 'config.form_settings.help_language'|trans }}"> 84 <a href="#" class="tooltipped" data-position="left" data-delay="50" data-tooltip="{{ 'config.form_settings.help_language'|trans }}">
@@ -89,9 +89,9 @@
89 89
90 <div class="row"> 90 <div class="row">
91 <div class="input-field col s11"> 91 <div class="input-field col s11">
92 {{ form_label(form.config.pocket_consumer_key) }}
93 {{ form_errors(form.config.pocket_consumer_key) }} 92 {{ form_errors(form.config.pocket_consumer_key) }}
94 {{ form_widget(form.config.pocket_consumer_key) }} 93 {{ form_widget(form.config.pocket_consumer_key) }}
94 {{ form_label(form.config.pocket_consumer_key) }}
95 <p> 95 <p>
96 &raquo; 96 &raquo;
97 <a href="https://getpocket.com/developer/docs/authentication">https://getpocket.com/developer/docs/authentication</a> 97 <a href="https://getpocket.com/developer/docs/authentication">https://getpocket.com/developer/docs/authentication</a>
@@ -132,8 +132,8 @@
132 </div> 132 </div>
133 133
134 <div class="row"> 134 <div class="row">
135 <div class="input-field col s12"> 135 <div class="col s12">
136 <label>{{ 'config.form_rss.token_label'|trans }}</label> 136 <h6 class="grey-text">{{ 'config.form_rss.token_label'|trans }}</h6>
137 <div> 137 <div>
138 {% if rss.token %} 138 {% if rss.token %}
139 {{ rss.token }} 139 {{ rss.token }}
@@ -151,8 +151,8 @@
151 </div> 151 </div>
152 {% if rss.token %} 152 {% if rss.token %}
153 <div class="row"> 153 <div class="row">
154 <div class="input-field col s12"> 154 <div class="col s12">
155 <label>{{ 'config.form_rss.rss_links'|trans }}</label> 155 <h6 class="grey-text">{{ 'config.form_rss.rss_links'|trans }}</h6>
156 <ul> 156 <ul>
157 <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.unread'|trans }}</a></li> 157 <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.unread'|trans }}</a></li>
158 <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.starred'|trans }}</a></li> 158 <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.starred'|trans }}</a></li>
@@ -229,6 +229,9 @@
229 <a href="{{ path('config_reset', { type: 'tags'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red"> 229 <a href="{{ path('config_reset', { type: 'tags'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
230 {{ 'config.reset.tags'|trans }} 230 {{ 'config.reset.tags'|trans }}
231 </a> 231 </a>
232 <a href="{{ path('config_reset', { type: 'archived'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
233 {{ 'config.reset.archived'|trans }}
234 </a>
232 <a href="{{ path('config_reset', { type: 'entries'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red"> 235 <a href="{{ path('config_reset', { type: 'entries'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
233 {{ 'config.reset.entries'|trans }} 236 {{ 'config.reset.entries'|trans }}
234 </a> 237 </a>
@@ -410,8 +413,8 @@
410 <tr> 413 <tr>
411 <td>domainName</td> 414 <td>domainName</td>
412 <td>{{ 'config.form_rules.faq.variable_description.domainName'|trans }}</td> 415 <td>{{ 'config.form_rules.faq.variable_description.domainName'|trans }}</td>
413 <td>matches</td> 416 <td>matches<br />notmaches</td>
414 <td>{{ 'config.form_rules.faq.operator_description.matches'|trans|raw }}</td> 417 <td>{{ 'config.form_rules.faq.operator_description.matches'|trans|raw }}<br />{{ 'config.form_rules.faq.operator_description.notmatches'|trans|raw }}</td>
415 </tr> 418 </tr>
416 </tbody> 419 </tbody>
417 </table> 420 </table>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig
index d278da1b..468338ac 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig
@@ -9,7 +9,7 @@
9 <li> 9 <li>
10 <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}redo{% endif %}</i></a> 10 <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}redo{% endif %}</i></a>
11 <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a> 11 <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a>
12 <a title="{{ 'entry.list.delete'|trans }}" class="tool grey-text delete" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons">delete</i></a> 12 <a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" class="tool grey-text delete" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons">delete</i></a>
13 </li> 13 </li>
14 </ul> 14 </ul>
15</div> 15</div>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig
index 3ba6253a..b64e1436 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig
@@ -1,18 +1,28 @@
1<div class="card"> 1<div class="card-stacked">
2 <div class="card-stacked"> 2 <div class="preview">{% if entry.previewPicture is not null %}<img src="{{ entry.previewPicture }}" />{% endif %}</div>
3 <div class="card-content"> 3 <div class="card-content">
4 <span class="card-title dot-ellipsis dot-resize-update"> 4 <span class="card-title dot-ellipsis dot-resize-update">
5 <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | striptags | e('html_attr') }}"> 5 <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | striptags | e('html_attr') }}">
6 {{ entry.title| striptags | truncate(120, true, '…') | raw }} 6 {{ entry.title| striptags | truncate(120, true, '…') | raw }}
7 </a> 7 </a>
8 </span> 8 </span>
9 <ul class="tools-list right"> 9
10 <li> 10 <div class="metadata">
11 <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}redo{% endif %}</i></a> 11 <a href="{{ entry.url|e }}" class="grey-text domain" target="_blank" title="{{ entry.domainName|removeWww }}">
12 <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a> 12 <span>{{ entry.domainName|removeWww }}</span>
13 <a title="{{ 'entry.list.delete'|trans }}" class="tool grey-text delete" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons">delete</i></a> 13 </a>
14 </li> 14 {% for tag in entry.tags | slice(0, 3) %}
15 </ul> 15 <span class="chip hide-on-med-and-down">
16 <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
17 </span>
18 {% endfor %}
16 </div> 19 </div>
17 </div> 20 </div>
21 <ul class="tools-list hide-on-small-only">
22 <li>
23 <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}redo{% endif %}</i></a>
24 <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a>
25 <a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" class="tool grey-text delete" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons">delete</i></a>
26 </li>
27 </ul>
18</div> 28</div>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig
index 1a932a9f..6ba18768 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig
@@ -1,7 +1,7 @@
1{% set readingTime = entry.readingTime / app.user.config.readingSpeed %} 1{% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
2<i class="material-icons">timer</i> 2<i class="material-icons">timer</i>
3{% if readingTime > 0 %} 3{% if readingTime > 0 %}
4 {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }} 4 <span>{{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}</span>
5{% else %} 5{% else %}
6 {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }} 6 <span>{{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}</span>
7{% endif %} 7{% endif %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/edit.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/edit.html.twig
index 1c5e2aab..b9537975 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/edit.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/edit.html.twig
@@ -27,11 +27,6 @@
27 {{ form_label(form.url) }} 27 {{ form_label(form.url) }}
28 {{ form_widget(form.url) }} 28 {{ form_widget(form.url) }}
29 </div> 29 </div>
30
31 <div class="input-field s12">
32 {{ form_widget(form.is_public) }}
33 {{ form_label(form.is_public) }}
34 </div>
35 <br> 30 <br>
36 31
37 {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} 32 {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
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 5fca53ae..6f657b18 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
@@ -24,9 +24,9 @@
24 </div> 24 </div>
25 25
26 <br /> 26 <br />
27 <ul class="row data"> 27 <ul class="{% if listMode == 1 %}collection{% else %}row data{% endif %}">
28 {% for entry in entries %} 28 {% for entry in entries %}
29 <li id="entry-{{ entry.id|e }}" class="col {% if listMode == 0 %}l3 m6{% endif %} s12"> 29 <li id="entry-{{ entry.id|e }}" class="col {% if listMode == 0 %}l3 m6{% else %}collection-item{% endif %} s12">
30 {% if listMode == 1 %} 30 {% if listMode == 1 %}
31 {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %} 31 {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %}
32 {% elseif entry.previewPicture is null %} 32 {% elseif entry.previewPicture is null %}
@@ -45,7 +45,7 @@
45 {% endif %} 45 {% endif %}
46 46
47 <!-- Export --> 47 <!-- Export -->
48 <div id="export" class="side-nav fixed right-aligned"> 48 <div id="export" class="side-nav right-aligned">
49 {% set currentRoute = app.request.attributes.get('_route') %} 49 {% set currentRoute = app.request.attributes.get('_route') %}
50 {% set currentTag = '' %} 50 {% set currentTag = '' %}
51 {% if tag is defined %} 51 {% if tag is defined %}
@@ -68,7 +68,7 @@
68 68
69 <!-- Filters --> 69 <!-- Filters -->
70 {% if form is not null %} 70 {% if form is not null %}
71 <div id="filters" class="side-nav fixed right-aligned"> 71 <div id="filters" class="side-nav right-aligned">
72 <form action="{{ path('all') }}"> 72 <form action="{{ path('all') }}">
73 73
74 <h4 class="center">{{ 'entry.filters.title'|trans }}</h4> 74 <h4 class="center">{{ 'entry.filters.title'|trans }}</h4>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
index af53084f..4cff7bf2 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
@@ -12,6 +12,11 @@
12 <div class="nav-wrapper cyan darken-1"> 12 <div class="nav-wrapper cyan darken-1">
13 <ul> 13 <ul>
14 <li> 14 <li>
15 <a href="#" data-activates="slide-out" class="button-collapse">
16 <i class="material-icons">menu</i>
17 </a>
18 </li>
19 <li>
15 <a class="waves-effect" href="{{ path('homepage') }}"> 20 <a class="waves-effect" href="{{ path('homepage') }}">
16 <i class="material-icons">exit_to_app</i> 21 <i class="material-icons">exit_to_app</i>
17 </a> 22 </a>
@@ -28,11 +33,6 @@
28 <i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i> 33 <i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
29 </a> 34 </a>
30 </li> 35 </li>
31 <li>
32 <a href="#" data-activates="slide-out" class="button-collapse right">
33 <i class="material-icons">menu</i>
34 </a>
35 </li>
36 </ul> 36 </ul>
37 </div> 37 </div>
38 </nav> 38 </nav>
@@ -82,7 +82,7 @@
82 <div class="collapsible-body"></div> 82 <div class="collapsible-body"></div>
83 </li> 83 </li>
84 <li class="bold border-bottom"> 84 <li class="bold border-bottom">
85 <a class="waves-effect collapsible-header delete" title="{{ 'entry.view.left_menu.delete'|trans }}" href="{{ path('delete_entry', { 'id': entry.id }) }}"> 85 <a class="waves-effect collapsible-header delete" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.delete'|trans }}" href="{{ path('delete_entry', { 'id': entry.id }) }}">
86 <i class="material-icons small">delete</i> 86 <i class="material-icons small">delete</i>
87 <span>{{ 'entry.view.left_menu.delete'|trans }}</span> 87 <span>{{ 'entry.view.left_menu.delete'|trans }}</span>
88 </a> 88 </a>
@@ -125,39 +125,43 @@
125 {% endif %} 125 {% endif %}
126 {% if craue_setting('share_shaarli') %} 126 {% if craue_setting('share_shaarli') %}
127 <li> 127 <li>
128 <a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}&amp;tags={{ entry.tags|join(',')|striptags|url_encode }}" target="_blank"> 128 <a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}&amp;tags={{ entry.tags|join(',')|striptags|url_encode }}" target="_blank" title="shaarli" class="tool icon-image shaarli">
129 <i class="tool icon-image icon-image--shaarli" title="shaarli"></i>
130 <span>shaarli</span> 129 <span>shaarli</span>
131 </a> 130 </a>
132 </li> 131 </li>
133 {% endif %} 132 {% endif %}
133 {% if craue_setting('share_scuttle') %}
134 <li>
135 <a href="{{ craue_setting('scuttle_url') }}/bookmarks.php?action=add&amp;address={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}&amp;tags={{ entry.tags|join(',')|striptags|url_encode }}" target="_blank" title="scuttle" class="tool icon-image scuttle">
136 <span>scuttle</span>
137 </a>
138 </li>
139 {% endif %}
134 {% if craue_setting('share_diaspora') %} 140 {% if craue_setting('share_diaspora') %}
135 <li> 141 <li>
136 <a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}&amp;notes=&amp;v=1&amp;noui=1&amp;jump=doclose" target="_blank"> 142 <a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}&amp;notes=&amp;v=1&amp;noui=1&amp;jump=doclose" target="_blank" class="tool icon-image diaspora" title="diaspora">
137 <i class="tool icon-image icon-image--diaspora" title="diaspora"></i>
138 <span>diaspora*</span> 143 <span>diaspora*</span>
139 </a> 144 </a>
140 </li> 145 </li>
141 {% endif %} 146 {% endif %}
142 {% if craue_setting('share_unmark') %} 147 {% if craue_setting('share_unmark') %}
143 <li> 148 <li>
144 <a href="{{ craue_setting('unmark_url') }}/mark/add?url={{ entry.url|url_encode }}&amp;title={{entry.title|striptags|url_encode}}&amp;v=6" target="_blank"> 149 <a href="{{ craue_setting('unmark_url') }}/mark/add?url={{ entry.url|url_encode }}&amp;title={{entry.title|striptags|url_encode}}&amp;v=6" target="_blank" class="tool icon-image unmark" title="unmark">
145 <i class="tool icon-image icon-image--unmark" title="unmark"></i>
146 <span>unmark.it</span> 150 <span>unmark.it</span>
147 </a> 151 </a>
148 </li> 152 </li>
149 {% endif %} 153 {% endif %}
150 {% if craue_setting('carrot') %} 154 {% if craue_setting('carrot') %}
151 <li> 155 <li>
152 <a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}" target="_blank" title="carrot"> 156 <a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}" target="_blank" title="carrot" class="tool icon-image carrot">
153 <i class="tool icon-image icon-image--carrot"></i>
154 <span>Carrot</span> 157 <span>Carrot</span>
155 </a> 158 </a>
156 </li> 159 </li>
157 {% endif %} 160 {% endif %}
158 {% if craue_setting('share_mail') %} 161 {% if craue_setting('share_mail') %}
159 <li> 162 <li>
160 <a href="mailto:?subject={{ entry.title|striptags|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" title="{{ 'entry.view.left_menu.share_email_label'|trans }}" class="tool email icon icon-mail"> 163 <a href="mailto:?subject={{ entry.title|striptags|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" title="{{ 'entry.view.left_menu.share_email_label'|trans }}" class="tool icon">
164 <i class="material-icons vertical-align-middle">mail</i>
161 <span>{{ 'entry.view.left_menu.share_email_label'|trans }}</span> 165 <span>{{ 'entry.view.left_menu.share_email_label'|trans }}</span>
162 </a> 166 </a>
163 </li> 167 </li>
@@ -212,32 +216,51 @@
212 <h1>{{ entry.title|striptags|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1> 216 <h1>{{ entry.title|striptags|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1>
213 </header> 217 </header>
214 <aside> 218 <aside>
215 <ul class="tools"> 219 <div class="tools">
216 <li> 220 <ul class="stats">
217 {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %} 221 <li>
218 </li> 222 {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
219 <li> 223 </li>
220 <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i> 224 <li>
221 {{ entry.createdAt|date('Y-m-d') }} 225 <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i>
222 </li> 226 {{ entry.createdAt|date('Y-m-d H:i') }}
223 <li> 227 </li>
224 <i class="material-icons link">link</i> 228 {% if entry.publishedAt is not null %}
225 <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|striptags }}" class="tool"> 229 <li>
226 {{ entry.domainName|removeWww }} 230 <i class="material-icons" title="{{ 'entry.view.published_at'|trans }}">create</i>
227 </a> 231 {{ entry.publishedAt|date('Y-m-d H:i') }}
228 </li> 232 </li>
229 <li> 233 {% endif %}
230 <i class="material-icons link">comment</i> 234 {% if entry.publishedBy is not empty %}
231 {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} 235 <li>
232 </li> 236 <i class="material-icons" title="{{ 'entry.view.published_by'|trans }}">person</i>
233 <li id="list"> 237 {% for author in entry.publishedBy %}
238 {{ author }}{% if not loop.last %}, {% endif %}
239 {% endfor %}
240 </li>
241 {% endif %}
242 <li>
243 <i class="material-icons link">link</i>
244 <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|striptags }}" class="tool">
245 {{ entry.domainName|removeWww }}
246 </a>
247 </li>
248 <li>
249 <i class="material-icons link">comment</i>
250 {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}
251 </li>
252 </ul>
253 <ul class="tags">
234 {% for tag in entry.tags %} 254 {% for tag in entry.tags %}
235 <div class="chip"> 255 <li class="chip">
236 <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i class="material-icons">delete</i></a> 256 <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
237 </div> 257 <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}" onclick="return confirm('{{ 'entry.confirm.delete_tag'|trans|escape('js') }}')">
258 <i class="material-icons vertical-align-middle">delete</i>
259 </a>
260 </li>
238 {% endfor %} 261 {% endfor %}
239 </li> 262 </ul>
240 </ul> 263 </div>
241 264
242 <div class="input-field nav-panel-add-tag" style="display: none"> 265 <div class="input-field nav-panel-add-tag" style="display: none">
243 {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }} 266 {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }}
@@ -259,7 +282,7 @@
259 <ul> 282 <ul>
260 <li><a class="btn-floating" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">done</i></a></li> 283 <li><a class="btn-floating" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">done</i></a></li>
261 <li><a class="btn-floating" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">star_outline</i></a></li> 284 <li><a class="btn-floating" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">star_outline</i></a></li>
262 <li><a class="btn-floating" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons">delete</i></a></li> 285 <li><a class="btn-floating" href="{{ path('delete_entry', { 'id': entry.id }) }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')"><i class="material-icons">delete</i></a></li>
263 </ul> 286 </ul>
264 </div> 287 </div>
265 </div> 288 </div>
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 3c169c04..2dab1c18 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
@@ -2,12 +2,14 @@
2 2
3{% block css %} 3{% block css %}
4 {{ parent() }} 4 {{ parent() }}
5 <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/themes/material/css/style.min.css') }}" media="screen,projection,print"/> 5 {% if not app.debug %}
6 <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/material.css') }}">
7 {% endif %}
6{% endblock %} 8{% endblock %}
7 9
8{% block scripts %} 10{% block scripts %}
9 {{ parent() }} 11 {{ parent() }}
10 <script src="{{ asset('bundles/wallabagcore/themes/material/js/material.min.js') }}"></script> 12 <script src="{{ asset('bundles/wallabagcore/material' ~ (app.debug ? '.dev' : '') ~ '.js') }}"></script>
11{% endblock %} 13{% endblock %}
12 14
13{% block header %} 15{% block header %}
@@ -116,12 +118,12 @@
116 </ul> 118 </ul>
117 <div class="input-field nav-panel-search" style="display: none"> 119 <div class="input-field nav-panel-search" style="display: none">
118 {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }} 120 {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
119 <label for="search" class="active"><i class="material-icons search">search</i></label> 121 <label for="search"><i class="material-icons search">search</i></label>
120 <i class="material-icons close">clear</i> 122 <i class="material-icons close">clear</i>
121 </div> 123 </div>
122 <div class="input-field nav-panel-add" style="display: none"> 124 <div class="input-field nav-panel-add" style="display: none">
123 {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }} 125 {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }}
124 <label for="add" class="active"><i class="material-icons add">add</i></label> 126 <label for="add"><i class="material-icons add">add</i></label>
125 <i class="material-icons close">clear</i> 127 <i class="material-icons close">clear</i>
126 </div> 128 </div>
127 </div> 129 </div>
diff --git a/src/Wallabag/ImportBundle/Command/ImportCommand.php b/src/Wallabag/ImportBundle/Command/ImportCommand.php
index 28d01715..5f1ab0af 100644
--- a/src/Wallabag/ImportBundle/Command/ImportCommand.php
+++ b/src/Wallabag/ImportBundle/Command/ImportCommand.php
@@ -5,6 +5,7 @@ namespace Wallabag\ImportBundle\Command;
5use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; 5use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6use Symfony\Component\Config\Definition\Exception\Exception; 6use Symfony\Component\Config\Definition\Exception\Exception;
7use Symfony\Component\Console\Input\InputArgument; 7use Symfony\Component\Console\Input\InputArgument;
8use Symfony\Component\Console\Input\InputOption;
8use Symfony\Component\Console\Input\InputInterface; 9use Symfony\Component\Console\Input\InputInterface;
9use Symfony\Component\Console\Output\OutputInterface; 10use Symfony\Component\Console\Output\OutputInterface;
10 11
@@ -15,10 +16,12 @@ class ImportCommand extends ContainerAwareCommand
15 $this 16 $this
16 ->setName('wallabag:import') 17 ->setName('wallabag:import')
17 ->setDescription('Import entries from a JSON export') 18 ->setDescription('Import entries from a JSON export')
18 ->addArgument('userId', InputArgument::REQUIRED, 'User ID to populate') 19 ->addArgument('username', InputArgument::REQUIRED, 'User to populate')
19 ->addArgument('filepath', InputArgument::REQUIRED, 'Path to the JSON file') 20 ->addArgument('filepath', InputArgument::REQUIRED, 'Path to the JSON file')
20 ->addOption('importer', null, InputArgument::OPTIONAL, 'The importer to use: v1, v2, instapaper, pinboard, readability, firefox or chrome', 'v1') 21 ->addOption('importer', null, InputOption::VALUE_OPTIONAL, 'The importer to use: v1, v2, instapaper, pinboard, readability, firefox or chrome', 'v1')
21 ->addOption('markAsRead', null, InputArgument::OPTIONAL, 'Mark all entries as read', false) 22 ->addOption('markAsRead', null, InputOption::VALUE_OPTIONAL, 'Mark all entries as read', false)
23 ->addOption('useUserId', null, InputOption::VALUE_NONE, 'Use user id instead of username to find account')
24 ->addOption('disableContentUpdate', null, InputOption::VALUE_NONE, 'Disable fetching updated content from URL')
22 ; 25 ;
23 } 26 }
24 27
@@ -34,10 +37,14 @@ class ImportCommand extends ContainerAwareCommand
34 // Turning off doctrine default logs queries for saving memory 37 // Turning off doctrine default logs queries for saving memory
35 $em->getConnection()->getConfiguration()->setSQLLogger(null); 38 $em->getConnection()->getConfiguration()->setSQLLogger(null);
36 39
37 $user = $em->getRepository('WallabagUserBundle:User')->findOneById($input->getArgument('userId')); 40 if ($input->getOption('useUserId')) {
41 $user = $em->getRepository('WallabagUserBundle:User')->findOneById($input->getArgument('username'));
42 } else {
43 $user = $em->getRepository('WallabagUserBundle:User')->findOneByUsername($input->getArgument('username'));
44 }
38 45
39 if (!is_object($user)) { 46 if (!is_object($user)) {
40 throw new Exception(sprintf('User with id "%s" not found', $input->getArgument('userId'))); 47 throw new Exception(sprintf('User "%s" not found', $input->getArgument('username')));
41 } 48 }
42 49
43 switch ($input->getOption('importer')) { 50 switch ($input->getOption('importer')) {
@@ -64,6 +71,7 @@ class ImportCommand extends ContainerAwareCommand
64 } 71 }
65 72
66 $import->setMarkAsRead($input->getOption('markAsRead')); 73 $import->setMarkAsRead($input->getOption('markAsRead'));
74 $import->setDisableContentUpdate($input->getOption('disableContentUpdate'));
67 $import->setUser($user); 75 $import->setUser($user);
68 76
69 $res = $import 77 $res = $import
diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php
index 1d4a6e27..9b624296 100644
--- a/src/Wallabag/ImportBundle/Import/AbstractImport.php
+++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php
@@ -8,6 +8,7 @@ use Doctrine\ORM\EntityManager;
8use Wallabag\CoreBundle\Helper\ContentProxy; 8use Wallabag\CoreBundle\Helper\ContentProxy;
9use Wallabag\CoreBundle\Entity\Entry; 9use Wallabag\CoreBundle\Entity\Entry;
10use Wallabag\CoreBundle\Entity\Tag; 10use Wallabag\CoreBundle\Entity\Tag;
11use Wallabag\CoreBundle\Helper\TagsAssigner;
11use Wallabag\UserBundle\Entity\User; 12use Wallabag\UserBundle\Entity\User;
12use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface; 13use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface;
13use Symfony\Component\EventDispatcher\EventDispatcherInterface; 14use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -18,19 +19,22 @@ abstract class AbstractImport implements ImportInterface
18 protected $em; 19 protected $em;
19 protected $logger; 20 protected $logger;
20 protected $contentProxy; 21 protected $contentProxy;
22 protected $tagsAssigner;
21 protected $eventDispatcher; 23 protected $eventDispatcher;
22 protected $producer; 24 protected $producer;
23 protected $user; 25 protected $user;
24 protected $markAsRead; 26 protected $markAsRead;
27 protected $disableContentUpdate = false;
25 protected $skippedEntries = 0; 28 protected $skippedEntries = 0;
26 protected $importedEntries = 0; 29 protected $importedEntries = 0;
27 protected $queuedEntries = 0; 30 protected $queuedEntries = 0;
28 31
29 public function __construct(EntityManager $em, ContentProxy $contentProxy, EventDispatcherInterface $eventDispatcher) 32 public function __construct(EntityManager $em, ContentProxy $contentProxy, TagsAssigner $tagsAssigner, EventDispatcherInterface $eventDispatcher)
30 { 33 {
31 $this->em = $em; 34 $this->em = $em;
32 $this->logger = new NullLogger(); 35 $this->logger = new NullLogger();
33 $this->contentProxy = $contentProxy; 36 $this->contentProxy = $contentProxy;
37 $this->tagsAssigner = $tagsAssigner;
34 $this->eventDispatcher = $eventDispatcher; 38 $this->eventDispatcher = $eventDispatcher;
35 } 39 }
36 40
@@ -82,21 +86,34 @@ abstract class AbstractImport implements ImportInterface
82 } 86 }
83 87
84 /** 88 /**
89 * Set whether articles should be fetched for updated content.
90 *
91 * @param bool $disableContentUpdate
92 */
93 public function setDisableContentUpdate($disableContentUpdate)
94 {
95 $this->disableContentUpdate = $disableContentUpdate;
96
97 return $this;
98 }
99
100 /**
85 * Fetch content from the ContentProxy (using graby). 101 * Fetch content from the ContentProxy (using graby).
86 * If it fails return the given entry to be saved in all case (to avoid user to loose the content). 102 * If it fails return the given entry to be saved in all case (to avoid user to loose the content).
87 * 103 *
88 * @param Entry $entry Entry to update 104 * @param Entry $entry Entry to update
89 * @param string $url Url to grab content for 105 * @param string $url Url to grab content for
90 * @param array $content An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url 106 * @param array $content An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url
91 *
92 * @return Entry
93 */ 107 */
94 protected function fetchContent(Entry $entry, $url, array $content = []) 108 protected function fetchContent(Entry $entry, $url, array $content = [])
95 { 109 {
96 try { 110 try {
97 return $this->contentProxy->updateEntry($entry, $url, $content); 111 $this->contentProxy->updateEntry($entry, $url, $content, $this->disableContentUpdate);
98 } catch (\Exception $e) { 112 } catch (\Exception $e) {
99 return $entry; 113 $this->logger->error('Error trying to import an entry.', [
114 'entry_url' => $url,
115 'error_msg' => $e->getMessage(),
116 ]);
100 } 117 }
101 } 118 }
102 119
diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php
index 8bf7d92e..71e65e59 100644
--- a/src/Wallabag/ImportBundle/Import/BrowserImport.php
+++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php
@@ -4,7 +4,6 @@ namespace Wallabag\ImportBundle\Import;
4 4
5use Wallabag\CoreBundle\Entity\Entry; 5use Wallabag\CoreBundle\Entity\Entry;
6use Wallabag\UserBundle\Entity\User; 6use Wallabag\UserBundle\Entity\User;
7use Wallabag\CoreBundle\Helper\ContentProxy;
8use Wallabag\CoreBundle\Event\EntrySavedEvent; 7use Wallabag\CoreBundle\Event\EntrySavedEvent;
9 8
10abstract class BrowserImport extends AbstractImport 9abstract class BrowserImport extends AbstractImport
@@ -202,10 +201,10 @@ abstract class BrowserImport extends AbstractImport
202 $entry->setTitle($data['title']); 201 $entry->setTitle($data['title']);
203 202
204 // update entry with content (in case fetching failed, the given entry will be return) 203 // update entry with content (in case fetching failed, the given entry will be return)
205 $entry = $this->fetchContent($entry, $data['url'], $data); 204 $this->fetchContent($entry, $data['url'], $data);
206 205
207 if (array_key_exists('tags', $data)) { 206 if (array_key_exists('tags', $data)) {
208 $this->contentProxy->assignTagsToEntry( 207 $this->tagsAssigner->assignTagsToEntry(
209 $entry, 208 $entry,
210 $data['tags'] 209 $data['tags']
211 ); 210 );
diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php
index 70a53f1a..3aa12f6f 100644
--- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php
+++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php
@@ -68,6 +68,14 @@ class InstapaperImport extends AbstractImport
68 continue; 68 continue;
69 } 69 }
70 70
71 // last element in the csv is the folder where the content belong
72 // BUT it can also be the status (since status = folder in Instapaper)
73 // and we don't want archive, unread & starred to become a tag
74 $tags = null;
75 if (false === in_array($data[3], ['Archive', 'Unread', 'Starred'])) {
76 $tags = [$data[3]];
77 }
78
71 $entries[] = [ 79 $entries[] = [
72 'url' => $data[0], 80 'url' => $data[0],
73 'title' => $data[1], 81 'title' => $data[1],
@@ -75,6 +83,7 @@ class InstapaperImport extends AbstractImport
75 'is_archived' => $data[3] === 'Archive' || $data[3] === 'Starred', 83 'is_archived' => $data[3] === 'Archive' || $data[3] === 'Starred',
76 'is_starred' => $data[3] === 'Starred', 84 'is_starred' => $data[3] === 'Starred',
77 'html' => false, 85 'html' => false,
86 'tags' => $tags,
78 ]; 87 ];
79 } 88 }
80 fclose($handle); 89 fclose($handle);
@@ -116,7 +125,15 @@ class InstapaperImport extends AbstractImport
116 $entry->setTitle($importedEntry['title']); 125 $entry->setTitle($importedEntry['title']);
117 126
118 // update entry with content (in case fetching failed, the given entry will be return) 127 // update entry with content (in case fetching failed, the given entry will be return)
119 $entry = $this->fetchContent($entry, $importedEntry['url'], $importedEntry); 128 $this->fetchContent($entry, $importedEntry['url'], $importedEntry);
129
130 if (!empty($importedEntry['tags'])) {
131 $this->tagsAssigner->assignTagsToEntry(
132 $entry,
133 $importedEntry['tags'],
134 $this->em->getUnitOfWork()->getScheduledEntityInsertions()
135 );
136 }
120 137
121 $entry->setArchived($importedEntry['is_archived']); 138 $entry->setArchived($importedEntry['is_archived']);
122 $entry->setStarred($importedEntry['is_starred']); 139 $entry->setStarred($importedEntry['is_starred']);
diff --git a/src/Wallabag/ImportBundle/Import/PinboardImport.php b/src/Wallabag/ImportBundle/Import/PinboardImport.php
index d9865534..110b0464 100644
--- a/src/Wallabag/ImportBundle/Import/PinboardImport.php
+++ b/src/Wallabag/ImportBundle/Import/PinboardImport.php
@@ -109,10 +109,10 @@ class PinboardImport extends AbstractImport
109 $entry->setTitle($data['title']); 109 $entry->setTitle($data['title']);
110 110
111 // update entry with content (in case fetching failed, the given entry will be return) 111 // update entry with content (in case fetching failed, the given entry will be return)
112 $entry = $this->fetchContent($entry, $data['url'], $data); 112 $this->fetchContent($entry, $data['url'], $data);
113 113
114 if (!empty($data['tags'])) { 114 if (!empty($data['tags'])) {
115 $this->contentProxy->assignTagsToEntry( 115 $this->tagsAssigner->assignTagsToEntry(
116 $entry, 116 $entry,
117 $data['tags'], 117 $data['tags'],
118 $this->em->getUnitOfWork()->getScheduledEntityInsertions() 118 $this->em->getUnitOfWork()->getScheduledEntityInsertions()
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index 33093480..c1d5b6da 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -5,7 +5,6 @@ namespace Wallabag\ImportBundle\Import;
5use GuzzleHttp\Client; 5use GuzzleHttp\Client;
6use GuzzleHttp\Exception\RequestException; 6use GuzzleHttp\Exception\RequestException;
7use Wallabag\CoreBundle\Entity\Entry; 7use Wallabag\CoreBundle\Entity\Entry;
8use Wallabag\CoreBundle\Helper\ContentProxy;
9 8
10class PocketImport extends AbstractImport 9class PocketImport extends AbstractImport
11{ 10{
@@ -193,7 +192,7 @@ class PocketImport extends AbstractImport
193 $entry->setUrl($url); 192 $entry->setUrl($url);
194 193
195 // update entry with content (in case fetching failed, the given entry will be return) 194 // update entry with content (in case fetching failed, the given entry will be return)
196 $entry = $this->fetchContent($entry, $url); 195 $this->fetchContent($entry, $url);
197 196
198 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted 197 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
199 $entry->setArchived($importedEntry['status'] == 1 || $this->markAsRead); 198 $entry->setArchived($importedEntry['status'] == 1 || $this->markAsRead);
@@ -216,7 +215,7 @@ class PocketImport extends AbstractImport
216 } 215 }
217 216
218 if (isset($importedEntry['tags']) && !empty($importedEntry['tags'])) { 217 if (isset($importedEntry['tags']) && !empty($importedEntry['tags'])) {
219 $this->contentProxy->assignTagsToEntry( 218 $this->tagsAssigner->assignTagsToEntry(
220 $entry, 219 $entry,
221 array_keys($importedEntry['tags']), 220 array_keys($importedEntry['tags']),
222 $this->em->getUnitOfWork()->getScheduledEntityInsertions() 221 $this->em->getUnitOfWork()->getScheduledEntityInsertions()
diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php
index de320d23..002b27f4 100644
--- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php
+++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php
@@ -109,7 +109,7 @@ class ReadabilityImport extends AbstractImport
109 $entry->setTitle($data['title']); 109 $entry->setTitle($data['title']);
110 110
111 // update entry with content (in case fetching failed, the given entry will be return) 111 // update entry with content (in case fetching failed, the given entry will be return)
112 $entry = $this->fetchContent($entry, $data['url'], $data); 112 $this->fetchContent($entry, $data['url'], $data);
113 113
114 $entry->setArchived($data['is_archived']); 114 $entry->setArchived($data['is_archived']);
115 $entry->setStarred($data['is_starred']); 115 $entry->setStarred($data['is_starred']);
diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php
index 702da057..c64ccd64 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagImport.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php
@@ -108,10 +108,10 @@ abstract class WallabagImport extends AbstractImport
108 $entry->setTitle($data['title']); 108 $entry->setTitle($data['title']);
109 109
110 // update entry with content (in case fetching failed, the given entry will be return) 110 // update entry with content (in case fetching failed, the given entry will be return)
111 $entry = $this->fetchContent($entry, $data['url'], $data); 111 $this->fetchContent($entry, $data['url'], $data);
112 112
113 if (array_key_exists('tags', $data)) { 113 if (array_key_exists('tags', $data)) {
114 $this->contentProxy->assignTagsToEntry( 114 $this->tagsAssigner->assignTagsToEntry(
115 $entry, 115 $entry,
116 $data['tags'], 116 $data['tags'],
117 $this->em->getUnitOfWork()->getScheduledEntityInsertions() 117 $this->em->getUnitOfWork()->getScheduledEntityInsertions()
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
index 59e3ce02..1f0df646 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
@@ -4,6 +4,17 @@ namespace Wallabag\ImportBundle\Import;
4 4
5class WallabagV1Import extends WallabagImport 5class WallabagV1Import extends WallabagImport
6{ 6{
7 protected $fetchingErrorMessage;
8 protected $fetchingErrorMessageTitle;
9
10 public function __construct($em, $contentProxy, $tagsAssigner, $eventDispatcher, $fetchingErrorMessageTitle, $fetchingErrorMessage)
11 {
12 $this->fetchingErrorMessageTitle = $fetchingErrorMessageTitle;
13 $this->fetchingErrorMessage = $fetchingErrorMessage;
14
15 parent::__construct($em, $contentProxy, $tagsAssigner, $eventDispatcher);
16 }
17
7 /** 18 /**
8 * {@inheritdoc} 19 * {@inheritdoc}
9 */ 20 */
@@ -43,10 +54,11 @@ class WallabagV1Import extends WallabagImport
43 'created_at' => '', 54 'created_at' => '',
44 ]; 55 ];
45 56
46 // force content to be refreshed in case on bad fetch in the v1 installation 57 // In case of a bad fetch in v1, replace title and content with v2 error strings
58 // If fetching fails again, they will get this instead of the v1 strings
47 if (in_array($entry['title'], $this->untitled)) { 59 if (in_array($entry['title'], $this->untitled)) {
48 $data['title'] = ''; 60 $data['title'] = $this->fetchingErrorMessageTitle;
49 $data['html'] = ''; 61 $data['html'] = $this->fetchingErrorMessage;
50 } 62 }
51 63
52 if (array_key_exists('tags', $entry) && $entry['tags'] != '') { 64 if (array_key_exists('tags', $entry) && $entry['tags'] != '') {
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
index d2a89d79..3e085ecf 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php
@@ -36,8 +36,8 @@ class WallabagV2Import extends WallabagImport
36 return [ 36 return [
37 'html' => $entry['content'], 37 'html' => $entry['content'],
38 'content_type' => $entry['mimetype'], 38 'content_type' => $entry['mimetype'],
39 'is_archived' => (int) ($entry['is_archived'] || $this->markAsRead), 39 'is_archived' => (bool) ($entry['is_archived'] || $this->markAsRead),
40 'is_starred' => false, 40 'is_starred' => (bool) $entry['is_starred'],
41 ] + $entry; 41 ] + $entry;
42 } 42 }
43 43
diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml
index c4fe3f92..b224a6a2 100644
--- a/src/Wallabag/ImportBundle/Resources/config/services.yml
+++ b/src/Wallabag/ImportBundle/Resources/config/services.yml
@@ -20,6 +20,7 @@ services:
20 arguments: 20 arguments:
21 - "@doctrine.orm.entity_manager" 21 - "@doctrine.orm.entity_manager"
22 - "@wallabag_core.content_proxy" 22 - "@wallabag_core.content_proxy"
23 - "@wallabag_core.tags_assigner"
23 - "@event_dispatcher" 24 - "@event_dispatcher"
24 calls: 25 calls:
25 - [ setClient, [ "@wallabag_import.pocket.client" ] ] 26 - [ setClient, [ "@wallabag_import.pocket.client" ] ]
@@ -32,7 +33,10 @@ services:
32 arguments: 33 arguments:
33 - "@doctrine.orm.entity_manager" 34 - "@doctrine.orm.entity_manager"
34 - "@wallabag_core.content_proxy" 35 - "@wallabag_core.content_proxy"
36 - "@wallabag_core.tags_assigner"
35 - "@event_dispatcher" 37 - "@event_dispatcher"
38 - "%wallabag_core.fetching_error_message_title%"
39 - "%wallabag_core.fetching_error_message%"
36 calls: 40 calls:
37 - [ setLogger, [ "@logger" ]] 41 - [ setLogger, [ "@logger" ]]
38 tags: 42 tags:
@@ -43,6 +47,7 @@ services:
43 arguments: 47 arguments:
44 - "@doctrine.orm.entity_manager" 48 - "@doctrine.orm.entity_manager"
45 - "@wallabag_core.content_proxy" 49 - "@wallabag_core.content_proxy"
50 - "@wallabag_core.tags_assigner"
46 - "@event_dispatcher" 51 - "@event_dispatcher"
47 calls: 52 calls:
48 - [ setLogger, [ "@logger" ]] 53 - [ setLogger, [ "@logger" ]]
@@ -54,6 +59,7 @@ services:
54 arguments: 59 arguments:
55 - "@doctrine.orm.entity_manager" 60 - "@doctrine.orm.entity_manager"
56 - "@wallabag_core.content_proxy" 61 - "@wallabag_core.content_proxy"
62 - "@wallabag_core.tags_assigner"
57 - "@event_dispatcher" 63 - "@event_dispatcher"
58 calls: 64 calls:
59 - [ setLogger, [ "@logger" ]] 65 - [ setLogger, [ "@logger" ]]
@@ -65,6 +71,7 @@ services:
65 arguments: 71 arguments:
66 - "@doctrine.orm.entity_manager" 72 - "@doctrine.orm.entity_manager"
67 - "@wallabag_core.content_proxy" 73 - "@wallabag_core.content_proxy"
74 - "@wallabag_core.tags_assigner"
68 - "@event_dispatcher" 75 - "@event_dispatcher"
69 calls: 76 calls:
70 - [ setLogger, [ "@logger" ]] 77 - [ setLogger, [ "@logger" ]]
@@ -76,6 +83,7 @@ services:
76 arguments: 83 arguments:
77 - "@doctrine.orm.entity_manager" 84 - "@doctrine.orm.entity_manager"
78 - "@wallabag_core.content_proxy" 85 - "@wallabag_core.content_proxy"
86 - "@wallabag_core.tags_assigner"
79 - "@event_dispatcher" 87 - "@event_dispatcher"
80 calls: 88 calls:
81 - [ setLogger, [ "@logger" ]] 89 - [ setLogger, [ "@logger" ]]
@@ -87,6 +95,7 @@ services:
87 arguments: 95 arguments:
88 - "@doctrine.orm.entity_manager" 96 - "@doctrine.orm.entity_manager"
89 - "@wallabag_core.content_proxy" 97 - "@wallabag_core.content_proxy"
98 - "@wallabag_core.tags_assigner"
90 - "@event_dispatcher" 99 - "@event_dispatcher"
91 calls: 100 calls:
92 - [ setLogger, [ "@logger" ]] 101 - [ setLogger, [ "@logger" ]]
@@ -97,6 +106,7 @@ services:
97 arguments: 106 arguments:
98 - "@doctrine.orm.entity_manager" 107 - "@doctrine.orm.entity_manager"
99 - "@wallabag_core.content_proxy" 108 - "@wallabag_core.content_proxy"
109 - "@wallabag_core.tags_assigner"
100 - "@event_dispatcher" 110 - "@event_dispatcher"
101 calls: 111 calls:
102 - [ setLogger, [ "@logger" ]] 112 - [ setLogger, [ "@logger" ]]
diff --git a/src/Wallabag/UserBundle/Controller/ManageController.php b/src/Wallabag/UserBundle/Controller/ManageController.php
index 92ee2b41..084f2c67 100644
--- a/src/Wallabag/UserBundle/Controller/ManageController.php
+++ b/src/Wallabag/UserBundle/Controller/ManageController.php
@@ -4,12 +4,15 @@ namespace Wallabag\UserBundle\Controller;
4 4
5use FOS\UserBundle\Event\UserEvent; 5use FOS\UserBundle\Event\UserEvent;
6use FOS\UserBundle\FOSUserEvents; 6use FOS\UserBundle\FOSUserEvents;
7use Pagerfanta\Adapter\DoctrineORMAdapter;
8use Pagerfanta\Exception\OutOfRangeCurrentPageException;
9use Pagerfanta\Pagerfanta;
7use Symfony\Component\HttpFoundation\Request; 10use Symfony\Component\HttpFoundation\Request;
8use Symfony\Bundle\FrameworkBundle\Controller\Controller; 11use Symfony\Bundle\FrameworkBundle\Controller\Controller;
9use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; 12use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
10use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 13use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
11use Wallabag\UserBundle\Entity\User; 14use Wallabag\UserBundle\Entity\User;
12use Wallabag\CoreBundle\Entity\Config; 15use Wallabag\UserBundle\Form\SearchUserType;
13 16
14/** 17/**
15 * User controller. 18 * User controller.
@@ -17,23 +20,6 @@ use Wallabag\CoreBundle\Entity\Config;
17class ManageController extends Controller 20class ManageController extends Controller
18{ 21{
19 /** 22 /**
20 * Lists all User entities.
21 *
22 * @Route("/", name="user_index")
23 * @Method("GET")
24 */
25 public function indexAction()
26 {
27 $em = $this->getDoctrine()->getManager();
28
29 $users = $em->getRepository('WallabagUserBundle:User')->findAll();
30
31 return $this->render('WallabagUserBundle:Manage:index.html.twig', array(
32 'users' => $users,
33 ));
34 }
35
36 /**
37 * Creates a new User entity. 23 * Creates a new User entity.
38 * 24 *
39 * @Route("/new", name="user_new") 25 * @Route("/new", name="user_new")
@@ -47,9 +33,7 @@ class ManageController extends Controller
47 // enable created user by default 33 // enable created user by default
48 $user->setEnabled(true); 34 $user->setEnabled(true);
49 35
50 $form = $this->createForm('Wallabag\UserBundle\Form\NewUserType', $user, [ 36 $form = $this->createForm('Wallabag\UserBundle\Form\NewUserType', $user);
51 'validation_groups' => ['Profile'],
52 ]);
53 $form->handleRequest($request); 37 $form->handleRequest($request);
54 38
55 if ($form->isSubmitted() && $form->isValid()) { 39 if ($form->isSubmitted() && $form->isValid()) {
@@ -146,4 +130,49 @@ class ManageController extends Controller
146 ->getForm() 130 ->getForm()
147 ; 131 ;
148 } 132 }
133
134 /**
135 * @param Request $request
136 * @param int $page
137 *
138 * @Route("/list/{page}", name="user_index", defaults={"page" = 1})
139 *
140 * Default parameter for page is hardcoded (in duplication of the defaults from the Route)
141 * because this controller is also called inside the layout template without any page as argument
142 *
143 * @return \Symfony\Component\HttpFoundation\Response
144 */
145 public function searchFormAction(Request $request, $page = 1)
146 {
147 $em = $this->getDoctrine()->getManager();
148 $qb = $em->getRepository('WallabagUserBundle:User')->createQueryBuilder('u');
149
150 $form = $this->createForm(SearchUserType::class);
151 $form->handleRequest($request);
152
153 if ($form->isSubmitted() && $form->isValid()) {
154 $this->get('logger')->info('searching users');
155
156 $searchTerm = (isset($request->get('search_user')['term']) ? $request->get('search_user')['term'] : '');
157
158 $qb = $em->getRepository('WallabagUserBundle:User')->getQueryBuilderForSearch($searchTerm);
159 }
160
161 $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);
162 $pagerFanta = new Pagerfanta($pagerAdapter);
163 $pagerFanta->setMaxPerPage(50);
164
165 try {
166 $pagerFanta->setCurrentPage($page);
167 } catch (OutOfRangeCurrentPageException $e) {
168 if ($page > 1) {
169 return $this->redirect($this->generateUrl('user_index', ['page' => $pagerFanta->getNbPages()]), 302);
170 }
171 }
172
173 return $this->render('WallabagUserBundle:Manage:index.html.twig', [
174 'searchForm' => $form->createView(),
175 'users' => $pagerFanta,
176 ]);
177 }
149} 178}
diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php
index 3a167de7..ed6ce331 100644
--- a/src/Wallabag/UserBundle/Entity/User.php
+++ b/src/Wallabag/UserBundle/Entity/User.php
@@ -4,11 +4,11 @@ namespace Wallabag\UserBundle\Entity;
4 4
5use Doctrine\Common\Collections\ArrayCollection; 5use Doctrine\Common\Collections\ArrayCollection;
6use Doctrine\ORM\Mapping as ORM; 6use Doctrine\ORM\Mapping as ORM;
7use JMS\Serializer\Annotation\Groups;
8use JMS\Serializer\Annotation\XmlRoot;
7use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; 9use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
8use Scheb\TwoFactorBundle\Model\TrustedComputerInterface; 10use Scheb\TwoFactorBundle\Model\TrustedComputerInterface;
9use FOS\UserBundle\Model\User as BaseUser; 11use FOS\UserBundle\Model\User as BaseUser;
10use JMS\Serializer\Annotation\ExclusionPolicy;
11use JMS\Serializer\Annotation\Expose;
12use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; 12use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
13use Symfony\Component\Security\Core\User\UserInterface; 13use Symfony\Component\Security\Core\User\UserInterface;
14use Wallabag\ApiBundle\Entity\Client; 14use Wallabag\ApiBundle\Entity\Client;
@@ -18,23 +18,25 @@ use Wallabag\CoreBundle\Entity\Entry;
18/** 18/**
19 * User. 19 * User.
20 * 20 *
21 * @XmlRoot("user")
21 * @ORM\Entity(repositoryClass="Wallabag\UserBundle\Repository\UserRepository") 22 * @ORM\Entity(repositoryClass="Wallabag\UserBundle\Repository\UserRepository")
22 * @ORM\Table(name="`user`") 23 * @ORM\Table(name="`user`")
23 * @ORM\HasLifecycleCallbacks() 24 * @ORM\HasLifecycleCallbacks()
24 * @ExclusionPolicy("all")
25 * 25 *
26 * @UniqueEntity("email") 26 * @UniqueEntity("email")
27 * @UniqueEntity("username") 27 * @UniqueEntity("username")
28 */ 28 */
29class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface 29class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface
30{ 30{
31 /** @Serializer\XmlAttribute */
31 /** 32 /**
32 * @var int 33 * @var int
33 * 34 *
34 * @Expose
35 * @ORM\Column(name="id", type="integer") 35 * @ORM\Column(name="id", type="integer")
36 * @ORM\Id 36 * @ORM\Id
37 * @ORM\GeneratedValue(strategy="AUTO") 37 * @ORM\GeneratedValue(strategy="AUTO")
38 *
39 * @Groups({"user_api"})
38 */ 40 */
39 protected $id; 41 protected $id;
40 42
@@ -42,20 +44,40 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
42 * @var string 44 * @var string
43 * 45 *
44 * @ORM\Column(name="name", type="text", nullable=true) 46 * @ORM\Column(name="name", type="text", nullable=true)
47 *
48 * @Groups({"user_api"})
45 */ 49 */
46 protected $name; 50 protected $name;
47 51
48 /** 52 /**
49 * @var date 53 * @var string
54 *
55 * @Groups({"user_api"})
56 */
57 protected $username;
58
59 /**
60 * @var string
61 *
62 * @Groups({"user_api"})
63 */
64 protected $email;
65
66 /**
67 * @var \DateTime
50 * 68 *
51 * @ORM\Column(name="created_at", type="datetime") 69 * @ORM\Column(name="created_at", type="datetime")
70 *
71 * @Groups({"user_api"})
52 */ 72 */
53 protected $createdAt; 73 protected $createdAt;
54 74
55 /** 75 /**
56 * @var date 76 * @var \DateTime
57 * 77 *
58 * @ORM\Column(name="updated_at", type="datetime") 78 * @ORM\Column(name="updated_at", type="datetime")
79 *
80 * @Groups({"user_api"})
59 */ 81 */
60 protected $updatedAt; 82 protected $updatedAt;
61 83
@@ -135,7 +157,7 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
135 } 157 }
136 158
137 /** 159 /**
138 * @return string 160 * @return \DateTime
139 */ 161 */
140 public function getCreatedAt() 162 public function getCreatedAt()
141 { 163 {
@@ -143,7 +165,7 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
143 } 165 }
144 166
145 /** 167 /**
146 * @return string 168 * @return \DateTime
147 */ 169 */
148 public function getUpdatedAt() 170 public function getUpdatedAt()
149 { 171 {
diff --git a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
index 0bdd1cae..e4d55c19 100644
--- a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
+++ b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
@@ -5,7 +5,6 @@ namespace Wallabag\UserBundle\EventListener;
5use Doctrine\ORM\EntityManager; 5use Doctrine\ORM\EntityManager;
6use FOS\UserBundle\Event\UserEvent; 6use FOS\UserBundle\Event\UserEvent;
7use FOS\UserBundle\FOSUserEvents; 7use FOS\UserBundle\FOSUserEvents;
8use Symfony\Component\EventDispatcher\EventDispatcherInterface;
9use Symfony\Component\EventDispatcher\EventSubscriberInterface; 8use Symfony\Component\EventDispatcher\EventSubscriberInterface;
10use Wallabag\CoreBundle\Entity\Config; 9use Wallabag\CoreBundle\Entity\Config;
11 10
@@ -47,7 +46,7 @@ class CreateConfigListener implements EventSubscriberInterface
47 ]; 46 ];
48 } 47 }
49 48
50 public function createConfig(UserEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null) 49 public function createConfig(UserEvent $event)
51 { 50 {
52 $config = new Config($event->getUser()); 51 $config = new Config($event->getUser());
53 $config->setTheme($this->theme); 52 $config->setTheme($this->theme);
diff --git a/src/Wallabag/UserBundle/Form/SearchUserType.php b/src/Wallabag/UserBundle/Form/SearchUserType.php
new file mode 100644
index 00000000..9ce46ee1
--- /dev/null
+++ b/src/Wallabag/UserBundle/Form/SearchUserType.php
@@ -0,0 +1,29 @@
1<?php
2
3namespace Wallabag\UserBundle\Form;
4
5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\TextType;
7use Symfony\Component\Form\FormBuilderInterface;
8use Symfony\Component\OptionsResolver\OptionsResolver;
9
10class SearchUserType extends AbstractType
11{
12 public function buildForm(FormBuilderInterface $builder, array $options)
13 {
14 $builder
15 ->setMethod('GET')
16 ->add('term', TextType::class, [
17 'required' => true,
18 'label' => 'user.new.form_search.term_label',
19 ])
20 ;
21 }
22
23 public function configureOptions(OptionsResolver $resolver)
24 {
25 $resolver->setDefaults([
26 'csrf_protection' => false,
27 ]);
28 }
29}
diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php
index f913f52d..6adbe329 100644
--- a/src/Wallabag/UserBundle/Repository/UserRepository.php
+++ b/src/Wallabag/UserBundle/Repository/UserRepository.php
@@ -52,4 +52,17 @@ class UserRepository extends EntityRepository
52 ->getQuery() 52 ->getQuery()
53 ->getSingleScalarResult(); 53 ->getSingleScalarResult();
54 } 54 }
55
56 /**
57 * Retrieves users filtered with a search term.
58 *
59 * @param string $term
60 *
61 * @return QueryBuilder
62 */
63 public function getQueryBuilderForSearch($term)
64 {
65 return $this->createQueryBuilder('u')
66 ->andWhere('lower(u.username) LIKE lower(:term) OR lower(u.email) LIKE lower(:term) OR lower(u.name) LIKE lower(:term)')->setParameter('term', '%'.$term.'%');
67 }
55} 68}
diff --git a/src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig b/src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig
index daba29e4..15002632 100644
--- a/src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig
@@ -7,37 +7,60 @@
7 <div class="row"> 7 <div class="row">
8 <div class="col s12"> 8 <div class="col s12">
9 <div class="card-panel"> 9 <div class="card-panel">
10 {% if users.getNbPages > 1 %}
11 {{ pagerfanta(users, 'twitter_bootstrap_translated', {'proximity': 1}) }}
12 {% endif %}
10 <div class="row"> 13 <div class="row">
11 <div class="input-field col s12"> 14 <div class="col s6">
12 <p class="help">{{ 'user.description'|trans|raw }}</p> 15 <p class="help">{{ 'user.description'|trans|raw }}</p>
16 </div>
17 <div class="col s6">
18 <div class="input-field">
19 <form name="search_users" method="GET" action="{{ path('user_index')}}">
20 {% if form_errors(searchForm) %}
21 <span class="black-text">{{ form_errors(searchForm) }}</span>
22 {% endif %}
23
24 {% if form_errors(searchForm.term) %}
25 <span class="black-text">{{ form_errors(searchForm.term) }}</span>
26 {% endif %}
13 27
14 <table class="bordered"> 28 {{ form_widget(searchForm.term, { 'attr': {'autocomplete': 'off', 'placeholder': 'user.search.placeholder'} }) }}
15 <thead> 29
16 <tr> 30 {{ form_rest(searchForm) }}
17 <th>{{ 'user.form.username_label'|trans }}</th> 31 </form>
18 <th>{{ 'user.form.email_label'|trans }}</th> 32 </div>
19 <th>{{ 'user.form.last_login_label'|trans }}</th>
20 <th>{{ 'user.list.actions'|trans }}</th>
21 </tr>
22 </thead>
23 <tbody>
24 {% for user in users %}
25 <tr>
26 <td>{{ user.username }}</td>
27 <td>{{ user.email }}</td>
28 <td>{% if user.lastLogin %}{{ user.lastLogin|date('Y-m-d H:i:s') }}{% endif %}</td>
29 <td>
30 <a href="{{ path('user_edit', { 'id': user.id }) }}">{{ 'user.list.edit_action'|trans }}</a>
31 </td>
32 </tr>
33 {% endfor %}
34 </tbody>
35 </table>
36 <br />
37 <p>
38 <a href="{{ path('user_new') }}" class="waves-effect waves-light btn">{{ 'user.list.create_new_one'|trans }}</a>
39 </p>
40 </div> 33 </div>
34
35 <table class="bordered">
36 <thead>
37 <tr>
38 <th>{{ 'user.form.username_label'|trans }}</th>
39 <th>{{ 'user.form.email_label'|trans }}</th>
40 <th>{{ 'user.form.last_login_label'|trans }}</th>
41 <th>{{ 'user.list.actions'|trans }}</th>
42 </tr>
43 </thead>
44 <tbody>
45 {% for user in users %}
46 <tr>
47 <td>{{ user.username }}</td>
48 <td>{{ user.email }}</td>
49 <td>{% if user.lastLogin %}{{ user.lastLogin|date('Y-m-d H:i:s') }}{% endif %}</td>
50 <td>
51 <a href="{{ path('user_edit', { 'id': user.id }) }}">{{ 'user.list.edit_action'|trans }}</a>
52 </td>
53 </tr>
54 {% endfor %}
55 </tbody>
56 </table>
57 <br />
58 <p>
59 <a href="{{ path('user_new') }}" class="waves-effect waves-light btn">{{ 'user.list.create_new_one'|trans }}</a>
60 </p>
61 {% if users.getNbPages > 1 %}
62 {{ pagerfanta(users, 'twitter_bootstrap_translated', {'proximity': 1}) }}
63 {% endif %}
41 </div> 64 </div>
42 </div> 65 </div>
43 </div> 66 </div>