4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/intro/helpers/view_helper.rb', line 4
def intro_tags(options = {})
return unless options[:enable] || enable_intro?
intro_options = {
controller: controller_path,
action: action_name,
original_url: request.original_url,
tours_path: intro.tours_path,
record_tours_path: intro.record_tours_path,
locales: t('intro.tour'),
locale: I18n.locale,
signed: !!send(Intro.config.current_user_method),
shepherd_options: options[:shepherd] || {}
}.freeze
custom_assets = Intro.config.custom_assets_with_default
custom_assets_tag = "#{javascript_pack_tag(custom_assets)} #{stylesheet_pack_tag(custom_assets)}" if custom_assets
<<-HTML.html_safe
<script>window._intro = #{ intro_options.to_json }</script>
#{intro_webpacker_helper.javascript_pack_tag('intro/application')}
#{intro_webpacker_helper.stylesheet_pack_tag('intro/application')}
#{custom_assets_tag}
HTML
end
|