]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #2702 from wallabag/add-index-uuid
authorNicolas LÅ“uillet <nicolas@loeuillet.org>
Thu, 29 Dec 2016 09:54:07 +0000 (10:54 +0100)
committerGitHub <noreply@github.com>
Thu, 29 Dec 2016 09:54:07 +0000 (10:54 +0100)
Added index on entry.uuid

src/Wallabag/CoreBundle/Controller/TagController.php
src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php
tests/Wallabag/CoreBundle/Controller/TagControllerTest.php

index 52707cb8311dae23222d7451ac35ec48ab7d33ae..8a0932892d58567f94b3d46956be208d9d48a867 100644 (file)
@@ -143,7 +143,7 @@ class TagController extends Controller
             'form' => null,
             'entries' => $entries,
             'currentPage' => $page,
-            'tag' => $tag->getLabel(),
+            'tag' => $tag->getSlug(),
         ]);
     }
 }
index 09e99f36bb46b222544d6cfe11484e270231ccac..6de561e0d5843908e414fe44473380f172a008ff 100644 (file)
@@ -15,7 +15,7 @@ class LoadTagData extends AbstractFixture implements OrderedFixtureInterface
     public function load(ObjectManager $manager)
     {
         $tag1 = new Tag();
-        $tag1->setLabel('foo');
+        $tag1->setLabel('foo bar');
 
         $manager->persist($tag1);
 
index 56442116579c2bff1fe7c976e98a4cacd6003aa0..d278da1b91d988bc31073b24abf6b3ad1d9e49fc 100644 (file)
@@ -1,8 +1,6 @@
 <div class="card-action">
     <span class="reading-time grey-text">
-        <i class="material-icons" title="{{ 'entry.list.reading_time'|trans }}">timer</i>
-        {{ entry.readingTime / app.user.config.readingSpeed|round }} min&nbsp;
-
+        {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
         <i class="material-icons hide-on-med-and-down" title="{{ 'entry.view.created_at'|trans }}">today</i>
         <span class="hide-on-med-and-down">&nbsp;{{ entry.createdAt|date('Y-m-d') }}</span>
     </span>
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
new file mode 100644 (file)
index 0000000..1a932a9
--- /dev/null
@@ -0,0 +1,7 @@
+{% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
+<i class="material-icons">timer</i>
+{% if readingTime > 0 %}
+    {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}
+{% else %}
+    {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}
+{% endif %}
index 0cbf1999d1e826ff36ab411889999c1ba7146533..46f89e19d8eb86dd0e5bfd3c9ee2e5304ca58f31 100644 (file)
         <aside>
             <ul class="tools">
                 <li>
-                    {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
-                    <i class="material-icons">timer</i>
-                    {% if readingTime > 0 %}
-                        {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}
-                    {% else %}
-                        {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}
-                    {% endif %}
+                    {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
                 </li>
                 <li>
                     <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i>
index 5ca886bd4d9e0a61ba29c12c76aac8ee80e948df..32a18e261a702fdaa80b27a00aa4af1b504915f7 100644 (file)
@@ -119,7 +119,7 @@ class ExportControllerTest extends WallabagCoreTestCase
         $this->assertEquals('binary', $headers->get('content-transfer-encoding'));
 
         ob_start();
-        $crawler = $client->request('GET', '/export/tag_entries.pdf?tag=foo');
+        $crawler = $client->request('GET', '/export/tag_entries.pdf?tag=foo-bar');
         ob_end_clean();
 
         $this->assertEquals(200, $client->getResponse()->getStatusCode());
@@ -241,7 +241,7 @@ class ExportControllerTest extends WallabagCoreTestCase
         $this->assertEquals($contentInDB->getLanguage(), $content[0]['language']);
         $this->assertEquals($contentInDB->getReadingtime(), $content[0]['reading_time']);
         $this->assertEquals($contentInDB->getDomainname(), $content[0]['domain_name']);
-        $this->assertEquals(['foo', 'baz'], $content[0]['tags']);
+        $this->assertEquals(['foo bar', 'baz'], $content[0]['tags']);
     }
 
     public function testXmlExport()
index 769ce66ebfdb685963ec95572f76929d7a2796dc..fa1a3539f4960d5d4b23d00222d404058f2ed12a 100644 (file)
@@ -61,7 +61,7 @@ class TagControllerTest extends WallabagCoreTestCase
 
         // tag already exists but still not assigned to this entry
         $data = [
-            'tag[label]' => 'foo',
+            'tag[label]' => 'foo bar',
         ];
 
         $client->submit($form, $data);