{% extends "base.html" %}

{% block title %}IceProd{% end %}

{% block page_title %}Dataset Summary{% end %}

{% block sidebar %}
<div class="section">
    <h3>Filters</h3>
    <div class="indent">
        <form action="/dataset" autocomplete="off" class="filters">
        {% for f in filter_options %}
        <h4>By {{ f }}:</h4>
        <select name="{{ f }}" multiple class="chosen-select">
            <option></option>
            {% for option in filter_options[f] %}
            <option{% if option in filter_results[f] %} selected{% end %}>{{ option }}</option>
            {% end %}
        </select>
        {% end %}
        <button>Update</button>
    </div>
</div>
<div class="esc-separator"></div>
<div class="section">
    <h4><a href="/submit">Submit Dataset</a></h4>
</div>
{% end %}

{% block body %}
<div class="browse">
    {% for dataset in datasets %}
    <div class="entry">
        <div class="header">
            <div class="id"><a href="/dataset/{{ dataset['dataset_id'] }}">{{ dataset['dataset'] }}</a></div>
            <div class="user-group"><span class="username">{{ dataset['username'] }}</span> <span class="group">({{ dataset['group'] }})</span></div>
            <div class="status">{{ dataset['status'] }}</div>
        </div>
        <div class="description">{{ dataset['description'] }}</div>
    </div>
    {% end %}
</div>
{% end %}