Merge pull request #1417 from wallabag/v2-display-picture

fix #972: add preview pictures
This commit is contained in:
Jeremy Benoist 2015-09-13 11:41:23 +02:00
commit 4d5fd9be81
6 changed files with 25 additions and 2 deletions

View file

@ -37,7 +37,11 @@
<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>
{% 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 %}

View 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>

View file

@ -448,6 +448,10 @@ footer a {
}
*/
img.preview {
max-width: 100%;
}
.entry p {
color: #666;
font-size: 0.9em;

View file

@ -40,7 +40,11 @@
{% 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 }}" />
{% 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>

View 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>

View file

@ -226,6 +226,10 @@ main ul.row {
overflow: hidden;
}
img.preview {
max-width: 100%;
}
.card .card-content .card-title {
line-height: 32px;
}