Skip to content

Commit

Permalink
cleaned up some old =>'s from effected views #1632
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Nov 9, 2023
1 parent 8d9afc6 commit 8bef10a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/views/sample_types/_sample_attribute_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@
</td>
<td>
<%= select_tag "#{field_name_prefix}[sample_attribute_type_id]",
options_for_select(displayed_sample_attribute_types.sort_by(&:title).sort_by { |t| t.default? ? 0 : 1 }.map { |t| [t.title, t.id,{'data-use-cv'=>t.controlled_vocab? || t.seek_cv_list?, 'data-is-seek-sample'=>t.seek_sample? || t.seek_sample_multi? }] }, attribute_type_id),
options_for_select(displayed_sample_attribute_types.sort_by(&:title).sort_by { |t| t.default? ? 0 : 1 }.map do |t|
[t.title, t.id,{'data-use-cv': t.controlled_vocab? || t.seek_cv_list?, 'data-is-seek-sample': t.seek_sample? || t.seek_sample_multi? }]
end , attribute_type_id),
class: 'form-control sample-type-attribute-type',
disabled: !allow_type_change, data: { attr: "type" } %>
<div class='controlled-vocab-block' style="<%= 'display:none;' unless sample_attribute.try(:controlled_vocab?) || sample_attribute.try(:seek_cv_list?) %>">
<br/>
<%= select_tag "#{field_name_prefix}[sample_controlled_vocab_id]",
options_for_select(SampleControlledVocab.all.map { |scv| [scv.title, scv.id, {'data-editable'=>scv.can_edit?}] },
options_for_select(SampleControlledVocab.all.map { |scv| [scv.title, scv.id, {'data-editable': scv.can_edit?}] },
sample_controlled_vocab_id),
include_blank: true,
class: 'form-control controlled-vocab-selection',
Expand Down
6 changes: 4 additions & 2 deletions app/views/templates/_template_attribute_form.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@
</td>
<td>
<%= select_tag "#{field_name_prefix}[sample_attribute_type_id]",
options_for_select(SampleAttributeType.all.sort_by(&:title).sort_by { |t| t.default? ? 0 : 1 }.map { |t| [t.title, t.id,{'data-is-cv'=>t.controlled_vocab?,'data-is-seek-sample'=>t.seek_sample? || t.seek_sample_multi? }] }, attribute_type_id),
options_for_select(SampleAttributeType.all.sort_by(&:title).sort_by { |t| t.default? ? 0 : 1 }.map do |t|
[t.title, t.id,{'data-is-cv': t.controlled_vocab?,'data-is-seek-sample': t.seek_sample? || t.seek_sample_multi? }]
end, attribute_type_id),
class: 'form-control sample-type-attribute-type', data: {attr: "type"} %>

<div class='controlled-vocab-block' style="<%= 'display:none;' unless template_attribute.try(:controlled_vocab?) %>">
<br/>
<%= select_tag "#{field_name_prefix}[sample_controlled_vocab_id]",
options_for_select(SampleControlledVocab.all.map { |scv| [scv.title, scv.id, {'data-editable'=>scv.can_edit?}] },
options_for_select(SampleControlledVocab.all.map { |scv| [scv.title, scv.id, {'data-editable': scv.can_edit?}] },
sample_controlled_vocab_id),include_blank: true,
class: 'form-control controlled-vocab-selection', data: {attr: "cv_id"} %>
Expand Down

0 comments on commit 8bef10a

Please sign in to comment.