]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #2383 from wallabag/add-info-publich-articles
authorNicolas Lœuillet <nicolas@loeuillet.org>
Fri, 7 Oct 2016 12:30:46 +0000 (14:30 +0200)
committerGitHub <noreply@github.com>
Fri, 7 Oct 2016 12:30:46 +0000 (14:30 +0200)
Added OpenGraph support for public articles

13 files changed:
src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig
tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php

index b04b95120a94b0f2ad6f4a520b10cc75632864db..2652a1028fefcc7efbd71666dab049aef684aafe 100644 (file)
@@ -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 <a href=%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'Om'
index 6ea3f5c52a559ae53dfaf486e88b014f35c0a7ad..e0f29b6110449a8d6bbaf33891f9efdc31e3c60d 100644 (file)
@@ -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 <a href='%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'Über'
index 38631e243609d388f0c09212ffb21d8b36be2ea7..b8e98112994023532807553c00d8f60d4cb56df5 100644 (file)
@@ -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 <a href='%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'About'
index a1fc34efb32731fe87daf915e7ebb2ad67dd9bea..70633bd76ce90fb78cf4984dc7e95bff4617fa15 100644 (file)
@@ -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 <a href='%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'Acerca de'
index 740302c52f33d4a5746c6984397f9e417725a431..074ab7a8981c84666abd240110ff85f03358cc3c 100644 (file)
@@ -208,6 +208,8 @@ entry:
         url_label: 'نشانی'
         is_public_label: 'عمومی'
         save_label: 'ذخیره'
+    public:
+        # shared_by_wallabag: "This article has been shared by <a href='%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'درباره'
index ad4fc99f626433fd1284991942f9c9f8ed4426f8..6d85a5aeac9158ab62f1b923cb1a241d53d5e226 100644 (file)
@@ -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 <a href='%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'À propos'
index e0bd9d8bdbda96a917cf384e00e5e5d29e75aaa9..15f7e7743822b1ab782d0348482e2e19e1099efc 100644 (file)
@@ -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 <a href='%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'About'
index b26bed872dd88679f02143b548f211d10b59817a..1d10be2aeb06cb2d72ebb73cefee7a6457ade90e 100644 (file)
@@ -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 <a href='%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'A prepaus'
index 285d73e54d20efdf66a3075c368d64441d296362..9791a3b2a388b558cae2c8962633382d478081b4 100644 (file)
@@ -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 <a href='%wallabag_instance%'>wallabag</a>"
 
 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:
index fba6f998f4d8bbb94f39b205b885abd02bc9f764..2b1d4f6db59bde5e883c8c6884d5a8dc7b598802 100644 (file)
@@ -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 <a href='%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'Despre'
index 1694e2121165883987a18ef545a1d6449bdb2588..8cfc245ab99a22616af157299d31110664870ac0 100644 (file)
@@ -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 <a href='%wallabag_instance%'>wallabag</a>"
 
 about:
     page_title: 'Hakkımızda'
index b82b3d3d86c7f75e64fcd264210ca29173c3a81a..36c49e0422d0a4866036ea5a974e909427aa8db6 100644 (file)
                 width: 600px;
             }
         </style>
+        <meta property="og:title" content="{{ entry.title | raw }}" />
+        <meta property="og:type" content="article" />
+        <meta property="og:url" content="{{ app.request.uri }}" />
+        {% if entry.previewPicture is not null %}
+        <meta property="og:image" content="{{ entry.previewPicture }}" />
+        {% endif %}
     </head>
     <body>
         <header>
             <h1>{{ entry.title | raw }}</h1>
-            <span><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool">{{ entry.domainName|removeWww }}</a></span>
+            <div><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool">{{ entry.domainName|removeWww }}</a></div>
+            <div>{{ "entry.public.shared_by_wallabag"|trans({'%wallabag_instance%': url('homepage')})|raw }}</div>
         </header>
         <article>
             {{ entry.content | raw }}
index c40e10a50041135efd2b49af3ba57edba2e8adda..03267e7686a2a46ebe66f9fa993993dede9d0809 100644 (file)
@@ -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);