Skip to content

Commit 34ab219

Browse files
committed
Only send staging warning script/html for staging env
1 parent 94f2099 commit 34ab219

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

app/views/layouts/_devise_shared.html.erb

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
padding-left: 0px;
3333
}
3434
</style>
35-
<script type="module">
36-
$(document).ready(function() {
37-
<% if Rails.env.staging? %>
35+
<% if Rails.env.staging? %>
36+
<script type="module">
37+
$(document).ready(function() {
3838
// Prevents users from closing the modal by clicking outside of it or pressing the esc key
3939
new bootstrap.Modal('#warningModal', {
4040
backdrop: 'static',
@@ -49,9 +49,9 @@
4949
$('.continue-btn').attr("disabled", true);
5050
}
5151
});
52-
<% end %>
53-
});
54-
</script>
52+
});
53+
</script>
54+
<% end %>
5555
</head>
5656

5757
<body id="devise" class="hold-transition login-page <%= body_class %> <%= Rails.env.staging? ? 'login-page-test' : '' %>">
@@ -73,31 +73,33 @@
7373
<!-- /.login-box -->
7474

7575
<!-- Modal -->
76-
<div class="modal fade" id="warningModal" tabindex="-1" role="dialog" aria-labelledby="warningModalLabel" aria-hidden="true">
77-
<div class="modal-dialog" role="document">
78-
<div class="modal-content">
79-
<div class="modal-header">
80-
<h3 class="modal-title" id="warningModalLabel"><b>This site is for TEST purposes only!</b></h3>
81-
</div>
82-
<div class="modal-body">
83-
You're visiting staging.humanessentials.app, a demo/test site for the full site at <a href="https://humanessentials.app">humanessentials.app</a>.<br>
84-
It is not safe to upload, enter or save any sensitive data here.<br>
85-
<div class="modal-body-warning-text">
86-
If you meant to login to your live account, go to <a href="https://humanessentials.app/users/sign_in">humanessentials.app</a>
76+
<% if Rails.env.staging? %>
77+
<div class="modal fade" id="warningModal" tabindex="-1" role="dialog" aria-labelledby="warningModalLabel" aria-hidden="true">
78+
<div class="modal-dialog" role="document">
79+
<div class="modal-content">
80+
<div class="modal-header">
81+
<h3 class="modal-title" id="warningModalLabel"><b>This site is for TEST purposes only!</b></h3>
8782
</div>
88-
<br>
89-
<div class="form-check">
90-
<input class="form-check-input" type="checkbox" value="" id="defaultCheck1">
91-
<label class="form-check-label" for="defaultCheck1">
92-
I Understand
93-
</label>
83+
<div class="modal-body">
84+
You're visiting staging.humanessentials.app, a demo/test site for the full site at <a href="https://humanessentials.app">humanessentials.app</a>.<br>
85+
It is not safe to upload, enter or save any sensitive data here.<br>
86+
<div class="modal-body-warning-text">
87+
If you meant to login to your live account, go to <a href="https://humanessentials.app/users/sign_in">humanessentials.app</a>
88+
</div>
89+
<br>
90+
<div class="form-check">
91+
<input class="form-check-input" type="checkbox" value="" id="defaultCheck1">
92+
<label class="form-check-label" for="defaultCheck1">
93+
I Understand
94+
</label>
95+
</div>
96+
</div>
97+
<div class="modal-footer">
98+
<button type="button" class="btn btn-warning continue-btn" data-bs-dismiss="modal" disabled>Continue To The Test Site</button>
9499
</div>
95-
</div>
96-
<div class="modal-footer">
97-
<button type="button" class="btn btn-warning continue-btn" data-bs-dismiss="modal" disabled>Continue To The Test Site</button>
98100
</div>
99101
</div>
100102
</div>
101-
</div>
103+
<% end %>
102104
</body>
103105
</html>

0 commit comments

Comments
 (0)