mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-28 19:24:10 +08:00
Merge pull request #5091 from aignatov-bio/ai-sci-8079-fix-print-button-on-protocol-show-page
Fix print protocol button on protocol show page [SCI-8079]
This commit is contained in:
commit
ff4ef31ebf
2 changed files with 9 additions and 2 deletions
|
@ -13,7 +13,7 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions-block">
|
<div class="actions-block">
|
||||||
<a class="btn btn-light icon-btn pull-right" data-toggle="modal" data-target="#print-protocol-modal" tabindex="0">
|
<a class="btn btn-light icon-btn pull-right" :href="protocol.attributes.urls.print_protocol_url" target="_blank">
|
||||||
<span class="fas fa-print" aria-hidden="true"></span>
|
<span class="fas fa-print" aria-hidden="true"></span>
|
||||||
</a>
|
</a>
|
||||||
<button class="btn btn-light" @click="openVersionsModal">{{ i18n.t("protocols.header.versions") }}</button>
|
<button class="btn btn-light" @click="openVersionsModal">{{ i18n.t("protocols.header.versions") }}</button>
|
||||||
|
|
|
@ -75,7 +75,8 @@ class ProtocolSerializer < ActiveModel::Serializer
|
||||||
delete_steps_url: delete_steps_url,
|
delete_steps_url: delete_steps_url,
|
||||||
publish_url: publish_url,
|
publish_url: publish_url,
|
||||||
save_as_draft_url: save_as_draft_url,
|
save_as_draft_url: save_as_draft_url,
|
||||||
versions_modal_url: versions_modal_url
|
versions_modal_url: versions_modal_url,
|
||||||
|
print_protocol_url: print_protocol_url
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -115,6 +116,12 @@ class ProtocolSerializer < ActiveModel::Serializer
|
||||||
versions_modal_protocol_path(object.parent || object)
|
versions_modal_protocol_path(object.parent || object)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def print_protocol_url
|
||||||
|
return unless can_read_protocol_in_repository?(object)
|
||||||
|
|
||||||
|
print_protocol_path(object)
|
||||||
|
end
|
||||||
|
|
||||||
def reorder_steps_url
|
def reorder_steps_url
|
||||||
return unless can_manage_protocol_in_module?(object) || can_manage_protocol_in_repository?(object)
|
return unless can_manage_protocol_in_module?(object) || can_manage_protocol_in_repository?(object)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue