{% extends "formunculous/base.html" %}
{% load i18n %}

{% block title %}{% trans "Available Forms" %}{% endblock %}
{% block css %}{{ block.super }}
<link href="{{ MEDIA_URL }}formunculous/css/formunculous.css" rel="stylesheet" type="text/css" />
{% endblock %}

{% block js %}{{ block.super }}
{% if review_apps %}
<script type="text/javascript" src="{{ MEDIA_URL }}formunculous/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}formunculous/js/index.js"></script>
{% endif %}
{% endblock %}


{% block content %}
{% if review_apps %}
<div class="formunculous_tab_bar">
  <ul>
	<li class="here" id="formunculous-current">
	  <a href="#" class="formunculous_currentlink">{% trans "Current Forms" %}</a>
	</li>
	<li id="formunculous-review">
	  <a href="#" class="formunculous_reviewlink">{% trans "Review Forms" %}</a>
	</li>
  </ul>
</div>
{% endif %}

<div class="formunculous_container">
{% if app_coll %}
<div id="formunculous-apply-available-forms">
<h2>{% trans "Available Forms" %}</h2>
{% for app in app_coll %}

  <h2>
	<a href="{% url formunculous-apply app.app_def.slug %}">
	  {{ app.app_def.name }}
	</a>
  </h2>
  <div class="formunculous_available_info">
  	<div class="formunculous_available_description">
	  <h3>{% trans "Description:" %}</h3>
	  <p>
		{{ app.app_def.description|safe }}
	  </p>
	</div>
  </div>
  <div class="formunculous_available_status">
	<h3>{% trans "Status:" %}</h3>
	<p>{{ app.status }}</p>
	<h3>{% trans "Available until:" %}</h3>
	<p>
	  {{ app.app_def.stop_date|date:"D d M Y" }}
	  {{ app.app_def.stop_time|time:"g:i A" }}
	</p>
  </div>

<div class="formunculous_available_cb"></div>
{% endfor %}
</div>
{% endif %}
{% if review_apps %}
<div id="formunculous-apply-review-forms">
  <h2>{% trans "Forms for Review" %}</h2>
  <ul class="formunculous_list">
	{% for app in review_apps %}
	  <li><a href="{% url reviewer-index app.slug %}">{{ app.name }}</a>{% if not app.is_active %} <span class="formunculous_inactive">( {% trans "Inactive" %} )</span>{% endif %} - {{ app.application_set.all.count }} {% trans "forms" %}</li>
	{% endfor %}
  </ul>
</div>
{% endif %}
</div>
{% endblock %}
