{% extends 'flask-admin/base.html' %}

{% block brand %}
<a href="{{ url_for(admin_view.admin.endpoint+'.index') }}" class="brand-link">
  <img src="{{ adminlte_static.url('img/AdminLTELogo.png') }}" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
       style="opacity: .8">
  <span class="brand-text font-weight-light">{{ admin_view.admin.name }}</span>
</a>
{% endblock brand %}

{% block nav_control %}
    <ul class="navbar-nav">
        <li class="nav-item d-none d-sm-inline-block">
            <a href="{{ admin_view.admin.url }}" class="nav-link">Home</a>
        </li>
    </ul>
    <form class="form-inline ml-3">
      <div class="input-group input-group-sm">
        <input class="form-control form-control-navbar" type="search" placeholder="Search" aria-label="Search">
        <div class="input-group-append">
          <button class="btn btn-navbar" type="submit">
            <i class="fas fa-search"></i>
          </button>
        </div>
      </div>
    </form>
{% endblock %}

{% block access_control %}
    <li class="nav-item">
      {% set signout = '#' %}
      <a class="nav-link" href="{{ signout }}">
        <i class="fas fa-sign-out-alt"></i>        
      </a>
  </li>
{% endblock %}

{% block footer %}
    <div class="float-right d-none d-sm-inline">
        Version 1.0.0
    </div>
    {% set owner = current_user.email if current_user else ''%}
    <strong>Copyright © 2014-2020 {{owner}}</strong> All rights reserved.
{% endblock footer %}

{% block user_panel %}
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
  {% if current_user %}
  <div class="image">
    {% if current_user.picture %}
      {% set src=current_user.picture %}
    {%else%}
      {% set src=adminlte_static.url('img/avatar.png') %}
    {% endif %}
    <img src="{{ src }}" class="img-circle elevation-2" alt="User Image">
  </div>
  <div class="info">
      <span class="d-block">
          <a href="#" class="d-block">{{ current_user.email }}</a>
      </span>
  </div>
  {% endif %}
</div>
{% endblock user_panel %}