mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +08:00
16 lines
386 B
Ruby
16 lines
386 B
Ruby
module ProtocolStatusHelper
|
|
|
|
def protocol_name(protocol)
|
|
if protocol_private_for_current_user?(protocol)
|
|
I18n.t('my_modules.protocols.protocol_status_bar.private_parent')
|
|
else
|
|
escape_input(protocol.name)
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def protocol_private_for_current_user?(protocol)
|
|
protocol.in_repository_private? && protocol.added_by != current_user
|
|
end
|
|
end
|