<!DOCTYPE html>
{% for lang in site['languages'] %}
{% if lang['active'] %}
<html lang="{{ lang['code'] }}">
{% endif %}
{% endfor %}
<head>
  <base href="{{ site['url'] }}/">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{{ title }}</title>
  <meta name="keywords" content="{{ keywords }}">
  <meta name="description" content="{{ description }}">
  {% if site['favicon'] %}
    <link rel="shortcut icon" type="image/ico" href="{{ site['favicon'] }}" />
  {% endif %}

  <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
  
    {{ headerCode }}
     
    {% for style in styleList %}
      <link rel="stylesheet" type="text/css" href="{{ style }}">
    {% endfor %}
  </head>
<body>
    	{%  if settings['demo_mode'] == 1 %}
       <style>
            .fixed-footer{
                position: fixed;
                background: #fff;
                border:1px solid #000;
                width:100%;
                bottom:0;
                z-index:99999;
                padding:10px;
            }
        </style>
        
    <div class="fixed-footer">
            <h4 style="color:#000">Choose Theme: 
                
                   {% for thm in site['themes'] %}
<a href="/select-theme/{{thm['dirname']}}" style="color:blue;margin:0 10px;font-size:16px">[ {{thm['name']}} ]</a>
{% endfor %}
            </h4>
    </div>
    
  {% endif %}


{% if user['auth'] %}
<nav class="navbar navbar-default navbar-static-top">
    <div class="container-fluid">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="/">
          {% if site["logo"] %}
            <img src="{{ site['logo'] }}" alt="{{ site["site_name"] }}" title="{{ site["site_name"] }}">
          {% else %}
            {{ site["site_name"] }}
          {% endif %}
        </a>
      </div>
      <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-left-block">
        {% if ( settings['sms_verify'] == 2 and user['sms_verify'] == 1 ) or (settings['mail_verify'] == 2 and user['mail_verify'] == 1 ) %}
            <li {% if active_menu == "verify" %} class="active" {% endif %}><a href="/">{{ lang['verify.title'] }}</a></li>
        {% else %}
            <li {% if active_menu == "neworder" %} class="active" {% endif %}><a href="/">{{ lang['neworder.title'] }}</a></li>
            <li {% if active_menu == "services" %} class="active" {% endif %}><a href="/services">{{ lang['services.title'] }}</a></li>
            <li {% if active_menu == "orders" %} class="active" {% endif %}><a href="/orders">{{ lang['orders.title'] }}</a></li>
           	{% if site["dripfeedcount"] %}
			<li {% if active_menu == "dripfeeds" %} class="active" {% endif %}><a href="/dripfeeds">{{ lang['dripfeed.title'] }}</a></li>
			{% endif %}
			{% if site["subscriptionscount"] %}
			<li {% if active_menu == "subscriptions" %} class="active" {% endif %} ><a href="/subscriptions">{{ lang['subscriptions.title'] }}</a></li>
			{% endif %}
            <li {% if active_menu == "addfunds" %} class="active" {% endif %}><a href="/addfunds">{{ lang['addfunds.title'] }}</a></li>
			{% if affiliates %}
            <li {% if active_menu == "affiliates" %} class="active" {% endif %}><a href="/affiliates">{{ lang['affiliates.title'] }}</a></li>
            {% endif %}
            {% if panelSelling %}
            <li {% if active_menu == "child-panels" %} class="active" {% endif %}><a href="/child-panels">{{ lang['childpanels.title'] }}</a></li>
            {% endif %}
            {% if apiPage %}
            <li {% if active_menu == "api" %} class="active" {% endif %}><a href="/api">{{ lang['api.title'] }}</a></li>
            {% endif %}
            {% if ticketPage %}
            <li {% if active_menu == "tickets" %} class="active" {% endif %}><a href="/tickets">{{ lang['tickets.title'] }} {% if ticketCount %} <span class="badge">{{ ticketCount }}</span> {% endif %}</a></li>  
            {% endif %}
            {% if blogPage %}    
            <li {% if active_menu == "blog" %} class="active" {% endif %}><a href="/blog">{{ lang['blog.title'] }}</a></li>
            {% endif %}
            {% if faqPage %} 
            <li {% if active_menu == "faq" %} class="active" {% endif %}><a href="/faq">{{ lang['faq.title'] }}</a></li>
            {% endif %}
            {% if termsPage %} 
            <li {% if active_menu == "terms" %} class="active" {% endif %}><a href="/terms">{{ lang['terms.title'] }}</a></li> 
            {% endif %}
        {% endif %}  
        </ul>
        <ul class="nav navbar-nav navbar-right">
          <li>
            <a><span class="badge">
                {{ user['balance'] }}
            </span></a>
          </li>
          <li {% if active_menu == "account" %} class="active" {% endif %}>
            <a href="account">{{ lang['account.title'] }}</a>
          </li>
          <li>
            <a href="logout">{{ lang['logout.title'] }}</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>
{% else %}
<nav class="navbar navbar-default navbar-static-top ">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="/">
        {% if site["logo"] %}
          <img src="{{ site['logo'] }}" alt="{{ site["site_name"] }}" title="{{ site["site_name"] }}">
        {% else %}
          {{ site["site_name"] }}
        {% endif %}
      </a>
    </div>
    <div id="navbar" class="collapse navbar-collapse">
      {% if site['languages']|length > 1 %}
        <ul class="nav navbar-nav navbar-left-block">
          <li class="dropdown">
            {% for lang in site['languages'] %}
              {% if lang['active'] %}
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> {{ lang['name'] }} <span class="caret"></span></a>
              {% endif %}
            {% endfor %}
            <ul class="dropdown-menu dropdown-max-height">
              {% for lang in site['languages'] %}
                <li {% if lang['active'] %} class="active" {% endif %}><a href="?lang={{ lang['code'] }}">{{ lang['name'] }}</a></li>
              {% endfor %}
            </ul>
          </li>
        </ul>
      {% endif %}
      <ul class="nav navbar-nav navbar-right">
        <li {% if active_menu == "auth" %} class="active" {% endif %}>
          <a href="/">{{ lang['signin.title'] }}</a>
        </li> 
        {% if servicesPage %}
        <li {% if active_menu == "services" %} class="active" {% endif %}>
          <a href="/services">{{ lang['services.title'] }}</a>
        </li>
        {% endif %}
        {% if registerPage %}
        <li {% if active_menu == "signup" %} class="active" {% endif %}>
          <a href="/signup">{{ lang['signup.title'] }}</a>
        </li>
        {% endif %}
        {% if blogPage %}
        <li {% if active_menu == "blog" %} class="active" {% endif %}>
          <a href="/blog">{{ lang['blog.title'] }}</a>
        </li>
        {% endif %}
        {% if faqPage %}
        <li {% if active_menu == "faq" %} class="active" {% endif %}>
          <a href="/faq">{{ lang['faq.title'] }}</a>
        </li>
        {% endif %}
        {% if termsPage %}
        <li {% if active_menu == "terms" %} class="active" {% endif %}>
          <a href="/terms">{{ lang['terms.title'] }}</a>
        </li>
        {% endif %}
        {% if apiPage %}
        <li {% if active_menu == "api" %} class="active" {% endif %}>
          <a href="/api">{{ lang['api.title'] }}</a>
        </li>
        {% endif %}
      </ul>
    </div>
  </div>
</nav>
{% endif %}
