{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load form_as_table %} 
{% block extra_head %}

<link type="text/css" href="{% static "css/smoothness/jquery-ui-1.7.2.custom.css" %}" rel="stylesheet" />
<link type="text/css" href="{% static "css/ui_override.css" %}" rel="stylesheet" />
<script type="text/javascript" src="{% static "admin/js/admin/RelatedObjectLookups.js" %}"></script>

{% endblock %}

{% block title %}
{% if form.instance.pk %}
	{% trans "Edit Timeseries"  %}
{% else %} 
	{% trans "Add Timeseries" %}
{% endif %}
{% endblock %}

{% block content %}

<form method="post" action="" class="wide" enctype="multipart/form-data">
    {% csrf_token %} 
    {% if form.instance.pk %}
            <h3>
                {% trans "Edit timeseries details for " %}
                <a href="{% url "timeseries_detail" form.instance.id %}">
                    {% if form.instance.name %}
                        {{ form.instance.name }}
                    {% else %}
                        {{ form.instance.id }}
                    {% endif %}</a>:
            </h3>
        {% else %} 
            <h3>{% trans "Fill the timeseries details:" %}</h3>
    {% endif %}

    {% if form.errors %}
        <p class="fielderrors">{% trans "Please correct the errors below: " %}{{ form.field_errors }}</p>
    {% endif %}
	<form method="post" action="" class="wide">
        {% csrf_token %} 
		<table class="table_container">
			<tbody>
				{% form_as_table_rows form  %}
			</tbody>
		</table>

	<p class="submit"><input type="submit" value="{% trans "Submit Changes" %} &rarr;"></p>
    </form>
{% endblock %}
