% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
% use Mojo::Util qw(url_escape);
% my $twitter_url = 'https://twitter.com/share';
% my $scheme = (defined(config('https')) && config('https')) ? 'https' : 'http';
% my $url    = url_for('/')->base->scheme($scheme)->to_abs().'/';
% $twitter_url .= '?url='.url_escape("$url")
%              .'&via=framasky'
%              .'&text=Check out this %23LUTIm instance! ';
<!DOCTYPE html>
<html>
    <head>
        <title>LUTIm</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta charset="utf-8" />
        <link rel="icon" type="image/png" href="<%= url_for('/') %>img/favicon.png">
        %= stylesheet 'css/bootstrap.min.css', media => 'screen'
        %= stylesheet 'css/fontello.css'
        %= stylesheet 'css/animation.css'
        %= stylesheet 'css/uploader.css'
        %= stylesheet begin
            body {
                padding-top: 40px;
                padding-bottom: 40px;
            }

            .container {
                padding: 15px;
                margin: 0 auto;
            }

            .jsonly {
                display: none;
            }

            .thumbnail {
                margin-right: 8px;
            }

% if (config('always_encrypt')) {
            label.always-encrypt {
                display: none;
            }
% }
        % end
        %= javascript 'js/jquery-2.1.0.min.js'
        %= javascript 'js/bootstrap.min.js'
        %= javascript begin
            $('document').ready(function() {
                $('.jsonly').show();
            });
        % end
    </head>
    <body>
        <div class="container-fluid">
            <div>
% if (defined(config('hosted_by'))) {
                <div class="pull-right">
                    <%== config('hosted_by') %>
                </div>
% }
                <div>
                    <div class="pull-left hidden-xs">
                        <img src="<%= url_for('/') %>img/LUTIm_small.png" alt="LUTIm logo">
                    </div>
                    <h1>Let's Upload That Image!</h1>
                    <p>
                        &copy; 2014 <%= link_to 'http://www.fiat-tux.fr' => begin %>Luc Didry<% end %> — 
                        <%=l 'license' %> <%= link_to 'https://www.gnu.org/licenses/agpl-3.0.html' => begin %>AGPL<% end %> — 
                        <span class="jsonly"><a data-toggle="modal" href="#myModal"><%=l 'informations' %></a> — </span>
                        <noscript><%= link_to url_for('about') => begin %><%=l 'informations' %><% end %> — </noscript>
                        <%= link_to 'https://github.com/ldidry/lutim' => (title => l 'fork-me') => begin %><i class="lead icon icon-github-circled"></i><% end %> 
                        <%= link_to $twitter_url                      => (title => l 'share-twitter')   => begin %><i class="lead icon icon-touiteur"></i><% end %> 
                        <%= link_to 'https://flattr.com/submit/auto?user_id=_SKy_&url='.$url.'&title=LUTIm&category=software' => (title => 'Flattr this') => begin %><i class="lead icon icon-flattr"></i><% end %> 
                        <%= link_to 'bitcoin:1K3n4MXNRSMHk28oTfXEvDunWFthePvd8v?label=lutim' => (title => 'Give Bitcoins') => begin %><i class="lead icon icon-bitcoin"></i><% end %>
                    </p>
                </div>
            </div>
% if (defined(config('broadcast_message'))) {
            <div class="alert alert-info">
                <strong><%= config('broadcast_message') %></strong>
            </div>
% }
% if (defined(stash('stop_upload'))) {
            <div class="alert alert-danger">
                <strong><%= stash('stop_upload') %></strong>
            </div>
% }
            <%= content %>
            <div class="modal fade bs-modal-lg"  id="myModal" role="dialog">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h3 class="modal-title">LUTIm</h3>
                        </div>
                        <div class="modal-body">
                            <%==l 'informations-body', url_for('/')->base->scheme($scheme)->to_abs().'/', config('contact') %>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                        </div>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal-dialog -->
            </div><!-- /.modal -->
        </div>
% if (defined(config('piwik_img'))) {
        <img src="<%== config('piwik_img') %>" style="border:0" alt="" />
% }
    </body>
</html>
