diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2017-11-20 21:10:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-20 21:10:33 +0100 |
commit | f4f7994c40ca57c7e6f8ca0a3d298c50c4e5f813 (patch) | |
tree | 14b2c8f8ea61578a7ca0c5414a85ce29bcf57bd7 /src | |
parent | 16b1939827453bc1c8f65c908c45575d27134a53 (diff) | |
parent | eae8138b33e4ed4a5d1a98daf77941ef691629de (diff) | |
download | wallabag-f4f7994c40ca57c7e6f8ca0a3d298c50c4e5f813.tar.gz wallabag-f4f7994c40ca57c7e6f8ca0a3d298c50c4e5f813.tar.zst wallabag-f4f7994c40ca57c7e6f8ca0a3d298c50c4e5f813.zip |
Merge pull request #3346 from Kdecherf/origin-property
Add originUrl property to Entry
Diffstat (limited to 'src')
21 files changed, 108 insertions, 2 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 6f161a08..7d820c7e 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -309,6 +309,7 @@ class EntryRestController extends WallabagRestController | |||
309 | * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, | 309 | * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, |
310 | * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, | 310 | * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, |
311 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, | 311 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, |
312 | * {"name"="origin_url", "dataType"="string", "required"=false, "format"="http://www.test.com/article.html", "description"="Origin url for the entry (from where you found it)."}, | ||
312 | * } | 313 | * } |
313 | * ) | 314 | * ) |
314 | * | 315 | * |
@@ -368,6 +369,10 @@ class EntryRestController extends WallabagRestController | |||
368 | $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']); | 369 | $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']); |
369 | } | 370 | } |
370 | 371 | ||
372 | if (!empty($data['origin_url'])) { | ||
373 | $entry->setOriginUrl($data['origin_url']); | ||
374 | } | ||
375 | |||
371 | if (null !== $data['isPublic']) { | 376 | if (null !== $data['isPublic']) { |
372 | if (true === (bool) $data['isPublic'] && null === $entry->getUid()) { | 377 | if (true === (bool) $data['isPublic'] && null === $entry->getUid()) { |
373 | $entry->generateUid(); | 378 | $entry->generateUid(); |
@@ -404,6 +409,7 @@ class EntryRestController extends WallabagRestController | |||
404 | * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, | 409 | * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, |
405 | * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, | 410 | * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, |
406 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, | 411 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, |
412 | * {"name"="origin_url", "dataType"="string", "required"=false, "format"="http://www.test.com/article.html", "description"="Origin url for the entry (from where you found it)."}, | ||
407 | * } | 413 | * } |
408 | * ) | 414 | * ) |
409 | * | 415 | * |
@@ -480,6 +486,10 @@ class EntryRestController extends WallabagRestController | |||
480 | } | 486 | } |
481 | } | 487 | } |
482 | 488 | ||
489 | if (!empty($data['origin_url'])) { | ||
490 | $entry->setOriginUrl($data['origin_url']); | ||
491 | } | ||
492 | |||
483 | $em = $this->getDoctrine()->getManager(); | 493 | $em = $this->getDoctrine()->getManager(); |
484 | $em->persist($entry); | 494 | $em->persist($entry); |
485 | $em->flush(); | 495 | $em->flush(); |
@@ -778,6 +788,7 @@ class EntryRestController extends WallabagRestController | |||
778 | 'picture' => $request->request->get('preview_picture'), | 788 | 'picture' => $request->request->get('preview_picture'), |
779 | 'publishedAt' => $request->request->get('published_at'), | 789 | 'publishedAt' => $request->request->get('published_at'), |
780 | 'authors' => $request->request->get('authors', ''), | 790 | 'authors' => $request->request->get('authors', ''), |
791 | 'origin_url' => $request->request->get('origin_url', ''), | ||
781 | ]; | 792 | ]; |
782 | } | 793 | } |
783 | 794 | ||
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index fedad009..0e1510a2 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php | |||
@@ -37,6 +37,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface | |||
37 | $entry2->setMimetype('text/html'); | 37 | $entry2->setMimetype('text/html'); |
38 | $entry2->setTitle('test title entry2'); | 38 | $entry2->setTitle('test title entry2'); |
39 | $entry2->setContent('This is my content /o/'); | 39 | $entry2->setContent('This is my content /o/'); |
40 | $entry2->setOriginUrl('ftp://oneftp.tld'); | ||
40 | $entry2->setLanguage('fr'); | 41 | $entry2->setLanguage('fr'); |
41 | 42 | ||
42 | $manager->persist($entry2); | 43 | $manager->persist($entry2); |
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index cfb8db75..2b1f2e05 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -245,6 +245,15 @@ class Entry | |||
245 | */ | 245 | */ |
246 | private $tags; | 246 | private $tags; |
247 | 247 | ||
248 | /** | ||
249 | * @var string | ||
250 | * | ||
251 | * @ORM\Column(name="origin_url", type="text", nullable=true) | ||
252 | * | ||
253 | * @Groups({"entries_for_user", "export_all"}) | ||
254 | */ | ||
255 | private $originUrl; | ||
256 | |||
248 | /* | 257 | /* |
249 | * @param User $user | 258 | * @param User $user |
250 | */ | 259 | */ |
@@ -831,4 +840,28 @@ class Entry | |||
831 | 840 | ||
832 | return $this; | 841 | return $this; |
833 | } | 842 | } |
843 | |||
844 | /** | ||
845 | * Set origin url. | ||
846 | * | ||
847 | * @param string $originUrl | ||
848 | * | ||
849 | * @return Entry | ||
850 | */ | ||
851 | public function setOriginUrl($originUrl) | ||
852 | { | ||
853 | $this->originUrl = $originUrl; | ||
854 | |||
855 | return $this; | ||
856 | } | ||
857 | |||
858 | /** | ||
859 | * Get origin url. | ||
860 | * | ||
861 | * @return string | ||
862 | */ | ||
863 | public function getOriginUrl() | ||
864 | { | ||
865 | return $this->originUrl; | ||
866 | } | ||
834 | } | 867 | } |
diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php index 1627cc44..08355928 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php | |||
@@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Form\Type; | |||
5 | use Symfony\Component\Form\AbstractType; | 5 | use Symfony\Component\Form\AbstractType; |
6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | 6 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
7 | use Symfony\Component\Form\Extension\Core\Type\TextType; | 7 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
8 | use Symfony\Component\Form\Extension\Core\Type\UrlType; | ||
8 | use Symfony\Component\Form\FormBuilderInterface; | 9 | use Symfony\Component\Form\FormBuilderInterface; |
9 | use Symfony\Component\OptionsResolver\OptionsResolver; | 10 | use Symfony\Component\OptionsResolver\OptionsResolver; |
10 | 11 | ||
@@ -17,11 +18,16 @@ class EditEntryType extends AbstractType | |||
17 | 'required' => true, | 18 | 'required' => true, |
18 | 'label' => 'entry.edit.title_label', | 19 | 'label' => 'entry.edit.title_label', |
19 | ]) | 20 | ]) |
20 | ->add('url', TextType::class, [ | 21 | ->add('url', UrlType::class, [ |
21 | 'disabled' => true, | 22 | 'disabled' => true, |
22 | 'required' => false, | 23 | 'required' => false, |
23 | 'label' => 'entry.edit.url_label', | 24 | 'label' => 'entry.edit.url_label', |
24 | ]) | 25 | ]) |
26 | ->add('origin_url', UrlType::class, [ | ||
27 | 'required' => false, | ||
28 | 'property_path' => 'originUrl', | ||
29 | 'label' => 'entry.edit.origin_url_label', | ||
30 | ]) | ||
25 | ->add('save', SubmitType::class, [ | 31 | ->add('save', SubmitType::class, [ |
26 | 'label' => 'entry.edit.save_label', | 32 | 'label' => 'entry.edit.save_label', |
27 | ]) | 33 | ]) |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index d0a38f7e..27dbb388 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Oprettelsesdato' | 233 | created_at: 'Oprettelsesdato' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Gem ny artikel' | 238 | page_title: 'Gem ny artikel' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | # page_title: 'Edit an entry' | 245 | # page_title: 'Edit an entry' |
245 | # title_label: 'Title' | 246 | # title_label: 'Title' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Gem' | 249 | save_label: 'Gem' |
248 | public: | 250 | public: |
249 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 251 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 158762a9..d47986e5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Erstellungsdatum' | 233 | created_at: 'Erstellungsdatum' |
234 | published_at: 'Erscheinungsdatum' | 234 | published_at: 'Erscheinungsdatum' |
235 | published_by: 'Veröffentlicht von' | 235 | published_by: 'Veröffentlicht von' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Neuen Artikel speichern' | 238 | page_title: 'Neuen Artikel speichern' |
238 | placeholder: 'https://website.de' | 239 | placeholder: 'https://website.de' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Eintrag bearbeiten' | 245 | page_title: 'Eintrag bearbeiten' |
245 | title_label: 'Titel' | 246 | title_label: 'Titel' |
246 | url_label: 'URL' | 247 | url_label: 'URL' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Speichern' | 249 | save_label: 'Speichern' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: 'Dieser Artikel wurde von %username% mittels <a href="%wallabag_instance%">wallabag</a> geteilt' | 251 | shared_by_wallabag: 'Dieser Artikel wurde von %username% mittels <a href="%wallabag_instance%">wallabag</a> geteilt' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index de3e11fe..bbaecb24 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Creation date' | 233 | created_at: 'Creation date' |
234 | published_at: 'Publication date' | 234 | published_at: 'Publication date' |
235 | published_by: 'Published by' | 235 | published_by: 'Published by' |
236 | provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Save new entry' | 238 | page_title: 'Save new entry' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Edit an entry' | 245 | page_title: 'Edit an entry' |
245 | title_label: 'Title' | 246 | title_label: 'Title' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Save' | 249 | save_label: 'Save' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 6dfc1525..e3b625f7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Fecha de creación' | 233 | created_at: 'Fecha de creación' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Guardar un nuevo artículo' | 238 | page_title: 'Guardar un nuevo artículo' |
238 | placeholder: 'http://sitioweb.com' | 239 | placeholder: 'http://sitioweb.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Editar un artículo' | 245 | page_title: 'Editar un artículo' |
245 | title_label: 'Título' | 246 | title_label: 'Título' |
246 | url_label: 'URL' | 247 | url_label: 'URL' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Guardar' | 249 | save_label: 'Guardar' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Este artículo se ha compartido con <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Este artículo se ha compartido con <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index ffc48933..c03cca46 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'زمان ساخت' | 233 | created_at: 'زمان ساخت' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'ذخیرهٔ مقالهٔ تازه' | 238 | page_title: 'ذخیرهٔ مقالهٔ تازه' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'ویرایش مقاله' | 245 | page_title: 'ویرایش مقاله' |
245 | title_label: 'عنوان' | 246 | title_label: 'عنوان' |
246 | url_label: 'نشانی' | 247 | url_label: 'نشانی' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'ذخیره' | 249 | save_label: 'ذخیره' |
248 | public: | 250 | public: |
249 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 251 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index c9d95e2b..b0037ad2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: "Date de création" | 233 | created_at: "Date de création" |
234 | published_at: "Date de publication" | 234 | published_at: "Date de publication" |
235 | published_by: "Publié par" | 235 | published_by: "Publié par" |
236 | provided_by: "Fourni par" | ||
236 | new: | 237 | new: |
237 | page_title: "Sauvegarder un nouvel article" | 238 | page_title: "Sauvegarder un nouvel article" |
238 | placeholder: "http://website.com" | 239 | placeholder: "http://website.com" |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: "Éditer un article" | 245 | page_title: "Éditer un article" |
245 | title_label: "Titre" | 246 | title_label: "Titre" |
246 | url_label: "Adresse" | 247 | url_label: "Adresse" |
248 | origin_url_label: "Adresse d'origine (d'où vous avez trouvé cet article)" | ||
247 | save_label: "Enregistrer" | 249 | save_label: "Enregistrer" |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Cet article a été partagé par %username% avec <a href=\"%wallabag_instance%\">wallabag</a>" | 251 | shared_by_wallabag: "Cet article a été partagé par %username% avec <a href=\"%wallabag_instance%\">wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index c53266ca..56cf341b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Data di creazione' | 233 | created_at: 'Data di creazione' |
234 | published_at: 'Data di pubblicazione' | 234 | published_at: 'Data di pubblicazione' |
235 | published_by: 'Pubblicato da' | 235 | published_by: 'Pubblicato da' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Salva un nuovo contenuto' | 238 | page_title: 'Salva un nuovo contenuto' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Modifica voce' | 245 | page_title: 'Modifica voce' |
245 | title_label: 'Titolo' | 246 | title_label: 'Titolo' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Salva' | 249 | save_label: 'Salva' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Questo articolo è stato condiviso da %username% con <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Questo articolo è stato condiviso da %username% con <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 3ae64c49..1b5b221f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Data de creacion' | 233 | created_at: 'Data de creacion' |
234 | published_at: 'Data de publicacion' | 234 | published_at: 'Data de publicacion' |
235 | published_by: 'Publicat per' | 235 | published_by: 'Publicat per' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Enregistrar un novèl article' | 238 | page_title: 'Enregistrar un novèl article' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Modificar un article' | 245 | page_title: 'Modificar un article' |
245 | title_label: 'Títol' | 246 | title_label: 'Títol' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Enregistrar' | 249 | save_label: 'Enregistrar' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Aqueste article es estat partejat per <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Aqueste article es estat partejat per <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index e642c530..88f35738 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Czas stworzenia' | 233 | created_at: 'Czas stworzenia' |
234 | published_at: 'Data publikacji' | 234 | published_at: 'Data publikacji' |
235 | published_by: 'Opublikowane przez' | 235 | published_by: 'Opublikowane przez' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Zapisz nowy wpis' | 238 | page_title: 'Zapisz nowy wpis' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Edytuj wpis' | 245 | page_title: 'Edytuj wpis' |
245 | title_label: 'Tytuł' | 246 | title_label: 'Tytuł' |
246 | url_label: 'Adres URL' | 247 | url_label: 'Adres URL' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Zapisz' | 249 | save_label: 'Zapisz' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Ten artykuł został udostępniony przez <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Ten artykuł został udostępniony przez <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 9b3fea6b..3987cec3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Data de criação' | 233 | created_at: 'Data de criação' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Salvar nova entrada' | 238 | page_title: 'Salvar nova entrada' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | page_title: 'Editar uma entrada' | 245 | page_title: 'Editar uma entrada' |
245 | title_label: 'Título' | 246 | title_label: 'Título' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Salvar' | 249 | save_label: 'Salvar' |
248 | public: | 250 | public: |
249 | shared_by_wallabag: "Este artigo foi compartilhado pelo <a href='%wallabag_instance%'>wallabag</a>" | 251 | shared_by_wallabag: "Este artigo foi compartilhado pelo <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 673ca183..4d2fd569 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | |||
@@ -233,6 +233,7 @@ entry: | |||
233 | created_at: 'Data creării' | 233 | created_at: 'Data creării' |
234 | # published_at: 'Publication date' | 234 | # published_at: 'Publication date' |
235 | # published_by: 'Published by' | 235 | # published_by: 'Published by' |
236 | # provided_by: 'Provided by' | ||
236 | new: | 237 | new: |
237 | page_title: 'Salvează un nou articol' | 238 | page_title: 'Salvează un nou articol' |
238 | placeholder: 'http://website.com' | 239 | placeholder: 'http://website.com' |
@@ -244,6 +245,7 @@ entry: | |||
244 | # page_title: 'Edit an entry' | 245 | # page_title: 'Edit an entry' |
245 | # title_label: 'Title' | 246 | # title_label: 'Title' |
246 | url_label: 'Url' | 247 | url_label: 'Url' |
248 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
247 | save_label: 'Salvează' | 249 | save_label: 'Salvează' |
248 | public: | 250 | public: |
249 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 251 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index eceecabf..a560e58d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | |||
@@ -223,6 +223,7 @@ entry: | |||
223 | original_article: 'оригинал' | 223 | original_article: 'оригинал' |
224 | annotations_on_the_entry: '{0} Нет аннотации|{1} Одна аннотация|]1,Inf[ %count% аннотаций' | 224 | annotations_on_the_entry: '{0} Нет аннотации|{1} Одна аннотация|]1,Inf[ %count% аннотаций' |
225 | created_at: 'Дата создания' | 225 | created_at: 'Дата создания' |
226 | # provided_by: 'Provided by' | ||
226 | new: | 227 | new: |
227 | page_title: 'Сохранить новую запись' | 228 | page_title: 'Сохранить новую запись' |
228 | placeholder: 'http://website.com' | 229 | placeholder: 'http://website.com' |
@@ -234,6 +235,7 @@ entry: | |||
234 | page_title: 'Изменить запись' | 235 | page_title: 'Изменить запись' |
235 | title_label: 'Название' | 236 | title_label: 'Название' |
236 | url_label: 'Ссылка' | 237 | url_label: 'Ссылка' |
238 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
237 | is_public_label: 'Публичная' | 239 | is_public_label: 'Публичная' |
238 | save_label: 'Сохранить' | 240 | save_label: 'Сохранить' |
239 | public: | 241 | public: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 563bc50b..0fd6e989 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | |||
@@ -231,6 +231,7 @@ entry: | |||
231 | created_at: 'Oluşturulma tarihi' | 231 | created_at: 'Oluşturulma tarihi' |
232 | # published_at: 'Publication date' | 232 | # published_at: 'Publication date' |
233 | # published_by: 'Published by' | 233 | # published_by: 'Published by' |
234 | # provided_by: 'Provided by' | ||
234 | new: | 235 | new: |
235 | page_title: 'Yeni makaleyi kaydet' | 236 | page_title: 'Yeni makaleyi kaydet' |
236 | placeholder: 'http://website.com' | 237 | placeholder: 'http://website.com' |
@@ -242,6 +243,7 @@ entry: | |||
242 | page_title: 'Makaleyi düzenle' | 243 | page_title: 'Makaleyi düzenle' |
243 | title_label: 'Başlık' | 244 | title_label: 'Başlık' |
244 | url_label: 'Url' | 245 | url_label: 'Url' |
246 | # origin_url_label: 'Origin url (from where you found that entry)' | ||
245 | save_label: 'Kaydet' | 247 | save_label: 'Kaydet' |
246 | public: | 248 | public: |
247 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" | 249 | # shared_by_wallabag: "This article has been shared by %username% with <a href='%wallabag_instance%'>wallabag</a>" |
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 f8723189..0c7cbaa6 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 | |||
@@ -71,6 +71,14 @@ | |||
71 | </i> | 71 | </i> |
72 | 72 | ||
73 | <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span> | 73 | <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span> |
74 | |||
75 | {% if entry.originUrl is not empty %} | ||
76 | <i class="material-icons" title="{{ 'entry.view.provided_by'|trans }}">launch</i> | ||
77 | <a href="{{ entry.originUrl|e }}" target="_blank" class="tool"> | ||
78 | {{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }} | ||
79 | </a> | ||
80 | {% endif %} | ||
81 | |||
74 | <aside class="tags"> | 82 | <aside class="tags"> |
75 | <div class="card-entry-tags"> | 83 | <div class="card-entry-tags"> |
76 | {% for tag in entry.tags %} | 84 | {% for tag in entry.tags %} |
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 b9537975..ed225957 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,6 +27,11 @@ | |||
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_label(form.origin_url) }} | ||
33 | {{ form_widget(form.origin_url) }} | ||
34 | </div> | ||
30 | <br> | 35 | <br> |
31 | 36 | ||
32 | {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} | 37 | {{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} |
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 4cff7bf2..019569f7 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 | |||
@@ -125,7 +125,7 @@ | |||
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 }}&title={{ entry.title|striptags|url_encode }}&tags={{ entry.tags|join(',')|striptags|url_encode }}" target="_blank" title="shaarli" class="tool icon-image shaarli"> | 128 | <a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|striptags|url_encode }}&tags={{ entry.tags|join(',')|striptags|url_encode }}&lf_original_url={{ entry.originUrl|url_encode }}" target="_blank" title="shaarli" class="tool icon-image shaarli"> |
129 | <span>shaarli</span> | 129 | <span>shaarli</span> |
130 | </a> | 130 | </a> |
131 | </li> | 131 | </li> |
@@ -249,6 +249,14 @@ | |||
249 | <i class="material-icons link">comment</i> | 249 | <i class="material-icons link">comment</i> |
250 | {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} | 250 | {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} |
251 | </li> | 251 | </li> |
252 | {% if entry.originUrl is not empty %} | ||
253 | <li> | ||
254 | <i class="material-icons" title="{{ 'entry.view.provided_by'|trans }}">launch</i> | ||
255 | <a href="{{ entry.originUrl|e }}" target="_blank" class="tool"> | ||
256 | {{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }} | ||
257 | </a> | ||
258 | </li> | ||
259 | {% endif %} | ||
252 | </ul> | 260 | </ul> |
253 | <ul class="tags"> | 261 | <ul class="tags"> |
254 | {% for tag in entry.tags %} | 262 | {% for tag in entry.tags %} |
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index 351172c4..8992117e 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php | |||
@@ -28,6 +28,7 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa | |||
28 | { | 28 | { |
29 | return [ | 29 | return [ |
30 | new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), | 30 | new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), |
31 | new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), | ||
31 | ]; | 32 | ]; |
32 | } | 33 | } |
33 | 34 | ||
@@ -45,6 +46,13 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa | |||
45 | return preg_replace('/^www\./i', '', $url); | 46 | return preg_replace('/^www\./i', '', $url); |
46 | } | 47 | } |
47 | 48 | ||
49 | public function removeSchemeAndWww($url) | ||
50 | { | ||
51 | return $this->removeWww( | ||
52 | preg_replace('@^https?://@i', '', $url) | ||
53 | ); | ||
54 | } | ||
55 | |||
48 | /** | 56 | /** |
49 | * Return number of entries depending of the type (unread, archive, starred or all). | 57 | * Return number of entries depending of the type (unread, archive, starred or all). |
50 | * | 58 | * |