diff --git a/app/views/single_pages/_duplicate_samples_panel.html.erb b/app/views/single_pages/_duplicate_samples_panel.html.erb index b05064fdd6..6a623a4286 100644 --- a/app/views/single_pages/_duplicate_samples_panel.html.erb +++ b/app/views/single_pages/_duplicate_samples_panel.html.erb @@ -1,8 +1,9 @@ <% unless @possible_duplicates.nil? or @possible_duplicates.compact.none? %> - <%= folding_panel("Possible Duplicates #{@possible_duplicates.size}", true, :id => "duplicate-samples-panel", :body_options => {:id => "duplicate-samples-panel-content"}, - :help_text => "These new samples have been matched to already existing samples.") do %> + <%= folding_panel("Possible Duplicates #{@possible_duplicates.size}", true, :id => "duplicate-samples-panel", :body_options => { :id => "duplicate-samples-panel-content" }, + :help_text => "These new samples have been matched to already existing samples.") do %>
+ <% for key in @possible_duplicates[0].keys %> @@ -11,56 +12,64 @@ <% end %> <% end %> + + <% for dupl_sample in @possible_duplicates %> - ' > - - <% dupl_sample.map do |key, val| %> - <% val = '' if key =='id' %> - <% unless %w[uuid duplicate].include?(key) %> - <% if @multiple_input_fields.include?(key)%> - - <% elsif @cv_list_fields.include?(key) %> - - <% elsif @registered_sample_fields.include?(key) %> - - <% else %> - + '> + + <% dupl_sample.map do |key, val| %> + <% val = '' if key == 'id' %> + <% unless %w[uuid duplicate].include?(key) %> + <% if @multiple_input_fields.include?(key) %> + + <% elsif @cv_list_fields.include?(key) %> + + <% elsif @registered_sample_fields.include?(key) %> + + <% else %> + + <% end %> <% end %> <% end %> - <% end %> ' class="danger"> <% dupl_sample['duplicate'].map do |key, val| %> <% unless %w[uuid duplicate].include?(key) %> - <% if @multiple_input_fields.include?(key)%> + <% if @multiple_input_fields.include?(key) %> <% elsif @cv_list_fields.include?(key) %> <% elsif @registered_sample_fields.include?(key) %> - + <% else %> - + <% end %> <% end %> <% end %> - + <% end %> +
- <% val.each do |sub_sample| %> - ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> - <% end %> - - <% val.each do |cv_term| %> - <%= cv_term %> - <% end %> - ' data-attr_type="seek-sample"><%= val['title'] %>' ><%= val %>
+ + <% val.each do |sub_sample| %> + ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> + <% end %> + + <% val.each do |cv_term| %> + <%= cv_term %> + <% end %> + + ' data-attr_type="seek-sample"><%= val['title'] %> + '><%= val %>
<% val.each do |sub_sample| %> - '><%= sub_sample['title'] %> + '><%= sub_sample['title'] %> <% end %> <% val.each do |cv_term| %> - <%= cv_term %> + <%= cv_term %> <% end %> '><%= val['title'] %>'><%= val['title'] %><%= val%><%= val %>
<% end %> diff --git a/app/views/single_pages/_new_samples_panel.html.erb b/app/views/single_pages/_new_samples_panel.html.erb index 1b163ec3da..4fd18ae27b 100644 --- a/app/views/single_pages/_new_samples_panel.html.erb +++ b/app/views/single_pages/_new_samples_panel.html.erb @@ -1,8 +1,9 @@ <% unless @new_samples.nil? or @new_samples.compact.none? %> - <%= folding_panel("New Samples #{@new_samples.size}", true, :id => "new-samples-panel", :body_options => {:id => "new-samples-panel-content"}, - :help_text => "These samples have been detected as new samples and will be created.") do %> + <%= folding_panel("New Samples #{@new_samples.size}", true, :id => "new-samples-panel", :body_options => { :id => "new-samples-panel-content" }, + :help_text => "These samples have been detected as new samples and will be created.") do %>
+ <% for key in @new_samples[0].keys %> @@ -11,36 +12,42 @@ <% end %> <% end %> + + <% for new_sample in @new_samples %> <% new_sample_id = UUID.generate %> - - <% new_sample.map do |key, val| %> - <% val = '' if key =='id' %> + + <% new_sample.map do |key, val| %> + <% val = '' if key == 'id' %> <% unless key == 'uuid' %> - <% if @multiple_input_fields.include?(key)%> - <% elsif @cv_list_fields.include?(key) %> - <% elsif @registered_sample_fields.include?(key) %> - <% else %> - + <% end %> <% end %> <% end %> <% end %> +
+ + <% if @multiple_input_fields.include?(key) %> + <% val.each do |sub_sample| %> - ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> + ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> <% end %> + <% val.each do |cv_term| %> - <%= cv_term %> + <%= cv_term %> <% end %> - ' data-attr_type="seek-sample"><%= val['title'] %> + + ' data-attr_type="seek-sample"><%= val['title'] %> <%= val %><%= val %>
<% end %> diff --git a/app/views/single_pages/_unauthorized_samples_panel.html.erb b/app/views/single_pages/_unauthorized_samples_panel.html.erb index 8ad35705d2..4d69e2a741 100644 --- a/app/views/single_pages/_unauthorized_samples_panel.html.erb +++ b/app/views/single_pages/_unauthorized_samples_panel.html.erb @@ -1,15 +1,17 @@ <% unless @unauthorized_samples.nil? or @unauthorized_samples.compact.none? %> <% @can_upload = false %> <% errors.append("There are unauthorized samples present in the spreadsheet.") %> - <%= folding_panel("Unauthorized Samples", false, :id => "unauthorized-samples-panel", :body_options => {:id => "unauthorized-samples-panel-content"}, - :help_text => "Sample the current user does not have permission to edit them.") do %> + <%= folding_panel("Unauthorized Samples", false, :id => "unauthorized-samples-panel", :body_options => { :id => "unauthorized-samples-panel-content" }, + :help_text => "Sample the current user does not have permission to edit them.") do %>

