{% extends "videos/base.html" %}
{% load search_tags %}

{% block title %}{% if category %}{{category|title}} {% endif %}Videos{% endblock %}

{% block body %}
<div class="t">
<h1>{% if category %}{{category|title}} {% endif %}Videos</h1>
{% if can_add_video %}
    <div><a href="{% url admin:videos_video_add %}">Add Video</a></div>
    {% endif %}
<form class="search-form" action="{% url video.search %}" method="get">
<input type="text" name="q" value="{{ request.GET.q|striptags }}" />
  <select name="cat">
    <option value="">All Categories</option>
    {% for cat in categories %}
      <option value="{{ cat.slug }}" {% if cat.slug == category.slug %}selected{% endif %}>{{ cat }}</option>
    {% endfor %}
  </select>
  <input type="submit" value="Search" />

</form>
{% for video in videos %}
    {% search_result video %}
{% endfor %}
</div>
{% endblock body %}

