diff options
-rw-r--r-- | app/helpers/javascript_helper.rb | 6 | ||||
-rw-r--r-- | app/views/projects/graphs/_head.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/network/show.html.haml | 4 | ||||
-rw-r--r-- | app/views/users/show.html.haml | 4 |
4 files changed, 8 insertions, 10 deletions
diff --git a/app/helpers/javascript_helper.rb b/app/helpers/javascript_helper.rb index 91dd91718dc..4bdc8e516ac 100644 --- a/app/helpers/javascript_helper.rb +++ b/app/helpers/javascript_helper.rb @@ -1,7 +1,5 @@ module JavascriptHelper - def page_specific_javascripts(js = nil) - @page_specific_javascripts = js unless js.nil? - - @page_specific_javascripts + def page_specific_javascript_tag(js) + javascript_include_tag asset_path(js), {integrity: true, "data-turbolinks-track" => true} end end diff --git a/app/views/projects/graphs/_head.html.haml b/app/views/projects/graphs/_head.html.haml index ca04a782fcf..ca347406dfe 100644 --- a/app/views/projects/graphs/_head.html.haml +++ b/app/views/projects/graphs/_head.html.haml @@ -2,8 +2,8 @@ %ul{ class: (container_class) } - content_for :page_specific_javascripts do - = javascript_include_tag 'lib/chart.js', {integrity: true, "data-turbolinks-track" => true} - = javascript_include_tag 'graphs/application.js', {integrity: true, "data-turbolinks-track" => true} + = page_specific_javascript_tag('lib/chart.js') + = page_specific_javascript_tag('graphs/application.js') = nav_link(action: :show) do = link_to 'Contributors', namespace_project_graph_path = nav_link(action: :commits) do diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index 8bfda9776c7..3ca30b4ba6b 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -1,7 +1,7 @@ - page_title "Network", @ref - content_for :page_specific_javascripts do - = javascript_include_tag 'lib/raphael.js', {integrity: true, "data-turbolinks-track" => true} - = javascript_include_tag 'network/application.js', {integrity: true, "data-turbolinks-track" => true} + = page_specific_javascript_tag('lib/raphael.js') + = page_specific_javascript_tag('network/application.js') = render "projects/commits/head" = render "head" %div{ class: (container_class) } diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 0fabc2a7714..68665858c3e 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -1,8 +1,8 @@ - page_title @user.name - page_description @user.bio - content_for :page_specific_javascripts do - = javascript_include_tag 'lib/d3.js', {integrity: true, "data-turbolinks-track" => true} - = javascript_include_tag 'users/application.js', {integrity: true, "data-turbolinks-track" => true} + = page_specific_javascript_tag('lib/d3.js') + = page_specific_javascript_tag('users/application.js') - header_title @user.name, user_path(@user) - @no_container = true |