diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/images/coinslotlogo.png | bin | 0 -> 71390 bytes | |||
-rw-r--r-- | app/assets/stylesheets/application.css | 54 | ||||
-rw-r--r-- | app/assets/stylesheets/machines.scss | 3 | ||||
-rw-r--r-- | app/assets/stylesheets/players.scss | 3 | ||||
-rw-r--r-- | app/controllers/machines_controller.rb | 7 | ||||
-rw-r--r-- | app/controllers/pages_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/players_controller.rb | 2 | ||||
-rw-r--r-- | app/views/layouts/application.html.erb | 12 | ||||
-rw-r--r-- | app/views/pages/index.html.erb | 3 |
9 files changed, 79 insertions, 9 deletions
diff --git a/app/assets/images/coinslotlogo.png b/app/assets/images/coinslotlogo.png new file mode 100644 index 0000000..495364c --- /dev/null +++ b/app/assets/images/coinslotlogo.png Binary files differdiff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index d05ea0f..61eef33 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -13,3 +13,57 @@ *= require_tree . *= require_self */ + +main { + -webkit-font-feature-settings: "liga" on, "calt" on; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: 'JetBrains Mono', 'Input Mono', monospace; + max-width: 38rem; + padding: 2rem; + margin: auto; +} + +@media only screen and (max-device-width: 736px) { + main { + padding: 0.2rem; + } +} + +::selection { + background: #9c0018; +} + +body { + background: #282828; + color: #ebdbb2; +} + +pre { + background-color: #3c3836; + padding: 1em; + border: 0; +} + +a, a:active, a:visited { + color: #e491b6; + background-color: #1d2021; +} + +h1, h2, h3, h4, h5 { + margin-bottom: .1rem; +} + +blockquote { + border-left: 1px solid #bdae93; + margin: 0.5em 10px; + padding: 0.5em 10px; +} + +footer { + align: center; +} + +img { + max-width: 100%; +} diff --git a/app/assets/stylesheets/machines.scss b/app/assets/stylesheets/machines.scss deleted file mode 100644 index 1cabf09..0000000 --- a/app/assets/stylesheets/machines.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Machines controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: https://sass-lang.com/ diff --git a/app/assets/stylesheets/players.scss b/app/assets/stylesheets/players.scss deleted file mode 100644 index a74761d..0000000 --- a/app/assets/stylesheets/players.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Players controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: https://sass-lang.com/ diff --git a/app/controllers/machines_controller.rb b/app/controllers/machines_controller.rb index 24c90e7..3145fd1 100644 --- a/app/controllers/machines_controller.rb +++ b/app/controllers/machines_controller.rb @@ -1,4 +1,9 @@ class MachinesController < ApplicationController + def random + @machine = Machine.order(Arel.sql("RANDOM()")).first + render :show + end + def index @machines = Machine.order("name") end @@ -39,7 +44,7 @@ class MachinesController < ApplicationController @machine = Machine.find(params[:id]) @machine.destroy - redirect_to root_path + redirect_to machines_path end private diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb new file mode 100644 index 0000000..39848c6 --- /dev/null +++ b/app/controllers/pages_controller.rb @@ -0,0 +1,4 @@ +class PagesController < ApplicationController + def index + end +end diff --git a/app/controllers/players_controller.rb b/app/controllers/players_controller.rb index e129114..c67e4dd 100644 --- a/app/controllers/players_controller.rb +++ b/app/controllers/players_controller.rb @@ -39,7 +39,7 @@ class PlayersController < ApplicationController @player = Player.find(params[:id]) @player.destroy - redirect_to player_path + redirect_to players_path end private diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4b286d2..47f7f24 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,6 +10,16 @@ </head> <body> - <%= yield %> + <main> + <nav> + <%= link_to "Home", root_path %> ~ + <%= link_to "Manage Tables", machines_path %> ~ + <%= link_to "Add Players", players_path %> ~ + <%= link_to "Pick Random Table", controller: "machines", action: "random" %> + </nav> + <hr> + + <%= yield %> + </main> </body> </html> diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb new file mode 100644 index 0000000..bccab8f --- /dev/null +++ b/app/views/pages/index.html.erb @@ -0,0 +1,3 @@ +<h1>nomi pinball</h1> +<%= image_tag "coinslotlogo.png" %> + |