client/posts: allow clicking on upload thumbnails

This commit is contained in:
rr- 2016-09-10 16:13:57 +02:00
parent b68f833ce9
commit cf1e1670c4
2 changed files with 14 additions and 6 deletions

View file

@ -40,12 +40,16 @@
label
margin-right: 1em
.thumbnail
.thumbnail-wrapper
float: left
width: 12.5em
height: 7em
margin: 0.2em 1em 0 0
.thumbnail
width: 100%
height: 100%
.controls
float: right
a

View file

@ -5,17 +5,21 @@
<a href class='remove'><i class='fa fa-remove'></i></a>
</div>
<div class='thumbnail'>
<div class='thumbnail-wrapper'>
<% if (['image'].includes(ctx.uploadable.type)) { %>
<%= ctx.makeThumbnail(ctx.uploadable.previewUrl) %>
<a href='<%= ctx.uploadable.previewUrl %>'>
<%= ctx.makeThumbnail(ctx.uploadable.previewUrl) %>
</a>
<% } else if (['video'].includes(ctx.uploadable.type)) { %>
<div class='thumbnail'>
<video id='video' nocontrols muted>
<source type='<%- ctx.uploadable.mimeType %>' src='<%- ctx.uploadable.previewUrl %>'/>
</video>
<a href='<%= ctx.uploadable.previewUrl %>'>
<video id='video' nocontrols muted>
<source type='<%- ctx.uploadable.mimeType %>' src='<%- ctx.uploadable.previewUrl %>'/>
</video>
</a>
</div>
<% } else { %>