Commit 2f96407f authored by Luc Didry's avatar Luc Didry
Browse files

Add view links to thumbnails and filenames

parent 14943906
......@@ -9,18 +9,18 @@
<p><%= l('The images are encrypted on the server (Lutim does not keep the key).') %></p>
% }
% if (defined(stash('short'))) {
% my $url = url_for('/'.stash('short'))->to_abs();
<div class="alert alert-success">
<div class="row">
% if (defined(stash('short'))) {
% if (defined(stash('thumb'))) {
<div class="col-sm-1">
<img class="thumbnail img-responsive" alt="<%= stash('filename') %> thumbnail" src="<%= stash('thumb') %>">
<a href="<%= $url.'.'.stash('ext') %>" target="_blank"><img class="thumbnail img-responsive" alt="<%= stash('filename') %> thumbnail" src="<%= stash('thumb') %>"></a>
</div>
% }
<div class="col-sm-11">
% # Display image informations
% my $url = url_for('/'.stash('short'))->to_abs();
<h4>
<%= stash('filename') %>
<a href="<%= $url.'.'.stash('ext') %>" target="_blank"><%= stash('filename') %></a>
&nbsp;&nbsp;&nbsp;<a title="<%= l('Tweet it!') %>" target="_blank" href="https://twitter.com/share?url=<%= $url %>?t"><span class="icon icon-twitter"></span></a>
</h4>
% my $delete_url = url_for('delete', {short => stash('real_short'), token => stash('token')})->to_abs();
......
......@@ -92,15 +92,18 @@
}
function buildMessage(success, msg) {
if(success) {
var thumb = (msg.thumb !== null) ? '<div class="col-sm-1"><img class="thumbnail img-responsive" alt="'+msg.filename+' thumbnail" src="'+msg.thumb+'"></div>' : ''
var s_url = link(msg.short+'.'+msg.ext, '');
var thumb = (msg.thumb !== null) ? '<div class="col-sm-1"><a href="'+s_url+'" target="_blank"><img class="thumbnail img-responsive" alt="'+msg.filename+' thumbnail" src="'+msg.thumb+'"></a></div>' : ''
return '<div class="alert alert-success"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button><div class="row">'
+thumb
+'<div class="col-sm-11"><h4>'
+'<a href="'+s_url+'" target="_blank">'
+msg.filename
+'</a>'
+tw_url(msg.short)
+'</h4>'
+'<form class="form"><div class="form-group"><label class="sr-only" for="view'+msg.real_short+'"><%= l('View link') %></label><div class="input-group col-sm-6"><div class="input-group-addon"><a href="'+link(msg.short+'.'+msg.ext, '')+'" target="_blank"><span class="icon icon-eye" title =" <%= l('View link') %>"></span></a></div><input type="text" class="form-control view-link-input" id="view'+msg.real_short+'" value="'
+link(msg.short+'.'+msg.ext, '')
+'<form class="form"><div class="form-group"><label class="sr-only" for="view'+msg.real_short+'"><%= l('View link') %></label><div class="input-group col-sm-6"><div class="input-group-addon"><a href="'+s_url+'" target="_blank"><span class="icon icon-eye" title =" <%= l('View link') %>"></span></a></div><input type="text" class="form-control view-link-input" id="view'+msg.real_short+'" value="'
+s_url
+'" readonly><a href="#" onClick="copyToClipboard($(this));" class="input-group-addon" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a></div></div><div class="form-group"><label class="sr-only" for="markdown'+msg.real_short+'"><%= l('Markdown syntax') %></label><div class="input-group col-sm-6"><div class="input-group-addon"><span class="markdown-mark-solid" title ="<%= l('Markdown syntax') %>"></span></div><input type="text" class="form-control" id="markdown'+msg.real_short+'" value="![]('
+link(msg.short, '')
+')" readonly><a href="#" onClick="copyToClipboard($(this));" class="input-group-addon" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a></div></div><div class="form-group"><label class="sr-only" for="download'+msg.real_short+'"><%= l('Download link') %></label><div class="input-group col-sm-6"><div class="input-group-addon"><a href="'+link(msg.short, 'dl')+'"><span class="icon icon-download" title ="<%= l('Download link') %>"></span></a></div><input type="text" class="form-control" id="download'+msg.real_short+'" value="'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment