mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Merge pull request #1880 from biosistemika/SCI-3644-hide-import-button
SCI-3644 Import button is always visible
This commit is contained in:
commit
882e453b9c
|
@ -159,17 +159,28 @@
|
|||
.protocol-card {
|
||||
border-bottom: 1px solid $color-gainsboro;
|
||||
margin-right: 20px;
|
||||
padding: 12px 11px 7px 11px;
|
||||
padding: 12px 11px;
|
||||
|
||||
&.active {
|
||||
border: 2px solid $brand-primary;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 1px 4px 0 $color-black;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(64,161,215,0.1);
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
.external-import-btn {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:hover .external-import-btn, &.active .external-import-btn{
|
||||
display: block;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.protocol-title {
|
||||
|
|
|
@ -9,12 +9,12 @@ class ExternalProtocolsController < ApplicationController
|
|||
service_call = ProtocolImporters::SearchProtocolsService
|
||||
.call(protocol_source: index_params[:protocol_source],
|
||||
query_params: index_params)
|
||||
|
||||
if service_call.succeed?
|
||||
show_import_button = can_create_protocols_in_repository?(@team)
|
||||
render json: {
|
||||
html: render_to_string(
|
||||
partial: 'protocol_importers/list_of_protocol_cards.html.erb',
|
||||
locals: { protocols: service_call.protocols_list }
|
||||
locals: { protocols: service_call.protocols_list, show_import_button: show_import_button }
|
||||
)
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% protocols[:protocols].each do |protocol| %>
|
||||
<%= render partial: 'protocol_importers/protocol_card',
|
||||
locals: { protocol: protocol } %>
|
||||
locals: { protocol: protocol, show_import_button: show_import_button } %>
|
||||
<% end %>
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
<%= t('protocol_importers.card.views_and_steps', nr_of_views: protocol[:nr_of_views], nr_of_steps: protocol[:nr_of_steps]) %>
|
||||
</div>
|
||||
<div class='col-md-6 info-line'>
|
||||
<button type="button" class='external-import-btn btn btn-primary pull-right'><%= t('protocol_importers.card.import_button_text') %></button>
|
||||
<% if show_import_button %>
|
||||
<button type="button" class='external-import-btn btn btn-primary pull-right'><%= t('protocol_importers.card.import_button_text') %></button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue