| {% extends "modules/gsoc/form_base.html" %} |
| {% comment %} |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| {% endcomment %} |
| |
| {% block stylesheets %} |
| {{ block.super }} |
| <link rel="stylesheet" type="text/css" media="screen" href="/soc/content/{{ app_version }}/css/gsoc/forms.css" /> |
| <link rel="stylesheet" type="text/css" media="screen" href="/soc/content/{{ app_version }}/css/gsoc/uniform.default.css" /> |
| {% endblock stylesheets %} |
| |
| {% block page_content %} |
| |
| {% if form_top_msg %} |
| {{ form_top_msg.render }} |
| {% endif %} |
| |
| {% if posted %} |
| {% if error %} |
| <div id="flash-message" class="flash-error"> |
| <p>Sorry, we could not save your data. Please fix the errors mentioned below.</p> |
| {% else %} |
| <div id="flash-message" class="flash-success"> |
| <p>Data saved successfully.</p> |
| {% endif %} |
| </div> |
| {% endif %} |
| |
| <div id="pre-form-header"> |
| <h2 id="form-evaluation-title"> |
| {% if form_header_msg %} |
| {{ form_header_msg }} |
| {% else %} |
| {{ page_name }} |
| {% endif %} |
| <div id="form-evaluation-req" class="req">* fields required</div> |
| </h2> |
| <h3 id="form-project-title"> |
| Project: {{ project }}<br/> |
| {% if student %} |
| Student: {{ student }} |
| {% endif %} |
| </h3> |
| <div class="description"> |
| {{ description|safe }} |
| </div> |
| </div> |
| |
| <!-- begin form --> |
| {% block open_form %} |
| <form action="{% if cbox %}?cbox=true{% else %}#{% endif %}" method="post" id="form" class="form-register"> |
| <h2>Questionnaire</h2> |
| {% endblock open_form %} |
| |
| {% for form in forms %} |
| {{ form.render }} |
| {% endfor %} |
| |
| {% block form_button %} |
| <div id="form-register-fieldset-button-row" class="row button-row"> |
| <input id="form-register-submit" type="submit" value="Submit" class="submit" /> |
| </div> |
| {% endblock form_button %} |
| </form> |
| <!-- end form --> |
| |
| {% endblock page_content %} |
| |
| |
| {% block dependencies %} |
| [ |
| dep.jqueryui.effects.blind, |
| dep.uniform, |
| null, |
| function () { |
| jQuery("select, input:radio, input:file, input:checkbox").uniform(); |
| |
| jQuery(document).ready(function () { |
| |
| jQuery(':checkbox[value="Other"],:radio').each(function () { |
| if (jQuery(this).val() == "Other") { |
| var selector = "#form_row_" + jQuery(this).attr("name") + "-other"; |
| if (jQuery(this).parent().attr("class") == "checked") { |
| jQuery(selector).show(); |
| } else { |
| jQuery(selector).hide(); |
| } |
| } |
| }); |
| |
| jQuery(':radio').change(function () { |
| var selector = "#form_row_" + jQuery(this).attr("name") + "-other"; |
| if (jQuery(this).val() != "Other") { |
| jQuery(selector).hide("Blind"); |
| } else { |
| jQuery(selector).show("Blind"); |
| } |
| }); |
| jQuery(':checkbox[value="Other"]').change(function () { |
| var selector = "#form_row_" + jQuery(this).attr("name") + "-other"; |
| jQuery(selector).toggle("Blind"); |
| }); |
| }); |
| } |
| ] |
| {% endblock dependencies %} |