codeforamerica/intake

View on GitHub
formation/templates/formation/counties_input.jinja

Summary

Maintainability
Test Coverage
<div class="{% if field.is_subfield %}sub{% endif %}field {{ field.get_html_class_name() }}
  {%- if field.warnings %} warnings{% endif %}
  {%- if field.errors %} errors{% endif %}">
  {%- include "formation/messages_list.jinja" %}
  <fieldset>
    <legend>
      {{ field.label }}
      {%- if field.optional %}
      <span class="field-optional">(optional)</span>
      {%- endif %}
    </legend>
    {%- if field.help_text %}
    <div class="field-help_text">
      {{ field.help_text }}
    </div>
    {%- endif %}
    <ul class="checkbox_options options_list">
    {%- for county_slug, county in field.choices %}
    <li>
      <label class="field-option_label">
        <input type="checkbox" name="{{ field.get_input_name() }}" value="{{ county_slug }}"
        {%- if county_slug in field.get_current_value() %} checked="checked"{% endif %}>
        <span class="option-display_text">
          {{ county.description }}
        </span>
      </label>
    </li>{% endfor %}
    </ul>
  </fieldset>
</div>