<%
    # Note that this file is not a valid *.html file!
    # It is intended to be a bottlepy - style template
    # used for the scripting part of TheOnionBox!

    # tor = get('tor')

    # import socket
    # host_name = socket.gethostname()

    sc = get('section_config')
    header = sc['header'] if 'header' in sc else {}
%>

<div class="row box_header" style="min-height: 50px;">
%   if 'logout' in header:
%       if header['logout'] == True:
    <form role="logout" method='get' action="{{base_path}}{{session_id}}/logout.html">
        <button type="submit" id="button_logout" class="btn btn-outline-light"
                style="position: absolute; right: 20px; top: 20px;">Logout</button>
    </form>
%       end
%   end


    % if 'achtung' in header:
    %   achtung_title = header['achtung']['title']
    %   achtung_content = header['achtung']['content']
    <a tabindex="0" class="btn btn-lg btn-default"
        role="button"
        style="position: absolute; left: 20px; top: 20px;"
        data-container="body"
        data-trigger="focus"
        data-toggle="popover"
        data-title="{{!achtung_title}}"
        data-content="{{!achtung_content}}"
        data-html="true"
        data-template='<div class="popover popover_width" role="tooltip">
            <div class="arrow"></div>
            <h3 class="popover-header"></h3>
            <div class="popover-body"></div>
            </div>'
        > !! </a>
    % end

</div>

%   title = 'The Onion Box'
%   if 'title' in header:
%       ttl = header['title']
%       title = ttl if len(ttl)> 0 else title
%   end
<div class="row box_header">
    <div class="{{box_bold_grid}}"></div>
    <div class="{{box_title_grid}}">
        {{!title}}
    </div>
</div>

%   subtitle = ''
%   if 'subtitle' in header:
%       subtitle = header['subtitle']
%   end
<div class="row box_header ">
    <div class="{{box_bold_grid}}"></div>
    <div class="truncate {{box_subtitle_grid}}">
        {{!subtitle}}
    </div>
    <div class="col-3"></div>
</div>

%   powered = ''
%   if 'powered' in header:
%       powered = header['powered']
%   end
<div class="row box_header " style="min-height: 70px;">
    <div class="{{box_bold_grid}}"></div>
    <div class="{{box_powered_grid}}">
        {{!powered}}
    </div>
</div>

<br>
