app/templates/projrev/proposal/submit.html
author Madhusudan.C.S <madhusudancs@gmail.com>
Mon, 10 Aug 2009 00:06:31 +0530
changeset 24 7257b66a6766
parent 23 91cf6872d853
child 38 3cb38edbe05f
permissions -rw-r--r--
Purr implemented for submit form.

{% extends "projrev/base.html" %}
{% block scripts %}
{{ block.super }}
<script language="JavaScript" type="text/javascript" src="/site-content/js/jquery.chainedSelects.js"></script>
<script language="JavaScript" type="text/javascript">
  $(function()
  {
    $('#id_state').chainSelect('#id_district','/proposal/submit/get_dfors');
  });
  $(document).ready(function() {
	  $.get('/proposal/submit/get_dfors', function() {
      $('#id_district').html('<option value="">---------</option>');
	  });
  });
</script>
{% endblock scripts %}
{% block content %}
<div class="post">
			
	<a name="TemplateInfo"></a>	
	<h1>Submit your proposal</h1>

  {% if created_now %}
    <p>An MICR Code has been assigned and e-mailed to you. Please remember it for future reference.</p>
  {% else %}{% if micr_code %}
    <p>Edit your details and upload new version of the proposal in the form below.</p>
  {% else %}
    <p>Fill up the form below, and upload your proposal file by clicking on Browse.</p>
  {% endif %}{% endif %}

	<form enctype="multipart/form-data" method="post" action="">			
		<p>
    {% for field in form %}
      <p>
      {% if field.help_text %}
        <script type="text/javascript">
          $(document).ready( function() {
            var tooltip = [
            "<div class='tooltip'>",
            "  <div class='tooltip-body'>",
            "    <img src='/site-content/images/info.png' alt='' />",
            "    <h3>Info</h3>",
            "    <p>",
            "      {% autoescape off %}",
            "        {{ field.help_text|linebreaksbr|escapejs }}",
            "      {% endautoescape %}",
            "    </p>",
            "  </div>",
            "  <div class='tooltip-bottom'></div>",
            "</div>"
            ].join("");

            var tooltip_object=null;
            var documented = $("#id_{{ field.name }}");
            var not_fieldset = documented.attr('tagName') !== 'FIELDSET';
            if (not_fieldset) {
              documented.focus(function() {
                if (tooltip_object==null) {
                  tooltip_object = $(tooltip).purr({usingTransparentPNG: true,removeTimer: 10000});
                }
              });
              documented.blur(function() {
                if (tooltip_object!==null) {
                  tooltip_object.remove();
                  tooltip_object=null;
                }
              });
            }
            else {
              documented.find("input").hover(function() {
                if (tooltip_object==null) {
                  tooltip_object = $(tooltip).purr({usingTransparentPNG: true,removeTimer: 10000});
                }
              },
              function() {
                if (tooltip_object!==null) {
                  tooltip_object.remove();
                  tooltip_object=null;
                }
              });
            }
          });
        </script>
      {% endif %}
      {{ field.errors }}
      {{ field.label_tag }}:{{ field }}{% if field.field.required %}<span class="special_class">&nbsp;&nbsp;(required)</span>{% endif %}
      </p>
    {% endfor %}

      {% if proposal_path %}
        <p>
          <label for="id_proposal">Previous Proposal Document:</label>
          <a class="document-right" href="/site-content/{{ proposal_path }}">{{ proposal_name }}</a>
        </p>
      {% endif %}
      {% if micr_code %}
        <p>
          <label for="id_micr_code">MICR Code:</label>
          <input id="id_micr_code" type="text" maxlength="15" value="{{ micr_code }}" name="institution" DISABLED />
        </p>
      {% endif %}
		  <br />	
		  <input class="button" type="submit" value="Submit Proposal" />		
		</p>		
	</form>
				
	<p class="post-footer align-right">
		<span class="comments">Reviews:
		{% if nr_reviews %}
		  {{ nr_reviews }}
		{% else %}
		  (<i>None</i>)
		{% endif %}
		</span>
		<span class="date">Last reviewed:
		{% if last_reviewed %}
      {{ last_reviewed|date:"jS F Y h:iA" }}
    {% else %}
      (<i>Not Reviewed</i>)
    {% endif %}
		</span>
		<span class="date">Last submitted:
		{% if last_submitted %}
      {{ last_submitted|date:"jS F Y h:iA" }}
    {% else %}
      (<i>New Submission</i>)
    {% endif %} 
		</span>	
	</p>
				
</div>
{% endblock content %}