{% extends 'base.html' %}
{% load i18n %}

{% block title %} - {% trans "Events" %}{% endblock %}

{% block rss_url %}
<link rel="alternate" type="application/rss+xml"
   title="RSS" href="{{ request.get_full_path}}rss/" />
{% endblock %}

{% block content %}

{% trans "Events" as ch_title %}
{% with ch_icon="icon-time" ch_title=ch_title ch_bc1=ch_title %}
{% include "layout_elements/category_header.html" %}
{% endwith %}

</div>

<div class="row">

<div class="span6">
  
  <div class="section">
    {% include "info_box/site_category_detail.html" %}
  </div>
  
  {% trans "Chronology" as sh_title %}
  {% with sh_title=sh_title only_main="yes" id_addon="1" %}
    {% include "layout_elements/event_section_header.html" %}
  {% endwith %}
  
  {% with event_list=chronology_list class_addon="1" id_addon="1" %}
  <div class="events_{{ class_addon }}" id="events_{{ id_addon }}">
  {% for event in event_list %}
    {% include "info_box/event_compact.html" %}
  {% endfor %}
  <div style="display: none;" class="no_events_tr">
    {% trans "No events available." %}
  </div>
  </div>
  {% endwith %}
  
</div>

<div class="span6">
  {% trans "Sorted by Topics" as sh_title %}
  {% with sh_title=sh_title id_addon="2" %}
    {% include "layout_elements/event_section_header.html" %}
  {% endwith %}
  
  <div class="pull-right" style="margin-bottom:9px;">
  <select name="mpp_events_select" id="mpp_events_select">
  {% for mpp in main_project_part_list %}
    <option value="{{ mpp.id }}"{% if forloop.first %} selected{% endif %}>{{ mpp }} ({{ mpp.get_events|length }})</option>
  {% endfor %}
  </select>
  </div>
  <div style="clear:both;"></div>
  
  {% for mpp in main_project_part_list %}
  {% with event_list=mpp.related_events.all id_addon=mpp.id class_addon="2" %}
  <div class="events_{{ class_addon }}" id="events_{{ id_addon }}">
  {% for event in mpp.get_events %}
    {% include "info_box/event_compact.html" %}
  {% endfor %}
  <div style="display: none;" class="no_events_tr">
    {% trans "No events available." %}
  </div>
  </div>
  {% endwith %}
  {% endfor %}
  
<script>
  $(document).ready(function() {
    $('.events_2').css('display', 'none');
    $('.events_2:first').css('display', 'block');
    
    $('#mpp_events_select').change(function(){
      var id = $(this).val();
      $('.events_2').css('display', 'none');
      $('#events_' + id).css('display', 'block');
    });
    
  });
  
</script>
  
</div>

{% endblock %}





