app/soc/templates/soc/survey/universal_choice_editor.html
changeset 2560 a944c0169ad8
parent 2502 2e096acc8720
child 2570 851640749319
equal deleted inserted replaced
2559:af2874bc01f3 2560:a944c0169ad8
     1 <fieldset>
     1 <fieldset>
     2 
     2 
       
     3 <table>
       
     4  <tr>
       
     5   <td>
     3 {# Drop-down setting whether question is required #}
     6 {# Drop-down setting whether question is required #}
     4   <label for="required_for_{{ name }}">Required</label>
     7   <label for="required_for_{{ name }}">Required</label>
     5   <select id="required_for_{{ name }}" name="required_for_{{ name }}">
     8   <select id="required_for_{{ name }}" name="required_for_{{ name }}">
     6     <option value="True" {% if is_required %} selected='selected' {% endif %}
     9     <option value="True" {% if is_required %} selected='selected' {% endif %}
     7     >True</option>
    10     >True</option>
     8     <option value="False" {% if not is_required %} selected='selected' {% endif %}
    11     <option value="False" {% if not is_required %} selected='selected' {% endif %}
     9     >False</option>
    12     >False</option>
    10   </select><br/>
    13   </select>
    11 
    14   </td>
       
    15   <td>
    12 {# Drop-down setting whether question allows comments #}
    16 {# Drop-down setting whether question allows comments #}
    13   <label for="comment_for_{{ name }}">Allow Comments</label>
    17   <label for="comment_for_{{ name }}">Allow Comments</label>
    14   <select id="comment_for_{{ name }}" name="comment_for_{{ name }}">
    18   <select id="comment_for_{{ name }}" name="comment_for_{{ name }}">
    15     <option value="True" {% if has_comment %} selected='selected' {% endif %}
    19     <option value="True" {% if has_comment %} selected='selected' {% endif %}
    16     >True</option>
    20     >True</option>
    17     <option value="False" {% if not has_comment %} selected='selected' {% endif %}
    21     <option value="False" {% if not has_comment %} selected='selected' {% endif %}
    18     >False</option>
    22     >False</option>
    19   </select><br/>
    23   </select>
    20 
    24   </td>
       
    25  </tr>
       
    26  <tr>
       
    27   <td>
    21 {# Question type drop-down #}
    28 {# Question type drop-down #}
    22   <label for="type_for_{{ name }}">Question Type</label>
    29   <label for="type_for_{{ name }}">Question Type</label>
    23   <select id="type_for_{{ name }}" name="type_for_{{ name }}">
    30   <select id="type_for_{{ name }}" name="type_for_{{ name }}">
    24     <option value="selection" {{ is_selection|safe }}>selection</option>
    31     <option value="selection" {{ is_selection|safe }}>selection</option>
    25     <option value="pick_multi" {{ is_pick_multi }}>pick_multi</option>
    32     <option value="pick_multi" {{ is_pick_multi }}>pick_multi</option>
    26     <option value="pick_quant" {{ is_pick_quant }}>pick_quant</option>
    33     <option value="pick_quant" {{ is_pick_quant }}>pick_quant</option>
    27   </select>
    34   </select>
    28 
    35   </td>
       
    36   <td>
    29 {# Render widget drop-down #}
    37 {# Render widget drop-down #}
    30   <label for="render_for_{{ name }}">Render as</label>
    38   <label for="render_for_{{ name }}">Render as</label>
    31   <select id="render_for_{{ name }}" name="render_for_{{ name }}">
    39   <select id="render_for_{{ name }}" name="render_for_{{ name }}">
    32     <option value="select" {{ is_select|safe }}>select</option>
    40     <option value="select" {{ is_select|safe }}>select</option>
    33     <option value="checkboxes" {{ is_checkboxes|safe }}>checkboxes</option>
    41     <option value="checkboxes" {{ is_checkboxes|safe }}>checkboxes</option>
    34     <option value="radio_buttons" {{ is_radio_buttons }}>radio_buttons</option>
    42     <option value="radio_buttons" {{ is_radio_buttons }}>radio_buttons</option>
    35   </select>
    43   </select>
       
    44   </td>
       
    45  </tr>
       
    46  <tr>
       
    47   <td  colspan='2'>
       
    48     <textarea id="tip_for_{{ name }}" name="tip_for_{{ name }}"
       
    49      cols='20' rows='1' class="tooltip_entry">{{ tooltip_content }}</textarea>
       
    50   </td>
       
    51  </tr>
       
    52 </table>
       
    53 
    36 
    54 
    37 {# Each choice field has a hidden input where its options' order is stored. #}
    55 {# Each choice field has a hidden input where its options' order is stored. #}
    38   <input type="hidden" id="order_for_{{ name }}" name="order_for_{{ name }}"
    56   <input type="hidden" id="order_for_{{ name }}" name="order_for_{{ name }}"
    39    value=""/>
    57    value=""/>
       
    58 {# The index for choice questions is also kept in a hidden input. #}
       
    59   <input type="hidden" id="index_for_{{ name }}"
       
    60    name="index_for_{{ name }}" value=""/>
    40 
    61 
    41 {# Open the ordered list. #}
    62 {# Open the ordered list. #}
    42   <ol id="{{ name }}" class="sortable">
    63   <ol id="{{ name }}" class="sortable">
    43 {# Template for each option #}
    64 {# Template for each option #}
    44   {% for i, option_value in  choices.items %}
    65   {% for i, option_value in  choices.items %}