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

{% block left_button %}
  <a class="search" href="{{ url_for('sickbeard_search') }}">+</a>
{% endblock %}

{% block header %}<h1>Sickbeard</h1>{% endblock %}

{% block navbar %}
<div data-role="navbar">
	<ul>
		<li><a href="#" class="ui-btn-active ui-state-persist">Coming Episodes</a></li>
    <li><a href="{{ url_for('sickbeard_all') }}">All</a></li>
    <li><a href="{{ url_for('sickbeard_history') }}">History</a></li>
	</ul>
</div><!-- /navbar -->
{% endblock %}

{% block content %}
<ul id="coming_episodes" data-role="listview" data-split-icon="gear">
  <li data-role="list-devider" data-theme="a"><span class="ui-li-count">{{coming_episodes.missed|length}}</span>Missed</li>
  {% for episode in coming_episodes.missed %}
      <li class="missed" data-theme="e">
        <a class="inner" href="{{ url_for('sickbeard_episode', id=episode.tvdbid, season=episode.season, episode=episode.episode) }}">
        	<h2>{{episode.show_name}}</h2>
        	<p>{{episode.ep_name}}</p>
        	<p>{{episode.airdate}}</p>
        </a>
        <a href="{{ url_for('sickbeard_episode_options', id=episode.tvdbid, season=episode.season, episode=episode.episode) }}" data-theme="a" data-rel="dialog" data-transition="flip">Options</a>
      </li>
  {% endfor %}
  <li data-role="list-devider" data-theme="a"><span class="ui-li-count">{{coming_episodes.soon|length}}</span>Soon</li>
  {% for episode in coming_episodes.soon %}
      <li>
        <a class="inner" href="{{ url_for('sickbeard_episode', id=episode.tvdbid, season=episode.season, episode=episode.episode) }}">
        	<h2>{{episode.show_name}}</h2>
        	<p>{{episode.ep_name}}</p>
        	<p>{{episode.airdate}}</p>
        </a>
      </li>
  {% endfor %}
  <li data-role="list-devider" data-theme="a"><span class="ui-li-count">{{coming_episodes.later|length}}</span>Later</li>
  {% for episode in coming_episodes.later %}
      <li>
        <a class="inner" href="{{ url_for('sickbeard_episode', id=episode.tvdbid, season=episode.season, episode=episode.episode) }}">
        	<h2>{{episode.show_name}}</h2>
        	<p>{{episode.ep_name}}</p>
        	<p>{{episode.airdate}}</p>
        </a>
      </li>
  {% endfor %}
</ul>

{% endblock %}
