<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="open, data, portal, events">
    <meta name="author" content="Jordi Xaubet - Universitat de Barcelona (UB)">
    <link rel="shortcut icon" href="{{ asset('ico/favicon.ico') }}">

    <title>{% block title %}{% endblock %} | Open Data Portal</title>

    <!-- Bootstrap core CSS -->
    <link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">
    <!-- Bootstrap theme -->
    <link href="{{ asset('css/bootstrap-theme.min.css') }}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="{{ asset('css/theme.css') }}" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="{{ asset('js/ie8-responsive-file-warning.js') }}"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    {% block head %}{% endblock %}
  </head>

  <body role="document">

  <header>
    <!-- Fixed navbar -->
    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="{{ path('home') }}"><img src="{{ asset('img/logo-open-data.png') }}" height="100%"></a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li class=""><a href="{{ path('home') }}">OPEN DATA PORTAL</a></li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li><a href="#facebook_link"><i class=""></i><img src={{ asset('img/social-facebook.png') }}></a></li>
            <li><a href="#twitter_link"><i class=""></i><img src={{ asset('img/social-twitter.png') }}></a></li>

              <!--{# set locale = app.request.locale #}-->
              {% set locale = app.request.get('_locale') %}
	<!--
            <li class="dropdown">
              <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#"><i class="glyphicon glyphicon-globe"></i> Languages <span class="caret"></span></a>
              <ul id="g-account-menu" class="dropdown-menu" role="menu">
                <li><a href="{{ path('home', { '_locale': 'en' }) }}"><i class="{% if (locale == 'en') or (locale == "") %}glyphicon glyphicon-chevron-right{% endif %}"></i> English</a></li>
                <li><a href="{{ path('home', { '_locale': 'ca' }) }}"><i class="{% if locale == 'ca' %}glyphicon glyphicon-chevron-right{% endif %}"></i> Catalan</a></li>
              </ul>
            </li>
	-->
            {% if is_granted('ROLE_USER') %}
              <li {% block activeProfile %}{% endblock %} class="dropdown">
                  <a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#"><i class="glyphicon glyphicon-user"></i> {{ app.user }} <span class="caret"></span></a>
                  <ul id="g-account-menu" class="dropdown-menu" role="menu">
                      <li><a href="{{ path('profile') }}"><i class="glyphicon glyphicon-pencil"></i> My Profile</a></li>
                      <li><a href="{{ path('upload') }}"><i class="glyphicon glyphicon-upload"></i> Upload Data</a></li>
                      <li><a href="{{ path('add_event') }}"><i class="glyphicon glyphicon-calendar"></i> Add Event</a></li>
                  </ul>
                </li>
              <li><a href="{{ path('logout') }}"><i class="glyphicon glyphicon-off"></i> Logout</a></li>
            {% else %}
                <li {% block activeRegister %}{% endblock %}><a href="{{ path('register') }}"><i class="glyphicon glyphicon-list-alt"></i> Register</a></li>
                <li {% block activeLogin %}{% endblock %}><a href="{{ path('login') }}"><i class="glyphicon glyphicon-log-in"></i> Login</a></li>
            {% endif %}
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>
    </header>

    <themeOpen>
    <div class="container theme-showcase" role="main">
    </themeOpen>

    <menuBar>
        <hr>
        <div style="margin-bottom: 25px;"></div>
      
      <div class="navbar navbar-inverse">
        <div class="container">
          <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
              <li {% block activeHome %}{% endblock %}><a href="{{ path('home') }}">Home</a></li>
              <li {% block activeWhatsOpenData %}{% endblock %}><a href="{{ path('static_page', {'page': 'what_is_open_data' }) }}">What is Open Data</a></li>
              <li {% block activeLegalInformation %}{% endblock %}><a href="{{ path('static_page', {'page': 'legal_information' }) }}">Legal Information</a></li>
              <li {% block activeContact %}{% endblock %}><a href="{{ path('contact') }}">Contact - Help us to improve</a></li>
		
              <div class="col-sm-3 col-md-3 pull-right">
		<!--
                <form class="navbar-form" role="search">
                  <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term" disabled>
                      <div class="input-group-btn">
                        <button class="btn btn-default" type="submit" disabled><i class="glyphicon glyphicon-search"></i></button>
                      </div>
                  </div>
                </form>
		-->
              </div>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </menuBar>

    <content>
        {% block content %}{% endblock %}
    </content>

    <footer>
      <div class="page-header">

      </div>
      <div class="well">
        <p>
          <center>
              <!-- Facebook button -->
              <div class="fb-like" data-href="http://www.ub.edu" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>
          <!--<div id="fb-root"></div>-->
          <script>
              (function(d, s, id) {
                  var js, fjs = d.getElementsByTagName(s)[0];
                  if (d.getElementById(id)) return;
                  js = d.createElement(s); js.id = id;
                  js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.0";
                  fjs.parentNode.insertBefore(js, fjs);
              }(document, 'script', 'facebook-jssdk'));
          </script>

            </center>
          </p>
        <p>
            <center>
              <!-- Twitter button -->
              <a style="margin-bottom: 10px" href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
              <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
            </center>
        </p>
        <p style="margin-bottom: 35px"></p>
        <p><center><a target="_blank" href="http://www.gnu.org/licenses/gpl-3.0.en.html">GNU General Public License</a> <a target="_blank" href="http://www.gnu.org/licenses/gpl-3.0.en.html"><img src="{{ asset('img/gplv3-127x51.png') }}" height="25"></a> <b>{{ "now" | date("Y") }}</b></center></p>
      </div>
    </footer>

  </themeClose>
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="{{ asset('js/bootstrap.min.js') }}"></script>
    <script src="{{ asset('js/docs.min.js') }}"></script>
    <script src="{{ asset('js/alertify.min.js') }}"></script>
    <link rel="stylesheet" href="{{ asset('css/alertify.bootstrap.css') }}" />
    <link rel="stylesheet" href="{{ asset('css/alertify.core.css') }}" />
  </themeClose>
  </body>
</html>
