{% extends "rpt_base.html" %}
{% load staticfiles %}

{% block header %}
<h1><a href="{{ dataset.get_absolute_url }}">DataSet Details: {{ dataset.hr_name }}</a></h1>
{% endblock %}

{% block content %}
{% if dataset %}

    <!-- concise read-only elements -->
    <ul>
        {% if dataset.status %}<li>Status: {{ dataset.get_status_display|lower|capfirst }}</li>{% endif %}
        <li>Reporting Universe: <a href="{{ dataset.universe.get_absolute_url }}">{{ dataset.universe.hr_name }}</a></li>
        {% if dataset.start %}<li>Started: {{ dataset.start }}</li>{% endif %}
        {% if dataset.complete %}<li>Completed: {{ dataset.complete }}</li>
            {%if dataset.archive_path %}<li><a href="{{ dataset.get_download_url }}">Download ZIP archive of this dataset</a></li>{% endif %}
        {% endif %}
    </ul>

    <!-- form for updates and whatnot -->
    <!--<h2>Update DataSet</h2>-->
    <form class="form-horizontal" action="{{ dataset.get_absolute_url }}" method="post">
        {% csrf_token %}
        <div class="form-group">
            <label for="id_name" class="col-sm-2 control-label">Name</label>
            <div class="col-sm-6">
                <input id="id_name" class="form-control" type="text" name="name" value="{{ form.name.value|default_if_none:"" }}">
            </div>
        </div>
        <div class="form-group">
            <label for="id_description" class="col-sm-2 control-label">Description</label>
            <div class="col-sm-6">
                <textarea id="id_name" class="form-control" name="description">{{ form.description.value|default_if_none:"" }}</textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-6">
                <button type="submit" class="btn btn-primary">Update</button>
            </div>
        </div>
    </form>
{% endif %}
{% endblock %}
