mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 21:24:54 +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
|