This commit is contained in:
Executable
+56
@@ -0,0 +1,56 @@
|
||||
<% if current_user %>
|
||||
<footer class="border-top mt-5 py-4 text-center text-muted bg-white">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="mb-1">
|
||||
<i class="bi bi-shield-check"></i>
|
||||
© <%= Date.current.year %> The Open Worldwide Application Security Project - OWASP
|
||||
</p>
|
||||
<p class="small mb-0">
|
||||
<a href="https://owasp.org" target="_blank" class="text-decoration-none me-3">
|
||||
<i class="bi bi-globe"></i> OWASP.org
|
||||
</a>
|
||||
<a href="https://github.com/OWASP/railsgoat" target="_blank" class="text-decoration-none me-3">
|
||||
<i class="bi bi-github"></i> GitHub
|
||||
</a>
|
||||
<a href="https://github.com/OWASP/railsgoat/wiki" target="_blank" class="text-decoration-none">
|
||||
<i class="bi bi-book"></i> Documentation
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<% end %>
|
||||
|
||||
<!-- Scroll to Top Button -->
|
||||
<button id="scrollTopBtn" class="btn btn-primary rounded-circle position-fixed bottom-0 end-0 m-4" style="width: 48px; height: 48px; display: none; z-index: 1000;" title="Scroll to top">
|
||||
<i class="bi bi-arrow-up"></i>
|
||||
</button>
|
||||
|
||||
<script>
|
||||
// Modern scroll-to-top without jQuery
|
||||
(function() {
|
||||
const scrollBtn = document.getElementById('scrollTopBtn');
|
||||
|
||||
if (scrollBtn) {
|
||||
// Show/hide button based on scroll position
|
||||
window.addEventListener('scroll', function() {
|
||||
if (window.pageYOffset > 300) {
|
||||
scrollBtn.style.display = 'block';
|
||||
} else {
|
||||
scrollBtn.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// Scroll to top on click
|
||||
scrollBtn.addEventListener('click', function() {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
Executable
+115
@@ -0,0 +1,115 @@
|
||||
<% if current_user %>
|
||||
<!-- Authenticated Header -->
|
||||
<header class="rg-header">
|
||||
<div class="container-fluid h-100">
|
||||
<div class="row h-100 align-items-center">
|
||||
<div class="col-auto">
|
||||
<a href="<%= home_dashboard_index_path %>" class="rg-brand">
|
||||
<i class="bi bi-shield-fill-exclamation"></i> RailsGoat
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col"></div>
|
||||
|
||||
<div class="col-auto">
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<!-- Font Size Controls -->
|
||||
<div class="btn-group btn-group-sm" role="group" aria-label="Font size controls">
|
||||
<a href="/dashboard/home?font=8pt" class="btn btn-outline-secondary" style="font-size: 10pt;" title="Small font" aria-label="Small font" data-turbolinks="false">
|
||||
<i class="bi bi-type"></i>
|
||||
</a>
|
||||
<a href="/dashboard/home?font=200%25" class="btn btn-outline-secondary" style="font-size: 14pt;" title="Large font" aria-label="Large font" data-turbolinks="false">
|
||||
<i class="bi bi-type"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Tutorial Link -->
|
||||
<%= button_to "https://github.com/OWASP/railsgoat/wiki", {
|
||||
method: "get",
|
||||
class: "btn btn-sm btn-outline-primary",
|
||||
onclick: "window.open('https://github.com/OWASP/railsgoat/wiki', '_blank'); return false;"
|
||||
} do %>
|
||||
<i class="bi bi-book"></i> Tutorials
|
||||
<% end %>
|
||||
|
||||
<!-- User Dropdown -->
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-link text-decoration-none dropdown-toggle d-flex align-items-center gap-2" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<div class="bg-primary rounded-circle d-flex align-items-center justify-content-center" style="width: 32px; height: 32px;">
|
||||
<i class="bi bi-person-fill text-white"></i>
|
||||
</div>
|
||||
<!--
|
||||
VULNERABILITY: XSS via html_safe
|
||||
I'm going to use HTML safe because we had some weird stuff
|
||||
going on with funny chars and jquery, plus it says safe so I'm guessing
|
||||
nothing bad will happen
|
||||
-->
|
||||
<span class="text-dark"><%= current_user.first_name.html_safe %></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<%= link_to user_account_settings_path(user_id: current_user.id), class: "dropdown-item" do %>
|
||||
<i class="bi bi-gear"></i> Account Settings
|
||||
<% end %>
|
||||
</li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<%= link_to logout_path, class: "dropdown-item text-danger" do %>
|
||||
<i class="bi bi-box-arrow-right"></i> Logout
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<% else %>
|
||||
<!-- Unauthenticated Header -->
|
||||
<header class="rg-header">
|
||||
<div class="container-fluid h-100">
|
||||
<div class="row h-100 align-items-center">
|
||||
<div class="col-auto">
|
||||
<a href="<%= login_path %>" class="rg-brand">
|
||||
<i class="bi bi-shield-fill-exclamation"></i> RailsGoat
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col"></div>
|
||||
|
||||
<div class="col-auto">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<%= link_to credentials_tutorials_path, class: "btn btn-sm btn-warning" do %>
|
||||
<i class="bi bi-key"></i> Demo Credentials
|
||||
<% end %>
|
||||
|
||||
<%= button_to "https://github.com/OWASP/railsgoat/wiki", {
|
||||
method: "get",
|
||||
class: "btn btn-sm btn-outline-primary",
|
||||
onclick: "window.open('https://github.com/OWASP/railsgoat/wiki', '_blank'); return false;"
|
||||
} do %>
|
||||
<i class="bi bi-book"></i> Tutorials
|
||||
<% end %>
|
||||
|
||||
<%= button_to signup_path, {
|
||||
class: "btn btn-sm btn-primary",
|
||||
method: "get"
|
||||
} do %>
|
||||
<i class="bi bi-person-plus"></i> Sign Up
|
||||
<% end %>
|
||||
|
||||
<%= button_to login_path, {
|
||||
class: "btn btn-sm btn-outline-primary",
|
||||
method: "get"
|
||||
} do %>
|
||||
<i class="bi bi-box-arrow-in-right"></i> Login
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<% end %>
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<% flash.each do |name, msg| %>
|
||||
<% name = name.to_sym %>
|
||||
<%
|
||||
alert_class = case name
|
||||
when :error, :alert
|
||||
'alert-danger'
|
||||
when :success, :notice
|
||||
'alert-success'
|
||||
when :info
|
||||
'alert-info'
|
||||
when :warning
|
||||
'alert-warning'
|
||||
else
|
||||
'alert-secondary'
|
||||
end
|
||||
|
||||
icon_class = case name
|
||||
when :error, :alert
|
||||
'bi-exclamation-circle-fill'
|
||||
when :success, :notice
|
||||
'bi-check-circle-fill'
|
||||
when :info
|
||||
'bi-info-circle-fill'
|
||||
when :warning
|
||||
'bi-exclamation-triangle-fill'
|
||||
else
|
||||
'bi-bell-fill'
|
||||
end
|
||||
%>
|
||||
|
||||
<div class="alert <%= alert_class %> alert-dismissible show d-flex align-items-center" role="alert">
|
||||
<i class="bi <%= icon_class %> me-2"></i>
|
||||
<div class="flex-grow-1">
|
||||
<%= msg %>
|
||||
</div>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<% end %>
|
||||
Executable
+90
@@ -0,0 +1,90 @@
|
||||
<% if current_user %>
|
||||
<nav class="rg-sidebar">
|
||||
<ul class="rg-sidebar-nav">
|
||||
<li>
|
||||
<%= link_to home_dashboard_index_path, class: "#{controller_name == 'dashboard' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-speedometer2"></i>
|
||||
<span>Dashboard</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<% if is_admin? %>
|
||||
<li class="mt-3">
|
||||
<div class="px-4 py-2 text-white-50 text-uppercase small fw-bold">Admin</div>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to admin_dashboard_path(admin_id: "1"), class: "#{controller_name == 'admin' && action_name == 'dashboard' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-people"></i>
|
||||
<span>Manage Users</span>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to admin_analytics_path(admin_id: "1"), class: "#{controller_name == 'admin' && action_name == 'analytics' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-graph-up"></i>
|
||||
<span>View Analytics</span>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li class="mt-3">
|
||||
<div class="px-4 py-2 text-white-50 text-uppercase small fw-bold">Employee</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to user_benefit_forms_path(user_id: current_user.id), class: "#{controller_name == 'benefit_forms' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-file-earmark-text"></i>
|
||||
<span>Benefit Forms</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to user_retirement_index_path(user_id: current_user.id), class: "#{controller_name == 'retirement' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-piggy-bank"></i>
|
||||
<span>401k Info</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to user_paid_time_off_index_path(user_id: current_user.id), class: "#{controller_name == 'paid_time_off' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-calendar-check"></i>
|
||||
<span>PTO</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to user_work_info_index_path(user_id: current_user.id), class: "#{controller_name == 'work_info' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-briefcase"></i>
|
||||
<span>Work Info</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to user_performance_index_path(user_id: current_user.id), class: "#{controller_name == 'performance' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-bar-chart"></i>
|
||||
<span>Performance</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to user_messages_path(user_id: current_user.id), class: "#{controller_name == 'messages' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-envelope"></i>
|
||||
<span>Messages</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<%= link_to user_pay_index_path(user_id: current_user.id), class: "#{controller_name == 'pay' ? 'active' : ''}" do %>
|
||||
<i class="bi bi-credit-card"></i>
|
||||
<span>Pay</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li class="mt-4 pt-4 border-top border-secondary">
|
||||
<div class="px-4 py-2 text-white-50 small">
|
||||
<i class="bi bi-shield-exclamation"></i>
|
||||
OWASP RailsGoat <%= Rails::VERSION::STRING %>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user