]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
add preview pictures
authorNicolas Lœuillet <nicolas@loeuillet.org>
Sat, 12 Sep 2015 11:39:01 +0000 (13:39 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Sat, 12 Sep 2015 11:39:01 +0000 (13:39 +0200)
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css

index 3711f6e561dd49a52193ac8c4a6ea4c3f87a9892..f7f53b9d257a3190fb472ef0eb406bf43304f0fa 100644 (file)
                         {% else %}
                             <div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time: {% endtrans %} <small class="inferieur">&lt;</small> 1 min</span></div>
                         {% endif %}
-                        <p>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p>
+                        {% if entry.previewPicture is null %}
+                            <p>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p>
+                        {% else %}
+                            <img class="preview" src="{{ entry.previewPicture }}" alt="{{ entry.title|raw }}" />
+                        {% endif %}
                     </div>
                     <div class="card-action">
                         <span class="bold"><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %}: {{ entry.title|e }} - {{ entry.domainName }}" class="tool original grey-text"><span>{{ entry.domainName | truncate(18) }}</span></a></bold>
index 75ac2a6bd4fc5d189b85ae83646883eb226413d0..3b4c7053025b18968b87717d4571d08982700760 100644 (file)
@@ -149,6 +149,10 @@ main {
                 {% for tag in entry.tags %}<span><a href="#">{{ tag.label }}</a></span>{% endfor %}
             </div>
 
+            {% if entry.previewPicture is not null %}
+                <div><img class="preview" src="{{ entry.previewPicture }}" alt="{{ entry.title|raw }}" /></div>
+            {% endif %}
+
             <div class="input-field nav-panel-add-tag" style="display: none">
                 {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }}
             </div>
index 6c139b7289da8393fbe18a82dd44e4d12f892bba..5e1ae8bd5a71febb7c660c4eea667a068330565d 100755 (executable)
@@ -226,6 +226,10 @@ main ul.row {
     overflow: hidden;
 }
 
+img.preview {
+    max-width: 100%;
+}
+
 .card .card-content .card-title {
     line-height: 32px;
 }