% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab:
% my $lang = $self->languages;
%    $lang =~ s/-(.*)/_\U$1/;
<nav class="navbar navbar-default">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-lutim" aria-expanded="false">
                <span class="sr-only"><%= l('Toggle navigation') %></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="<%= url_for('/') %>">Lutim</a>
        </div>
        <div class="collapse navbar-collapse" id="navbar-lutim">
            <ul class="nav navbar-nav">
                <li>
                    <%= link_to url_for('myfiles') => begin %><%= l('My images') %><% end %>
                </li>
                <li>
                    <%= link_to url_for('stats') => begin %><%= l('Instance\'s statistics') %><% end %>
                </li>
                <li>
                    <a class="btn btn-default btn-xs" href="#" id="install-app">
                        <img src="<%= url_for('/img/rocket.png') %>" alt="mozilla rocket logo"> <%= l('Install webapp') %>
                    </a>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
        % if (defined($self->config('ldap')) || defined($self->config('htpasswd'))) {
            % if ($c->is_user_authenticated) {
                <li>
                    <a href="<%= url_for('logout') %>"><%= l('Logout') %></a>
                </li>
            % } else {
                <li>
                    <a href="<%= url_for('login') %>"><%= l('Signin') %></a>
                </li>
            % }
        % }
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                        <span class="icon-language"  aria-hidden="true" title="<%= l('Language') %>"></span><span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu" role="menu">
                    % for my $i (@{$self->available_langs}) {
                        <li<%== ($i eq $lang) ? ' class="active"' : '' %>>
                            <a href="<%= url_for('lang', l => $i) %>" class="set-lang"><%= iso639_native_name($i) %></a>
                        </li>
                    % }
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                        <%= l('Informations') %>
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li>
                            <%= link_to 'https://www.gnu.org/licenses/agpl-3.0.html' => begin %><%= l('License:') %> AGPL<% end %>
                        </li>
                        <li>
                            <%= link_to url_for('about') => begin %><%= l('About') %><% end %>
                        </li>
                        <li>
                            <%= link_to 'https://framagit.org/luc/lutim' => begin %><%= l('Fork me!') %><% end %>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</nav>
