{% macro title() %}
{% block title %}{% endblock %}
{% endmacro %}
{% from "elements/upload.html" import upload_button_modal %}
<html lang="{{config['default_language']}}" class="mdc-typography"
      xmlns="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
  <head>
    <meta charset="UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>{{ title() }} - {{ config['SITE_NAME'] }}</title>
    <link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
    <!-- Angular Material style sheet -->
    <link rel="stylesheet" href="{{ url_for('static', filename='css/lib/angular-material.min.css')}}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/lib/ui-bootstrap-csp.css')}}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/md-range-slider.css')}}">

    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="{{ url_for('static', filename='/css/lib/bootstrap.min.css')}}">

    <!-- Optional theme -->
    <link rel="stylesheet" href="{{ url_for('static', filename='css/lib/bootstrap-theme.min.css')}}">

    <link rel="stylesheet" href="{{ url_for('static', filename='css/lib/semantic-faceted-search.css')}}">

    <link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v3.20.1/css/ol.css">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/lib/markers.css')}}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/lib/openlayers.css')}}">

    <link rel="stylesheet" href="{{ url_for('static', filename='css/whyis.css')}}">
    <link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.ico') }}">
<link rel="apple-touch-icon" sizes="57x57" href="{{ url_for('static', filename='images/apple-icon-57x57.png') }}">
<link rel="apple-touch-icon" sizes="60x60" href="{{ url_for('static', filename='images/apple-icon-60x60.png') }}">
<link rel="apple-touch-icon" sizes="72x72" href="{{ url_for('static', filename='images/apple-icon-72x72.png') }}">
<link rel="apple-touch-icon" sizes="76x76" href="{{ url_for('static', filename='images/apple-icon-76x76.png') }}">
<link rel="apple-touch-icon" sizes="114x114" href="{{ url_for('static', filename='images/apple-icon-114x114.png') }}">
<link rel="apple-touch-icon" sizes="120x120" href="{{ url_for('static', filename='images/apple-icon-120x120.png') }}">
<link rel="apple-touch-icon" sizes="144x144" href="{{ url_for('static', filename='images/apple-icon-144x144.png') }}">
<link rel="apple-touch-icon" sizes="152x152" href="{{ url_for('static', filename='images/apple-icon-152x152.png') }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='images/apple-icon-180x180.png') }}">
<link rel="icon" type="image/png" sizes="192x192"  href="{{ url_for('static', filename='images/android-icon-192x192.png') }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='images/favicon-32x32.png') }}">
<link rel="icon" type="image/png" sizes="96x96" href="{{ url_for('static', filename='images/favicon-96x96.png') }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='images/favicon-16x16.png') }}">
<meta name="msapplication-TileImage" content="{{ url_for('static', filename='images/ms-icon-144x144.png') }}">

<link href="{{ url_for('static', filename='css/lib/fileinput.css')}}" media="all" rel="stylesheet" type="text/css"/>

    <style>
      /* Fix for background-color being gray after the viewport is scrolled for all views that include extends "base.html"   */
      html, body {
        background-color: #fff;
      }
      .nav, .pagination, .carousel, .panel-title a { cursor: pointer; }
      div.container {
      width: 100%;
      margin-left: 0px;
      margin-right: 0px;
      }
      a:visited {
      color: #887ab7;
      }
    </style>

    {% block styles %}{% endblock %}

  </head>
