index.html.ep 13.2 KB
Newer Older
Luc Didry's avatar
Luc Didry committed
1
% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
2
3
4
5
6
% my %d = (
%   delay_0   => l('no time limit'),
%   delay_1   => l('24 hours'),
%   delay_365 => l('1 year')
% );
Luc Didry's avatar
Luc Didry committed
7
8
9
10
11
<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">
12
13
14
                <a class="input-group-addon" id="gallery-url-link" href="#" target="_blank" title="<%= l('Gallery link') %>">
                    <span class="icon icon-picture"></span>
                </a>
Luc Didry's avatar
Luc Didry committed
15
                <input class="form-control" name="gallery-url-input" type="text" id="gallery-url-input" readonly></input>
Luc Didry's avatar
Luc Didry committed
16
                <a href="#" class="input-group-addon jsonly copy-to-clipboard-link" title="<%= l('Copy to clipboard') %>">
Luc Didry's avatar
Luc Didry committed
17
18
19
20
21
22
                    <span class="icon icon-clipboard"></span>
                </a>
            </div>
        </div>
    </form>
</div>
23
24
25
26
27
<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">
28
29
30
                <a class="input-group-addon" id="zip-url-link" href="#" target="_blank" title="<%= l('Download zip link') %>">
                    <span class="icon icon-file-archive"></span>
                </a>
31
                <input class="form-control" name="zip-url-input" type="text" id="zip-url-input" readonly></input>
Luc Didry's avatar
Luc Didry committed
32
                <a href="#" class="input-group-addon jsonly copy-to-clipboard-link" title="<%= l('Copy to clipboard') %>">
33
34
35
36
37
38
                    <span class="icon icon-clipboard"></span>
                </a>
            </div>
        </div>
    </form>
</div>
39
40
41
42
43
<div id="random-url" class="hidden row">
    <form class="form col-sm-12">
        <div class="form-group">
            <label for="random-url-input"><%= l('Random image link') %></label>
            <div class="input-group">
44
45
46
                <a class="input-group-addon" id="random-url-link" href="#" target="_blank" title="<%= l('Random image link') %>">
                    <span class="icon icon-shuffle"></span>
                </a>
47
48
49
50
51
52
53
54
                <input class="form-control" name="random-url-input" type="text" id="random-url-input" readonly></input>
                <a href="#" class="input-group-addon jsonly copy-to-clipboard-link" title="<%= l('Copy to clipboard') %>">
                    <span class="icon icon-clipboard"></span>
                </a>
            </div>
        </div>
    </form>
