]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
improved display pictures 1420/head
authorAlexandr Danilov <bitbucket@modos189.ru>
Sun, 13 Sep 2015 23:12:39 +0000 (02:12 +0300)
committerAlexandr Danilov <bitbucket@modos189.ru>
Sun, 13 Sep 2015 23:12:39 +0000 (02:12 +0300)
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css

index b46d8f11fd5a1071954ff4406fd54721d47f8c96..77483a09210af8e6e130ebf017925149bb3602de 100644 (file)
         {% for entry in entries %}
             <li id="entry-{{ entry.id|e }}" class="col l4 m6 s12">
                 <div class="card">
-                    <div class="card-content">
-                        <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></span>
-                        {% if entry.readingTime > 0 %}
-                            <div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time: {% endtrans %} {{ entry.readingTime }} min</span></div>
-                        {% 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 %}
-                        {% 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 }}" />
+
+                    <div class="card-body">
+                        {% if not entry.previewPicture is null %}
+                            <div class="card-image waves-effect waves-block waves-light">
+                                <div class="preview activator" style="background-image: url({{ entry.previewPicture }})"></div>
+                            </div>
                         {% endif %}
+
+                        <div class="card-content">
+                            {% if not entry.previewPicture is null %}
+                                <i class="card-title grey-text text-darken-4 activator mdi-navigation-more-vert right"></i>
+                            {% endif %}
+
+                            <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw|striptags|slice(0, 42) }}</a></span>
+
+                            {% if entry.readingTime > 0 %}
+                                <div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time: {% endtrans %} {{ entry.readingTime }} min</span></div>
+                            {% 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 %}
+
+                            {% if entry.previewPicture is null %}
+                                <p>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p>
+                            {% endif %}
+                        </div>
                     </div>
+
+                    {% if not entry.previewPicture is null %}
+                        <div class="card-reveal">
+                            <i class="card-title grey-text text-darken-4 mdi-card-close right"></i>
+                            <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></span>
+
+                            {% if entry.readingTime > 0 %}
+                                <div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time: {% endtrans %} {{ entry.readingTime }} min</span></div>
+                            {% 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>
+                        </div>
+                    {% endif %}
+
                     <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 5e1ae8bd5a71febb7c660c4eea667a068330565d..144e259fbf18908a70860674c471b6e1b83c5673 100755 (executable)
@@ -221,15 +221,11 @@ main ul.row {
     padding: 0px 0.75rem;
 }
 
-.data .card .card-content {
+.data .card .card-body {
     height: 22em;
     overflow: hidden;
 }
 
-img.preview {
-    max-width: 100%;
-}
-
 .card .card-content .card-title {
     line-height: 32px;
 }
@@ -262,6 +258,21 @@ img.preview {
     margin-right: auto;
 }
 
+.mdi-card-close:before {
+    content: "\e8aa";
+}
+
+.card .card-image {
+    height: 14em;
+}
+
+.card .card-image .preview {
+    height: 14em;
+    background-size: cover;
+    background-repeat: no-repeat;
+    background-position: 50%;
+}
+
 /* ==========================================================================
    5 = Article
    ========================================================================== */