{% extends "base/_base.html" %} {% import 'base/_speaker_macro.html' as speaker_macro %} {% set page_title = message.page_title_index
%} {% block content %}

<div class="ui vertical stripe segment pycon-odd-seg">
  <div class="ui middle aligned stackable grid container">
    <div class="row">
      <div class="eight wide column">
        <h3 class="ui header">{{ message.pycon_intro_title }}</h3>
        <p>{{ message.pycon_intro }}</p>
      </div>
      {% macro agenda_link(city) %}
      <div class="step">
        <!--<i class="{{ 'remove from calendar' if city.completed else 'in cart' }} icon"></i>-->
        <div class="content">
          <div class="title">{{ city.name }}</div>
          <div class="description">{{ city.date }}</div>
        </div>
      </div>
      {% endmacro %}

      <div class="six wide right floated column">
        <div class="ui vertical steps">
          {% for city_name in agenda.city_list %} {{ agenda_link(agenda[city_name]) }} {% endfor %}
        </div>
      </div>
    </div>
    <div class="row">
      <div class="center aligned column">
        <a class="ui huge primary button" href="{{ site.shanghai.booking_url }}" target="_blank">{{ message.shanghai_booking_now }}</a>
        <a class="ui huge primary button" href="{{ site.hangzhou.booking_url }}" target="_blank">{{ message.hangzhou_booking_now }}</a>

      </div>
    </div>
  </div>
</div>


<!-- 赞助商 -->
<div class="ui vertical stripe center aligned segment pycon-odd-seg">

  {% macro sponsor_block(sponsor_meta, sponsor_list) %}
  <div class="ui text container">
    <h3 class="ui center aligned header sponsors">{{ sponsor_meta.name }}</h3>
  </div>
  <div class="ui container">
    <div class="ui small images sponsors">
      {% if sponsor_list %} {% for sponsor_info in sponsor_list %}
      <a href="{{ sponsor_info.link }}" target="_blank">
        <img class="ui image" src="{{ sponsor_info.logo }}">
      </a>
      {% endfor %} {% endif %}
    </div>
  </div>
  {% endmacro %} {% for sponsor_meta in sponsors.meta %} {{ sponsor_block(sponsor_meta, sponsors[sponsor_meta.level]) }} {%
  endfor %}

</div>


<!-- 讲师 -->
<!-- FIXME: DRY -->
{% for city in agenda.city_list %} {% set speaker_city = agenda[city].name + message.speakers %} {% set extra_class = loop.cycle('pycon-even-seg',
'pycon-odd-seg') %} {{ speaker_macro.speaker_block(speaker_city, selectspeakers(speakers, city), extra_class) }} {% endfor
%}


<!-- 蠎人赞助 -->
<!-- FIXME: DRY -->
{% if agenda.city_list|length % 2 == 0 %} {% set extra_class = "pycon-even-seg" %} {% else %} {% set extra_class = "pycon-odd-seg"
%} {% endif %}
<div class="ui vertical stripe center aligned segment {{ extra_class }}">

  <div class="ui text container">
    <h3 class="ui center aligned header pythoners">{{ message.donators }}</h3>
  </div>

  <!-- TODO: 头像放到CDN -->

  <div class="ui container pythoners">
    {% for donator in donators %}
    <a class="ui image label">
      <img  src="{{ site.base_url }}/asset/images/avatar-2016/small/{{ loop.cycle('1', '2', '3', '4', '5', '6', '7', '8', '9') }}.jpg"> {{ donator}}
    </a>
    {% endfor %}
  </div>

</div>


{% endblock %}