</div>
Luc Didry's avatar
Luc Didry committed
55
<div class="messages">
56
% if (config('always_encrypt')) {
57
    <p><%= l('The images are encrypted on the server (Lutim does not keep the key).') %></p>
Luc Didry's avatar
Fix #22    
Luc Didry committed
58
% }
Luc Didry's avatar
Fix #20    
Luc Didry committed
59
% if (defined(stash('short'))) {
60
    % my $url = url_for('/'.stash('short'))->to_abs();
Luc Didry's avatar
Luc Didry committed
61
    <div class="alert alert-success">
62
        <div class="row">
63
%     if (defined(stash('thumb'))) {
64
            <div class="col-sm-1">
65
                <a href="<%= $url.'.'.stash('ext') %>" target="_blank"><img class="thumbnail img-responsive" alt="<%= stash('filename') %> thumbnail" src="<%= stash('thumb') %>"></a>
66
            </div>
Luc Didry's avatar
Fix #20    
Luc Didry committed
67
%     }
68
            <div class="col-sm-11">
Luc Didry's avatar
Fix #12    
Luc Didry committed
69
% # Display image informations
70
                <h4>
71
                    <a href="<%= $url.'.'.stash('ext') %>" target="_blank"><%= stash('filename') %></a>
72
73
                    &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>
Luc Didry's avatar
Fix #28    
Luc Didry committed
74
                % my $delete_url = url_for('delete', {short => stash('real_short'), token => stash('token')})->to_abs();
75
76
77
78
                <form class="form">
                    <div class="form-group">
                        <label class="sr-only" for="view"><%= l('View link') %></label>
                        <div class="input-group col-sm-6">
Luc Didry's avatar
Luc Didry committed
79
                            <div class="input-group-addon"><a href="<%= $url.'.'.stash('ext') %>" target="_blank"><span class="icon icon-eye" title =" <%= l('View link') %>"></span></a></div>
Luc Didry's avatar
Luc Didry committed
80
                            <input type="text" class="form-control" id="view" value="<%= $url.'.'.stash('ext') %>" readonly>
Luc Didry's avatar
Luc Didry committed
81
                            <a href="#" class="input-group-addon jsonly copy-to-clipboard-link" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a>
82
83
84
85
86
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="sr-only" for="markdown"><%= l('Markdown syntax') %></label>
                        <div class="input-group col-sm-6">
Luc Didry's avatar
Luc Didry committed
87
                            <div class="input-group-addon"><span class="markdown-mark-solid" title ="<%= l('Markdown syntax') %>"></span></div>
88
                            <input type="text" class="form-control" id="markdown" value="![](<%= $url %>)" readonly>
Luc Didry's avatar
Luc Didry committed
89
                            <a href="#" class="input-group-addon jsonly copy-to-clipboard-link" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a>
90
91
92
93
94
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="sr-only" for="download"><%= l('Download link') %></label>
                        <div class="input-group col-sm-6">
Luc Didry's avatar
Luc Didry committed
95
                            <div class="input-group-addon"><a href="<%= $url %>?dl"><span class="icon icon-download" title ="<%= l('Download link') %>"></span></a></div>
96
                            <input type="text" class="form-control" id="download" value="<%= $url %>?dl" readonly>
Luc Didry's avatar
Luc Didry committed
97
                            <a href="#" class="input-group-addon jsonly copy-to-clipboard-link" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a>
98
99
100
101
102
                        </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">
Luc Didry's avatar
Luc Didry committed
103
                            <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>
104
                            <input type="text" class="form-control" id="share" value="<%= $url %>?t" readonly>
Luc Didry's avatar
Luc Didry committed
105
                            <a href="#" class="input-group-addon jsonly copy-to-clipboard-link" title="<%= l('Copy to clipboard') %>"><span class="icon icon-clipboard"></span></a>
106
107
108
109
110
111
112
113
114
                        </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>
Luc Didry's avatar
Fix #20    
Luc Didry committed
115
        </div>
116
        <div class="row">
Luc Didry's avatar
Fix #12    
Luc Didry committed
117
% # Delay modification form
118
119
120
121
122
123
124
125
126
127
128
129
130
            % 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' %>
Luc Didry's avatar
Fix #12    
Luc Didry committed
131
                </div>
132
133
            </form>
        </div>
Luc Didry's avatar
Luc Didry committed
134
135
    </div>
% }
Luc Didry's avatar
Fix #28    
Luc Didry committed
136
137
138
% if (defined(flash('success'))) {
    <div class="alert alert-success">
        <button type="button" class="close jsonly" data-dismiss="alert" aria-hidden="true">&times;</button>
Luc Didry's avatar
Fix #12    
Luc Didry committed
139
        <p><%== flash('success') %></p>
Luc Didry's avatar
Fix #28    
Luc Didry committed
140
141
    </div>
% }
Luc Didry's avatar
Luc Didry committed
142
143
% if (defined(flash('msg'))) {
    <div class="alert alert-danger">
Luc Didry's avatar
Fix #28    
Luc Didry committed
144
        <button type="button" class="close jsonly" data-dismiss="alert" aria-hidden="true">&times;</button>
145
        <strong><%= l('Something bad happened') %></strong><br>
Luc Didry's avatar
Luc Didry committed
146
147
148
149
150
151
        <%= flash('filename') %> <%= flash('msg') %>
    </div>
% }
</div>

<noscript>
152
    <form class="form" method="POST" action="<%= url_for('/') %>" enctype="multipart/form-data">
153
154
        <div class="form-group form-inline">
            <select name="delete-day" class="form-control">
155
                %= include 'partial/for_my_delay', d => \%d
156
157
158
            </select>
            <div class="checkbox">
                <label>
159
                    <input type="checkbox" name="first-view"> <%= l('Delete at first view?') %>
160
161
                </label>
                <label <%== (config('always_encrypt')) ? 'class="always-encrypt"' : '' %>>
162
                    <input type="checkbox" name="crypt"> <%= l('Encrypt the image (Lutim does not keep the key).') %>
163
                </label>
164
165
                <label>
                    <input type="checkbox" name="keep-exif"> <%= l('Keep EXIF tags') %>
166
                </label>
167
            </div>
