{% import "macro_functions.phtml" as mf %}
{% set profile = admin.staff_profile_get %}
{% set company = guest.system_company %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>{% block meta_title %}{% endblock %} - {{ company.name }}</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    
    {% include "partial_bb_meta.phtml" %}
    
    {% include "partial_styles.phtml" %}
    
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/ui/jquery.alerts.js"></script>
    <script type="text/javascript" src="js/ui/jquery.tipsy.js"></script>
    <script type="text/javascript" src="js/jquery.collapsible.min.js"></script>
    <script type="text/javascript" src="js/forms/forms.js"></script>
    <script type="text/javascript" src="js/jquery.ToTop.js"></script>
    <script type="text/javascript" src="js/jquery.scrollTo-min.js"></script>
    <script type="text/javascript" src="js/jquery-ui.js"></script>
    <script type="text/javascript" src="js/bb-admin.js?v={{guest.system_version}}"></script>

    {% block head %}{% endblock %}
</head>

<body>

<div id="topNav">
    <div class="fixed">
        <div class="wrapper">
            <div class="welcome"><a href="{{ 'staff/profile'|alink }}" title=""><img src="{{ profile.email|gravatar }}?size=20" alt="{{ profile.name }}" /><span>{% trans 'Hi,' %} {{ profile.name }}!</span></a></div>
            <div class="userNav">
                <ul>
                    <li class="loading" style="display:none;"><img src="images/loader.gif" alt="" /><span>{% trans 'Loading ...' %}</span></li>
                    <li class="dd"><img src="images/icons/topnav/register.png" alt="" /><span>{% trans 'New' %}</span>
                        {% include "partial_menu_top.phtml" %}
                    </li>
                    {#<li><a href="{{ 'staff/profile'|alink }}" title=""><img src="images/icons/topnav/profile.png" alt="" /><span>{% trans 'Profile' %}</span></a></li>#}
                    <li><a href="{{ '/'|link }}" title="" target="_blank"><img src="images/icons/topnav/mainWebsite.png" alt=""/><span>{% trans 'Visit site' %}</span></a></li>
                    <li><a href="http://www.boxbilling.com/docs{% if help_query %}/search.html?q={{help_query}}{% endif %}" title="" target="_blank"><img src="images/icons/topnav/help.png" alt="" /><span>{% trans 'Help' %}</span></a></li>
                    <li><a href="admin/staff/profile_logout" title="" class="api-link" data-api-redirect="staff/login"><img src="images/icons/topnav/logout.png" alt="" /><span>{% trans 'Logout' %}</span></a></li>
                </ul>
            </div>
            <div class="fix"></div>
        </div>
    </div>
</div>

<div id="header" class="wrapper">
    <div class="logo"><a href="{{ 'system'|alink }}" title=""><img src="{{ company.logo_url }}" alt="{{ company.name }}" style="max-height: 50px;"/></a></div>
    <div class="middleNav">
        {% set count_orders = admin.order_get_statuses.failed_setup %}
        {% set count_invoices = admin.invoice_get_statuses.unpaid %}
        {% set count_tickets = admin.support_ticket_get_statuses.open %}
        {% set count_ptickets = admin.support_public_ticket_get_statuses.open %}
    	<ul>
            {% if guest.extension_is_on({"mod":"notification"}) %}
            {% set count_notifications = admin.notification_get_list({"per_page":1}).total %}
        	<li class="iMegaphone"><a href="{{ 'notification'|alink }}" title=""><span>{% trans 'Notifications' %}</span></a>{% if count_notifications %}<span class="numberMiddle">{{ count_notifications }}</span>{% endif %}</li>
            {% endif %}
        	<li class="iOrders"><a href="{{ 'order'|alink }}?status=failed_setup" title=""><span>{% trans 'Orders' %}</span></a>{% if count_orders %}<span class="numberMiddle">{{ count_orders }}</span>{% endif %}</li>
        	<li class="iInvoices"><a href="{{ 'invoice'|alink }}?status=unpaid" title=""><span>{% trans 'Invoices' %}</span></a>{% if count_invoices %}<span class="numberMiddle">{{ count_invoices }}</span>{% endif %}</li>
        	<li class="iSpeech"><a href="{{ 'support/public-tickets'|alink }}?status=open" title=""><span>{% trans 'Inquiries' %}</span></a>{% if count_ptickets %}<span class="numberMiddle">{{ count_ptickets }}</span>{% endif %}</li>
        	<li class="iMes"><a href="{{ 'support'|alink }}?status=open" title=""><span>{% trans 'Tickets' %}</span></a>{% if count_tickets %}<span class="numberMiddle">{{ count_tickets }}</span>{% endif %}</li>
            <li class="iUser"><a href="{{ 'client'|alink }}" title=""><span>{% trans 'Clients' %}</span></a></li>
        	<li class="iHome"><a href="{{ 'index'|alink }}" title=""><span>{% trans 'Dashboard' %}</span></a></li>
        </ul>
    </div>
    <div class="fix"></div>
</div>


<div class="wrapper">
    
    <div class="leftNav">
    {% block left_top %}{% endblock %}    
    {% block nav %}{% include "partial_menu.phtml" %}{% endblock %}
    {% block left_bottom %}{% endblock %}
    </div>
    
    {% block before_content %}{% endblock %}
    <div class="content">
        {% block breadcrumbs %}{% endblock %}
        {% block top_content %}{% endblock %}
        {% block content %}{% endblock %}
    </div>
    <div class="fix"></div>
</div>

<div id="footer">
	<div class="wrapper">
        {% include "partial_footer.phtml" with {'product': product} %}
    </div>
</div>
<div class="loading dim"></div>    
    {% block js %}{% endblock %}
    <noscript id="noscript">
        <div class="msg error">
        NOTE: Many features on BoxBilling require Javascript and cookies. You can enable both via your browser's preference settings.
        </div>
    </noscript>
</body>
</html>