From 4140a23ab404122e3b767d0a15764fb0590b1f32 Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Fri, 21 Nov 2025 15:27:54 +0000 Subject: [PATCH] feat: Add views for missions and game - Add missions index view with grid layout - Add game show view with Phaser container - Include CSP nonces for inline scripts - Bootstrap game configuration in window object - Load game CSS and JavaScript --- app/views/break_escape/games/show.html.erb | 33 ++++++++ .../break_escape/missions/index.html.erb | 78 +++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 app/views/break_escape/games/show.html.erb create mode 100644 app/views/break_escape/missions/index.html.erb diff --git a/app/views/break_escape/games/show.html.erb b/app/views/break_escape/games/show.html.erb new file mode 100644 index 0000000..7e6ddd4 --- /dev/null +++ b/app/views/break_escape/games/show.html.erb @@ -0,0 +1,33 @@ + + + + <%= @mission.display_name %> - BreakEscape + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%# Load game CSS %> + <%= stylesheet_link_tag '/break_escape/css/styles.css' %> + + + <%# Game container - Phaser will render here %> +
+ + <%# Loading indicator %> +
+ Loading game... +
+ + <%# Bootstrap configuration for client %> + + + <%# Load game JavaScript (ES6 module) %> + <%= javascript_include_tag '/break_escape/js/main.js', type: 'module', nonce: content_security_policy_nonce %> + + diff --git a/app/views/break_escape/missions/index.html.erb b/app/views/break_escape/missions/index.html.erb new file mode 100644 index 0000000..01019dc --- /dev/null +++ b/app/views/break_escape/missions/index.html.erb @@ -0,0 +1,78 @@ + + + + BreakEscape - Select Mission + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + + +

🔓 BreakEscape - Select Your Mission

+ +
+ <% @missions.each do |mission| %> + <%= link_to mission_path(mission), class: 'mission-card' do %> +
<%= mission.display_name %>
+
+ <%= mission.description || "An exciting escape room challenge awaits..." %> +
+
+ Difficulty: <%= "⭐" * mission.difficulty_level %> +
+ <% end %> + <% end %> +
+ +