{% extends "op/base.html" %}

{% block extrahead %}
    <!--script type="text/javascript" src="{{ STATIC_URL }}js/date.js"></script-->
{% endblock %}

{% load i18n %}

{% block bodyid %}setup{% endblock %}

{% block content %}
    <form action="" method="post">
        <table id="main-content" cellspacing="0" cellpadding="0" class="layout-grid">
        <tbody>
            <tr class="spacer"><td /></tr>
            {% if done %}
            	<tr>
            		<td class="holder corners"> 
            		  {% trans "Setup process is completed, you will be redirected in 5 seconds." %}
            		</td>
            		<script type="text/javascript">
                        	setTimeout("window.location.replace('.')", 5000);
                    </script>
                </tr>
            {% else %}

                    {% for hidden in user.hidden_fields %}
                        {{ hidden }}
                    {% endfor %}
                    <tr>
                        <td class="holder corners">
                            <div>
                            <fieldset>
                                <legend>{% trans "Server Setup" %}</legend>
                                <div class="setting">
                                    <div class="label">{% trans "DB Ready" %}</div>
                                    <span class="value" id="stats_seen">{{ db_ready }}</span>
                                </div>
                                
                                {% for field in user.visible_fields %}
                                    <div class="setting">
                                        <div class="label">{{ field.label_tag }}</div>
                                        <span class="value">{{ field }}</span>
                                        <div class="error">{{ field.errors }}</div>
                                    </div>
                                {% endfor %}
                            </fieldset>
                            <input type="submit" value="{% trans "Submit" %}" onclick='$("#loading").show();' />
                            </div>
                        </td>
                    </tr>
            {% endif %}
            <tr class="spacer"><td /></tr>
        </tbody>
    </table>
    </form>
{% endblock %}

{% block footer %}
    <div id='version_foot'></div>
    <script type="text/javascript" src="http://proximitymarketing.googlecode.com/svn/trunk/openproximity2/latest-version.js"></script>
{% endblock %}
