Files
lutim/templates/index.html.ep
T

213 lines
12 KiB
Plaintext

% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
% my %d = (
% delay_0 => l('no time limit'),
% delay_1 => l('24 hours'),
% delay_365 => l('1 year')
% );
<div id="gallery-url" class="hidden row">
<form class="form col-sm-12">
<div class="form-group">
<label for="gallery-url-input"><%= l('Gallery link') %></label>
<div class="input-group">
<div class="input-group-addon">
<a id="gallery-url-link" href="#" target="_blank" title="<%= l('Gallery link') %>">
<span class="icon icon-picture"></span>
</a>
</div>
<input class="form-control" name="gallery-url-input" type="text" id="gallery-url-input" readonly></input>
<a href="#" onClick="copyToClipboard($(this));" class="input-group-addon jsonly" title="<%= l('Copy to clipboard') %>">
<span class="icon icon-clipboard"></span>
</a>
</div>
</div>
</form>
</div>
<div id="zip-url" class="hidden row">
<form class="form col-sm-12">
<div class="form-group">
<label for="zip-url-input"><%= l('Download zip link') %></label>
<div class="input-group">
<div class="input-group-addon">
<a id="zip-url-link" href="#" target="_blank" title="<%= l('Download zip link') %>">
<span class="icon icon-file-archive"></span>
</a>
</div>
<input class="form-control" name="zip-url-input" type="text" id="zip-url-input" readonly></input>
<a href="#" onClick="copyToClipboard($(this));" class="input-group-addon jsonly" title="<%= l('Copy to clipboard') %>">
<span class="icon icon-clipboard"></span>
</a>
</div>
</div>
</form>
</div>
<div class="messages">
% if (config('always_encrypt')) {
<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('thumb'))) {
<div class="col-sm-1">
<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
<h4>
<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();
<form class="form">
<div class="form-group">
<label class="sr-only" for="view"><%= l('View link') %></label>
<div class="input-group col-sm-6">
<div class="input-group-addon"><a href="<%= $url.'.'.stash('ext') %>" target="_blank"><span class="icon icon-eye" title =" <%= l('View link') %>"></span></a></div>
<input type="text" class="form-control" id="view" value="<%= $url.'.'.stash('ext') %>" readonly>
<a href="#" onClick="copyToClipboard($(this));" class="input-group-addon jsonly" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a>
</div>
</div>
<div class="form-group">
<label class="sr-only" for="markdown"><%= 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" value="![](<%= $url %>)" readonly>
<a href="#" onClick="copyToClipboard($(this));" class="input-group-addon jsonly" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a>
</div>
</div>
<div class="form-group">
<label class="sr-only" for="download"><%= l('Download link') %></label>
<div class="input-group col-sm-6">
<div class="input-group-addon"><a href="<%= $url %>?dl"><span class="icon icon-download" title ="<%= l('Download link') %>"></span></a></div>
<input type="text" class="form-control" id="download" value="<%= $url %>?dl" readonly>
<a href="#" onClick="copyToClipboard($(this));" class="input-group-addon jsonly" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a>
</div>
</div>
<div class="form-group">
<label class="sr-only" for="share"><%= l('Link for share on social networks') %></label>
<div class="input-group col-sm-6">
<div class="input-group-addon"><a href="<%= $url %>?t" target="_blank"><span class="icon icon-share" title ="<%= l('Link for share on social networks') %>"></span></a></div>
<input type="text" class="form-control" id="share" value="<%= $url %>?t" readonly>
<a href="#" onClick="copyToClipboard($(this));" class="input-group-addon jsonly" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a>
</div>
</div>
<div class="form-group">
<div class="input-group col-sm-6 col-xs-12">
<span class="form-control-static"><%= link_to $delete_url => ( class => "btn btn-default col-xs-12 text-left", title => l('Deletion link') ) => begin %><span class="icon icon-trash"></span> <%= $delete_url %> <%= end %></span>
</div>
</div>
</form>
</div>
</div>
<div class="row">
% # Delay modification form
% my $modify_url = url_for('modify', {short => stash('real_short'), token => stash('token')})->to_abs();
<form class="form col-sm-11 col-sm-offset-1" method="POST" action="<%== $modify_url %>">
<div class="form-group form-inline">
<input name="image_url" type="hidden" value="<%= $url %>">
<select name="delete-day" class="form-control">
%= include 'partial/for_my_delay', d => \%d
</select>
<div class="checkbox">
<label>
<input type="checkbox" name="first-view"> <%= l('Delete at first view?') %>
</label>
</div>
<%= submit_button l('Let\'s go!'), class => 'btn btn-sm btn-default btn-primary', id => 'submitmodbutton' %>
</div>
</form>
</div>
</div>
% }
% if (defined(flash('success'))) {
<div class="alert alert-success">
<button type="button" class="close jsonly" data-dismiss="alert" aria-hidden="true">&times;</button>
<p><%== flash('success') %></p>
</div>
% }
% if (defined(flash('msg'))) {
<div class="alert alert-danger">
<button type="button" class="close jsonly" data-dismiss="alert" aria-hidden="true">&times;</button>
<strong><%= l('Something bad happened') %></strong><br>
<%= flash('filename') %> <%= flash('msg') %>
</div>
% }
</div>
<noscript>
<form class="form" method="POST" action="<%= url_for('/') %>" enctype="multipart/form-data">
<div class="form-group form-inline">
<select name="delete-day" class="form-control">
%= include 'partial/for_my_delay', d => \%d
</select>
<div class="checkbox">
<label>
<input type="checkbox" name="first-view"> <%= l('Delete at first view?') %>
</label>
<label <%== (config('always_encrypt')) ? 'class="always-encrypt"' : '' %>>
<input type="checkbox" name="crypt"> <%= l('Encrypt the image (Lutim does not keep the key).') %>
</label>
<label>
<input type="checkbox" name="keep-exif"> <%= l('Keep EXIF tags') %>
</label>
</div>
</div>
<div class="form-group">
<label for="lutim-file"><%= l('Send an image') %></label>
<input type="file" name="file" id="lutim-file" accept="image/*">
</div>
<div class="form-group">
<label for="lutim-file-url"><%= l('Upload an image with its URL') %></label>
<input type="url" name="lutim-file-url" placeholder="<%= l('Image URL') %>">
</div>
<p class="help-block"><%= l('Only images are allowed') %></p>
<%= submit_button l('Let\'s go!'), class => 'btn btn-default btn-primary', id => 'submitbutton' %>
</form>
</noscript>
<!-- D&D Zone-->
<div class="jsonly">
<div class="form-group form-inline">
<select id="delete-day" class="form-control">
%= include 'partial/for_my_delay', d => \%d
</select>
<div class="checkbox">
<label>
<input type="checkbox" id="first-view"> <%= l('Delete at first view?') %>
</label>
<label <%== (config('always_encrypt')) ? 'class="always-encrypt"' : '' %>>
<input type="checkbox" id="crypt"> <%= l('Encrypt the image (Lutim does not keep the key).') %>
</label>
<label>
<input type="checkbox" id="keep-exif"> <%= l('Keep EXIF tags') %>
</label>
</div>
</div>
<div id="drag-and-drop-zone" class="uploader">
<div><%= l('Drag & drop images here') %></div>
<div class="or"><%= l('-or-') %></div>
<div class="browser">
<label>
<span><%= l('Click to open the file browser') %></span>
<input type="file" name="files[]" multiple="multiple" title='<%= l('Click to open the file browser') %>' accept="image/*">
</label>
</div>
</div>
<p class="help-block"><%= l('Only images are allowed') %></p>
<form class="form-horizontal" method="POST" action="<%== url_for('add') %>">
<div class="form-group">
<span class="col-sm-3 col-xs-12"><span class="hidden-spin" style="font-size:200%; display:none;" > <span class="icon-spinner animate-spin pull-right"></span></span><label for="lutim-file-url" class="control-label pull-right"><%= l('Upload an image with its URL') %></label></span>
<div class="col-sm-9 col-xs-12">
<input type="url" name="lutim-file-url" class="form-control" id="lutim-file-url" placeholder="<%= l('Image URL') %>">
</div>
</div>
<a href="#" class="btn btn-default btn-primary pull-right" id="file-url-button"><%= l('Let\'s go!') %></a>
</form>
</div>
<!-- /D&D Zone -->
%= include 'partial/common', format => 'js'
%= include 'partial/lutim', format => 'js', d => \%d