Skip to content

Commit

Permalink
Merge pull request #2015 from cloudnativedaysjp/modify_radiobutton_htmls
Browse files Browse the repository at this point in the history
checkbox と radio_button をラベルリンクする
  • Loading branch information
jacopen authored Sep 3, 2023
2 parents 6c1c7f1 + 719af6b commit 3a341ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% if f.object.proposal && f.object.proposal.accepted? %>
<%= radio_button_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}]", item.id, checked, {required: true, class: classes, params: item.params, disabled: 'disabled'} %>
<% else %>
<%= radio_button_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}]", item.id, checked, {required: true, class: classes, params: item.params} %>
<%= radio_button_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}]", item.id, checked, {required: true, class: classes, params: item.params, id: "#{label}_#{item.params}"} %>
<% end %>
<%= label label, item.params, {class: 'form-check-label'} %><br>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<% if (label == :session_times && item.key.to_i == SessionTime::TWENTY_MINUTES) || (f.object.proposal && f.object.proposal.accepted?) %>
<%= radio_button_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}]", item.id, checked, {required: true, class: classes, params: item.params, disabled: 'disabled'} %>
<% else %>
<%= radio_button_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}]", item.id, checked, {required: true, class: classes, params: item.params} %>
<%= radio_button_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}]", item.id, checked, {required: true, class: classes, params: item.params, id: "#{label}_#{item.params}"} %>
<% end %>
<%= label label, item.params, {class: 'form-check-label'} %><br>
4 changes: 2 additions & 2 deletions app/views/speaker_dashboard/speakers/_talk_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<% @conference.proposal_item_configs.where(item_number: item_number).each do |item|%>
<% label = item.label.pluralize.to_sym %>
<% checked = existing_items ? existing_items.include?(item.id.to_s) : false%>
<%= check_box_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}][]", item.id, checked, {id: "speaker_talks_attributes_#{f.options[:child_index]}_#{label}", class: 'form-check-input'} %>
<%= check_box_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}][]", item.id, checked, {id: "speaker_talks_attributes_#{f.options[:child_index]}_#{label}", class: 'form-check-input', id: "#{label}_#{item.params}"} %>
<%= label label, item.params, {class: 'form-check-label'} %><br>
<% end %>
</div>
Expand All @@ -73,7 +73,7 @@
<% when 'session_time' then %>
<%= render 'speaker_dashboard/speakers/session_times', f: f, existing_items: existing_items, first_item: first_item, item: item, classes: classes, label: label, checked: checked %>
<% else %>
<%= radio_button_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}]", item.id, checked, {required: true, class: classes, params: item.params} %>
<%= radio_button_tag "speaker[talks_attributes][#{f.options[:child_index]}][#{label}]", item.id, checked, {required: true, class: classes, params: item.params, id: "#{label}_#{item.params}"} %>
<%= label label, item.params, {class: 'form-check-label'} %><br>
<% end %>
<% end %>
Expand Down

0 comments on commit 3a341ee

Please sign in to comment.