scinote-web/app/helpers/protocol_status_helper.rb

17 lines
386 B
Ruby
Raw Normal View History

2016-07-21 19:11:15 +08:00
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
2016-07-21 19:11:15 +08:00
end
2020-04-17 01:13:18 +08:00
private
2016-07-21 19:11:15 +08:00
2020-04-17 01:13:18 +08:00
def protocol_private_for_current_user?(protocol)
protocol.in_repository_private? && protocol.added_by != current_user
2016-07-21 19:11:15 +08:00
end
end