app/templates/projrev/proposal/submit.html
changeset 23 91cf6872d853
parent 22 0321f984fb16
child 24 7257b66a6766
equal deleted inserted replaced
22:0321f984fb16 23:91cf6872d853
     1 {% extends "projrev/base.html" %}
     1 {% extends "projrev/base.html" %}
     2 {% block scripts %}
     2 {% block scripts %}
     3 {{ block.super }}
     3 {{ block.super }}
     4 <script language="JavaScript" type="text/javascript" src="/site-content/js/jquery.chainedSelects.js"></script>
     4 <script language="JavaScript" type="text/javascript" src="/site-content/js/jquery.chainedSelects.js"></script>
     5 <script language="JavaScript" type="text/javascript">
     5 <script language="JavaScript" type="text/javascript">
     6 $(function()
     6   $(function()
     7 {
     7   {
     8   $('#id_state').chainSelect('#id_district','/proposal/submit/get_dfors');
     8     $('#id_state').chainSelect('#id_district','/proposal/submit/get_dfors');
     9 });
     9   });
       
    10   $(document).ready(function() {
       
    11 	  $.get('/proposal/submit/get_dfors', function() {
       
    12       $('#id_district').html('<option value="">---------</option>');
       
    13 	  });
       
    14   });
    10 </script>
    15 </script>
    11 {% endblock scripts %}
    16 {% endblock scripts %}
    12 {% block content %}
    17 {% block content %}
    13 <div class="post">
    18 <div class="post">
    14 			
    19 			
    25 
    30 
    26 	<form enctype="multipart/form-data" method="post" action="">			
    31 	<form enctype="multipart/form-data" method="post" action="">			
    27 		<p>
    32 		<p>
    28     {% for field in form %}
    33     {% for field in form %}
    29       <p>
    34       <p>
       
    35       {% if field.help_text %}
       
    36         <script type="text/javascript">
       
    37           $(document).ready( function() {
       
    38             var tooltip = [
       
    39             "<div class='tooltip'>",
       
    40             "  <div class='tooltip-body'>",
       
    41             "    <img src='/site-content/images/purrInfo.png' alt='' />",
       
    42             "    <h3>Info</h3>",
       
    43             "    <p>",
       
    44             "      {% autoescape off %}",
       
    45             "        {{ help_text|linebreaksbr|escapejs }}",
       
    46             "      {% endautoescape %}",
       
    47             "    </p>",
       
    48             "  </div>",
       
    49             "  <div class='tooltip-bottom'></div>",
       
    50             "</div>"
       
    51           ].join("");
       
    52           var tooltip_object=null;
       
    53           var documented = $("#{{ field_id }}");
       
    54           var not_fieldset = documented.attr('tagName') !== 'FIELDSET';
       
    55           if (not_fieldset) {
       
    56             documented.focus(function() {
       
    57               if (tooltip_object==null) {
       
    58                 tooltip_object = $(tooltip).purr({usingTransparentPNG: true,removeTimer: 10000});
       
    59               }
       
    60             });
       
    61             documented.blur(function() {
       
    62               if (tooltip_object!==null) {
       
    63                 tooltip_object.remove();
       
    64                 tooltip_object=null;
       
    65               }
       
    66             });
       
    67           }
       
    68           else {
       
    69             documented.find("input").hover(function() {
       
    70               if (tooltip_object==null) {
       
    71                 tooltip_object = $(tooltip).purr({usingTransparentPNG: true,removeTimer: 10000});
       
    72               }
       
    73             },
       
    74             function() {
       
    75               if (tooltip_object!==null) {
       
    76                 tooltip_object.remove();
       
    77                 tooltip_object=null;
       
    78               }
       
    79             });
       
    80           }
       
    81         });
       
    82         </script>
       
    83       {% endif %}
    30       {{ field.errors }}
    84       {{ field.errors }}
    31       {{ field.label_tag }}{% if field.field.required %}<span class="special_class">(*)</span>{% endif %}:{{ field }}
    85       {{ field.label_tag }}:{{ field }}{% if field.field.required %}<span class="special_class">&nbsp;&nbsp;(required)</span>{% endif %}
    32       </p>
    86       </p>
    33     {% endfor %}
    87     {% endfor %}
    34 
    88 
    35       {% if proposal_path %}
    89       {% if proposal_path %}
    36         <p>
    90         <p>