{% load captureas %}
{% load i18n %}

<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE|default:'fr' }}" xml:lang="{{ LANGUAGE_CODE|default:'fr' }}">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    {% block additional_meta %}
    {% endblock %}
    
    <title>
    	{% if title %}
    		{{ title }}
    	{% else %}
    		{% block page_title %}
    		{% endblock %}
    	{% endif %}
    </title>
    
    {% block additional_links %}
    {% endblock %}
    
    <link href="https://www.epfl.ch/css/epfl.css" media="all" rel="stylesheet" type="text/css" />
   
    <script type="text/javascript" src="https://www.epfl.ch/js/jquery-epfl.min.js"></script>
    <script type="text/javascript" src="https://www.epfl.ch/js/globalnav.js"></script>
	
	{% block additional_css %}
	{% endblock %}
	
	{% block additional_js %}
    {% endblock %}

    {% include "django_epfl/template_inc/header.sig.html" %}

  </head>
  
  {% captureas body_class_content %}{% spaceless %}
  	  {% block body-class %}{% endblock %}
  {% endspaceless %}{% endcaptureas %}
  
  <body {% if body_class_content %}class="{{ body_class_content }}"{% endif %}>

    {% block header %}
		{% if LANGUAGE_CODE|slice:"0:2" == 'fr' %}
			{% include 'django_epfl/template_inc/header.fr.html' %}
		{% else %}
			{% include 'django_epfl/template_inc/header.en.html' %}
		{% endif %}
    {% endblock %}
    
    <div class="clear"></div>
    
    <div id="main-content">
    	
    	{% block breadcrumbs %}<ul id='breadcrumbs'><li>EPFL</li>{% block breadcrumbs-relative %}<li class='last'>{{ SITE_NAME }}</li>{% endblock %}</ul>{% endblock %}
    	
    	{% block languages %}{% endblock %}
    	
    	<div class="clear"></div>
    	
    	{% captureas title_content %}{% spaceless %}
    		{% block title %}{% endblock %}
    	{% endspaceless %}{% endcaptureas %}
    	
    	{% if title_content %}
    	<h1>
			{{ title_content }}
		</h1>
		{% endif %}
    	
    	
    	{% captureas main_navigation_content %}{% spaceless %}
    		{% block main-navigation %}{% endblock %}
    	{% endspaceless %}{% endcaptureas %}
    	
    	{% if main_navigation_content%}
    	<div class="navigation-bar" id="main-navigation">
	    	{{ main_navigation_content }}
	    	<div class="clear"></div>
	   	</div>
    	{% endif %}
    	
    	
    	{% captureas tools_content %}{% spaceless %}
    		{% block tools %}{% endblock %}
    	{% endspaceless %}{% endcaptureas %}
    	
    	{% if tools_content %}
		<div id="tools">
	    	{{ tools_content }}
	    </div>
	    {% endif %}
    	
    	{% comment %}
    	Test if the block right_column is defined and assign its content to right_col_content
    	{% endcomment %}
    	{% captureas right_col_content %}{% spaceless %}
    		{% block right_column %}{% endblock %}
    	{% endspaceless %}{% endcaptureas %}
    	
    	{% block content_div %}
		<div id="content" class="content {% if not right_col_content %}fullpage-content homepage-content{% endif %}">
			
			{% block content %}
			{% endblock %}
		</div>
		{% endblock %}
		
		{% if right_col_content %}
    		<div class="right-col">
    			{{ right_col_content }}
    		</div>
    	{% endif %} 
    	
    	<div class="clear"></div>
    	
    	<div class="clear"></div>
    	
    	{% captureas footer_content %}{% spaceless %}
    		{% block footer %}{% endblock %}
    	{% endspaceless %}{% endcaptureas %}
    	
    	{% block footer_content %}
    	<div id="footer">
    		{{ footer_content }}
    	</div>
    	{% endblock %}
    	
    </div>
    
    {% block additional_js_ajax %}
    {% endblock %}
  </body>
</html>
