{% extends "demos/base.html" %}

{% block pageid %}devderby{% endblock %}
{% block bodyclass %}section-demos devderby plain{% endblock %}
{% block title %}{{ page_title(_('{subtitle} | Demo Studio') | f(subtitle=tag_title(tag))) }}{% endblock %}
{% block extrahead %}
  <link rel="alternate" type="application/atom+xml" 
      title="{{_('Demos tagged {tag}') | f(tag=tag_title(tag)) }}"
      href="{{ url('demos_feed_tag', format='atom', tag=tag.name) }}" />
    {{ css('devderby') }}
{% endblock %}

{% block content %}

<section id="content">
<div class="wrap">

  <header id="page-head">
    <nav id="nav-derby">
      <ul>
        <li><a href="{{url('demos_devderby_landing')}}">{{_("Home")}}</a></li>
        <li><a href="{{url('demos_devderby_landing')}}#upcoming">{{_("Challenges")}}</a></li>
        <li><a href="{{url('demos_devderby_rules')}}">{{_("Rules")}}</a></li>
        <li><a href="{{url('demos_devderby_landing')}}#tab-judging">{{_("Judging")}}</a></li>
        <li><a href="{{url('demos_devderby_landing')}}#challenge-prizes">{{_("Prizes")}}</a></li>
        <li><a href="{{url('demos_devderby_landing')}}#resources">{{_("Resources")}}</a></li>
      </ul>
    </nav>
  </header>

  <section id="content-main" class="full" role="main">
    <header id="derby-head">
      <p class="presents"><a href="{{ url('demos') }}">{{_("Mozilla Demo Studio")}}</a> {{_("presents")}}</p>
      <h1><a href="{{url('demos_devderby_landing')}}">{{_("Dev Derby")}}</a></h1>
      <h2><span>{{ tag_meta(tag, 'dateline') }}</span> {{ tag_meta(tag, 'short_title') }}</h2>
    </header>
    
    <p>{{ tag_description(tag) }}</p>
    
    {% if winner_demos | count > 0 %}
    <section id="derby-winners">
      <h1>{{_("Derby Winners")}}</h1>

      {% set extra_class = cycler(' winner', ' winner', ' winner')%}
      <ul class="gallery">
          {% for submission in winner_demos %}
            {{ submission_thumb(submission, extra_class, "240", "180") }}
          {% endfor %}
      </ul>
    </section>
    {% endif %}
    
    <h2>{{_("Submissions")}}</h2>
    {{ submission_listing(
        request, submission_list, is_paginated, paginator, page_obj,
        _('Subscribe to a feed of {tag_title} demos') | f(tag_title=tag_title(tag)),
        url('demos_feed_tag', format='atom', tag=tag.name),
        cols_per_row=4, show_sorts=False
    ) }}

  </section><!-- /#content-main -->

</div>
</section>

{% endblock %}
