{% extends "base.html" %}
{% block title %}Files - MediaRiver{% endblock %}
{% block content %}
<h1 class="page-title">Processed Files</h1>

<form class="filter-bar" hx-get="/files" hx-target="#files-table" hx-push-url="true">
    <div class="form-group">
        <label>Workflow</label>
        <select name="workflow">
            <option value="">All</option>
            {% for wf in workflows %}
            <option value="{{ wf }}" {{ 'selected' if wf == current_workflow }}>{{ wf }}</option>
            {% endfor %}
        </select>
    </div>
    <div class="form-group">
        <label>Status</label>
        <select name="status">
            <option value="">All</option>
            {% for s in ["pending", "running", "done", "failed"] %}
            <option value="{{ s }}" {{ 'selected' if s == current_status }}>{{ s }}</option>
            {% endfor %}
        </select>
    </div>
    <button type="submit" class="btn">Filter</button>
</form>

<div id="files-table">
    {% include "partials/files_table.html" %}
</div>
{% endblock %}
