tidy up a bit
parent
c00902c956
commit
9150b57507
@ -1,24 +1,51 @@
|
||||
# README
|
||||
|
||||
This README would normally document whatever steps are necessary to get the
|
||||
application up and running.
|
||||
|
||||
Things you may want to cover:
|
||||
|
||||
* Ruby version
|
||||
|
||||
* System dependencies
|
||||
|
||||
* Configuration
|
||||
|
||||
* Database creation
|
||||
|
||||
* Database initialization
|
||||
|
||||
* How to run the test suite
|
||||
|
||||
* Services (job queues, cache servers, search engines, etc.)
|
||||
|
||||
* Deployment instructions
|
||||
|
||||
* ...
|
||||
# [pinrails](https://nomipinball.bhh.sh)
|
||||
|
||||
just a silly little site to help run the pinball tournaments at
|
||||
[the coin slot](https://thecoinslottc.com/).
|
||||
|
||||
currently running on ruby 3.0.2
|
||||
|
||||
bundle install
|
||||
RAILS_ENV=production bundle exec rails db:migrate
|
||||
RAILS_ENV=production bundle exec assets:precompile
|
||||
|
||||
## nginx config:
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name nomipinball.bhh.sh;
|
||||
return 307 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
include snippets/ssl/bhh.sh;
|
||||
root /srv/pinrails/pinrails/public;
|
||||
server_name nomipinball.bhh.sh;
|
||||
|
||||
try_files $uri $uri/index.html $uri.html @rails_app;
|
||||
|
||||
location @rails_app {
|
||||
include proxy_params;
|
||||
proxy_pass http://localhost:4000;
|
||||
}
|
||||
}
|
||||
|
||||
## /etc/systemd/system/pinrails.service
|
||||
|
||||
[Unit]
|
||||
Description=pinrails
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pinrails
|
||||
Group=nogroup
|
||||
WorkingDirectory=/srv/pinrails/pinrails
|
||||
Environment=RAILS_ENV=production
|
||||
Environment=PORT=4000
|
||||
Environment=RAILS_LOG_TO_STDOUT=true
|
||||
ExecStart=/srv/pinrails/.rbenv/shims/bundle exec rails server -b 127.0.0.1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
@ -1,22 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Knockout</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
<head>
|
||||
<title>Knockout</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
|
||||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
||||
<%= javascript_importmap_tags %>
|
||||
</head>
|
||||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
||||
<%= javascript_importmap_tags %>
|
||||
<%= favicon_link_tag asset_path('favicon.png') %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav>
|
||||
<%= link_to 'Home', root_path, class: "#{"current" if current_page?(root_path)}" %>
|
||||
<%= link_to 'Pins', machines_path, class: "#{"current" if current_page?(machines_path)}" %>
|
||||
<%= link_to 'Players', players_path, class: "#{"current" if current_page?(players_path)}" %>
|
||||
<%= link_to 'Randomize', {controller: 'pages', action: 'randomize'}, class: "#{"current" if current_page?(controller: 'pages', action: 'randomize')}" %>
|
||||
</nav>
|
||||
<%= yield %>
|
||||
</body>
|
||||
<body>
|
||||
<nav>
|
||||
<%= link_to 'Home', root_path, class: "#{"current" if current_page?(root_path)}" %>
|
||||
<%= link_to 'Pins', machines_path, class: "#{"current" if current_page?(machines_path)}" %>
|
||||
<%= link_to 'Players', players_path, class: "#{"current" if current_page?(players_path)}" %>
|
||||
<%= link_to 'Randomize', { controller: 'pages', action: 'randomize' }, class: "#{"current" if current_page?(controller: 'pages', action: 'randomize')}" %>
|
||||
</nav>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,9 +1,12 @@
|
||||
<% if not notice.nil? %><p style="color: green"><%= notice %></p><% end %>
|
||||
<% if not notice.nil? %><p style="color: green"><%= notice %></p>
|
||||
<% end %>
|
||||
|
||||
<h1><%= @machine.name %></h1>
|
||||
|
||||
<%= render "form", machine: @machine %>
|
||||
|
||||
<div>
|
||||
<%= link_to "Delete #{@machine.name} ❌", @machine, data: {
|
||||
turbo_method: :delete,
|
||||
turbo_confirm: "Are you sure you want to remove #{@machine.name}?"} %>
|
||||
turbo_confirm: "Are you sure you want to remove #{@machine.name}?" } %>
|
||||
</div>
|
||||
|
@ -1,3 +1,4 @@
|
||||
<h1>Knockout</h1>
|
||||
<p>To start the tournament, add players and make sure that the pins are up to date. Then hit randomize to automatically pick teams!</p>
|
||||
<p>To start the tournament, add players and make sure that the pins are up to date. Then hit randomize to automatically
|
||||
pick teams!</p>
|
||||
<p>The source code for this app can be found <%= link_to 'here', "#{GIT_REPO}/src/commit/#{GIT_SHA}" %>.</p>
|
||||
|
@ -1,6 +1,8 @@
|
||||
<div id="<%= dom_id player %>">
|
||||
<p>
|
||||
<% if player.paid %>✓<% else %> <% end %>
|
||||
<% if player.paid %>✓
|
||||
<% else %>
|
||||
<% end %>
|
||||
<%= link_to player.name, player %>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -1,9 +1,12 @@
|
||||
<% if not notice.nil? %><p style="color: green"><%= notice %></p><% end %>
|
||||
<% if not notice.nil? %><p style="color: green"><%= notice %></p>
|
||||
<% end %>
|
||||
|
||||
<h1><%= @player.name %></h1>
|
||||
|
||||
<%= render "form", player: @player %>
|
||||
|
||||
<div>
|
||||
<%= link_to "Delete #{@player.name} ❌", @player, data: {
|
||||
turbo_method: :delete,
|
||||
turbo_confirm: "Are you sure you want to remove #{@player.name}?"} %>
|
||||
turbo_confirm: "Are you sure you want to remove #{@player.name}?" } %>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue