@@ -20,48 +20,48 @@ <h3>{{ profile.display_name }}</h3>
2020 < div class ="js-options-container ">
2121 < div class ="option ">
2222 {%- if option['choices'] %}
23- < label for ="profile-option-{{ profile.slug }}--{{ k }} "
24- class ="js-profile-option-label "> {{ option.display_name }}</ label >
25- < select name ="profile-option-{{ profile.slug }}--{{ k }} "
26- class ="form-control js-profile-option-select ">
27- {%- for k, choice in option['choices'].items() %}
28- < option value ="{{ k }} " {% if choice.default %}selected{% endif %} > {{ choice.display_name }}</ option >
29- {%- endfor %}
30- {%- if option['unlisted_choice']['enabled'] %}
31- < option value ="unlisted-choice "> {{ option['unlisted_choice']['display_name_in_choices'] }}</ option >
32- {%- endif %}
33- </ select >
23+ < label for ="profile-option-{{ profile.slug }}--{{ k }} "
24+ class ="js-profile-option-label "> {{ option.display_name }}</ label >
25+ < select name ="profile-option-{{ profile.slug }}--{{ k }} "
26+ class ="form-control js-profile-option-select ">
27+ {%- for k, choice in option['choices'].items() %}
28+ < option value ="{{ k }} " {% if choice.default %}selected{% endif %} > {{ choice.display_name }}</ option >
29+ {%- endfor %}
30+ {%- if option['unlisted_choice']['enabled'] %}
31+ < option value ="unlisted-choice "> {{ option['unlisted_choice']['display_name_in_choices'] }}</ option >
32+ {%- endif %}
33+ </ select >
3434 {%- endif %}
3535 </ div >
3636 {%- if option['unlisted_choice']['enabled'] %}
37- < div class ="option js-other-input-container {%- if option['choices'] %} hidden {%- endif %} ">
37+ < div class ="option js-other-input-container {%- if option['choices'] %}hidden{%- endif %} ">
3838 < label for ="profile-option-{{ profile.slug }}--{{ k }}--unlisted-choice ">
3939 {{ option['unlisted_choice']['display_name'] }}
4040 </ label >
41- < input
42- {#- FIXME: This has gotten a bit ugly, ideally we would handle a lot of this
41+ < input
42+ {#- FIXME: This has gotten a bit ugly, ideally we would handle a lot of this
4343 logic all in Javascript and not need this conditional attribute rendering #}
44- {%- if option[ 'choices'] %}
45- data-name="profile-option-{{ profile.slug }}--{{ k }}--unlisted-choice "
46- {%- else %}
47- name ="profile-option-{{ profile.slug }}--{{ k }}--unlisted-choice "
48- {%- endif %}
49- {%- if option[ 'unlisted_choice']['validation_regex'] %}
50- pattern="{{ option['unlisted_choice']['validation_regex'] }} "
51- {%- endif %}
52- title ="{{ option['unlisted_choice']['validation_message'] }} "
53- class ="form-control js-other-input " />
54- </ div >
55- {%- endif %}
56- </ div >
57- {%- endfor %}
58- </ div >
59- {%- endif %}
60- </ div >
61- </ label >
62- {%- endfor %}
63- </ div >
64- < script >
44+ {%- if option[ 'choices'] %}
45+ data-name="profile-option-{{ profile.slug }}--{{ k }}--unlisted-choice "
46+ {%- else %}
47+ name ="profile-option-{{ profile.slug }}--{{ k }}--unlisted-choice "
48+ {%- endif %}
49+ {%- if option[ 'unlisted_choice']['validation_regex'] %}
50+ pattern="{{ option['unlisted_choice']['validation_regex'] }} "
51+ {%- endif %}
52+ title ="{{ option['unlisted_choice']['validation_message'] }} "
53+ class ="form-control js-other-input " />
54+ </ div >
55+ {%- endif %}
56+ </ div >
57+ {%- endfor %}
58+ </ div >
59+ {%- endif %}
60+ </ div >
61+ </ label >
62+ {%- endfor %}
63+ </ div >
64+ < script >
6565 $ ( '.js-profile-option-select, .js-profile-option-label' ) . click ( function ( ) {
6666 // we need this bit of JS to select the profile when a <select> inside is clicked.
6767 $ ( this ) . parents ( '.js-profile-label' )
@@ -104,4 +104,4 @@ <h3>{{ profile.display_name }}</h3>
104104 $ ( '.js-profile-option-select' ) . trigger ( 'change' ) ;
105105 } ) ;
106106
107- </ script >
107+ </ script >
0 commit comments