<!doctype html>
<html lang="en" ng-app="grano">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>grano</title>
  <meta name="description" content="A web-based framework for the storage, analysis and presentation of social network information.">
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>

  {% assets filters="less,cssmin,cssrewrite", output="prod/ui.style.css",
      "ui/style/main.less",
      "ui/vendor/animate.css/animate.css",
      "ui/vendor/angular-datepicker/dist/index.css" %}
    <link type="text/css" href="{{ ASSET_URL }}" rel="stylesheet">
  {% endassets %}

  <link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
  <link rel="shortcut icon" href="http://assets.pudo.org/img/favicon.ico" type="image/x-icon" />
</head>
<body ng-controller="AppCtrl" class="grano" ng-cloak>
  {% raw %}
  <div id="page">
    <nav class="navbar navbar-default" role="navigation" id="menu">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navitems">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a id="appName" class="navbar-brand" href="#/">
            {% endraw %}
            <img src="{{url_for('ui.static', filename='images/logo.png')}}">
            {% raw %}
          </a>
        </div>

        <div class="collapse navbar-collapse" id="navitems">
          <form ng-show="project.slug" class="navbar-form navbar-left"
            role="search" ng-submit="searchEntities()">
            <div class="form-group">
              <div class="input-group navbar-searchbox">
                <span class="input-group-addon"><i class="fa fa-search"></i></span>
                <input type="text" class="search-query form-control" autofocus
                        ng-model="navQuery" placeholder="Search people, companies and other entities">
                <span class="input-group-btn" gn-permission project="project" role="editor">
                  <a class="btn btn-default btn-success" href="#/p/{{project.slug}}/entities/new">New</a>
                </span>
              </div>
            </div>
          </form>

          <ul class="nav navbar-nav navbar-right">
            <li ng-show="project.slug" gn-permission project="project" role="editor">
              <a href="#/p/{{project.slug}}/settings"><i class="fa fa-cog"></i> Settings</a>
            </li>
            <li ng-show="session.logged_in">
              <a ng-click="showAccount()"><i class="fa fa-user"></i> Profile</a>
            </li>
            <li ng-show="session.oauth.github && !session.logged_in">
              <a href="{{session.oauth.github}}?next_url={{config.UI_ROOT}}"><i class="fa fa-github"></i> Sign in via GitHub</a>
            </li>
            <li ng-show="session.oauth.twitter && !session.logged_in">
              <a href="{{session.oauth.twitter}}?next_url={{config.UI_ROOT}}"><i class="fa fa-twitter"></i> Sign in via Twitter</a>
            </li>
            <li ng-show="session.oauth.facebook && !session.logged_in">
              <a href="{{session.oauth.facebook}}?next_url={{config.UI_ROOT}}"><i class="fa fa-facebook"></i> Sign in via Facebook</a>
            </li>
            <li ng-show="session.logged_in">
              <a href="{{config.API_ROOT}}/sessions/logout?next_url={{config.UI_ROOT}}"><i class="fa fa-sign-out"></i> Sign Out</a>
            </li>
          </ul>
        </div>
      </div>
    </nav>

    <div id="airlock" class="container-fluid view-area" ng-view>
    </div>
  </div>

  <footer>
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-3 inner">
            <strong>grano</strong> {{config.APP_VERSION}}<br/>
            like facebook, but for non-traditional militant actors
        </div>
        <div class="col-md-3 inner">
          <ul>
            <li><a href="https://granoproject.org">documentation</a></li>
            <li><a href="http://granoproject.org/docs/api/">api</a></li>
            <li><a href="https://github.com/granoproject">source code</a></li>
          </ul>
        </div>
        <div class="col-md-6 right">
          {% endraw %}
            <a href="https://codeforafrica.org/">
              <img src="{{url_for('ui.static', filename='images/c4a.png')}}">
            </a>
          {% raw %}
        </div>
      </div>
    </div>
  </footer>
  {% endraw %}

  {% for path, tmpl in angular_templates %}
    <script id="{{path}}" type="text/ng-template">{{tmpl|safe}}</script>
  {% endfor %}

  {% assets filters="uglifyjs", output="prod/ui.vendor.js",
        "ui/vendor/ng-file-upload/angular-file-upload-shim.js",
        "ui/vendor/jquery/dist/jquery.js",
        "ui/vendor/bootstrap/js/collapse.js",
        "ui/vendor/moment/moment.js",
        "ui/vendor/underscore/underscore.js",
        "ui/vendor/angular/angular.js",
        "ui/vendor/angular-bootstrap/ui-bootstrap-tpls.js",
        "ui/vendor/angular-route/angular-route.js",
        "ui/vendor/angular-sanitize/angular-sanitize.js",
        "ui/vendor/angular-animate/angular-animate.js",
        "ui/vendor/ng-file-upload/angular-file-upload.js",
        "ui/vendor/d3/d3.js",
        "ui/vendor/webcola/WebCola/cola.v3.min.js"
         %}
      <script type="text/javascript" src="{{ ASSET_URL }}"></script>
  {% endassets %}
  <script type="text/javascript" src="config.js"></script>
  {% assets filters="uglifyjs", output="prod/ui.app.js",
        "ui/js/util.js",
        "ui/js/app.js",
        "ui/js/validation.js",
        "ui/js/services/core.js",
        "ui/js/services/session.js",
        "ui/js/services/metadata.js",
        "ui/js/services/query_utils.js",
        "ui/js/filters/truncate.js",
        "ui/js/filters/datetime.js",
        "ui/js/directives/permission.js",
        "ui/js/directives/pager.js",
        "ui/js/directives/settings_frame.js",
        "ui/js/directives/property_view.js",
        "ui/js/directives/property_edit.js",
        "ui/js/directives/property_list.js",
        "ui/js/directives/relation_list.js",
        "ui/js/directives/relation_frame.js",
        "ui/js/directives/entity_suggest.js",
        "ui/js/directives/entity_frame.js",
        "ui/js/directives/query_graph.js",
        "ui/js/directives/query_table.js",
        "ui/js/directives/query_panel.js",
        "ui/js/directives/query_panel_layer.js",
        "ui/js/controllers/app.js",
        "ui/js/controllers/home.js",
        "ui/js/controllers/accounts.js",
        "ui/js/controllers/projects.js",
        "ui/js/controllers/query.js",
        "ui/js/controllers/schemata.js",
        "ui/js/controllers/permissions.js",
        "ui/js/controllers/entities.js",
        "ui/js/controllers/relations.js",
        "ui/js/controllers/imports.js"
         %}
      <script type="text/javascript" src="{{ ASSET_URL }}"></script>
  {% endassets %}
</body>
</html>
