{% load wagtailuserbar wagtailcore_tags wagtailsettings_tags wagtailimages_tags %}
{% load core_tags static compress gem_tags molo_commenting_tags %}

{% get_settings %}

<!DOCTYPE html>
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"><![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8"><![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9"><![endif]-->
<!--[if gt IE 8]><!-->
{% spaceless %}
<html class="no-js" lang="{{request.LANGUAGE_CODE}}">
<!--<![endif]-->
<head>
  <meta charset="utf-8" />
  <title>Ni Nyampinga |
    {% block title %}
      {% if self.seo_title %}
        {% if self.seo_title == "Main" %}Home{% else %}
          {{ self.seo_title }}
        {% endif %}
      {% elif self.title %}
        {% if self.title == "Main" %}Home{% else %}
          {{ self.title }}
        {% endif %}
      {% else %}Welcome{% endif %}
    {% endblock %}
  </title>
  <meta content="text/html; charset=UTF-8; X-Content-Type-Options=nosniff" http-equiv="Content-Type" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="twitter:card" content="summary_large_image"/>
  <meta property="og:url" content="{{ request.build_absolute_uri }}" />
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta name="keywords" content="{% if self.specific.metadata_tags %}{{self.specific.metadata_tags.all|join:','}}{% else %}{{self.seo_title}}{% endif %}" />
  <meta property="og:title" content="{% if self.social_media_title %}{{ self.social_media_title }}{% elif self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}" />
  {% if self.search_description %}
    <meta name="description" content="{{self.search_description}}" />
    <meta property="og:description" content="{{self.search_description}}"/>
  {% elif self.social_media_description %}
    <meta name="description" content="{{self.social_media_description}}" />
    <meta property="og:description" content="{{self.social_media_description}}"/>
  {% elif self.title and self.subtitle %}
    <meta name="description" content="{{self.title}} - {{self.subtitle}}" />
    <meta property="og:description" content="{{self.title}} - {{self.subtitle}}"/>
  {% else %}
    <meta name="description" lang="en" content="Ni Nyampinga is Rwanda’s first youth brand giving girls the advice and confidence they need to thrive." />
    <meta property="og:description" lang="en" content="Ni Nyampinga is Rwanda’s first youth brand giving girls the advice and confidence they need to thrive."/>
  {% endif %}
  <meta property="og:type" content="website" />
  {% if self.social_media_image %}
    {% image self.social_media_image fill-450x200 as tmp_photo %}
  {% endif %}
  {% if self.get_effective_image %}
    {% image self.get_effective_image fill-450x200 as article_photo %}
  {% endif %}
  <link href="{{ request.build_absolute_uri }}" rel="canonical" />
  <meta property="og:image" content="{% if self.social_media_image %}{{ tmp_photo.url }}{% elif article_photo.url %}{{ article_photo.url }}{% else %}{{ request.scheme }}://{{ request.get_host }}{% static 'img/logos/ninyampinga-logo.png' %}{% endif %}"/>
  <meta property="og:image:type" content="" />
  <meta property="og:image:width" content="1200" />
  <meta property="og:image:height" content="630" />
  <meta name="msapplication-TileColor" content="#ffffff" />
  <meta name="theme-color" content="#ffffff" />
  <meta name="msapplication-TileImage" content="{% static 'img/appicons/ninyampinga/NN_Favicon_WHITE.png' %}">
  <link rel="apple-touch-icon" sizes="144x144" href="{% static 'img/appicons/ninyampinga/NN_Favicon_GREEN.svg' %}">
  <link rel="apple-touch-icon" sizes="180x180" href="{% static 'img/appicons/ninyampinga/NN_Favicon_GREEN.svg' %}">
  <link rel="icon" type="image/png" sizes="192x192" href="{% static 'img/appicons/ninyampinga/NN_Favicon_GREEN.svg' %}">
  <link rel="icon" type="image/png" sizes="96x96" href="{% static 'img/appicons/ninyampinga/NN_Favicon_GREEN.svg' %}">
  <link rel="icon" type="image/png" sizes="39x49" href="{% static 'img/appicons/ninyampinga/NN_Favicon_GREEN.png' %}">
  <link rel="icon" type="image/png" sizes="16x16" href="{% static 'img/appicons/ninyampinga/NN_Favicon_GREEN.svg' %}">
  <link rel="shortcut icon" type="image/x-icon" href="{% static 'img/appicons/ninyampinga/favicon.ico' %}">
  <link rel="icon" type="image/x-icon" href="{% static 'img/appicons/ninyampinga/favicon.ico' %}">
  {% if settings.core.SiteSettings.google_search_console %}
    <meta name="google-site-verification" content="{{settings.core.SiteSettings.google_search_console}}" />
  {% endif %}
  {% compress css inline %}
  <link href="{{ STATIC_URL }}css/{{ ENV }}/nn.css" rel="stylesheet" media="all">
  {% endcompress %}
</head>
<body {% if request.LANGUAGE_CODE|language_bidi == True %}dir="rtl"{% endif %}>
  <img alt="Ninyampinga" src="{% if self.social_media_image %}{{ tmp_photo.url }}{% elif article_photo.url %}{{ article_photo.url }}{% else %}{{ request.scheme }}://{{ request.get_host }}{% static 'img/logos/ninyampinga-logo.png' %}{% endif %}" id="image__identity" style="display:none; visibility:hidden;" />
  <a class="skip-link" href="#wrapper">Skip to main</a>
  {% wagtailuserbar %}
  {% block google_analytics %}
   {% include "patterns/components/ga_tag_manager.html" %}
  {% endblock %}
  {% if settings.core.SiteSettings.local_ga_tracking_code %}
   <script>
     (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
     })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
     ga('create', '{{settings.core.SiteSettings.local_ga_tracking_code}}', 'auto');
   </script>
  {% endif %}
    <div id="header" class="header">
      <div class="logo-wrapper">
        <div class="logo">
          <a href="/" class="logo__anchor">
            {% if settings.core.SiteSettings.logo %}
              {% image settings.core.SiteSettings.logo width-350 as logo_image %}
              <img src="{{logo_image.url}}" width="334" height="57" alt="Girl Effect - Ni Nyampinga" class="logo__image" />
            {% else %}
              {% with "img/logos/ninyampinga-logo"|add:".png" as logo_url %}
                <img src="{% static logo_url %}" width="334" height="57" alt="Girl Effect - Ni Nyampinga" class="logo__image" />
              {% endwith %}
            {% endif %}
          </a>
        </div>
      </div>
      {% load_sections as sections %}
      <div class="navLogged-wrapper">
        <div class="nav dropdown">
          <label for="nav_accordion" class="burger-nav__label dropdown-toggle">{% trans "Menu" %}</label>
          <input type="checkbox" value="toggles" name="toggle" id="nav_accordion" class="burger-nav__checkbox" />
          <div class="nav-wrapper dropdown-menu">
            <div class="nav-primary">
              <ul class="nav-list">
                <li class="nav-list__item">
                  <a href="/" class="nav-list__anchor{% if request.path == '/' %} selected{% endif %}">
                    {% trans "Home" %}
                  </a>
                </li>
                {% if sections %}
                  {% for section_cat in sections %}
                    {% content_is section_cat "Events" as is_event %}
                    {% if is_event == True %}
                    <li class="nav-list__item">
                      <a href="{% pageurl section_cat.specific %}" class="nav-list__anchor">{{section_cat.title}}</a>
                    </li>
                    {% endif %}
                  {% endfor %}
                {% endif %}
                <li class="nav-list__item">
                  {% if not user.is_authenticated %}
                    <a href="{{REGISTRATION_URL}}" class="nav-list__anchor">{% trans "Sign up" %}</a>
                  {% else %}
                    <a href="{{VIEW_PROFILE_URL}}" class="nav-list__anchor">{% trans "Profile" %}</a>
                  {% endif %}
                </li>
                <li class="nav-list__item">
                  {% if not user.is_authenticated %}
                    <a href="{{ LOGIN_URL }}" class="nav-list__anchor">{% trans "Log in" %}</a>
                  {% else %}
                    <form action="{{ LOGOUT_URL }}"  method="post" novalidate>
                    {% csrf_token %}
                      <input class="nav-list__anchor" value="{% trans 'Log out' %}" type="submit"/>
                    </form>
                  {% endif %}
                </li>
              </ul>
            </div>
            {% if sections %}
            <div class="nav-secondary">
              <div class="nav-secondary__item">
                <h1 class="nav-list__title">{% trans "Featured" %}:</h1>
                <ul class="nav-list-inner">
                  {% for section_page in sections %}
                    {% content_is section_page "Events" as is_event %}
                    {% if section_page.show_in_menus == True  %}
                      {% if is_event == False %}
                        <li class="nav-list-inner__item">
                          <a href="{% pageurl section_page.specific %}" class="nav-list__anchor">
                            {{section_page.title}}
                          </a>
                        </li>
                      {% endif %}
                    {% endif %}
                  {% endfor %}
                </ul>
              </div>
              <div class="nav-secondary__item">
                <h1 class="nav-list__title">{% trans "News and stories" %}:</h1>
                <ul class="nav-list-inner">
                  {% for section in sections %}
                    {% content_is section "Events" as is_event %}
                    {% if section.show_in_menus == False %}
                      {% if is_event == False %}
                        <li class="nav-list-inner__item">
                          <a href="{% pageurl section.specific %}" class="nav-list__anchor {% if request.path == section_path %}nav-list__anchor--selected{% endif %}">
                            {{section.title}}
                          </a>
                        </li>
                      {% endif %}
                    {% endif %}
                  {% endfor %}
                </ul>
              </div>
            </div>
            {% endif %}
          </div>
        </div>
        {% if user.is_authenticated %}
          <div class="nav-logged">
            <a href="{{VIEW_PROFILE_URL}}" class="nav-logged__anchor">{% trans "Profile" %}</a>
          </div>
        {% endif %}
      </div>
      <div class="languageSearch-wrapper">
        <div class="languages dropdown">
          <label for="languages_accordion" class="languages-accordion__label dropdown-toggle">
            <span>{% trans "Languages" %}</span>
          </label>
          <input type="checkbox" value="toggles" name="languages_toggle" id="languages_accordion" class="languages-accordion__checkbox" />
          {% if languages|length > 1 %}
          <div class="languages-wrapper dropdown-menu">
            <ul class="languages-list">
              <li class="languages-list__item">
                <div class="languages-list__label">
                  <h1 class="languages-list__title">{% trans "Languages" %}:</h1>
                </div>
              </li>
              {% for language in languages %}
                <li class="languages-list__item">
                  <a rel="alternate" hreflang="{{language.locale | language_name_local}}" href="{% url 'locale_set' language.locale %}?next={{request.path}}{% if request.GET.urlencode %}?{{ request.GET.urlencode }}{% endif %}" class="languages-list__anchor{% if request.LANGUAGE_CODE == language.locale %} languages-list__active{% endif %}">{{language.locale | language_name_local}}</a>
                </li>
              {% endfor %}
            </ul>
          </div>
          {% endif %}
        </div>
        <div class="search search--header dropdown">
          <label for="search_accordion" id="search_nav" class="search-accordion__label dropdown-toggle">{% trans "Search" %}</label>
          <input type="checkbox" value="toggles" name="search_toggle" id="search_accordion" class="search-accordion__checkbox" />
          <div class="search-wrapper dropdown-menu">
            <h1 class="search__title">{% trans "Search" %}:</h1>
            <form action="{% url 'search' %}" class="search__form" novalidate>
              <label class="search__label" for="search_top">{% trans 'Search' %}</label>
              <input name="q" type="search" aria-label="Search Input" id="search_top" placeholder="{% trans 'Search' %}">
              <input type="submit" value="{% trans 'Search' %}" class="call-to-action__item call-to-action__item--text">
            </form>
          </div>
        </div>
      </div>
    </div>
    <div id="container" class="content-wrapper">
      <div class="inner-content">
        {% display_unread_notifications %}
        {% block content %}{% endblock %}
      </div>
    </div>
      <div id="footer" class="footer">
        {% load_sections as sections %}
        <div class="menu">
          <div class="heading heading--hero">
            <h3 class=" heading__basic">
              {% trans "Links" %}
            </h3>
          </div>
          <div class="menu--wrapper">
            <ul class="menu-list menu-list--column1">
              <li class="menu-list__item">
                <a href="/" class="menu-list__anchor{% if request.path == '/' %} selected{% endif %}">{% trans "Home" %}</a>
              </li>
              {% if sections %}
                {% for section in sections|slice:":4" %}
                  {% content_is section "Events" as is_event %}
                  {% if is_event == False %}
                    <li class="menu-list__item">
                      <a href="{% pageurl section.specific %}" class="menu-list__anchor {% if request.path == section_path %}menu-list__anchor--selected{% endif %}">
                        {{section.title}}
                      </a>
                    </li>
                  {% endif %}
                {% endfor %}
              {% endif %}
            </ul>
            <ul class="menu-list menu-list--column2">
              {% if sections %}
                {% for section in sections|slice:"4:" %}
                  {% content_is section "Events" as is_event %}
                  {% if is_event == False %}
                    <li class="menu-list__item">
                      <a href="{% pageurl section.specific %}" class="menu-list__anchor {% if request.path == section_path %}menu-list__anchor--selected{% endif %}">
                        {{section.title}}
                      </a>
                    </li>
                  {% endif %}
                {% endfor %}
              {% endif %}
            {% comment %}<!--NOTE:: Fragmented Markup-->{% endcomment %}
            {% footer_page %}
            {% if not user.is_authenticated %}
            <li class="menu-list__item">
              <a href="{{REGISTRATION_URL}}" class="menu-list__anchor">
                {% trans "Join us" %}</a>
            </li>
            <li class="menu-list__item">
              <a href="{{ LOGIN_URL }}" class="menu-list__anchor">
                {% trans "Log in" %}
              </a>
            </li>
            {% else %}
            <li class="menu-list__item">
              <a href="{{VIEW_PROFILE_URL}}" class="menu-list__anchor">
                {% trans "Profile" %}
              </a>
            </li>
            <li class="menu-list__item">
              <form method="post" action="{{ LOGOUT_URL }}" novalidate>
                {% csrf_token %}
                <input class="menu-list__anchor" value="{% trans 'Log out' %}" type="submit">
              </form>
            </li>
            {% endif %}
          </ul>
          </div>
        </div>
        {% social_media_footer %}
        <div class="searchCopyright-wrapper">
          {% block search %}
          <div class="search">
            <div class="heading heading--hero">
              <h3 class=" heading__basic">
                {% trans "Search" %}
              </h3>
            </div>
            <form action="{% url 'search' %}" class="search__form" novalidate>
              <label class="search__label" for="search_bottom">{% trans "Search" %}</label>
              <input name="q" type="search" aria-label="Search Input" id="search_bottom" placeholder="{% trans 'Search' %}">
              <input type="submit" value="{% trans 'Search' %}" class="call-to-action__item call-to-action__item--text">
            </form>
          </div>
          {% endblock %}
          {% if is_via_kaios %}
            <div class="softkey">
              <div id="softkey-left" class="softkey-link">Back</div>
              <div id="softkey-center" class="softkey-link">SELECT</div>
              <div id="softkey-right" class="softkey-link">Options</div>
            </div>
          {% endif %}
          <div class="copyright">
            {% if languages|length > 1 %}
            <div class="languages languages--footer">
              <p class="languages__label">{% trans "Languages" %}:</p>
              {% for language in languages %}
                <a href="{% url 'locale_set' language.locale %}?next={{request.path}}{% if request.GET.urlencode %}?{{ request.GET.urlencode }}{% endif %}" class="languages__anchor {% if request.LANGUAGE_CODE == language.locale %}active{% endif %}">{{ language }}</a>
              {% endfor %}
            </div>
            {% endif %}
            <p class="copyright__disclaimer">
              &copy; {% now "Y" %} Girl Effect. {% trans "All Rights Reserved." %}
              {% if settings.profiles.UserProfilesSettings.terms_and_conditions %}
                <a href="{% pageurl settings.profiles.UserProfilesSettings.terms_and_conditions.specific %}" class="copyright__link">
                  {% trans "Terms &amp; Conditions" %}
                  </a>
              {% endif %}
            </p>
            {% if settings.gem.GemSettings.show_partner_credit %}
              <p class="copyright__disclaimer">
                <a href="{{settings.gem.GemSettings.partner_credit_link}}" class="copyright__link">
                  {{settings.gem.GemSettings.partner_credit_description}}
                </a>
              </p>
            {% endif %}
          </div>
        </div>
      </div>
      {% if not is_via_freebasics %} -->
        {% compress js inline %}
        <script src="{% static 'js/dest/main-min.js' %}"></script>
        <script>
          !function(e){var i=/iPhone/i,o=/iPod/i,t=/iPad/i,n=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,d=/Android/i,r=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,s=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,b=/IEMobile/i,h=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,a=/BlackBerry/i,l=/BB10/i,p=/Opera Mini/i,f=/(CriOS|Chrome)(?=.*\bMobile\b)/i,c=/^((?!chrome|android).)*safari/i,u=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,w=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),v=function(e,i){return e.test(i)},A=function(e){var A=e||navigator.userAgent,F=A.split("[FBAN");return void 0!==F[1]&&(A=F[0]),void 0!==(F=A.split("Twitter"))[1]&&(A=F[0]),this.apple={phone:v(i,A),ipod:v(o,A),tablet:!v(i,A)&&v(t,A),device:v(i,A)||v(o,A)||v(t,A),browser:v(c,A)},this.amazon={phone:v(r,A),tablet:!v(r,A)&&v(s,A),device:v(r,A)||v(s,A)},this.android={phone:v(r,A)||v(n,A),tablet:!v(r,A)&&!v(n,A)&&(v(s,A)||v(d,A)),device:v(r,A)||v(s,A)||v(n,A)||v(d,A)},this.windows={phone:v(b,A),tablet:v(h,A),device:v(b,A)||v(h,A)},this.other={blackberry:v(a,A),blackberry10:v(l,A),opera:v(p,A),firefox:v(u,A),chrome:v(f,A),device:v(a,A)||v(l,A)||v(p,A)||v(u,A)||v(f,A)},this.seven_inch=v(w,A),this.any=this.apple.device||this.apple.browser||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,"undefined"==typeof window?this:void 0},F=function(){var e=new A;return e.Class=A,e};"undefined"!=typeof module&&module.exports&&"undefined"==typeof window?module.exports=A:"undefined"!=typeof module&&module.exports&&"undefined"!=typeof window?module.exports=F():"function"==typeof define&&define.amd?define("isMobile",[],e.isMobile=F()):e.isMobile=F()}(this);
          (function() {
            var domReady = function(callback) {
              window.onload ? callback() : document.addEventListener("DOMContentLoaded", callback);
            };
            var screenOrient = function() {
              var cutsTheMustard = 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window;
              var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
              var devices = (isMobile.apple.device || isMobile.android.device || isMobile.windows.device || !isMobile.other.opera || !isMobile.other.device);
                if (cutsTheMustard === true) {
                  if (devices && raf) {
                    raf(function() {
                      if(isMobile.apple.browser === true) {
                        var safari = '<link href="{{ STATIC_URL }}css/{{ ENV }}/nn-safari.css" rel="stylesheet" media="all">',
                            styles = document.getElementsByTagName('style')[0];
                        window.setTimeout(styles.insertAdjacentHTML('afterend', safari), 0);
                      }

                      var jsScripts = [
                         "{% static 'js/jquery-3.5.1.min.js' %}",
                         "{% static 'js/dest/nn-min.js' %}",
                         "{% static 'js/dest/kaios-min.js' %}"
                       ]
                      for (var i = 0; i < jsScripts.length; i++) {
                        var script = document.createElement('script');
                        script.src = jsScripts[i];
                        script.async = false;
                        document.querySelector('script').parentNode.appendChild(script);
                      }
                    });
                  }
                }
              }
            domReady(function() {
              screenOrient();
            });
          })();
        </script>
      {% endcompress %}
    {% endif %}
</body>
</html>
{% endspaceless %}
