]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #1417 from wallabag/v2-display-picture
authorJeremy Benoist <j0k3r@users.noreply.github.com>
Sun, 13 Sep 2015 09:41:23 +0000 (11:41 +0200)
committerJeremy Benoist <j0k3r@users.noreply.github.com>
Sun, 13 Sep 2015 09:41:23 +0000 (11:41 +0200)
fix #972: add preview pictures

src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig
src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css
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 3f5cf46090e7a3739b70d912df9fb737424252cc..0d295431ec2c2268a7436b9042cf6be51fbe4f1c 100644 (file)
                     <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li>
                     <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName }}</span></a></li>
                 </ul>
-                <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>
         {% endfor %}
     {% endif %}
index 18cfd59d2d036e586980fe14e8439dd161fe8acf..f58d0399bbe3a70a63e395e9f5c9f8f51635b3c4 100644 (file)
@@ -31,6 +31,9 @@
             {% for tag in entry.tags %}<span class="mdi-action-label-outline">{{ tag.label }}</span>{% endfor %}
             {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }}
         </aside>
+        {% if entry.previewPicture is not null %}
+            <div><img class="preview" src="{{ entry.previewPicture }}" alt="{{ entry.title|raw }}" /></div>
+        {% endif %}
         <article>
             {{ entry.content | raw }}
         </article>
index 6090face60914b1592bbb7b4c03b1149f2904a34..72a7b20542ecb207f38afc7128071a771dc7deff 100755 (executable)
@@ -448,6 +448,10 @@ footer a {
 }
 */
 
+img.preview {
+    max-width: 100%;
+}
+
 .entry p {
   color: #666;
   font-size: 0.9em;
index 89182d98f3b2f5dde6926b00149dc30d8114537d..b46d8f11fd5a1071954ff4406fd54721d47f8c96 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;
 }