]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Content card template shared
authorSimounet <contact@simounet.net>
Wed, 20 Dec 2017 20:02:37 +0000 (21:02 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Tue, 26 Dec 2017 07:55:23 +0000 (08:55 +0100)
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_full_image.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_no_preview.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_preview.html.twig

diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig
new file mode 100644 (file)
index 0000000..4836a4e
--- /dev/null
@@ -0,0 +1,21 @@
+<div class="card-content">
+    {% if withPreview is defined %}
+        <i class="grey-text text-darken-4 activator material-icons right">more_vert</i>
+    {% endif %}
+    <span class="card-title dot-ellipsis dot-resize-update">
+        <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title| striptags | e('html_attr') }}">
+            {{ entry.title | striptags | truncate(80, true, '…') | raw }}
+        </a>
+    </span>
+
+    <div class="{{ subClass|default('original grey-text') }}">
+        <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool grey-text">{{ entry.domainName|removeWww }}</a>
+        {% if withTags  %}
+            {% for tag in entry.tags | slice(0, 3) %}
+                <span class="chip hide-on-med-and-down">
+                    <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
+                </span>
+            {% endfor %}
+        {% endif %}
+    </div>
+</div>
index a4958b581fee9850e3a6969fdc5e68b42a76d8cb..ceb95381991b26ece18aced6c0f723b7a9d55ad3 100644 (file)
                 <span class="preview" style="background-image: url({{ entry.previewPicture }})"></span>
             </a>
         </div>
-
-        <div class="card-content">
-            <span class="card-title dot-ellipsis dot-resize-update">
-                <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title| striptags | e('html_attr') }}">
-                    {{ entry.title | striptags | truncate(80, true, '…') | raw }}
-                </a>
-            </span>
-
-            <div class="original grey-text">
-                <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool original grey-text">
-                    <span>{{ entry.domainName|removeWww }}</span>
-                </a>
-            </div>
-        </div>
+        {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry} only %}
     </div>
 
     {% include "@WallabagCore/themes/material/Entry/_card_actions.html.twig" with {'entry': entry} only %}
index 08f5b0e260ff4684a3679ff6ac8720ca16854333..7c83c3bba712200a17c64aee1810a712c8bdc6d9 100644 (file)
@@ -6,24 +6,7 @@
             </a>
         {% endif %}
     </div>
-    <div class="card-content">
-        <span class="card-title dot-ellipsis dot-resize-update">
-            <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | striptags | e('html_attr') }}">
-                {{ entry.title| striptags | truncate(120, true, '…') | raw }}
-            </a>
-        </span>
-
-        <div class="metadata">
-            <a href="{{ entry.url|e }}" class="grey-text domain" target="_blank" title="{{ entry.domainName|removeWww }}">
-                <span>{{ entry.domainName|removeWww }}</span>
-            </a>
-            {% for tag in entry.tags | slice(0, 3) %}
-                <span class="chip hide-on-med-and-down">
-                    <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
-                </span>
-            {% endfor %}
-        </div>
-    </div>
+    {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry, 'withTags': true, 'subClass': 'metadata'} only %}
     <ul class="tools-list hide-on-small-only">
         <li>
             <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 %}unarchive{% endif %}</i></a>
index eb1586597bd89a748a9afc8e3ce35d2d89f39587..8e6bbae01c8032b5482a30d35992906ebd4fd803 100644 (file)
@@ -1,25 +1,6 @@
 <div class="card">
     <div class="card-body">
-        <div class="card-content">
-            <span class="card-title dot-ellipsis dot-resize-update">
-                <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | striptags | e('html_attr') }}">
-                    {{ entry.title | striptags | truncate(80, true, '…') | raw }}
-                </a>
-            </span>
-
-            <div class="original grey-text">
-                <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool original grey-text">
-                    <span>{{ entry.domainName|removeWww }}</span>
-                </a>
-            </div>
-
-            <p>{{ entry.content|striptags|slice(0, 250)|raw }}&hellip;</p>
-            <ul class="card-entry-labels-hidden">
-            {% for tag in entry.tags | slice(0, 2) %}
-                <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li>
-            {% endfor %}
-            </ul>
-        </div>
+        {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry} only %}
     </div>
 
     {% include "@WallabagCore/themes/material/Entry/_card_actions.html.twig" with {'entry': entry} only %}
index c77e716b186c1fee272cd6dd68ecf1bee198dd09..e93646dcfd0d358be661cbc0464bd35023e57bcb 100644 (file)
                 <span class="preview" style="background-image: url({{ entry.previewPicture }})"></span>
             </a>
         </div>
-
-        <div class="card-content">
-            <i class="grey-text text-darken-4 activator material-icons right">more_vert</i>
-
-            <span class="card-title dot-ellipsis dot-resize-update">
-                <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | striptags | e('html_attr') }}">
-                    {{ entry.title | striptags | truncate(80, true, '…') | raw }}
-                </a>
-            </span>
-
-            <div class="original grey-text">
-                <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool original grey-text">
-                    <span>{{ entry.domainName|removeWww }}</span>
-                </a>
-            </div>
-        </div>
+        {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry, 'withPreview': true} only %}
     </div>
 
     <div class="card-reveal">