From: Nicolas Lœuillet Date: Fri, 7 Oct 2016 12:30:46 +0000 (+0200) Subject: Merge pull request #2383 from wallabag/add-info-publich-articles X-Git-Tag: 2.1.2~43 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=c8d2dcdafe95c7986bb9fdaa7998417a014bf6fa;hp=bf71a734f64a911549e188a5c69ac8e08eec896e;p=github%2Fwallabag%2Fwallabag.git Merge pull request #2383 from wallabag/add-info-publich-articles Added OpenGraph support for public articles --- diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index b04b9512..2652a102 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -208,6 +208,8 @@ entry: url_label: 'Url' # is_public_label: 'Public' save_label: 'Gem' + public: + # shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'Om' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 6ea3f5c5..e0f29b61 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -208,6 +208,8 @@ entry: url_label: 'URL' is_public_label: 'Öffentlich' save_label: 'Speichern' + public: + # shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'Über' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 38631e24..b8e98112 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -208,6 +208,8 @@ entry: url_label: 'Url' is_public_label: 'Public' save_label: 'Save' + public: + shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'About' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index a1fc34ef..70633bd7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -208,6 +208,8 @@ entry: url_label: 'Url' is_public_label: 'Es Público' save_label: 'Guardar' + public: + # shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'Acerca de' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 740302c5..074ab7a8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -208,6 +208,8 @@ entry: url_label: 'نشانی' is_public_label: 'عمومی' save_label: 'ذخیره' + public: + # shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'درباره' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index ad4fc99f..6d85a5ae 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -208,6 +208,8 @@ entry: url_label: 'Url' is_public_label: 'Public' save_label: 'Enregistrer' + public: + shared_by_wallabag: "Cet article a été partagé par wallabag" about: page_title: 'À propos' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index e0bd9d8b..15f7e774 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -208,6 +208,8 @@ entry: url_label: 'Url' is_public_label: 'Pubblico' save_label: 'Salva' + public: + # shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'About' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index b26bed87..1d10be2a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -208,6 +208,8 @@ entry: url_label: 'Url' is_public_label: 'Public' save_label: 'Enregistrar' + public: + # shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'A prepaus' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 285d73e5..9791a3b2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -208,6 +208,8 @@ entry: url_label: 'Adres URL' is_public_label: 'Publiczny' save_label: 'Zapisz' + public: + # shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'O nas' @@ -284,7 +286,7 @@ quickstart: import: 'Skonfigurować import' first_steps: title: 'Pierwsze kroki' - description: "Teraz wallabag jest poprawnie skonfigurowany, więc czas zarchiwizować Internet. Klinknij w prawym górnym rogu na znak +, aby dodać link" + description: "Teraz wallabag jest poprawnie skonfigurowany, więc czas zarchiwizować Internet. Klinknij w prawym górnym rogu na znak +, aby dodać link" new_article: 'Zapisz swój pierwszy artukuł' unread_articles: 'I sklasyfikuj go!' migrate: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index fba6f998..2b1d4f6d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -208,6 +208,8 @@ entry: url_label: 'Url' # is_public_label: 'Public' save_label: 'Salvează' + public: + # shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'Despre' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 1694e212..8cfc245a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -207,6 +207,8 @@ entry: url_label: 'Url' is_public_label: 'Herkes tarafından erişime açık olsun mu?' save_label: 'Kaydet' + public: + # shared_by_wallabag: "This article has been shared by wallabag" about: page_title: 'Hakkımızda' diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig index b82b3d3d..36c49e04 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig @@ -27,11 +27,18 @@ width: 600px; } + + + + {% if entry.previewPicture is not null %} + + {% endif %}

{{ entry.title | raw }}

- {{ entry.domainName|removeWww }} +
{{ entry.domainName|removeWww }}
+
{{ "entry.public.shared_by_wallabag"|trans({'%wallabag_instance%': url('homepage')})|raw }}
{{ entry.content | raw }} diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index c40e10a5..03267e76 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -753,7 +753,7 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertCount(2, $crawler->filter('div[class=entry]')); } - public function testCache() + public function testShareEntryPublicly() { $this->logInAs('admin'); $client = $this->getClient(); @@ -778,6 +778,9 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertContains('public', $client->getResponse()->headers->get('cache-control')); $this->assertContains('s-maxage=25200', $client->getResponse()->headers->get('cache-control')); $this->assertNotContains('no-cache', $client->getResponse()->headers->get('cache-control')); + $this->assertContains('og:title', $client->getResponse()->getContent()); + $this->assertContains('og:type', $client->getResponse()->getContent()); + $this->assertContains('og:url', $client->getResponse()->getContent()); // sharing is now disabled $client->getContainer()->get('craue_config')->set('share_public', 0);