Skip to content

Commit

Permalink
Fixes #36958 - wrap script tags in content_for(:javascripts)
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga authored and ekohl committed Nov 29, 2023
1 parent 740a46d commit 004c4d2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
7 changes: 5 additions & 2 deletions app/views/hosts/console/spice.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
</div>
<div id="spice-screen" class="console-screen"> </div>
<% end %>

<script type="text/javascript"> tfm.spice.startSpice() </script>
<% content_for(:javascripts) do -%>
<script type="text/javascript">
tfm.spice.startSpice()
</script>
<% end -%>
10 changes: 5 additions & 5 deletions app/views/report_templates/report_data.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% title _("Download generated report") %>

<%= react_component('TemplateGenerator', data: { templateName: @template.name }) %>

<script type="text/javascript">
tfm.templateInputs.pollReportData('<%= @data_url %>');
</script>
<% content_for(:javascripts) do -%>
<script type="text/javascript">
tfm.templateInputs.pollReportData('<%= @data_url %>');
</script>
<% end -%>
12 changes: 7 additions & 5 deletions app/views/users/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@
<% end %>

<% if @user.cached_usergroups.any? %>
<script>
$(function() {
tfm.users.initInheritedRoles();
});
</script>
<% content_for(:javascripts) do -%>
<script>
$(function() {
tfm.users.initInheritedRoles();
});
</script>
<% end -%>
<% end %>

0 comments on commit 004c4d2

Please sign in to comment.