{% load i18n static %}
{% load removeSpace_filter %}
<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<title>{% block title %}{% endblock %}</title>
<link rel="shortcut icon" href="/media/icons/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}">
{% block extrastyle %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="/static/css/header.css?v=3.6.1" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/admin_custom.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script>
{% if user.is_authenticated %}
<link rel="stylesheet" href="/static/css/versionLaunchVideo.css">
<link rel="stylesheet" href="/static/css/magnific-popup.min.css">
<script src="/static/js/jquery.magnific-popup.min.js"></script>
{% endif %}
{% endblock %}
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}">{% endif %}
{% block extrahead %}{% endblock %}
{% block responsive %}
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}">
    {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive_rtl.css" %}">{% endif %}
{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE">{% endblock %}
</head>
{% load i18n %}

<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"
  data-admin-utc-offset="{% now "Z" %}">

<!-- Container -->
<div id="container">

    {% if not is_popup %}
    <!-- Header -->
    <div id="topbar" class="topnav">
        <div id="branding">
            <a href="https://reindicator.com" title="Home - REIndicator"><img src="/media/images/logo1.png" align="left" height="50" alt="REIndicator homepage"></a>
        </div>
        <div class="topbar-dropdown">
            <a href="javascript:void(0);" class="icon dropbtn" onclick="menu_dropdown()">
                <i class="fa fa-bars"></i>
            </a>            
            <div id="dropdownContent" class="topbar-dropdown-content">
                <a href="/"><i class="fa fa-globe" aria-hidden="true"></i> View Map</a>
                <a href="/editinfo"><i class="fa fa-cog" aria-hidden="true"></i> Change My Settings</a>
                {% if user.is_authenticated and not user|has_group:"Hiatus" %}
                <a href='https://info.reindicator.com/new-member-welcome-notes/' target='_blank'><i class="fa fa-exclamation-circle" aria-hidden="true"></i> New Members Start Here</a>
                <a href="https://info.reindicator.com/webinar-replays/" target='_blank'><i class="fa fa-play-circle-o" aria-hidden="true"></i> Webinar Replays</a>
                <a href = "https://info.reindicator.com/" target='_blank'><i class="fa fa-life-ring" aria-hidden="true"></i> Support</a>
                {% if not user|has_group:"MDM1" %}
                <a href='#videoPopup' class="versionVideoLink" target='_blank'>Learn About Version 3.6</a>
                <a href='https://us06web.zoom.us/j/86440202851' class="webinarLink-dropdown" target='_blank'>Next Webinar: <span style='color:#ba3b46;'>Friday, December 1, 2PM ET</span>.<br>Preparing Investor Presentations Ep. 2</a>
                {% endif %}
                <a href = "https://calendly.com/reindicator/member-strategy-session" style="position:relative;" target='_blank'> Click here to schedule<br>a Quick Strategy Call with Scott</a>
                {% endif %}
                <a href="/logout"><i class="fa fa-sign-out" aria-hidden="true"></i> Log Out</a>
            </div>
        </div>
        {% if user.is_authenticated and not user|has_group:"Hiatus" and not user|has_group:"MDM1" %}
        <div class="webinarLinkDiv" style="width: 224px;"><a href='https://us06web.zoom.us/j/86440202851' class="webinarLink" target='_blank'>Next Webinar: <span style='color:#e9ff19;'>Friday, December 1, 2PM ET</span>.<br>Preparing Investor Presentations Ep. 2</a></div>
        <div class="versionVideoLinkDiv w100ForSmall"><a href='#videoPopup' class="versionVideoLink" target='_blank'>Learn About Version 3.6</a></div>
        <div id="videoPopup" class="mfp-hide embed-responsive embed-responsive-21by9">
            <iframe width="560" height="315" src="https://www.youtube.com/embed/Kt7NBcIBUps" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
        </div>
        {% endif %}
        <div class = "control-buttons" style="float: right;">
            {% if site_url %}
                <a href="{{ site_url }}" title="View map"><img src="/media/icons/SVG_USA_World.svg" class="menu-button" /></a>
            {% endif %}
            <a href="/editinfo" title="Change My Settings"><img src="/media/icons/user_settings.svg" class="menu-button" /></a>
            <a href="{% url 'admin:logout' %}" title="Log Out" style='margin: 0px 15px 0 0;'><img src="/media/icons/logout1.svg" class="menu-button" /></a>
        </div>
        {% if user.is_authenticated %}
        <div class = "welcome-user">
            <div class = 'welcom_msg'>
                <span>
                    Welcome,
                    <strong>{% firstof user.get_short_name user.get_username %}</strong>.
                </span>
            </div>
        </div>
        {% endif %}
        {% if user.is_authenticated and not user|has_group:"Hiatus" %}
        <div class = "help-link" style="float: right;">
            <div class="helpLinkDiv w100ForSmall"><a href='https://info.reindicator.com/new-member-welcome-notes/' class="helpLink" target='_blank'>New Members Start Here</a></div>
            <div class="helpLinkDiv"><a href='https://info.reindicator.com/webinar-replays/' class="helpLink" target='_blank'>Replays</a></div>
            <div class="helpLinkDiv"><a href='https://info.reindicator.com/' class="helpLink" target='_blank'>Support</a></div>
            <div class="helpLinkDiv" style="position: relative;">
                <a href='https://calendly.com/reindicator/member-strategy-session' class="helpLink" target='_blank'>Click here to schedule<br>a Quick Strategy Call with Scott</a>
            </div>
        </div>
        {% endif %}
        {% block usertools %}
        {% if has_permission %}        
        {% endif %}
        {% endblock %}
        {% block nav-global %}{% endblock %}
    </div>
    <!-- END Header -->
    {% block breadcrumbs %}
    <div class="breadcrumbs">
    <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
    {% if title %} &rsaquo; {{ title }}{% endif %}
    </div>
    {% endblock %}
    {% endif %}

    {% block messages %}
        {% if messages %}
        <ul class="messagelist">{% for message in messages %}
          <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
        {% endfor %}</ul>
        {% endif %}
    {% endblock messages %}

    <!-- Content -->
    <div id="content" class="{% block coltype %}colM{% endblock %}">
        {% block pretitle %}{% endblock %}
        {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
        {% block content %}
        {% block object-tools %}{% endblock %}
        {{ content }}
        {% endblock %}
        {% block sidebar %}{% endblock %}
        <br class="clear">
    </div>
    <!-- END Content -->

    {% block footer %}<div id="footer"></div>{% endblock %}
</div>
<!-- END Container -->
<script>
    function menu_dropdown() {
        document.getElementById("dropdownContent").classList.toggle("show");
    }

    // Close the dropdown if the user clicks outside of it
    document.onclick = function(event) {
        if (!event.target.matches('.dropbtn') && !event.target.matches('.fa-bars')) {
            var dropdowns = document.getElementsByClassName("topbar-dropdown-content");
            var i;
            for (i = 0; i < dropdowns.length; i++) {
                var openDropdown = dropdowns[i];
                if (openDropdown.classList.contains('show')) {
                    openDropdown.classList.remove('show');
                }
            }
        }
    }
    {% if user.is_authenticated and not user|has_group:"Hiatus" and not user|has_group:"MDM1" %}
    $('.versionVideoLink').magnificPopup({
        type:'inline',
        midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href.
    });
    {% endif %}
</script>
</body>
</html>