init
This commit is contained in:
		
							
								
								
									
										31
									
								
								app/views/game/index.html.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								app/views/game/index.html.erb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| <h1>Game History</h1> | ||||
|  | ||||
| <% if @recent_games.any? %> | ||||
|   <div class="wrapper"> | ||||
|     <div class="table"> | ||||
|       <div class="row header"> | ||||
|         <div class="cell">Time</div> | ||||
|         <div class="cell">Wager</div> | ||||
|         <div class="cell">Winner</div> | ||||
|         <div class="cell">High Roll</div> | ||||
|         <div class="cell">Loser</div> | ||||
|         <div class="cell">Low Roll</div> | ||||
|         <div class="cell">Payout</div> | ||||
|       </div> | ||||
|       <% @recent_games.each do |game| %> | ||||
|         <div class="row"> | ||||
|           <div class="cell" data-title="Time"><%= Time.at(game.timestamp).strftime("%Y-%m-%d %H:%M:%S") %></div> | ||||
|           <div class="cell" data-title="Wager"><%= game.wager %></div> | ||||
|           <div class="cell" data-title="Winner"><%= game.winner %></div> | ||||
|           <div class="cell" data-title="High Roll"><%= game.high_roll %></div> | ||||
|           <div class="cell" data-title="Loser"><%= game.loser %></div> | ||||
|           <div class="cell" data-title="Low Roll"><%= game.low_roll %></div> | ||||
|           <div class="cell" data-title="Payout"><%= game.payout %></div> | ||||
|         </div> | ||||
|       <% end %> | ||||
|     </div> | ||||
|     <a href="/">Leaderboard</a> | ||||
|   </div> | ||||
| <% else %> | ||||
|   <p>No recent games</p> | ||||
| <% end %> | ||||
							
								
								
									
										22
									
								
								app/views/game/show.html.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								app/views/game/show.html.erb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| <h1>Game <%= @game.id %></h1> | ||||
|  | ||||
| <table class="tg"><tbody> | ||||
| <tr> | ||||
|   <th class="tg-0lax">Game Type</th> | ||||
|   <th class="tg-0lax"><%= @game.gametype_str %></th> | ||||
| </tr> | ||||
| <tr> | ||||
|   <th class="tg-0lax">Winner</th> | ||||
|   <th class="tg-0lax"><%= @game.winner %></th> | ||||
| </tr> | ||||
| <tr> | ||||
|   <td class="tg-0lax">Loser</td> | ||||
|   <td class="tg-0lax"><%= @game.loser %></td> | ||||
| </tr> | ||||
| <tr> | ||||
|   <td class="tg-0lax">Payout</td> | ||||
|   <td class="tg-0lax"><%= @game.payout %></td> | ||||
| </tr> | ||||
| </tbody></table> | ||||
|  | ||||
| <%= link_to "Back", game_index_path %> | ||||
							
								
								
									
										27
									
								
								app/views/layouts/application.html.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								app/views/layouts/application.html.erb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| <!DOCTYPE html> | ||||
| <html> | ||||
|   <head> | ||||
|     <title><%= content_for(:title) || "Gambosite" %></title> | ||||
|     <meta name="viewport" content="width=device-width,initial-scale=1"> | ||||
|     <meta name="apple-mobile-web-app-capable" content="yes"> | ||||
|     <meta name="mobile-web-app-capable" content="yes"> | ||||
|     <%= csrf_meta_tags %> | ||||
|     <%= csp_meta_tag %> | ||||
|  | ||||
|     <%= yield :head %> | ||||
|  | ||||
|     <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %> | ||||
|     <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %> | ||||
|  | ||||
|     <link rel="icon" href="/icon.png" type="image/png"> | ||||
|     <link rel="icon" href="/icon.svg" type="image/svg+xml"> | ||||
|     <link rel="apple-touch-icon" href="/icon.png"> | ||||
|  | ||||
|     <%# Includes all stylesheet files in app/assets/stylesheets %> | ||||
|     <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> | ||||
|   </head> | ||||
|  | ||||
|   <body> | ||||
|     <%= yield %> | ||||
|   </body> | ||||
| </html> | ||||
							
								
								
									
										13
									
								
								app/views/layouts/mailer.html.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								app/views/layouts/mailer.html.erb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| <!DOCTYPE html> | ||||
