Skip to content

Commit

Permalink
Merge pull request seek4science#1609 from seek4science/show-hide-blocked
Browse files Browse the repository at this point in the history
batch_asset_selection buttons adjustment
  • Loading branch information
fherreazcue authored Oct 6, 2023
2 parents eaf138d + a831721 commit 96c8da3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
3 changes: 3 additions & 0 deletions app/views/assets/_batch_asset_selection.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
text: "your items",
select_deselect_all: true,
collapse_expand: true,
show_hide_blocked: publishing,
show_hide_permissions: show_permissions
} %>

Expand All @@ -34,6 +35,7 @@
<div class="batch-selection-collapse">
<%= render partial: 'assets/batch_selection/buttons', locals: {
text: (text_for_resource items.first).downcase.pluralize,
show_hide_blocked: publishing,
select_deselect_all: true
} %>
<% items.each do |item| %>
Expand All @@ -57,6 +59,7 @@
<div class="batch-selection-collapse">
<%= render partial: 'assets/batch_selection/buttons', locals: {
text: "items not in ISA",
show_hide_blocked: publishing,
select_deselect_all: true
} %>
<% @assets_not_in_isa.each do |item| %>
Expand Down
38 changes: 24 additions & 14 deletions app/views/assets/publishing/publish_related_items.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,31 @@

<br/>
<%= form_tag({action: :check_gatekeeper_required}, method: :post) do %>
<% @items_for_publishing.each do |item| %>
<% if item.contains_publishable_items? %>
<% if item.is_asset? %>
<%= render partial: "assets/batch_selection/asset_row",
collection: item.assays.map(&:study).map(&:investigation).flatten.uniq,
locals: { preselected: item, publishing: true, show_permissions: true, show_children: true } %>
<% else %>
<%= render partial: "assets/batch_selection/asset_row", object: item,
locals: { preselected: item, publishing: true, show_permissions: true, show_children: true } %>
<div class="batch-selection-scope" id="batch-asset-selection">
<%= render partial: 'assets/batch_selection/buttons', locals: {
text: "your items",
select_deselect_all: true,
collapse_expand: true,
show_hide_blocked: true,
show_hide_permissions: true
} %>
<div class="batch-selection-collapse" id="batch-asset-collapse">
<% @items_for_publishing.each do |item| %>
<% if item.contains_publishable_items? %>
<% if item.is_asset? %>
<%= render partial: "assets/batch_selection/asset_row",
collection: item.assays.map(&:study).map(&:investigation).flatten.uniq,
locals: { preselected: item, publishing: true, show_permissions: true, show_children: true } %>
<% else %>
<%= render partial: "assets/batch_selection/asset_row", object: item,
locals: { preselected: item, publishing: true, show_permissions: true, show_children: true } %>
<% end %>
<% else %>
<%= check_box_tag publishing_item_param(item), 1, true, {style: 'display:none;'} %>
<% end %>
<% end %>
<% else %>
<%= check_box_tag publishing_item_param(item), 1, true, {style: 'display:none;'} %>
<% end %>
<% end %>

</div>
</div>
<% resource = (controller_name == 'people') ? current_user.person : @asset %>

<%= submit_tag "Next",data: { disable_with: 'Next' }, class: 'btn btn-primary' -%>
Expand Down

0 comments on commit 96c8da3

Please sign in to comment.