168
169
170
171
172
173
174
175
176
177
178
179
180
        % if ($c->config('watermark_path') && $c->config('watermark_enforce') eq 'none') {
            <select name="watermark" class="form-control">
                <option value="tiling" <%== is_wm_selected('tiling') %>>
                    <%= l('Tiling watermark') %>
                </option>
                <option value="single" <%== is_wm_selected('single') %>>
                    <%= l('Single watermark') %>
                </option>
                <option value="none"   <%== is_wm_selected('none') %>>
                    <%= l('No watermark') %>
                </option>
            </select>
        % }
181
182
        </div>
        <div class="form-group">
183
            <label for="lutim-file"><%= l('Send an image') %></label>
dattaz's avatar
dattaz committed
184
            <input type="file" name="file" id="lutim-file" accept="image/*">
185
186
        </div>
        <div class="form-group">
187
188
            <label for="lutim-file-url"><%= l('Upload an image with its URL') %></label>
            <input type="url" name="lutim-file-url" placeholder="<%= l('Image URL') %>">
Luc Didry's avatar
Luc Didry committed
189
        </div>
190
191
        <p class="help-block"><%= l('Only images are allowed') %></p>
        <%= submit_button l('Let\'s go!'), class => 'btn btn-default btn-primary', id => 'submitbutton' %>
192
    </form>
Luc Didry's avatar
Luc Didry committed
193
194
195
196
197
</noscript>

<!-- D&D Zone-->
<div class="jsonly">
    <div class="form-group form-inline">
Luc Didry's avatar
Fix #18    
Luc Didry committed
198
        <select id="delete-day" class="form-control">
199
            %= include 'partial/for_my_delay', d => \%d
Luc Didry's avatar
Fix #18    
Luc Didry committed
200
        </select>
Luc Didry's avatar
Luc Didry committed
201
202
        <div class="checkbox">
            <label>
203
                <input type="checkbox" id="first-view"> <%= l('Delete at first view?') %>
Luc Didry's avatar
Fix #22    
Luc Didry committed
204
            </label>
Luc Didry's avatar
Luc Didry committed
205
            <label <%== (config('always_encrypt')) ? 'class="always-encrypt"' : '' %>>
206
                <input type="checkbox" id="crypt"> <%= l('Encrypt the image (Lutim does not keep the key).') %>
Luc Didry's avatar
Luc Didry committed
207
            </label>
208
209
            <label>
                <input type="checkbox" id="keep-exif"> <%= l('Keep EXIF tags') %>
210
            </label>
Luc Didry's avatar
Luc Didry committed
211
        </div>
212
213
214
215
216
217
218
219
220
221
222
223
224
        % if ($c->config('watermark_path') && $c->config('watermark_enforce') eq 'none') {
            <select id="watermark" class="form-control">
                <option value="tiling" <%== is_wm_selected('tiling') %>>
                    <%= l('Tiling watermark') %>
                </option>
                <option value="single" <%== is_wm_selected('single') %>>
                    <%= l('Single watermark') %>
                </option>
                <option value="none"   <%== is_wm_selected('none') %>>
                    <%= l('No watermark') %>
                </option>
            </select>
        % }
Luc Didry's avatar
Luc Didry committed
225
226
    </div>
    <div id="drag-and-drop-zone" class="uploader">
227
228
        <div><%= l('Drag & drop images here') %></div>
        <div class="or"><%= l('-or-') %></div>
Luc Didry's avatar
Luc Didry committed
229
230
        <div class="browser">
            <label>
231
232
                <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/*">
Luc Didry's avatar
Luc Didry committed
233
234
235
            </label>
        </div>
    </div>
236
    <p class="help-block"><%= l('Only images are allowed') %></p>
237
    <form class="form-horizontal" method="POST" action="<%== url_for('add') %>">
Luc Didry's avatar
Fix #7    
Luc Didry committed
238
        <div class="form-group">
Luc Didry's avatar
Luc Didry committed
239
            <span class="col-sm-3 col-xs-12"><span class="hidden-spin spin"> <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>
240
            <div class="col-sm-9 col-xs-12">
241
                <input type="url" name="lutim-file-url" class="form-control" id="lutim-file-url" placeholder="<%= l('Image URL') %>">
Luc Didry's avatar
Fix #7    
Luc Didry committed
242
243
            </div>
        </div>
244
        <a href="#" class="btn btn-default btn-primary pull-right" id="file-url-button"><%= l('Let\'s go!') %></a>
Luc Didry's avatar
Fix #7    
Luc Didry committed
245
    </form>
Luc Didry's avatar
Luc Didry committed
246
247
</div>
<!-- /D&D Zone -->