summary refs log tree commit diff stats
path: root/rails/app
diff options
context:
space:
mode:
Diffstat (limited to 'rails/app')
-rw-r--r--rails/app/assets/config/lingo_manifest.js2
-rw-r--r--rails/app/assets/images/lingo/.keep0
-rw-r--r--rails/app/assets/images/lingo/header.pngbin1213722 -> 0 bytes
-rw-r--r--rails/app/assets/stylesheets/lingo/application.css15
-rw-r--r--rails/app/assets/stylesheets/lingo/main.css.scss55
-rw-r--r--rails/app/controllers/concerns/.keep0
-rw-r--r--rails/app/controllers/lingo/application_controller.rb5
-rw-r--r--rails/app/controllers/lingo/scores_controller.rb25
-rw-r--r--rails/app/helpers/lingo/application_helper.rb4
-rw-r--r--rails/app/helpers/lingo/scores_helper.rb4
-rw-r--r--rails/app/jobs/lingo/application_job.rb4
-rw-r--r--rails/app/mailers/lingo/application_mailer.rb6
-rw-r--r--rails/app/models/concerns/.keep0
-rw-r--r--rails/app/models/lingo/application_record.rb5
-rw-r--r--rails/app/models/lingo/score.rb4
-rw-r--r--rails/app/views/layouts/lingo/application.html.haml9
-rw-r--r--rails/app/views/lingo/scores/index.html.haml14
17 files changed, 0 insertions, 152 deletions
diff --git a/rails/app/assets/config/lingo_manifest.js b/rails/app/assets/config/lingo_manifest.js deleted file mode 100644 index 32c12fb..0000000 --- a/rails/app/assets/config/lingo_manifest.js +++ /dev/null
@@ -1,2 +0,0 @@
1//= link_directory ../stylesheets/lingo .css
2//= link lingo/header.png
diff --git a/rails/app/assets/images/lingo/.keep b/rails/app/assets/images/lingo/.keep deleted file mode 100644 index e69de29..0000000 --- a/rails/app/assets/images/lingo/.keep +++ /dev/null
diff --git a/rails/app/assets/images/lingo/header.png b/rails/app/assets/images/lingo/header.png deleted file mode 100644 index 9384865..0000000 --- a/rails/app/assets/images/lingo/header.png +++ /dev/null
Binary files differ
diff --git a/rails/app/assets/stylesheets/lingo/application.css b/rails/app/assets/stylesheets/lingo/application.css deleted file mode 100644 index 0ebd7fe..0000000 --- a/rails/app/assets/stylesheets/lingo/application.css +++ /dev/null
@@ -1,15 +0,0 @@
1/*
2 * This is a manifest file that'll be compiled into application.css, which will include all the files
3 * listed below.
4 *
5 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7 *
8 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10 * files in this directory. Styles in this file should be added after the last require_* statement.
11 * It is generally better to create a new file per style scope.
12 *
13 *= require_tree .
14 *= require_self
15 */
diff --git a/rails/app/assets/stylesheets/lingo/main.css.scss b/rails/app/assets/stylesheets/lingo/main.css.scss deleted file mode 100644 index a65cd94..0000000 --- a/rails/app/assets/stylesheets/lingo/main.css.scss +++ /dev/null
@@ -1,55 +0,0 @@
1body {
2 background-color: black;
3 color: white;
4 font-family: sans-serif;
5}
6
7#header {
8 width: 100%;
9
10 img {
11 max-width: 80%;
12 margin: 0 auto;
13 display: block;
14 }
15}
16
17h2 {
18 text-align: center;
19}
20
21#scores {
22 margin: 0 auto;
23 border-spacing: 0px;
24 tr {
25 &.even {
26 background-color: gray;
27 }
28 &.odd {
29 background-color: purple;
30 }
31 th {
32 text-align: left;
33 padding-left: 0.5em;
34 padding-bottom: 0.5em;
35 }
36 td {
37 padding-right: 1em;
38 padding-top: 0.5em;
39 padding-bottom: 0.5em;
40 border-collapse: collapse;
41 &:first-child {
42 padding-left: 1em;
43 }
44 img {
45 width: 2em;
46 }
47 &.score-pfp {
48 width: 2em;
49 }
50 &.score-value {
51 text-align: center;
52 }
53 }
54 }
55} \ No newline at end of file
diff --git a/rails/app/controllers/concerns/.keep b/rails/app/controllers/concerns/.keep deleted file mode 100644 index e69de29..0000000 --- a/rails/app/controllers/concerns/.keep +++ /dev/null
diff --git a/rails/app/controllers/lingo/application_controller.rb b/rails/app/controllers/lingo/application_controller.rb deleted file mode 100644 index 08b728f..0000000 --- a/rails/app/controllers/lingo/application_controller.rb +++ /dev/null
@@ -1,5 +0,0 @@
1module Lingo
2 class ApplicationController < ActionController::Base
3 protect_from_forgery with: :exception
4 end
5end
diff --git a/rails/app/controllers/lingo/scores_controller.rb b/rails/app/controllers/lingo/scores_controller.rb deleted file mode 100644 index 59bbd9d..0000000 --- a/rails/app/controllers/lingo/scores_controller.rb +++ /dev/null
@@ -1,25 +0,0 @@
1module Lingo
2 class ScoresController < ApplicationController
3 skip_before_action :verify_authenticity_token, only: [:update]
4
5 def index
6 @scores = Score.order(score: :desc)
7 end
8
9 def update
10 if params[:secret_code] != Lingo.secret_code then
11 head :unauthorized
12 else
13 score = Score.find_or_create_by(user_id: params[:user_id]) do |score|
14 score.score = 0
15 end
16 score.username = params[:username]
17 score.avatar_url = CGI.unescape(params[:avatar_url])
18 score.score += 1
19 score.save!
20
21 head :created
22 end
23 end
24 end
25end
diff --git a/rails/app/helpers/lingo/application_helper.rb b/rails/app/helpers/lingo/application_helper.rb deleted file mode 100644 index 4d30003..0000000 --- a/rails/app/helpers/lingo/application_helper.rb +++ /dev/null
@@ -1,4 +0,0 @@
1module Lingo
2 module ApplicationHelper
3 end
4end
diff --git a/rails/app/helpers/lingo/scores_helper.rb b/rails/app/helpers/lingo/scores_helper.rb deleted file mode 100644 index 53b0031..0000000 --- a/rails/app/helpers/lingo/scores_helper.rb +++ /dev/null
@@ -1,4 +0,0 @@
1module Lingo
2 module ScoresHelper
3 end
4end
diff --git a/rails/app/jobs/lingo/application_job.rb b/rails/app/jobs/lingo/application_job.rb deleted file mode 100644 index 1dfcb44..0000000 --- a/rails/app/jobs/lingo/application_job.rb +++ /dev/null
@@ -1,4 +0,0 @@
1module Lingo
2 class ApplicationJob < ActiveJob::Base
3 end
4end
diff --git a/rails/app/mailers/lingo/application_mailer.rb b/rails/app/mailers/lingo/application_mailer.rb deleted file mode 100644 index b86b722..0000000 --- a/rails/app/mailers/lingo/application_mailer.rb +++ /dev/null
@@ -1,6 +0,0 @@
1module Lingo
2 class ApplicationMailer < ActionMailer::Base
3 default from: "from@example.com"
4 layout "mailer"
5 end
6end
diff --git a/rails/app/models/concerns/.keep b/rails/app/models/concerns/.keep deleted file mode 100644 index e69de29..0000000 --- a/rails/app/models/concerns/.keep +++ /dev/null
diff --git a/rails/app/models/lingo/application_record.rb b/rails/app/models/lingo/application_record.rb deleted file mode 100644 index 21a1824..0000000 --- a/rails/app/models/lingo/application_record.rb +++ /dev/null
@@ -1,5 +0,0 @@
1module Lingo
2 class ApplicationRecord < ActiveRecord::Base
3 self.abstract_class = true
4 end
5end
diff --git a/rails/app/models/lingo/score.rb b/rails/app/models/lingo/score.rb deleted file mode 100644 index 6df7dfb..0000000 --- a/rails/app/models/lingo/score.rb +++ /dev/null
@@ -1,4 +0,0 @@
1module Lingo
2 class Score < ApplicationRecord
3 end
4end
diff --git a/rails/app/views/layouts/lingo/application.html.haml b/rails/app/views/layouts/lingo/application.html.haml deleted file mode 100644 index 6731e5a..0000000 --- a/rails/app/views/layouts/lingo/application.html.haml +++ /dev/null
@@ -1,9 +0,0 @@
1!!! 5
2%html
3 %head
4 %title LINGO Bot Scoreboard
5 = stylesheet_link_tag "lingo/application", media: "all"
6 = csrf_meta_tags
7 %body
8 #header= image_tag "lingo/header.png"
9 #content= yield
diff --git a/rails/app/views/lingo/scores/index.html.haml b/rails/app/views/lingo/scores/index.html.haml deleted file mode 100644 index afcd0c7..0000000 --- a/rails/app/views/lingo/scores/index.html.haml +++ /dev/null
@@ -1,14 +0,0 @@
1%h2 Bot Puzzles Scoreboard
2%table#scores
3 %tr.scores-header
4 %th
5 %th{colspan: 2} Player
6 %th Score
7 - @scores.each_with_index do |score,index|
8 %tr{class: cycle("even", "odd")}
9 %td.score-index #{index+1}.
10 %td.score-pfp
11 - if !score.avatar_url.nil?
12 = image_tag score.avatar_url
13 %td.score-name= score.username
14 %td.score-value= score.score