% # 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')
% );
    <form class="row">
        <noscript>
            <div class="col s12">
                <div class="card pink">
                    <div class="card-content white-text">
                        <strong><%= l('Javascript is disabled. You won\'t be able to use Lufi.') %></strong>
                    </div>
                </div>
            </div>
        </noscript>
% if (defined(config('broadcast_message'))) {
        <div class="col s12">
            <div class="card pink">
                <div class="card-content white-text">
                    <strong><%= config('broadcast_message') %></strong>
                </div>
            </div>
        </div>
% }
        <div class="col s12 hiddendiv" id="not-enough-entropy">
            <div class="card pink">
                <div class="card-content white-text">
                    <strong><%= l('Your browser has not enough entropy to generate a strong encryption key. Please wait (it\'s better if you do things on your computer while waiting).') %></strong>
                </div>
            </div>
        </div>
% if (stop_upload) {
        <div class="col s12">
            <div class="card pink">
                <div class="card-content white-text">
                    <strong><%= l('Sorry, the uploading is currently disabled. Please try again later.') %></strong>
                </div>
            </div>
        </div>
% } else {
        <div class="col s12 m6">
            <div class="input-field">
                <a class="waves-effect waves-light modal-trigger prefix" href="#delays-info" title="<%= l('Important: more information on delays') %>"><i class="mdi-action-info small"></i></a>
                <select id="delete-day">
% for my $delay (qw/0 1 7 30 365/) {
%   my $text = ($delay == 7 || $delay == 30) ? l('%1 days', $delay) : $d{'delay_'.$delay};
%   if (max_delay) {
%       if ($delay) {
%           if ($delay < max_delay) {
                    <option value="<%= $delay %>" <%== is_selected($delay) %>><%= $text %></option>
%           } elsif ($delay == max_delay) {
                    <option value="<%= $delay %>" <%== is_selected($delay) %>><%= $text %></option>
%               last;
%           } else {
%               my $text = ($delay == 1) ? l('24 hours') : l('%1 days', $delay);
                    <option value="<%= max_delay %>" <%== is_selected(max_delay) %>><%= l('%1 days', max_delay) %></option>
%               last;
%           }
%       }
%   } else {
                    <option value="<%= $delay %>" <%== is_selected($delay) %>><%= $text %></option>
%   }
% }
                </select>
            </div>
        </div>
        <div class="input-field">
        % if ($self->config('force_burn_after_reading')) {
            <p class="col s12 m6 text-left like-label">
                <%= l('Files deleted at first download') %>
            </p>
        % }
            <p class="col s12 m6 text-left<%= ' hiddendiv' if $self->config('force_burn_after_reading') %>">
                <input
                    type="checkbox"
                    id="first-view"
                    data-checked="<%= 'data-checked' if $self->config('force_burn_after_reading') %>"
                    <%= 'disabled="disabled"' if $self->config('force_burn_after_reading') %>
                >
                <label for="first-view"><%= l('Delete at first download?') %></label>
            </p>
        </div>
    % if (config('allow_pwd_on_files')) {
        <div class="col s12 m12">
            <div class="input-field">
                <input type="password" id="file_pwd" placeholder="<%= l('Password') %>" class="validate" autocomplete="off">
                <label for="file_pwd"><%= l('Add a password to file(s)') %></label>
            </div>
        </div>
    % }
    </form>
    <div id="files">
        <h2><%= l('Drop files here') %></h2>
        <p id="max-file-size"></p>
        <p><small><%= l('or') %></small></p>
        <label>
            <span id="file-browser-span" class="btn disabled waves-effect waves-light"><%= l('Click to open the file browser') %></span>
            <input type="file" id="file-browser-button" multiple disabled>
        </label>
    </div>
    <div id="results">
        <h2><%= l('Uploaded files') %></h2>
        <div id="misc"></div>
        <ul class="list-group" id="ul-results">
        </ul>
    </div>
%= include 'delays'
%= javascript '/partial/index.js'
%= javascript '/js/sjcl.js'
%= javascript '/js/moment-with-locales.min.js'
%= javascript '/js/filesize.min.js'
%= javascript '/js/lufi-up.js'
% }