<body>
{% block body %}
    <md-toolbar class="md-primary" >
      <div class="md-toolbar-tools">

        <a href="{{url_for('entity.view',name='')}}">Home</a>
	<!-- Form for Search -->
	<form
	      class="navbar-form"
              style="color:black"
	      role="search"
	      action="{{url_for('entity.view',name='search')}}"
	      method="get"
	       name="search" layout="row" flex>
          <search-autocomplete flex></search-autocomplete>
	</form><!-- /search form -->

        {% block nav %}
        {% endblock %}
        {% include "nav.html" %}
        <h3>
        {% if not current_user or current_user.is_anonymous %}
        <md-button ng-href="{{url_for('security.login')}}" aria-label="Log in" title="">Log in</md-button>
        {% else %}
        <div flex="none" class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current-user-dropdown" role="button" aria-haspopup="true" aria-expanded="false">Welcome, {{current_user.givenName}} <span class="caret"></span></a>
          <ul class="dropdown-menu dropdown-menu-right">
            <li><a href="{{url_for('security.logout')}}" id="log-out">Log out</a></li>
            <li><a href="{{url_for('security.change_password')}}" id="change-password">Change password</a></li>
          </ul>
        </div>
        {% endif %}
        {% if current_user and current_user.is_anonymous and current_user.is_authenticated %}
        <a flex="none" href="{{url_for('security.register')}}">Register <span class="glyphicon glyphicon-log-in"></span></a>
        {% endif %}
        </h3>
      </div>
    </md-toolbar>
    {% block pageheader %}
    <div class="container" >
      <div class="page-header" layout="row">
        <h1 flex property="rdfs:label">{{ title() }} <small>{% block subtitle %}{% endblock %}</small>
        </h1>
        {% if this is defined %}
        <section class="pull-right" layout="row" layout-sm="column" layout-align="center center" layout-wrap ng-cloak>
          {% block actions %}
          {{ upload_button_modal(this) }}
          {% if g.current_user and g.current_user.is_authenticated %}
          <md-button md-secondary ng-href="{{url_for('entity.view',view='edit', uri=this.identifier)}}" class="md-icon-button" aria-label="Edit" title="Edit">
            <md-icon>create</md-icon>
          </md-button>
          {% endif %}
          {% if this.description().value(ns.whyis.hasFileID) %}
          <md-button md-secondary ng-href="{{url_for('entity.view',uri=this.identifier)}}" class="md-icon-button" aria-label="Download File" title="Download File">
            <md-icon>file_download</md-icon>
          </md-button>
          {% endif %}
          {% if not this.identifier.startswith(ns.local) %}
          <md-button md-secondary ng-href="{{this.identifier}}" class="md-icon-button" aria-label="Visit Page" title="Visit Page">
            <md-icon>launch</md-icon>
          </md-button>
          {% endif %}
          {% endblock %}
        </section>
        {% endif %}
      </div>
      {% endblock %}
      <div>
        {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
        {% for category, message in messages %}
        <div class="alert alert-info alert-{{category}} alert-dismissible" role="alert">
          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          {{message}}
        </div>
        {% endfor %}
        {% endif %}
        {% endwith %}
        {% block content %}
        {% endblock %}
      </div>
      </div>
      {% include "footer.html" %}
    {% endblock %}

    <script>
      LOD_PREFIX = '{{config.LOD_PREFIX}}';
      {% if 'BASE_RATE_PROBABILITY' in config %}
      BASE_RATE = {{config['BASE_RATE_PROBABILITY']}};
      {% else %}
      BASE_RATE = 0.5;
      {% endif %}
      {% if current_user and current_user.identifier %}
      USER = { uri: '{{current_user.identifier}}', admin: '{{current_user.has_role('Admin')}}' };
      {% else %}
      USER = { }
      {% endif %}
      {% if this is defined %}
      NODE_URI = "{{this.identifier | safe}}";
      ATTRIBUTES = {{ this | include('attributes') | safe }};
      DESCRIPTION = {{this.description().graph | serialize(format="json-ld") | safe}};
      NODE = DESCRIPTION.filter(function(d) { return d['@id'] == NODE_URI});
      if (NODE.length > 0)  NODE = NODE[0];
      else NODE = {"@id" : NODE_URI};
      {% endif %}
      ROOT_URL = "{{url_for('entity.view',name='')}}";
    </script>

    <script src="{{ url_for('static', filename='js/lib/jquery/dist/jquery.js')}}"></script>

<script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@3"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@4"></script>

      <script src="{{ url_for('static', filename='js/lib/d3.js')}}"></script>
    <script src="{{ url_for('static', filename='js/lib/bootstrap.js')}}"></script>

    <script src="{{ url_for('static', filename='js/lib/fileinput.js')}}" type="text/javascript"></script>

    <!-- Angular Material Dependencies -->
    <script src="{{ url_for('static', filename='js/lib/angular.min.js')}}"></script>
    <script src="{{ url_for('static', filename='js/lib/angular-animate.min.js')}}"></script>
    <script src="{{ url_for('static', filename='js/lib/angular-aria.min.js')}}"></script>
    <script src="{{ url_for('static', filename='js/lib/angular-material.min.js')}}"></script>

    <!-- Angular Material Fileinput -->
    <link rel="stylesheet" href="{{ url_for('static', filename='css/lib/lf-ng-md-file-input.css')}}">
    <script src="{{ url_for('static', filename='js/lib/lf-ng-md-file-input.js')}}"></script>

    <script src="{{ url_for('static', filename='js/lib/angular-sanitize.min.js')}}"></script>
    <script src="{{ url_for('static', filename='js/lib/angular-messages.min.js')}}"></script>

<script src="{{ url_for('static', filename='js/lib/lodash.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/lib/ui-bootstrap-tpls.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/lib/spin.js')}}"></script>
<script src="{{ url_for('static', filename='js/lib/angular-spinner.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/lib/sparql-service.js')}}"></script>
<script src="{{ url_for('static', filename='js/lib/checklist-model.js')}}"></script>

<script src="{{ url_for('static', filename='js/lib/chart.js')}}"></script>

<script src="{{ url_for('static', filename='js/lib/semantic-faceted-search.js')}}"></script>

<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v3.20.1/build/ol.js"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/directives/openlayers.js')}}"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/directives/center.js')}}"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/directives/control.js')}}"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/directives/layer.js')}}"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/directives/marker.js')}}"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/directives/path.js')}}"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/directives/view.js')}}"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/services/olData.js')}}"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/services/olHelpers.js')}}"></script>
<script src="{{ url_for('static', filename='js/angular-openlayers-directive/src/services/olMapDefaults.js')}}"></script>

    <script src="{{ url_for('static', filename='js/lib/moment-with-locales.min.js')}}"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/cytoscape/3.2.11/cytoscape.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/lib/cytoscape-cose-bilkent.js')}}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/lib/jsonLdEditor.js')}}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/lib/md-range-slider.js')}}"></script>

    <script>
</script>

<script src="{{ url_for('static', filename='js/whyis.js')}}"></script>

{% block scripts %}{% endblock %}

<script>
  $( function() {
    angular.bootstrap(document, ['App']);
  });
</script>

</body>
</html>