| <html> | ||||
|   <head> | ||||
|     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||||
|     <style> | ||||
|       /* Email styles need to be inline */ | ||||
|     </style> | ||||
|   </head> | ||||
|  | ||||
|   <body> | ||||
|     <%= yield %> | ||||
|   </body> | ||||
| </html> | ||||
							
								
								
									
										1
									
								
								app/views/layouts/mailer.text.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								app/views/layouts/mailer.text.erb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| <%= yield %> | ||||
							
								
								
									
										25
									
								
								app/views/leaderboard/index.html.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								app/views/leaderboard/index.html.erb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| <h1>Force Kin Gamba Leaderboard</h1> | ||||
|  | ||||
| <% if @players.any? %> | ||||
| <div class="wrapper"> | ||||
|   <div class="table"> | ||||
|     <div class="row header"> | ||||
|       <div class="cell">Player</div> | ||||
|       <div class="cell">Purse</div> | ||||
|       <div class="cell">Wins</div> | ||||
|       <div class="cell">Losses</div> | ||||
|     </div> | ||||
|     <% @players.each do |player| %> | ||||
|       <div class="row"> | ||||
|         <div class="cell" data-title="Player"><%= player.name %></div> | ||||
|         <div class="cell" data-title="Purse"><%= player.purse %></div> | ||||
|         <div class="cell" data-title="Wins"><%= player.wins %></div> | ||||
|         <div class="cell" data-title="Losses"><%= player.losses %></div> | ||||
|       </div> | ||||
|     <% end %> | ||||
|     </div> | ||||
|     <a href="/games">Game History</a> | ||||
| </div> | ||||
| <% else %> | ||||
|   <p>No Players!</p> | ||||
| <% end %> | ||||
							
								
								
									
										20
									
								
								app/views/player/show.html.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								app/views/player/show.html.erb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| <h1><%= @player.name %></h1> | ||||
|  | ||||
| <table><thead> | ||||
| <tr> | ||||
|   <th>Player</th> | ||||
|   <th>Purse</th> | ||||
|   <th>Wins</th> | ||||
|   <th>Losses</th> | ||||
| </tr></thead> | ||||
|   <tbody> | ||||
|   <% @player.each do |game| %> | ||||
|     <tr> | ||||
|       <td><% @player.name %></td> | ||||
|       <td><% @player.purse %></td> | ||||
|       <td><% @player.wins %></td> | ||||
|       <td><% @player.losses %></td> | ||||
|     </tr> | ||||
|   <% end %> | ||||
|   </tbody> | ||||
| </table> | ||||
							
								
								
									
										22
									
								
								app/views/pwa/manifest.json.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								app/views/pwa/manifest.json.erb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| { | ||||
|   "name": "Gambosite", | ||||
|   "icons": [ | ||||
|     { | ||||
|       "src": "/icon.png", | ||||
|       "type": "image/png", | ||||
|       "sizes": "512x512" | ||||
|     }, | ||||
|     { | ||||
|       "src": "/icon.png", | ||||
|       "type": "image/png", | ||||
|       "sizes": "512x512", | ||||
|       "purpose": "maskable" | ||||
|     } | ||||
|   ], | ||||
|   "start_url": "/", | ||||
|   "display": "standalone", | ||||
|   "scope": "/", | ||||
|   "description": "Gambosite.", | ||||
|   "theme_color": "red", | ||||
|   "background_color": "red" | ||||
| } | ||||
							
								
								
									
										26
									
								
								app/views/pwa/service-worker.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								app/views/pwa/service-worker.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| // Add a service worker for processing Web Push notifications: | ||||
| // | ||||
| // self.addEventListener("push", async (event) => { | ||||
| //   const { title, options } = await event.data.json() | ||||
| //   event.waitUntil(self.registration.showNotification(title, options)) | ||||
| // }) | ||||
| // | ||||
| // self.addEventListener("notificationclick", function(event) { | ||||
| //   event.notification.close() | ||||
| //   event.waitUntil( | ||||
| //     clients.matchAll({ type: "window" }).then((clientList) => { | ||||
| //       for (let i = 0; i < clientList.length; i++) { | ||||
| //         let client = clientList[i] | ||||
| //         let clientPath = (new URL(client.url)).pathname | ||||
| // | ||||
| //         if (clientPath == event.notification.data.path && "focus" in client) { | ||||
| //           return client.focus() | ||||
| //         } | ||||
| //       } | ||||
| // | ||||
| //       if (clients.openWindow) { | ||||
| //         return clients.openWindow(event.notification.data.path) | ||||
| //       } | ||||
| //     }) | ||||
| //   ) | ||||
| // }) | ||||
		Reference in New Issue
	
	Block a user