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

{% block header %}<h1>Recently Added Movies</h1>{% endblock %}

{% block content %}

<ul id="recent_movies" data-role="listview" data-divider-theme="e">
  {% if using_db %}
    <li data-role="list-divider" style="height: 20px;">XBMC is offline.</li>
  {% endif %}

  {% for movie in recently_added_movies %}
      <li data-icon="{{ 'check' if movie.playcount else 'false' }}">
        <a class="inner play" href="#" data-movieid="{{ movie.movieid }}">
          <div class="thumb"><img src="{{ movie.thumbnail|xbmc_image }}" alt=""></div>
          <span class="title">{{movie.title}} ({{movie.year}})</span>
          <span class="rating">{{movie.rating|float|round(1, 'common')}}</span>
        </a>
        <a
          href="{{ url_for('movie_info', id=movie.movieid) }}"
          data-rel="dialog"
          data-transition="flip"
          data-theme="a"
          data-icon="info"
        >
          Info
        </a>
      </li>
  {% endfor %}
</ul>

{% endblock %}