- You don't have permission to edit the samples listed below. Please contact the submitter of these samples or revert the changes in the spreadsheet to its original values. + You don't have permission to edit the samples listed below. Please contact the submitter of these samples or + revert the changes in the spreadsheet to its original values.

+ <% for key in @unauthorized_samples[0].keys %> <% unless key == 'uuid' %> @@ -17,6 +19,8 @@ <% end %> <% end %> + + <% for unauthorized_sample in @unauthorized_samples %> ' class=""> <% unauthorized_sample.map do |key, val| %> @@ -24,7 +28,7 @@ <% if @multiple_input_fields.include?(key) %> <% else %> @@ -34,6 +38,7 @@ <% end %> <% end %> +
<% val.each do |sub_sample| %> - '><%= sub_sample['title'] %> + '><%= sub_sample['title'] %> <% end %>
<% end %> diff --git a/app/views/single_pages/_update_samples_panel.html.erb b/app/views/single_pages/_update_samples_panel.html.erb index 4349edd71b..1d339a2bba 100644 --- a/app/views/single_pages/_update_samples_panel.html.erb +++ b/app/views/single_pages/_update_samples_panel.html.erb @@ -1,8 +1,9 @@ <% unless @update_samples.nil? or @update_samples.compact.none? %> - <%= folding_panel("Samples to Update #{@update_samples.size}", true, :id => "existing-samples-panel", :body_options => {:id => "existing-samples-panel-content"}, - :help_text => "These samples were detected existing samples and will be updated.") do %> + <%= folding_panel("Samples to Update #{@update_samples.size}", true, :id => "existing-samples-panel", :body_options => { :id => "existing-samples-panel-content" }, + :help_text => "These samples were detected existing samples and will be updated.") do %>
+ <% for key in @update_samples[0].keys %> @@ -11,38 +12,43 @@ <% end %> <% end %> + + <% for update_sample in @update_samples %> - ' > + '> <% db_sample = @authorized_db_samples.select { |s| s['id'] == update_sample['id'] }.first %> - + <% update_sample.map do |key, val| %> <% unless key == 'uuid' %> - <% if @multiple_input_fields.include?(key)%> - <% elsif @cv_list_fields.include?(key) %> - <% elsif @registered_sample_fields.include?(key) %> - <% else %> - + <% end %> <% end %> <% end %> - ' > + '> <% db_sample.map do |key, val| %> <% unless key == 'uuid' %> - <% if @multiple_input_fields.include?(key)%> + <% if @multiple_input_fields.include?(key) %> <% end %> +
+ ' > + <% if @multiple_input_fields.include?(key) %> + '> <% val.each do |sub_sample| %> ' data-attr_type="seek-sample-multi"><%= sub_sample['title'] %> <% end %> ' > + '> <% val.each do |cv_term| %> <%= cv_term %> <% end %> '> + '> ' data-attr_type="seek-sample"><%= val['title'] %> ' ><%= val %>'><%= val %>
<% val.each do |sub_sample| %> '><%= sub_sample['title'] %> @@ -63,6 +69,7 @@ <% end %>
<% end %>