<%def name="check_menu(module)">\
    % if module[:1]=='/':
${make_url(module[1:])}\
    % else:
${make_url('admin/'+module)}\
    % endif
</%def>
<!DOCTYPE html>
<html>
<head>                                                                                          
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
<title>${title}</title>
${add_css_home_local('admin.css', 'admin')}
${add_css_home_local('font-awesome.min.css', 'admin')}
${add_css_home_local('responsive-nav.css', 'admin')}
${add_css_home_local('tooltipster.bundle.min.css', 'admin')}
${add_js_home_local('jquery.min.js', 'admin')}
${add_js_home_local('responsive-nav.min.js', 'admin')}
${add_js_home_local('tooltipster.bundle.min.js', 'admin')}
${HeaderHTML.css_home()|n}
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> 
<%block name="extra_css">
</%block>
${HeaderHTML.js_home()|n}
<%block name="extra_js">
</%block>
${HeaderHTML.header_home()|n}
<%block name="extra_header">
</%block>
</head>
<body>
<div id="languages_general">
</div>
<div id="logout">
<%block name="logout"><a href="${make_url('admin/logout')}"><i class="fa fa-power-off" aria-hidden="true"></i> Logout</a></%block>
</div>

<div id="center_body">
    <div id="header">
        <a href="#nav" id="toggle"><i class="fa fa-bars" aria-hidden="true"></i><span>Menu</span></a>
        <%block name="title_admin"><span id="title_phango">Paramecio</span> <span id="title_framework">Framework!</span></%block>
        <%block name="languages">
        <div id="languages_general">
        <%def name="select_lang(i18n, lang_selected)">
            % if i18n==lang_selected:
                choose_flag
            % else:
                no_choose_flag
            % endif
        </%def>
        </%block>
        % if lang_selected!=None:
            % for i18n in arr_i18n:
                <a class="${select_lang(i18n, lang_selected)}" href="${make_url('change_lang/'+i18n)}"><img src="${make_media_url_module('images/languages/'+i18n+'.png', 'admin')}" alt="${i18n}"/></a> 
            
            % endfor 
        % endif
        </div>
    </div>
    <div class="content_admin">
        <nav id="menu" class="nav-collapse">
            <ul>
                <li class="menu_title"><%block name="applications"><i class="fa fa-gear" aria-hidden="true"></i>${lang('admin', 'applications', 'Applications')}</li></%block>
                % for module in menu:
                    % if type(menu[module]).__name__=='list':
                        % if menu[module][0]!="":
                            <li><a href="${check_menu(module).strip()|n}">${menu[module][3]|n}${menu[module][0]}</a></li>
                        % endif
                    % else:
                        % if menu[module]!="":
                            <li><div class="father_admin">${menu[module]|n}</div></li>
                        % endif
                    % endif
                % endfor
            </ul>
        </nav>
        <div class="contents">
            <h1>${title}</h1>
            <div class="content">
                ${show_flash_message()|n}
                <%block name="content">
                </%block>
            </div>
        </nav>
    </div>
</div>
<div id="loading_ajax">
</div>
<script>
    var navigation = responsiveNav(".nav-collapse", {customToggle: "#toggle"});
    
    $('.tooltip').tooltipster({
        animation: 'fade',
        delay: 100,
        trigger: 'click'
    });
    
</script>
<%block name="jscript_block">
</%block>
</body>
</html>
