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

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

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

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

{% block content %}
<ul id="couchpotato" data-role="listview" data-filter="true">
  {% for movie in wanted %}
      <li id="wanted">
        <a class="inner" href="{{ url_for('couchpotato_movie', id=movie.id) }}">
            <img src="{% if movie.library.files[0] %}{{movie.library.files[0].path|cp_img}}{% else %}{{ url_for('static', filename='images/poster.png') }}{% endif %}" alt="">
            <h2>{{movie.library.info.original_title}} ({{movie.library.info.year}})</h2>
            <p>{{movie.library.info.plot}}</p>
        </a>
      </li>
  {% endfor %}
</ul>

{% endblock %}
