[Rails] Site internet de la World Tartiflette Tour.
First commit.
Changed files
- .dockerignore
- .gitattributes
- .gitignore
- .kamal/hooks/docker-setup.sample
- .kamal/hooks/post-deploy.sample
- .kamal/hooks/post-proxy-reboot.sample
- .kamal/hooks/pre-build.sample
- .kamal/hooks/pre-connect.sample
- .kamal/hooks/pre-deploy.sample
- .kamal/hooks/pre-proxy-reboot.sample
- .kamal/secrets
- .rubocop.yml
- .ruby-version
- Dockerfile
- Gemfile
- Gemfile.lock
- README.md
- Rakefile
- app/assets/images/.keep
- app/assets/images/blason_Savoie.png
- app/assets/stylesheets/application.css
- app/assets/stylesheets/components/code_of_honor.css
- app/assets/stylesheets/components/footer.css
- app/assets/stylesheets/components/nav_top.css
- app/assets/stylesheets/components/notifications.css
- app/assets/stylesheets/pages/home.css
- app/channels/application_cable/connection.rb
- app/controllers/admin/dashboard_controller.rb
- app/controllers/admin/scores_controller.rb
- app/controllers/application_controller.rb
- app/controllers/code_of_honor_controller.rb
- app/controllers/concerns/.keep
- app/controllers/concerns/authentication.rb
- app/controllers/home_controller.rb
- app/controllers/passwords_controller.rb
- app/controllers/registrations_controller.rb
- app/controllers/scores_controller.rb
- app/controllers/sessions_controller.rb
- app/controllers/tartiflettes_controller.rb
- app/helpers/application_helper.rb
- app/helpers/home_helper.rb
- app/jobs/application_job.rb
- app/mailers/application_mailer.rb
- app/mailers/passwords_mailer.rb
- app/models/application_record.rb
- app/models/concerns/.keep
- app/models/current.rb
- app/models/score.rb
- app/models/scoring_criterium.rb
- app/models/session.rb
- app/models/tartiflette.rb
- app/models/user.rb
- app/services/tartiflette_score_export_service.rb
- app/services/tartiflette_scoring_service.rb
- app/views/admin/dashboard/index.html.erb
- app/views/admin/dashboard/tmp
- app/views/home/_code_of_honor.html.erb
- app/views/home/index.html.erb
- app/views/layouts/_footer.html.erb
- app/views/layouts/_notifications.html.erb
- app/views/layouts/_topnav.html.erb
- app/views/layouts/application.html.erb
- app/views/layouts/mailer.html.erb
- app/views/layouts/mailer.text.erb
- app/views/passwords/edit.html.erb
- app/views/passwords/new.html.erb
- app/views/passwords_mailer/reset.html.erb
- app/views/passwords_mailer/reset.text.erb
- app/views/pwa/manifest.json.erb
- app/views/pwa/service-worker.js
- app/views/registrations/new.html.erb
- app/views/scores/_form.html.erb
- app/views/scores/edit_all.html.erb
- app/views/scores/new.html.erb
- app/views/sessions/new.html.erb
- app/views/tartiflettes/index.html.erb
- app/views/tartiflettes/show.html.erb
- bin/brakeman
- bin/dev
- bin/docker-entrypoint
- bin/rails
- bin/rake
- bin/rubocop
- bin/setup
- bin/thrust
- config.ru
- config/application.rb
- config/boot.rb
- config/cable.yml
- config/credentials.yml.enc
- config/database.yml
- config/deploy.yml
- config/environment.rb
- config/environments/development.rb
- config/environments/production.rb
- config/environments/test.rb
- config/initializers/assets.rb
- config/initializers/content_security_policy.rb
- config/initializers/filter_parameter_logging.rb
- config/initializers/inflections.rb
- config/locales/en.yml
- config/puma.rb
- config/routes.rb
- config/storage.yml
- db/migrate/20241226110255_create_tartiflettes.rb
- db/migrate/20241226113752_create_scores.rb
- db/migrate/20241226113815_create_scoring_criteria.rb
- db/migrate/20241227180909_create_users.rb
- db/migrate/20241227180910_create_sessions.rb
- db/migrate/20241227181134_add_admin_to_users.rb
- db/schema.rb
- db/seeds.rb
- lib/tasks/.keep
- log/.keep
- public/400.html
- public/404.html
- public/406-unsupported-browser.html
- public/422.html
- public/500.html
- public/icon.png
- public/icon.svg
- public/robots.txt
- script/.keep
- storage/.keep
- test/application_system_test_case.rb
- test/controllers/.keep
- test/controllers/home_controller_test.rb
- test/controllers/scores_controller_test.rb
- test/fixtures/files/.keep
- test/fixtures/scores.yml
- test/fixtures/scoring_criteria.yml
- test/fixtures/tartiflettes.yml
- test/fixtures/users.yml
- test/helpers/.keep
- test/integration/.keep
- test/mailers/.keep
- test/mailers/previews/passwords_mailer_preview.rb
- test/models/.keep
- test/models/score_test.rb
- test/models/scoring_criterium_test.rb
- test/models/tartiflette_test.rb
- test/models/user_test.rb
- test/services/tartiflette_scoring_service.rb
- test/system/.keep
- test/test_helper.rb
- tmp/.keep
- tmp/pids/.keep
- tmp/storage/.keep
- vendor/.gitignore
- vendor/.keep
.dockerignore
@@ -0,0 +1,47 @@
1
Added:
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2
Added:
3
Added:
# Ignore git directory.
4
Added:
/.git/
5
Added:
/.gitignore
6
Added:
7
Added:
# Ignore bundler config.
8
Added:
/.bundle
9
Added:
10
Added:
# Ignore all environment files.
11
Added:
/.env*
12
Added:
13
Added:
# Ignore all default key files.
14
Added:
/config/master.key
15
Added:
/config/credentials/*.key
16
Added:
17
Added:
# Ignore all logfiles and tempfiles.
18
Added:
/log/*
19
Added:
/tmp/*
20
Added:
!/log/.keep
21
Added:
!/tmp/.keep
22
Added:
23
Added:
# Ignore pidfiles, but keep the directory.
24
Added:
/tmp/pids/*
25
Added:
!/tmp/pids/.keep
26
Added:
27
Added:
# Ignore storage (uploaded files in development and any SQLite databases).
28
Added:
/storage/*
29
Added:
!/storage/.keep
30
Added:
/tmp/storage/*
31
Added:
!/tmp/storage/.keep
32
Added:
33
Added:
# Ignore assets.
34
Added:
/node_modules/
35
Added:
/app/assets/builds/*
36
Added:
!/app/assets/builds/.keep
37
Added:
/public/assets
38
Added:
39
Added:
# Ignore CI service files.
40
Added:
/.github
41
Added:
42
Added:
# Ignore development files
43
Added:
/.devcontainer
44
Added:
45
Added:
# Ignore Docker-related files
46
Added:
/.dockerignore
47
Added:
/Dockerfile*
.gitattributes
@@ -0,0 +1,9 @@
1
Added:
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
2
Added:
3
Added:
# Mark the database schema as having been generated.
4
Added:
db/schema.rb linguist-generated
5
Added:
6
Added:
# Mark any vendored files as having been vendored.
7
Added:
vendor/* linguist-vendored
8
Added:
config/credentials/*.yml.enc diff=rails_credentials
9
Added:
config/credentials.yml.enc diff=rails_credentials
.gitignore
@@ -0,0 +1,34 @@
1
Added:
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
Added:
#
3
Added:
# Temporary files generated by your text editor or operating system
4
Added:
# belong in git's global ignore instead:
5
Added:
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`
6
Added:
7
Added:
# Ignore bundler config.
8
Added:
/.bundle
9
Added:
10
Added:
# Ignore all environment files.
11
Added:
/.env*
12
Added:
13
Added:
# Ignore all logfiles and tempfiles.
14
Added:
/log/*
15
Added:
/tmp/*
16
Added:
!/log/.keep
17
Added:
!/tmp/.keep
18
Added:
19
Added:
# Ignore pidfiles, but keep the directory.
20
Added:
/tmp/pids/*
21
Added:
!/tmp/pids/
22
Added:
!/tmp/pids/.keep
23
Added:
24
Added:
# Ignore storage (uploaded files in development and any SQLite databases).
25
Added:
/storage/*
26
Added:
!/storage/.keep
27
Added:
/tmp/storage/*
28
Added:
!/tmp/storage/
29
Added:
!/tmp/storage/.keep
30
Added:
31
Added:
/public/assets
32
Added:
33
Added:
# Ignore master key for decrypting credentials and more.
34
Added:
/config/master.key
.kamal/hooks/docker-setup.sample
@@ -0,0 +1,3 @@
1
Added:
#!/bin/sh
2
Added:
3
Added:
echo "Docker set up on $KAMAL_HOSTS..."
.kamal/hooks/post-deploy.sample
@@ -0,0 +1,14 @@
1
Added:
#!/bin/sh
2
Added:
3
Added:
# A sample post-deploy hook
4
Added:
#
5
Added:
# These environment variables are available:
6
Added:
# KAMAL_RECORDED_AT
7
Added:
# KAMAL_PERFORMER
8
Added:
# KAMAL_VERSION
9
Added:
# KAMAL_HOSTS
10
Added:
# KAMAL_ROLE (if set)
11
Added:
# KAMAL_DESTINATION (if set)
12
Added:
# KAMAL_RUNTIME
13
Added:
14
Added:
echo "$KAMAL_PERFORMER deployed $KAMAL_VERSION to $KAMAL_DESTINATION in $KAMAL_RUNTIME seconds"
.kamal/hooks/post-proxy-reboot.sample
@@ -0,0 +1,3 @@
1
Added:
#!/bin/sh
2
Added:
3
Added:
echo "Rebooted kamal-proxy on $KAMAL_HOSTS"
.kamal/hooks/pre-build.sample
@@ -0,0 +1,51 @@
1
Added:
#!/bin/sh
2
Added:
3
Added:
# A sample pre-build hook
4
Added:
#
5
Added:
# Checks:
6
Added:
# 1. We have a clean checkout
7
Added:
# 2. A remote is configured
8
Added:
# 3. The branch has been pushed to the remote
9
Added:
# 4. The version we are deploying matches the remote
10
Added:
#
11
Added:
# These environment variables are available:
12
Added:
# KAMAL_RECORDED_AT
13
Added:
# KAMAL_PERFORMER
14
Added:
# KAMAL_VERSION
15
Added:
# KAMAL_HOSTS
16
Added:
# KAMAL_ROLE (if set)
17
Added:
# KAMAL_DESTINATION (if set)
18
Added:
19
Added:
if [ -n "$(git status --porcelain)" ]; then
20
Added:
echo "Git checkout is not clean, aborting..." >&2
21
Added:
git status --porcelain >&2
22
Added:
exit 1
23
Added:
fi
24
Added:
25
Added:
first_remote=$(git remote)
26
Added:
27
Added:
if [ -z "$first_remote" ]; then
28
Added:
echo "No git remote set, aborting..." >&2
29
Added:
exit 1
30
Added:
fi
31
Added:
32
Added:
current_branch=$(git branch --show-current)
33
Added:
34
Added:
if [ -z "$current_branch" ]; then
35
Added:
echo "Not on a git branch, aborting..." >&2
36
Added:
exit 1
37
Added:
fi
38
Added:
39
Added:
remote_head=$(git ls-remote $first_remote --tags $current_branch | cut -f1)
40
Added:
41
Added:
if [ -z "$remote_head" ]; then
42
Added:
echo "Branch not pushed to remote, aborting..." >&2
43
Added:
exit 1
44
Added:
fi
45
Added:
46
Added:
if [ "$KAMAL_VERSION" != "$remote_head" ]; then
47
Added:
echo "Version ($KAMAL_VERSION) does not match remote HEAD ($remote_head), aborting..." >&2
48
Added:
exit 1
49
Added:
fi
50
Added:
51
Added:
exit 0
.kamal/hooks/pre-connect.sample
@@ -0,0 +1,47 @@
1
Added:
#!/usr/bin/env ruby
2
Added:
3
Added:
# A sample pre-connect check
4
Added:
#
5
Added:
# Warms DNS before connecting to hosts in parallel
6
Added:
#
7
Added:
# These environment variables are available:
8
Added:
# KAMAL_RECORDED_AT
9
Added:
# KAMAL_PERFORMER
10
Added:
# KAMAL_VERSION
11
Added:
# KAMAL_HOSTS
12
Added:
# KAMAL_ROLE (if set)
13
Added:
# KAMAL_DESTINATION (if set)
14
Added:
# KAMAL_RUNTIME
15
Added:
16
Added:
hosts = ENV["KAMAL_HOSTS"].split(",")
17
Added:
results = nil
18
Added:
max = 3
19
Added:
20
Added:
elapsed = Benchmark.realtime do
21
Added:
results = hosts.map do |host|
22
Added:
Thread.new do
23
Added:
tries = 1
24
Added:
25
Added:
begin
26
Added:
Socket.getaddrinfo(host, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
27
Added:
rescue SocketError
28
Added:
if tries < max
29
Added:
puts "Retrying DNS warmup: #{host}"
30
Added:
tries += 1
31
Added:
sleep rand
32
Added:
retry
33
Added:
else
34
Added:
puts "DNS warmup failed: #{host}"
35
Added:
host
36
Added:
end
37
Added:
end
38
Added:
39
Added:
tries
40
Added:
end
41
Added:
end.map(&:value)
42
Added:
end
43
Added:
44
Added:
retries = results.sum - hosts.size
45
Added:
nopes = results.count { |r| r == max }
46
Added:
47
Added:
puts "Prewarmed %d DNS lookups in %.2f sec: %d retries, %d failures" % [ hosts.size, elapsed, retries, nopes ]
.kamal/hooks/pre-deploy.sample
@@ -0,0 +1,109 @@
1
Added:
#!/usr/bin/env ruby
2
Added:
3
Added:
# A sample pre-deploy hook
4
Added:
#
5
Added:
# Checks the Github status of the build, waiting for a pending build to complete for up to 720 seconds.
6
Added:
#
7
Added:
# Fails unless the combined status is "success"
8
Added:
#
9
Added:
# These environment variables are available:
10
Added:
# KAMAL_RECORDED_AT
11
Added:
# KAMAL_PERFORMER
12
Added:
# KAMAL_VERSION
13
Added:
# KAMAL_HOSTS
14
Added:
# KAMAL_COMMAND
15
Added:
# KAMAL_SUBCOMMAND
16
Added:
# KAMAL_ROLE (if set)
17
Added:
# KAMAL_DESTINATION (if set)
18
Added:
19
Added:
# Only check the build status for production deployments
20
Added:
if ENV["KAMAL_COMMAND"] == "rollback" || ENV["KAMAL_DESTINATION"] != "production"
21
Added:
exit 0
22
Added:
end
23
Added:
24
Added:
require "bundler/inline"
25
Added:
26
Added:
# true = install gems so this is fast on repeat invocations
27
Added:
gemfile(true, quiet: true) do
28
Added:
source "https://rubygems.org"
29
Added:
30
Added:
gem "octokit"
31
Added:
gem "faraday-retry"
32
Added:
end
33
Added:
34
Added:
MAX_ATTEMPTS = 72
35
Added:
ATTEMPTS_GAP = 10
36
Added:
37
Added:
def exit_with_error(message)
38
Added:
$stderr.puts message
39
Added:
exit 1
40
Added:
end
41
Added:
42
Added:
class GithubStatusChecks
43
Added:
attr_reader :remote_url, :git_sha, :github_client, :combined_status
44
Added:
45
Added:
def initialize
46
Added:
@remote_url = `git config --get remote.origin.url`.strip.delete_prefix("https://github.com/")
47
Added:
@git_sha = `git rev-parse HEAD`.strip
48
Added:
@github_client = Octokit::Client.new(access_token: ENV["GITHUB_TOKEN"])
49
Added:
refresh!
50
Added:
end
51
Added:
52
Added:
def refresh!
53
Added:
@combined_status = github_client.combined_status(remote_url, git_sha)
54
Added:
end
55
Added:
56
Added:
def state
57
Added:
combined_status[:state]
58
Added:
end
59
Added:
60
Added:
def first_status_url
61
Added:
first_status = combined_status[:statuses].find { |status| status[:state] == state }
62
Added:
first_status && first_status[:target_url]
63
Added:
end
64
Added:
65
Added:
def complete_count
66
Added:
combined_status[:statuses].count { |status| status[:state] != "pending"}
67
Added:
end
68
Added:
69
Added:
def total_count
70
Added:
combined_status[:statuses].count
71
Added:
end
72
Added:
73
Added:
def current_status
74
Added:
if total_count > 0
75
Added:
"Completed #{complete_count}/#{total_count} checks, see #{first_status_url} ..."
76
Added:
else
77
Added:
"Build not started..."
78
Added:
end
79
Added:
end
80
Added:
end
81
Added:
82
Added:
83
Added:
$stdout.sync = true
84
Added:
85
Added:
puts "Checking build status..."
86
Added:
attempts = 0
87
Added:
checks = GithubStatusChecks.new
88
Added:
89
Added:
begin
90
Added:
loop do
91
Added:
case checks.state
92
Added:
when "success"
93
Added:
puts "Checks passed, see #{checks.first_status_url}"
94
Added:
exit 0
95
Added:
when "failure"
96
Added:
exit_with_error "Checks failed, see #{checks.first_status_url}"
97
Added:
when "pending"
98
Added:
attempts += 1
99
Added:
end
100
Added:
101
Added:
exit_with_error "Checks are still pending, gave up after #{MAX_ATTEMPTS * ATTEMPTS_GAP} seconds" if attempts == MAX_ATTEMPTS
102
Added:
103
Added:
puts checks.current_status
104
Added:
sleep(ATTEMPTS_GAP)
105
Added:
checks.refresh!
106
Added:
end
107
Added:
rescue Octokit::NotFound
108
Added:
exit_with_error "Build status could not be found"
109
Added:
end
.kamal/hooks/pre-proxy-reboot.sample
@@ -0,0 +1,3 @@
1
Added:
#!/bin/sh
2
Added:
3
Added:
echo "Rebooting kamal-proxy on $KAMAL_HOSTS..."
.kamal/secrets
@@ -0,0 +1,17 @@
1
Added:
# Secrets defined here are available for reference under registry/password, env/secret, builder/secrets,
2
Added:
# and accessories/*/env/secret in config/deploy.yml. All secrets should be pulled from either
3
Added:
# password manager, ENV, or a file. DO NOT ENTER RAW CREDENTIALS HERE! This file needs to be safe for git.
4
Added:
5
Added:
# Example of extracting secrets from 1password (or another compatible pw manager)
6
Added:
# SECRETS=$(kamal secrets fetch --adapter 1password --account your-account --from Vault/Item KAMAL_REGISTRY_PASSWORD RAILS_MASTER_KEY)
7
Added:
# KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract KAMAL_REGISTRY_PASSWORD ${SECRETS})
8
Added:
# RAILS_MASTER_KEY=$(kamal secrets extract RAILS_MASTER_KEY ${SECRETS})
9
Added:
10
Added:
# Use a GITHUB_TOKEN if private repositories are needed for the image
11
Added:
# GITHUB_TOKEN=$(gh config get -h github.com oauth_token)
12
Added:
13
Added:
# Grab the registry password from ENV
14
Added:
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD
15
Added:
16
Added:
# Improve security by using a password manager. Never check config/master.key into git!
17
Added:
RAILS_MASTER_KEY=$(cat config/master.key)
.rubocop.yml
@@ -0,0 +1,8 @@
1
Added:
# Omakase Ruby styling for Rails
2
Added:
inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3
Added:
4
Added:
# Overwrite or add rules to create your own house style
5
Added:
#
6
Added:
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7
Added:
# Layout/SpaceInsideArrayLiteralBrackets:
8
Added:
# Enabled: false
.ruby-version
@@ -0,0 +1,1 @@
1
Added:
ruby-3.3.6
Dockerfile
@@ -0,0 +1,72 @@
1
Added:
# syntax=docker/dockerfile:1
2
Added:
# check=error=true
3
Added:
4
Added:
# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand:
5
Added:
# docker build -t wtt .
6
Added:
# docker run -d -p 80:80 -e RAILS_MASTER_KEY=<value from config/master.key> --name wtt wtt
7
Added:
8
Added:
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
9
Added:
10
Added:
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
11
Added:
ARG RUBY_VERSION=3.3.6
12
Added:
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
13
Added:
14
Added:
# Rails app lives here
15
Added:
WORKDIR /rails
16
Added:
17
Added:
# Install base packages
18
Added:
RUN apt-get update -qq && \
19
Added:
apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 && \
20
Added:
rm -rf /var/lib/apt/lists /var/cache/apt/archives
21
Added:
22
Added:
# Set production environment
23
Added:
ENV RAILS_ENV="production" \
24
Added:
BUNDLE_DEPLOYMENT="1" \
25
Added:
BUNDLE_PATH="/usr/local/bundle" \
26
Added:
BUNDLE_WITHOUT="development"
27
Added:
28
Added:
# Throw-away build stage to reduce size of final image
29
Added:
FROM base AS build
30
Added:
31
Added:
# Install packages needed to build gems
32
Added:
RUN apt-get update -qq && \
33
Added:
apt-get install --no-install-recommends -y build-essential git pkg-config && \
34
Added:
rm -rf /var/lib/apt/lists /var/cache/apt/archives
35
Added:
36
Added:
# Install application gems
37
Added:
COPY Gemfile Gemfile.lock ./
38
Added:
RUN bundle install && \
39
Added:
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
40
Added:
bundle exec bootsnap precompile --gemfile
41
Added:
42
Added:
# Copy application code
43
Added:
COPY . .
44
Added:
45
Added:
# Precompile bootsnap code for faster boot times
46
Added:
RUN bundle exec bootsnap precompile app/ lib/
47
Added:
48
Added:
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
49
Added:
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
50
Added:
51
Added:
52
Added:
53
Added:
54
Added:
# Final stage for app image
55
Added:
FROM base
56
Added:
57
Added:
# Copy built artifacts: gems, application
58
Added:
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
59
Added:
COPY --from=build /rails /rails
60
Added:
61
Added:
# Run and own only the runtime files as a non-root user for security
62
Added:
RUN groupadd --system --gid 1000 rails && \
63
Added:
useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
64
Added:
chown -R rails:rails db log storage tmp
65
Added:
USER 1000:1000
66
Added:
67
Added:
# Entrypoint prepares the database.
68
Added:
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
69
Added:
70
Added:
# Start server via Thruster by default, this can be overwritten at runtime
71
Added:
EXPOSE 80
72
Added:
CMD ["./bin/thrust", "./bin/rails", "server"]
Gemfile
@@ -0,0 +1,63 @@
1
Added:
source "https://rubygems.org"
2
Added:
3
Added:
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
4
Added:
gem "rails", "~> 8.0.0"
5
Added:
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
6
Added:
gem "propshaft"
7
Added:
# Use sqlite3 as the database for Active Record
8
Added:
gem "sqlite3", ">= 2.1"
9
Added:
# Use the Puma web server [https://github.com/puma/puma]
10
Added:
gem "puma", ">= 5.0"
11
Added:
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
12
Added:
gem "importmap-rails"
13
Added:
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
14
Added:
gem "turbo-rails"
15
Added:
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
16
Added:
gem "stimulus-rails"
17
Added:
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
18
Added:
gem "jbuilder"
19
Added:
20
Added:
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
21
Added:
gem "bcrypt", "~> 3.1.7"
22
Added:
23
Added:
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
24
Added:
gem "tzinfo-data", platforms: %i[ windows jruby ]
25
Added:
26
Added:
# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
27
Added:
gem "solid_cache"
28
Added:
gem "solid_queue"
29
Added:
gem "solid_cable"
30
Added:
31
Added:
# Reduces boot times through caching; required in config/boot.rb
32
Added:
gem "bootsnap", require: false
33
Added:
34
Added:
# Deploy this application anywhere as a Docker container [https://kamal-deploy.org]
35
Added:
gem "kamal", require: false
36
Added:
37
Added:
# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/]
38
Added:
gem "thruster", require: false
39
Added:
40
Added:
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
41
Added:
# gem "image_processing", "~> 1.2"
42
Added:
43
Added:
group :development, :test do
44
Added:
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
45
Added:
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
46
Added:
47
Added:
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
48
Added:
gem "brakeman", require: false
49
Added:
50
Added:
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
51
Added:
gem "rubocop-rails-omakase", require: false
52
Added:
end
53
Added:
54
Added:
group :development do
55
Added:
# Use console on exceptions pages [https://github.com/rails/web-console]
56
Added:
gem "web-console"
57
Added:
end
58
Added:
59
Added:
group :test do
60
Added:
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
61
Added:
gem "capybara"
62
Added:
gem "selenium-webdriver"
63
Added:
end
Gemfile.lock
@@ -0,0 +1,389 @@
1
Added:
GEM
2
Added:
remote: https://rubygems.org/
3
Added:
specs:
4
Added:
actioncable (8.0.1)
5
Added:
actionpack (= 8.0.1)
6
Added:
activesupport (= 8.0.1)
7
Added:
nio4r (~> 2.0)
8
Added:
websocket-driver (>= 0.6.1)
9
Added:
zeitwerk (~> 2.6)
10
Added:
actionmailbox (8.0.1)
11
Added:
actionpack (= 8.0.1)
12
Added:
activejob (= 8.0.1)
13
Added:
activerecord (= 8.0.1)
14
Added:
activestorage (= 8.0.1)
15
Added:
activesupport (= 8.0.1)
16
Added:
mail (>= 2.8.0)
17
Added:
actionmailer (8.0.1)
18
Added:
actionpack (= 8.0.1)
19
Added:
actionview (= 8.0.1)
20
Added:
activejob (= 8.0.1)
21
Added:
activesupport (= 8.0.1)
22
Added:
mail (>= 2.8.0)
23
Added:
rails-dom-testing (~> 2.2)
24
Added:
actionpack (8.0.1)
25
Added:
actionview (= 8.0.1)
26
Added:
activesupport (= 8.0.1)
27
Added:
nokogiri (>= 1.8.5)
28
Added:
rack (>= 2.2.4)
29
Added:
rack-session (>= 1.0.1)
30
Added:
rack-test (>= 0.6.3)
31
Added:
rails-dom-testing (~> 2.2)
32
Added:
rails-html-sanitizer (~> 1.6)
33
Added:
useragent (~> 0.16)
34
Added:
actiontext (8.0.1)
35
Added:
actionpack (= 8.0.1)
36
Added:
activerecord (= 8.0.1)
37
Added:
activestorage (= 8.0.1)
38
Added:
activesupport (= 8.0.1)
39
Added:
globalid (>= 0.6.0)
40
Added:
nokogiri (>= 1.8.5)
41
Added:
actionview (8.0.1)
42
Added:
activesupport (= 8.0.1)
43
Added:
builder (~> 3.1)
44
Added:
erubi (~> 1.11)
45
Added:
rails-dom-testing (~> 2.2)
46
Added:
rails-html-sanitizer (~> 1.6)
47
Added:
activejob (8.0.1)
48
Added:
activesupport (= 8.0.1)
49
Added:
globalid (>= 0.3.6)
50
Added:
activemodel (8.0.1)
51
Added:
activesupport (= 8.0.1)
52
Added:
activerecord (8.0.1)
53
Added:
activemodel (= 8.0.1)
54
Added:
activesupport (= 8.0.1)
55
Added:
timeout (>= 0.4.0)
56
Added:
activestorage (8.0.1)
57
Added:
actionpack (= 8.0.1)
58
Added:
activejob (= 8.0.1)
59
Added:
activerecord (= 8.0.1)
60
Added:
activesupport (= 8.0.1)
61
Added:
marcel (~> 1.0)
62
Added:
activesupport (8.0.1)
63
Added:
base64
64
Added:
benchmark (>= 0.3)
65
Added:
bigdecimal
66
Added:
concurrent-ruby (~> 1.0, >= 1.3.1)
67
Added:
connection_pool (>= 2.2.5)
68
Added:
drb
69
Added:
i18n (>= 1.6, < 2)
70
Added:
logger (>= 1.4.2)
71
Added:
minitest (>= 5.1)
72
Added:
securerandom (>= 0.3)
73
Added:
tzinfo (~> 2.0, >= 2.0.5)
74
Added:
uri (>= 0.13.1)
75
Added:
addressable (2.8.7)
76
Added:
public_suffix (>= 2.0.2, < 7.0)
77
Added:
ast (2.4.2)
78
Added:
base64 (0.2.0)
79
Added:
bcrypt (3.1.20)
80
Added:
bcrypt_pbkdf (1.1.1)
81
Added:
bcrypt_pbkdf (1.1.1-arm64-darwin)
82
Added:
bcrypt_pbkdf (1.1.1-x86_64-darwin)
83
Added:
benchmark (0.4.0)
84
Added:
bigdecimal (3.1.8)
85
Added:
bindex (0.8.1)
86
Added:
bootsnap (1.18.4)
87
Added:
msgpack (~> 1.2)
88
Added:
brakeman (6.2.2)
89
Added:
racc
90
Added:
builder (3.3.0)
91
Added:
capybara (3.40.0)
92
Added:
addressable
93
Added:
matrix
94
Added:
mini_mime (>= 0.1.3)
95
Added:
nokogiri (~> 1.11)
96
Added:
rack (>= 1.6.0)
97
Added:
rack-test (>= 0.6.3)
98
Added:
regexp_parser (>= 1.5, < 3.0)
99
Added:
xpath (~> 3.2)
100
Added:
concurrent-ruby (1.3.4)
101
Added:
connection_pool (2.4.1)
102
Added:
crass (1.0.6)
103
Added:
date (3.4.1)
104
Added:
debug (1.10.0)
105
Added:
irb (~> 1.10)
106
Added:
reline (>= 0.3.8)
107
Added:
dotenv (3.1.7)
108
Added:
drb (2.2.1)
109
Added:
ed25519 (1.3.0)
110
Added:
erubi (1.13.1)
111
Added:
et-orbi (1.2.11)
112
Added:
tzinfo
113
Added:
fugit (1.11.1)
114
Added:
et-orbi (~> 1, >= 1.2.11)
115
Added:
raabro (~> 1.4)
116
Added:
globalid (1.2.1)
117
Added:
activesupport (>= 6.1)
118
Added:
i18n (1.14.6)
119
Added:
concurrent-ruby (~> 1.0)
120
Added:
importmap-rails (2.1.0)
121
Added:
actionpack (>= 6.0.0)
122
Added:
activesupport (>= 6.0.0)
123
Added:
railties (>= 6.0.0)
124
Added:
io-console (0.8.0)
125
Added:
irb (1.14.3)
126
Added:
rdoc (>= 4.0.0)
127
Added:
reline (>= 0.4.2)
128
Added:
jbuilder (2.13.0)
129
Added:
actionview (>= 5.0.0)
130
Added:
activesupport (>= 5.0.0)
131
Added:
json (2.9.1)
132
Added:
kamal (2.4.0)
133
Added:
activesupport (>= 7.0)
134
Added:
base64 (~> 0.2)
135
Added:
bcrypt_pbkdf (~> 1.0)
136
Added:
concurrent-ruby (~> 1.2)
137
Added:
dotenv (~> 3.1)
138
Added:
ed25519 (~> 1.2)
139
Added:
net-ssh (~> 7.3)
140
Added:
sshkit (>= 1.23.0, < 2.0)
141
Added:
thor (~> 1.3)
142
Added:
zeitwerk (>= 2.6.18, < 3.0)
143
Added:
language_server-protocol (3.17.0.3)
144
Added:
logger (1.6.4)
145
Added:
loofah (2.23.1)
146
Added:
crass (~> 1.0.2)
147
Added:
nokogiri (>= 1.12.0)
148
Added:
mail (2.8.1)
149
Added:
mini_mime (>= 0.1.1)
150
Added:
net-imap
151
Added:
net-pop
152
Added:
net-smtp
153
Added:
marcel (1.0.4)
154
Added:
matrix (0.4.2)
155
Added:
mini_mime (1.1.5)
156
Added:
minitest (5.25.4)
157
Added:
msgpack (1.7.5)
158
Added:
net-imap (0.5.4)
159
Added:
date
160
Added:
net-protocol
161
Added:
net-pop (0.1.2)
162
Added:
net-protocol
163
Added:
net-protocol (0.2.2)
164
Added:
timeout
165
Added:
net-scp (4.0.0)
166
Added:
net-ssh (>= 2.6.5, < 8.0.0)
167
Added:
net-sftp (4.0.0)
168
Added:
net-ssh (>= 5.0.0, < 8.0.0)
169
Added:
net-smtp (0.5.0)
170
Added:
net-protocol
171
Added:
net-ssh (7.3.0)
172
Added:
nio4r (2.7.4)
173
Added:
nokogiri (1.17.2-aarch64-linux)
174
Added:
racc (~> 1.4)
175
Added:
nokogiri (1.17.2-arm-linux)
176
Added:
racc (~> 1.4)
177
Added:
nokogiri (1.17.2-arm64-darwin)
178
Added:
racc (~> 1.4)
179
Added:
nokogiri (1.17.2-x86-linux)
180
Added:
racc (~> 1.4)
181
Added:
nokogiri (1.17.2-x86_64-darwin)
182
Added:
racc (~> 1.4)
183
Added:
nokogiri (1.17.2-x86_64-linux)
184
Added:
racc (~> 1.4)
185
Added:
ostruct (0.6.1)
186
Added:
parallel (1.26.3)
187
Added:
parser (3.3.6.0)
188
Added:
ast (~> 2.4.1)
189
Added:
racc
190
Added:
propshaft (1.1.0)
191
Added:
actionpack (>= 7.0.0)
192
Added:
activesupport (>= 7.0.0)
193
Added:
rack
194
Added:
railties (>= 7.0.0)
195
Added:
psych (5.2.2)
196
Added:
date
197
Added:
stringio
198
Added:
public_suffix (6.0.1)
199
Added:
puma (6.5.0)
200
Added:
nio4r (~> 2.0)
201
Added:
raabro (1.4.0)
202
Added:
racc (1.8.1)
203
Added:
rack (3.1.8)
204
Added:
rack-session (2.0.0)
205
Added:
rack (>= 3.0.0)
206
Added:
rack-test (2.2.0)
207
Added:
rack (>= 1.3)
208
Added:
rackup (2.2.1)
209
Added:
rack (>= 3)
210
Added:
rails (8.0.1)
211
Added:
actioncable (= 8.0.1)
212
Added:
actionmailbox (= 8.0.1)
213
Added:
actionmailer (= 8.0.1)
214
Added:
actionpack (= 8.0.1)
215
Added:
actiontext (= 8.0.1)
216
Added:
actionview (= 8.0.1)
217
Added:
activejob (= 8.0.1)
218
Added:
activemodel (= 8.0.1)
219
Added:
activerecord (= 8.0.1)
220
Added:
activestorage (= 8.0.1)
221
Added:
activesupport (= 8.0.1)
222
Added:
bundler (>= 1.15.0)
223
Added:
railties (= 8.0.1)
224
Added:
rails-dom-testing (2.2.0)
225
Added:
activesupport (>= 5.0.0)
226
Added:
minitest
227
Added:
nokogiri (>= 1.6)
228
Added:
rails-html-sanitizer (1.6.2)
229
Added:
loofah (~> 2.21)
230
Added:
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
231
Added:
railties (8.0.1)
232
Added:
actionpack (= 8.0.1)
233
Added:
activesupport (= 8.0.1)
234
Added:
irb (~> 1.13)
235
Added:
rackup (>= 1.0.0)
236
Added:
rake (>= 12.2)
237
Added:
thor (~> 1.0, >= 1.2.2)
238
Added:
zeitwerk (~> 2.6)
239
Added:
rainbow (3.1.1)
240
Added:
rake (13.2.1)
241
Added:
rdoc (6.10.0)
242
Added:
psych (>= 4.0.0)
243
Added:
regexp_parser (2.9.3)
244
Added:
reline (0.6.0)
245
Added:
io-console (~> 0.5)
246
Added:
rexml (3.4.0)
247
Added:
rubocop (1.69.2)
248
Added:
json (~> 2.3)
249
Added:
language_server-protocol (>= 3.17.0)
250
Added:
parallel (~> 1.10)
251
Added:
parser (>= 3.3.0.2)
252
Added:
rainbow (>= 2.2.2, < 4.0)
253
Added:
regexp_parser (>= 2.9.3, < 3.0)
254
Added:
rubocop-ast (>= 1.36.2, < 2.0)
255
Added:
ruby-progressbar (~> 1.7)
256
Added:
unicode-display_width (>= 2.4.0, < 4.0)
257
Added:
rubocop-ast (1.37.0)
258
Added:
parser (>= 3.3.1.0)
259
Added:
rubocop-minitest (0.36.0)
260
Added:
rubocop (>= 1.61, < 2.0)
261
Added:
rubocop-ast (>= 1.31.1, < 2.0)
262
Added:
rubocop-performance (1.23.0)
263
Added:
rubocop (>= 1.48.1, < 2.0)
264
Added:
rubocop-ast (>= 1.31.1, < 2.0)
265
Added:
rubocop-rails (2.27.0)
266
Added:
activesupport (>= 4.2.0)
267
Added:
rack (>= 1.1)
268
Added:
rubocop (>= 1.52.0, < 2.0)
269
Added:
rubocop-ast (>= 1.31.1, < 2.0)
270
Added:
rubocop-rails-omakase (1.0.0)
271
Added:
rubocop
272
Added:
rubocop-minitest
273
Added:
rubocop-performance
274
Added:
rubocop-rails
275
Added:
ruby-progressbar (1.13.0)
276
Added:
rubyzip (2.3.2)
277
Added:
securerandom (0.4.1)
278
Added:
selenium-webdriver (4.27.0)
279
Added:
base64 (~> 0.2)
280
Added:
logger (~> 1.4)
281
Added:
rexml (~> 3.2, >= 3.2.5)
282
Added:
rubyzip (>= 1.2.2, < 3.0)
283
Added:
websocket (~> 1.0)
284
Added:
solid_cable (3.0.5)
285
Added:
actioncable (>= 7.2)
286
Added:
activejob (>= 7.2)
287
Added:
activerecord (>= 7.2)
288
Added:
railties (>= 7.2)
289
Added:
solid_cache (1.0.6)
290
Added:
activejob (>= 7.2)
291
Added:
activerecord (>= 7.2)
292
Added:
railties (>= 7.2)
293
Added:
solid_queue (1.1.0)
294
Added:
activejob (>= 7.1)
295
Added:
activerecord (>= 7.1)
296
Added:
concurrent-ruby (>= 1.3.1)
297
Added:
fugit (~> 1.11.0)
298
Added:
railties (>= 7.1)
299
Added:
thor (~> 1.3.1)
300
Added:
sqlite3 (2.4.1-aarch64-linux-gnu)
301
Added:
sqlite3 (2.4.1-aarch64-linux-musl)
302
Added:
sqlite3 (2.4.1-arm-linux-gnu)
303
Added:
sqlite3 (2.4.1-arm-linux-musl)
304
Added:
sqlite3 (2.4.1-arm64-darwin)
305
Added:
sqlite3 (2.4.1-x86-linux-gnu)
306
Added:
sqlite3 (2.4.1-x86-linux-musl)
307
Added:
sqlite3 (2.4.1-x86_64-darwin)
308
Added:
sqlite3 (2.4.1-x86_64-linux-gnu)
309
Added:
sqlite3 (2.4.1-x86_64-linux-musl)
310
Added:
sshkit (1.23.2)
311
Added:
base64
312
Added:
net-scp (>= 1.1.2)
313
Added:
net-sftp (>= 2.1.2)
314
Added:
net-ssh (>= 2.8.0)
315
Added:
ostruct
316
Added:
stimulus-rails (1.3.4)
317
Added:
railties (>= 6.0.0)
318
Added:
stringio (3.1.2)
319
Added:
thor (1.3.2)
320
Added:
thruster (0.1.9)
321
Added:
thruster (0.1.9-aarch64-linux)
322
Added:
thruster (0.1.9-arm64-darwin)
323
Added:
thruster (0.1.9-x86_64-darwin)
324
Added:
thruster (0.1.9-x86_64-linux)
325
Added:
timeout (0.4.3)
326
Added:
turbo-rails (2.0.11)
327
Added:
actionpack (>= 6.0.0)
328
Added:
railties (>= 6.0.0)
329
Added:
tzinfo (2.0.6)
330
Added:
concurrent-ruby (~> 1.0)
331
Added:
unicode-display_width (3.1.2)
332
Added:
unicode-emoji (~> 4.0, >= 4.0.4)
333
Added:
unicode-emoji (4.0.4)
334
Added:
uri (1.0.2)
335
Added:
useragent (0.16.11)
336
Added:
web-console (4.2.1)
337
Added:
actionview (>= 6.0.0)
338
Added:
activemodel (>= 6.0.0)
339
Added:
bindex (>= 0.4.0)
340
Added:
railties (>= 6.0.0)
341
Added:
websocket (1.2.11)
342
Added:
websocket-driver (0.7.6)
343
Added:
websocket-extensions (>= 0.1.0)
344
Added:
websocket-extensions (0.1.5)
345
Added:
xpath (3.2.0)
346
Added:
nokogiri (~> 1.8)
347
Added:
zeitwerk (2.7.1)
348
Added:
349
Added:
PLATFORMS
350
Added:
aarch64-linux
351
Added:
aarch64-linux-gnu
352
Added:
aarch64-linux-musl
353
Added:
arm-linux
354
Added:
arm-linux-gnu
355
Added:
arm-linux-musl
356
Added:
arm64-darwin
357
Added:
x86-linux
358
Added:
x86-linux-gnu
359
Added:
x86-linux-musl
360
Added:
x86_64-darwin
361
Added:
x86_64-linux-gnu
362
Added:
x86_64-linux-musl
363
Added:
364
Added:
DEPENDENCIES
365
Added:
bcrypt (~> 3.1.7)
366
Added:
bootsnap
367
Added:
brakeman
368
Added:
capybara
369
Added:
debug
370
Added:
importmap-rails
371
Added:
jbuilder
372
Added:
kamal
373
Added:
propshaft
374
Added:
puma (>= 5.0)
375
Added:
rails (~> 8.0.0)
376
Added:
rubocop-rails-omakase
377
Added:
selenium-webdriver
378
Added:
solid_cable
379
Added:
solid_cache
380
Added:
solid_queue
381
Added:
sqlite3 (>= 2.1)
382
Added:
stimulus-rails
383
Added:
thruster
384
Added:
turbo-rails
385
Added:
tzinfo-data
386
Added:
web-console
387
Added:
388
Added:
BUNDLED WITH
389
Added:
2.5.23
README.md
@@ -0,0 +1,24 @@
1
Added:
# README
2
Added:
3
Added:
This README would normally document whatever steps are necessary to get the
4
Added:
application up and running.
5
Added:
6
Added:
Things you may want to cover:
7
Added:
8
Added:
* Ruby version
9
Added:
10
Added:
* System dependencies
11
Added:
12
Added:
* Configuration
13
Added:
14
Added:
* Database creation
15
Added:
16
Added:
* Database initialization
17
Added:
18
Added:
* How to run the test suite
19
Added:
20
Added:
* Services (job queues, cache servers, search engines, etc.)
21
Added:
22
Added:
* Deployment instructions
23
Added:
24
Added:
* ...
Rakefile
@@ -0,0 +1,6 @@
1
Added:
# Add your own tasks in files placed in lib/tasks ending in .rake,
2
Added:
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
Added:
4
Added:
require_relative "config/application"
5
Added:
6
Added:
Rails.application.load_tasks
app/assets/images/.keep
app/assets/images/blason_Savoie.png
Binary files differ
app/assets/stylesheets/application.css
@@ -0,0 +1,27 @@
1
Added:
/*
2
Added:
* This is a manifest file that'll be compiled into application.css.
3
Added:
*
4
Added:
* With Propshaft, assets are served efficiently without preprocessing steps. You can still include
5
Added:
* application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
6
Added:
* cascading order, meaning styles declared later in the document or manifest will override earlier ones,
7
Added:
* depending on specificity.
8
Added:
*
9
Added:
* Consider organizing styles into separate files for maintainability.
10
Added:
*/
11
Added:
12
Added:
body {
13
Added:
margin: 0;
14
Added:
font-family: sans-serif;
15
Added:
background: moccasin;
16
Added:
}
17
Added:
18
Added:
main {
19
Added:
margin: 0 auto;
20
Added:
padding: 0 1em;
21
Added:
max-width: 50em;
22
Added:
}
23
Added:
24
Added:
h1 {
25
Added:
text-align: center;
26
Added:
/* font-family: 'Old London', sans-serif; */
27
Added:
}
app/assets/stylesheets/components/code_of_honor.css
@@ -0,0 +1,11 @@
1
Added:
#code-of-honor {
2
Added:
width: 50%;
3
Added:
margin: 1em auto;
4
Added:
padding: 1em;
5
Added:
color: white;
6
Added:
7
Added:
border-radius: 1em;
8
Added:
}
9
Added:
#code-of-honor.accepted { background-color: forestgreen; }
10
Added:
#code-of-honor.rejected { background-color: firebrick; }
11
Added:
app/assets/stylesheets/components/footer.css
@@ -0,0 +1,6 @@
1
Added:
footer {
2
Added:
text-align: center;
3
Added:
margin: 3em 0 0;
4
Added:
color: dimgrey;
5
Added:
6
Added:
}
app/assets/stylesheets/components/nav_top.css
@@ -0,0 +1,40 @@
1
Added:
nav#top {
2
Added:
width: 100%;
3
Added:
background-color: firebrick;
4
Added:
display: flex;
5
Added:
justify-content: space-between;
6
Added:
align-items: center;
7
Added:
8
Added:
ul {
9
Added:
display: flex;
10
Added:
flex-wrap: wrap;
11
Added:
list-style-type: none;
12
Added:
padding: 0;
13
Added:
margin: 0;
14
Added:
}
15
Added:
16
Added:
li {
17
Added:
padding: 12px 0;
18
Added:
}
19
Added:
20
Added:
a {
21
Added:
padding: 12px;
22
Added:
color: white;
23
Added:
text-decoration: none;
24
Added:
}
25
Added:
26
Added:
a:hover {
27
Added:
background-color: tomato;
28
Added:
}
29
Added:
30
Added:
#authentication {
31
Added:
display: flex;
32
Added:
flex-wrap: wrap;
33
Added:
justify-content: right;
34
Added:
}
35
Added:
36
Added:
button {
37
Added:
margin: 0.5rem 0.5rem 0.5rem 0;
38
Added:
}
39
Added:
}
40
Added:
app/assets/stylesheets/components/notifications.css
@@ -0,0 +1,18 @@
1
Added:
#notifications {
2
Added:
max-width: 30rem;
3
Added:
margin: 1em auto;
4
Added:
}
5
Added:
6
Added:
.notice, .alert {
7
Added:
margin: 0 1em;
8
Added:
padding: 1em;
9
Added:
border-radius: 1em;
10
Added:
}
11
Added:
12
Added:
.notice {
13
Added:
background: lightblue;
14
Added:
}
15
Added:
16
Added:
.alert {
17
Added:
background: tomato;
18
Added:
}
app/assets/stylesheets/pages/home.css
@@ -0,0 +1,4 @@
1
Added:
#blason {
2
Added:
margin: 0 auto;
3
Added:
display: block;
4
Added:
}
app/channels/application_cable/connection.rb
@@ -0,0 +1,16 @@
1
Added:
module ApplicationCable
2
Added:
class Connection < ActionCable::Connection::Base
3
Added:
identified_by :current_user
4
Added:
5
Added:
def connect
6
Added:
set_current_user || reject_unauthorized_connection
7
Added:
end
8
Added:
9
Added:
private
10
Added:
def set_current_user
11
Added:
if session = Session.find_by(id: cookies.signed[:session_id])
12
Added:
self.current_user = session.user
13
Added:
end
14
Added:
end
15
Added:
end
16
Added:
end
app/controllers/admin/dashboard_controller.rb
@@ -0,0 +1,13 @@
1
Added:
class Admin::DashboardController < ApplicationController
2
Added:
def index
3
Added:
@tartiflettes = Tartiflette.includes(:scores)
4
Added:
end
5
Added:
6
Added:
private
7
Added:
8
Added:
def require_admin
9
Added:
unless logged_in? && current_user.admin?
10
Added:
redirect_to root_path, alert: "Access denied."
11
Added:
end
12
Added:
end
13
Added:
end
app/controllers/admin/scores_controller.rb
@@ -0,0 +1,14 @@
1
Added:
class Admin::ScoresController < ApplicationController
2
Added:
def export
3
Added:
csv_data = TartifletteScoreExportService.generate_csv
4
Added:
send_data csv_data, filename: "scores-#{Date.today}.csv"
5
Added:
end
6
Added:
7
Added:
private
8
Added:
9
Added:
def require_admin
10
Added:
unless logged_in? && current_user.admin?
11
Added:
redirect_to root_path, alert: "Access denied."
12
Added:
end
13
Added:
end
14
Added:
end
app/controllers/application_controller.rb
@@ -0,0 +1,5 @@
1
Added:
class ApplicationController < ActionController::Base
2
Added:
include Authentication
3
Added:
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
4
Added:
allow_browser versions: :modern
5
Added:
end
app/controllers/code_of_honor_controller.rb
@@ -0,0 +1,12 @@
1
Added:
class CodeOfHonorController < ApplicationController
2
Added:
allow_unauthenticated_access
3
Added:
4
Added:
def toggle
5
Added:
session[:agreed_to_code_of_honor] = !session[:agreed_to_code_of_honor]
6
Added:
if session[:agreed_to_code_of_honor]
7
Added:
redirect_to root_path, notice: "Vous acceptez le code d'honneur."
8
Added:
else
9
Added:
redirect_to root_path, alert: "Vous n'acceptez pas le code d'honneur."
10
Added:
end
11
Added:
end
12
Added:
end
app/controllers/concerns/.keep
app/controllers/concerns/authentication.rb
@@ -0,0 +1,52 @@
1
Added:
module Authentication
2
Added:
extend ActiveSupport::Concern
3
Added:
4
Added:
included do
5
Added:
before_action :require_authentication
6
Added:
helper_method :authenticated?
7
Added:
end
8
Added:
9
Added:
class_methods do
10
Added:
def allow_unauthenticated_access(**options)
11
Added:
skip_before_action :require_authentication, **options
12
Added:
end
13
Added:
end
14
Added:
15
Added:
private
16
Added:
def authenticated?
17
Added:
resume_session
18
Added:
end
19
Added:
20
Added:
def require_authentication
21
Added:
resume_session || request_authentication
22
Added:
end
23
Added:
24
Added:
def resume_session
25
Added:
Current.session ||= find_session_by_cookie
26
Added:
end
27
Added:
28
Added:
def find_session_by_cookie
29
Added:
Session.find_by(id: cookies.signed[:session_id]) if cookies.signed[:session_id]
30
Added:
end
31
Added:
32
Added:
def request_authentication
33
Added:
session[:return_to_after_authenticating] = request.url
34
Added:
redirect_to new_session_path
35
Added:
end
36
Added:
37
Added:
def after_authentication_url
38
Added:
session.delete(:return_to_after_authenticating) || root_url
39
Added:
end
40
Added:
41
Added:
def start_new_session_for(user)
42
Added:
user.sessions.create!(user_agent: request.user_agent, ip_address: request.remote_ip).tap do |session|
43
Added:
Current.session = session
44
Added:
cookies.signed.permanent[:session_id] = { value: session.id, httponly: true, same_site: :lax }
45
Added:
end
46
Added:
end
47
Added:
48
Added:
def terminate_session
49
Added:
Current.session.destroy
50
Added:
cookies.delete(:session_id)
51
Added:
end
52
Added:
end
app/controllers/home_controller.rb
@@ -0,0 +1,7 @@
1
Added:
class HomeController < ApplicationController
2
Added:
allow_unauthenticated_access
3
Added:
4
Added:
def index
5
Added:
@tartiflettes = Tartiflette.all
6
Added:
end
7
Added:
end
app/controllers/passwords_controller.rb
@@ -0,0 +1,33 @@
1
Added:
class PasswordsController < ApplicationController
2
Added:
allow_unauthenticated_access
3
Added:
before_action :set_user_by_token, only: %i[ edit update ]
4
Added:
5
Added:
def new
6
Added:
end
7
Added:
8
Added:
def create
9
Added:
if user = User.find_by(email_address: params[:email_address])
10
Added:
PasswordsMailer.reset(user).deliver_later
11
Added:
end
12
Added:
13
Added:
redirect_to new_session_path, notice: "Password reset instructions sent (if user with that email address exists)."
14
Added:
end
15
Added:
16
Added:
def edit
17
Added:
end
18
Added:
19
Added:
def update
20
Added:
if @user.update(params.permit(:password, :password_confirmation))
21
Added:
redirect_to new_session_path, notice: "Password has been reset."
22
Added:
else
23
Added:
redirect_to edit_password_path(params[:token]), alert: "Passwords did not match."
24
Added:
end
25
Added:
end
26
Added:
27
Added:
private
28
Added:
def set_user_by_token
29
Added:
@user = User.find_by_password_reset_token!(params[:token])
30
Added:
rescue ActiveSupport::MessageVerifier::InvalidSignature
31
Added:
redirect_to new_password_path, alert: "Password reset link is invalid or has expired."
32
Added:
end
33
Added:
end
app/controllers/registrations_controller.rb
@@ -0,0 +1,21 @@
1
Added:
class RegistrationsController < ApplicationController
2
Added:
def new
3
Added:
@user = User.new
4
Added:
end
5
Added:
6
Added:
def create
7
Added:
@user = User.new(user_params)
8
Added:
if @user.save
9
Added:
start_new_session_for @user
10
Added:
redirect_to root_path, notice: "Successfully signed up!"
11
Added:
else
12
Added:
render :new
13
Added:
end
14
Added:
end
15
Added:
16
Added:
private
17
Added:
18
Added:
def user_params
19
Added:
params.require(:user).permit(:email_address, :password, :password_confirmation)
20
Added:
end
21
Added:
end
app/controllers/scores_controller.rb
@@ -0,0 +1,49 @@
1
Added:
class ScoresController < ApplicationController
2
Added:
allow_unauthenticated_access
3
Added:
before_action :set_tartiflette, only: [ :new, :create, :edit_all, :update_all ]
4
Added:
before_action :scores_params, only: [ :create, :update_all ]
5
Added:
6
Added:
def new
7
Added:
end
8
Added:
9
Added:
def create
10
Added:
if TartifletteScoringService.scored?(@tartiflette, session)
11
Added:
redirect_to root_path, alert: "Vous avez déja noté cette tartiflette."
12
Added:
return
13
Added:
end
14
Added:
15
Added:
TartifletteScoringService.submit_scores(@tartiflette, scores_params, session)
16
Added:
redirect_to root_path,
17
Added:
notice: "Vos scores pour la tartiflette #{@tartiflette.scoring_id} ont été enregistrés."
18
Added:
rescue StandardError => e
19
Added:
redirect_to root_path,
20
Added:
status: :unprocessable_entity,
21
Added:
alert: "Erreur lors de l'enregistrement de vos scores : #{e.message}"
22
Added:
end
23
Added:
24
Added:
def edit_all
25
Added:
@scores = @tartiflette.scores
26
Added:
end
27
Added:
28
Added:
def update_all
29
Added:
scores_params.each do |score_id, score_params|
30
Added:
score = @tartiflette.scores.find(score_id)
31
Added:
score.update!(value: score_params[:value])
32
Added:
end
33
Added:
redirect_to root_path,
34
Added:
notice: "Vos scores pour la tartiflette #{@tartiflette.scoring_id} ont été mis à jour."
35
Added:
rescue StandardError => e
36
Added:
redirect_to edit_tartiflette_scores_path(@tartiflette),
37
Added:
alert: "Erreur lors de l'enregistrement de vos scores : #{e.message}"
38
Added:
end
39
Added:
40
Added:
private
41
Added:
42
Added:
def set_tartiflette
43
Added:
@tartiflette = Tartiflette.find(params[:tartiflette_id])
44
Added:
end
45
Added:
46
Added:
def scores_params
47
Added:
params.require(:scores).permit!.to_h
48
Added:
end
49
Added:
end
app/controllers/sessions_controller.rb
@@ -0,0 +1,21 @@
1
Added:
class SessionsController < ApplicationController
2
Added:
allow_unauthenticated_access only: %i[ new create ]
3
Added:
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_url, alert: "Try again later." }
4
Added:
5
Added:
def new
6
Added:
end
7
Added:
8
Added:
def create
9
Added:
if user = User.authenticate_by(params.permit(:email_address, :password))
10
Added:
start_new_session_for user
11
Added:
redirect_to after_authentication_url
12
Added:
else
13
Added:
redirect_to new_session_path, alert: "Try another email address or password."
14
Added:
end
15
Added:
end
16
Added:
17
Added:
def destroy
18
Added:
terminate_session
19
Added:
redirect_to new_session_path
20
Added:
end
21
Added:
end
app/controllers/tartiflettes_controller.rb
@@ -0,0 +1,26 @@
1
Added:
class TartiflettesController < ApplicationController
2
Added:
before_action :set_tartiflette, only: [ :show ]
3
Added:
4
Added:
def index
5
Added:
@tartiflettes = Tartiflette.all
6
Added:
end
7
Added:
8
Added:
def show
9
Added:
end
10
Added:
11
Added:
def new
12
Added:
@tartiflette = Tartiflette.new
13
Added:
end
14
Added:
15
Added:
private
16
Added:
17
Added:
def tartiflette_params
18
Added:
params.require(:tartiflette)
19
Added:
end
20
Added:
21
Added:
def set_tartiflette
22
Added:
@tartiflette = Tartiflette.find(params[:id])
23
Added:
rescue ActiveRecord::RecordNotFound
24
Added:
redirect_to root_path, alert: "Tartiflette introuvable."
25
Added:
end
26
Added:
end
app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
1
Added:
module ApplicationHelper
2
Added:
end
app/helpers/home_helper.rb
@@ -0,0 +1,2 @@
1
Added:
module HomeHelper
2
Added:
end
app/jobs/application_job.rb
@@ -0,0 +1,7 @@
1
Added:
class ApplicationJob < ActiveJob::Base
2
Added:
# Automatically retry jobs that encountered a deadlock
3
Added:
# retry_on ActiveRecord::Deadlocked
4
Added:
5
Added:
# Most jobs are safe to ignore if the underlying records are no longer available
6
Added:
# discard_on ActiveJob::DeserializationError
7
Added:
end
app/mailers/application_mailer.rb
@@ -0,0 +1,4 @@
1
Added:
class ApplicationMailer < ActionMailer::Base
2
Added:
default from: "from@example.com"
3
Added:
layout "mailer"
4
Added:
end
app/mailers/passwords_mailer.rb
@@ -0,0 +1,6 @@
1
Added:
class PasswordsMailer < ApplicationMailer
2
Added:
def reset(user)
3
Added:
@user = user
4
Added:
mail subject: "Reset your password", to: user.email_address
5
Added:
end
6
Added:
end
app/models/application_record.rb
@@ -0,0 +1,3 @@
1
Added:
class ApplicationRecord < ActiveRecord::Base
2
Added:
primary_abstract_class
3
Added:
end
app/models/concerns/.keep
app/models/current.rb
@@ -0,0 +1,4 @@
1
Added:
class Current < ActiveSupport::CurrentAttributes
2
Added:
attribute :session
3
Added:
delegate :user, to: :session, allow_nil: true
4
Added:
end
app/models/score.rb
@@ -0,0 +1,6 @@
1
Added:
class Score < ApplicationRecord
2
Added:
belongs_to :tartiflette
3
Added:
belongs_to :scoring_criterium
4
Added:
5
Added:
validates :value, presence: true, inclusion: { in: 1..5 }
6
Added:
end
app/models/scoring_criterium.rb
@@ -0,0 +1,9 @@
1
Added:
class ScoringCriterium < ApplicationRecord
2
Added:
has_many :scores, dependent: :destroy
3
Added:
4
Added:
validates :name, :category, presence: true
5
Added:
6
Added:
def self.grouped_by_category
7
Added:
ScoringCriterium.all.group_by(&:category)
8
Added:
end
9
Added:
end
app/models/session.rb
@@ -0,0 +1,3 @@
1
Added:
class Session < ApplicationRecord
2
Added:
belongs_to :user
3
Added:
end
app/models/tartiflette.rb
@@ -0,0 +1,3 @@
1
Added:
class Tartiflette < ApplicationRecord
2
Added:
has_many :scores
3
Added:
end
app/models/user.rb
@@ -0,0 +1,6 @@
1
Added:
class User < ApplicationRecord
2
Added:
has_secure_password
3
Added:
has_many :sessions, dependent: :destroy
4
Added:
5
Added:
normalizes :email_address, with: ->(e) { e.strip.downcase }
6
Added:
end
app/services/tartiflette_score_export_service.rb
@@ -0,0 +1,19 @@
1
Added:
require "csv"
2
Added:
3
Added:
class TartifletteScoreExportService
4
Added:
def self.generate_csv
5
Added:
CSV.generate(headers: true) do |csv|
6
Added:
csv << [ "Identifiant", "Critère", "Score", "Création" ]
7
Added:
Tartiflette.all.each do |tartiflette|
8
Added:
tartiflette.scores.each do |score|
9
Added:
csv << [
10
Added:
tartiflette.scoring_id,
11
Added:
score.scoring_criterium.name,
12
Added:
score.value,
13
Added:
score.created_at
14
Added:
]
15
Added:
end
16
Added:
end
17
Added:
end
18
Added:
end
19
Added:
end
app/services/tartiflette_scoring_service.rb
@@ -0,0 +1,54 @@
1
Added:
class TartifletteScoringService
2
Added:
def self.scored?(tartiflette, session)
3
Added:
session[:scored_tartiflettes]&.include?(tartiflette.id)
4
Added:
end
5
Added:
6
Added:
def self.mark_as_scored(tartiflette, session)
7
Added:
session[:scored_tartiflettes] ||= []
8
Added:
unless scored?(tartiflette, session)
9
Added:
session[:scored_tartiflettes] << tartiflette.id
10
Added:
end
11
Added:
end
12
Added:
13
Added:
def self.submit_scores(tartiflette, scores, session)
14
Added:
scores.each do |criterium_id, value|
15
Added:
Score.create!(
16
Added:
tartiflette: tartiflette,
17
Added:
scoring_criterium_id: criterium_id,
18
Added:
value: value[:value]
19
Added:
)
20
Added:
end
21
Added:
mark_as_scored(tartiflette, session)
22
Added:
end
23
Added:
24
Added:
def self.average_score(tartiflette)
25
Added:
tartiflette.scores.average(:value).to_f
26
Added:
end
27
Added:
28
Added:
def self.average_score_by_category(tartiflette)
29
Added:
tartiflette
30
Added:
.scores
31
Added:
.group_by { |score| score.scoring_criterium.category }
32
Added:
.transform_values do |scores|
33
Added:
(scores.sum(&:value).to_f / scores.size).round(2)
34
Added:
end
35
Added:
end
36
Added:
37
Added:
def self.total_score_by_category(tartiflette)
38
Added:
tartiflette
39
Added:
.scores
40
Added:
.group_by { |score| score.scoring_criterium.category }
41
Added:
.transform_values do |scores|
42
Added:
(scores.sum(&:value).to_f / scores.size).round(2)
43
Added:
end
44
Added:
end
45
Added:
46
Added:
def self.leaderboard
47
Added:
Tartiflette
48
Added:
.joins(:scores)
49
Added:
.select("tartiflettes.*, SUM(scores.value) AS total_score")
50
Added:
.group("tartiflettes.id")
51
Added:
.order("total_score DESC")
52
Added:
.map { |tartiflette| [ tartiflette, tartiflette.total_score.to_f ] }
53
Added:
end
54
Added:
end
app/views/admin/dashboard/index.html.erb
@@ -0,0 +1,10 @@
1
Added:
<h1>Administrateur</h1>
2
Added:
3
Added:
<!-- <h2>Tartiflettes</h2> -->
4
Added:
5
Added:
<p>
6
Added:
<%= button_to "Déconnexion",
7
Added:
session_path(session),
8
Added:
method: :delete %>
9
Added:
</p>
10
Added:
<p><%= link_to "Télécharger tous les scores en format CSV", admin_scores_export_path %></p>
app/views/admin/dashboard/tmp
@@ -0,0 +1,19 @@
1
Added:
<% ScoringCriterium.grouped_by_category.each do |category, criteria| %>
2
Added:
<h3><%= category.capitalize %></h3>
3
Added:
<table>
4
Added:
<thead>
5
Added:
<tr>
6
Added:
<th>Numéro</th>
7
Added:
<th>Score</th>
8
Added:
</tr>
9
Added:
</thead>
10
Added:
<tbody>
11
Added:
<% @tartiflettes.each do |tartiflette| %>
12
Added:
<tr>
13
Added:
<td><%= tartiflette.scoring_id %></td>
14
Added:
<td><%= tartiflette.scores.where(&:scoring_criterium.include? criteria) %></td>
15
Added:
</tr>
16
Added:
<% end %>
17
Added:
</tbody>
18
Added:
</table>
19
Added:
<% end %>
app/views/home/_code_of_honor.html.erb
@@ -0,0 +1,14 @@
1
Added:
<div id="code-of-honor" class="<%= session[:agreed_to_code_of_honor] ? 'accepted' : 'rejected' %>">
2
Added:
<h2>Code d'honneur</h2>
3
Added:
<p>
4
Added:
Tout Tartifleur s'engage à voter dans le respect de la
5
Added:
tradition de la WTT. Il ou elle se doit de voter en toute
6
Added:
honnêteté intellectuelle afin de favoriser un résultat mérité
7
Added:
!
8
Added:
</p>
9
Added:
<% if session[:agreed_to_code_of_honor] %>
10
Added:
<%= button_to "Renéguer", toggle_code_of_honor_path %>
11
Added:
<% else %>
12
Added:
<%= button_to "Accepter", toggle_code_of_honor_path %>
13
Added:
<% end %>
14
Added:
</div>
app/views/home/index.html.erb
@@ -0,0 +1,42 @@
1
Added:
<h1>World Tartiflette Tour 2024</h1>
2
Added:
3
Added:
<%= image_tag("blason_Savoie.png", :alt => "blason de la Savoie", id: "blason", width: 80) %>
4
Added:
5
Added:
<%= render "code_of_honor" %>
6
Added:
7
Added:
<h2>Noter les Tartiflettes</h2>
8
Added:
<ul>
9
Added:
<% @tartiflettes.each do |tartiflette| %>
10
Added:
<li><%= tartiflette.scoring_id %>
11
Added:
<% if session[:agreed_to_code_of_honor] %>
12
Added:
<% if TartifletteScoringService.scored?(tartiflette, session) %>
13
Added:
<%= link_to "modifier", tartiflette_edit_scores_path(tartiflette) %>
14
Added:
<% else %>
15
Added:
<%= link_to "noter", new_tartiflette_score_path(tartiflette) %>
16
Added:
<% end %>
17
Added:
<% end %>
18
Added:
</li>
19
Added:
<% end %>
20
Added:
</ul>
21
Added:
<!--
22
Added:
<h2>Résultats</h2>
23
Added:
<table>
24
Added:
<thead>
25
Added:
<tr>
26
Added:
<th>Tartiflette</th>
27
Added:
<th>Points</th>
28
Added:
</tr>
29
Added:
</thead>
30
Added:
<tbody>
31
Added:
<% TartifletteScoringService.leaderboard.each do |tartiflette, total_score| %>
32
Added:
<tr>
33
Added:
<td><%= tartiflette.scoring_id %></td>
34
Added:
<td><%= total_score %></td>
35
Added:
</tr>
36
Added:
<% end %>
37
Added:
</tbody>
38
Added:
</table>
39
Added:
-->
40
Added:
<p>
41
Added:
<%= link_to "Admin", admin_dashboard_path %>
42
Added:
</p>
app/views/layouts/_footer.html.erb
@@ -0,0 +1,3 @@
1
Added:
<footer>
2
Added:
<p>© <%= Date.current.year %> World Tartiflette Tour</p>
3
Added:
</footer>
app/views/layouts/_notifications.html.erb
@@ -0,0 +1,8 @@
1
Added:
<div id="notifications">
2
Added:
<% if alert %>
3
Added:
<p class="alert"><%= alert %></p>
4
Added:
<% end %>
5
Added:
<% if notice %>
6
Added:
<p class="notice"><%= notice %></p>
7
Added:
<% end %>
8
Added:
</div>
app/views/layouts/_topnav.html.erb
@@ -0,0 +1,5 @@
1
Added:
<nav id="top">
2
Added:
<ul>
3
Added:
<li><%= link_to "Accueil", root_path %></li>
4
Added:
</ul>
5
Added:
</nav>
app/views/layouts/application.html.erb
@@ -0,0 +1,33 @@
1
Added:
<!DOCTYPE html>
2
Added:
<html>
3
Added:
<head>
4
Added:
<title><%= content_for(:title) || "WTT" %></title>
5
Added:
<meta name="viewport" content="width=device-width,initial-scale=1">
6
Added:
<meta name="apple-mobile-web-app-capable" content="yes">
7
Added:
<meta name="mobile-web-app-capable" content="yes">
8
Added:
<%= csrf_meta_tags %>
9
Added:
<%= csp_meta_tag %>
10
Added:
11
Added:
<%= yield :head %>
12
Added:
13
Added:
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
14
Added:
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
15
Added:
16
Added:
<%= favicon_link_tag "blason_Savoie.png" %>
17
Added:
<!-- <link rel="icon" href="/icon.png" type="image/png">
18
Added:
<link rel="icon" href="/icon.svg" type="image/svg+xml">
19
Added:
<link rel="apple-touch-icon" href="/icon.png"> -->
20
Added:
21
Added:
<%# Includes all stylesheet files in app/assets/stylesheets %>
22
Added:
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
23
Added:
</head>
24
Added:
25
Added:
<body>
26
Added:
<%= render "layouts/topnav" %>
27
Added:
<%= render "layouts/notifications" %>
28
Added:
<main>
29
Added:
<%= yield %>
30
Added:
</main>
31
Added:
<%= render "layouts/footer" %>
32
Added:
</body>
33
Added:
</html>
app/views/layouts/mailer.html.erb
@@ -0,0 +1,13 @@
1
Added:
<!DOCTYPE html>
2
Added:
<html>
3
Added:
<head>
4
Added:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
Added:
<style>
6
Added:
/* Email styles need to be inline */
7
Added:
</style>
8
Added:
</head>
9
Added:
10
Added:
<body>
11
Added:
<%= yield %>
12
Added:
</body>
13
Added:
</html>
app/views/layouts/mailer.text.erb
@@ -0,0 +1,1 @@
1
Added:
<%= yield %>
app/views/passwords/edit.html.erb
@@ -0,0 +1,9 @@
1
Added:
<h1>Update your password</h1>
2
Added:
3
Added:
<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
4
Added:
5
Added:
<%= form_with url: password_path(params[:token]), method: :put do |form| %>
6
Added:
<%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72 %><br>
7
Added:
<%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72 %><br>
8
Added:
<%= form.submit "Save" %>
9
Added:
<% end %>
app/views/passwords/new.html.erb
@@ -0,0 +1,8 @@
1
Added:
<h1>Forgot your password?</h1>
2
Added:
3
Added:
<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
4
Added:
5
Added:
<%= form_with url: passwords_path do |form| %>
6
Added:
<%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address] %><br>
7
Added:
<%= form.submit "Email reset instructions" %>
8
Added:
<% end %>
app/views/passwords_mailer/reset.html.erb
@@ -0,0 +1,4 @@
1
Added:
<p>
2
Added:
You can reset your password within the next 15 minutes on
3
Added:
<%= link_to "this password reset page", edit_password_url(@user.password_reset_token) %>.
4
Added:
</p>
app/views/passwords_mailer/reset.text.erb
@@ -0,0 +1,2 @@
1
Added:
You can reset your password within the next 15 minutes on this password reset page:
2
Added:
<%= edit_password_url(@user.password_reset_token) %>
app/views/pwa/manifest.json.erb
@@ -0,0 +1,22 @@
1
Added:
{
2
Added:
"name": "Wtt",
3
Added:
"icons": [
4
Added:
{
5
Added:
"src": "/icon.png",
6
Added:
"type": "image/png",
7
Added:
"sizes": "512x512"
8
Added:
},
9
Added:
{
10
Added:
"src": "/icon.png",
11
Added:
"type": "image/png",
12
Added:
"sizes": "512x512",
13
Added:
"purpose": "maskable"
14
Added:
}
15
Added:
],
16
Added:
"start_url": "/",
17
Added:
"display": "standalone",
18
Added:
"scope": "/",
19
Added:
"description": "Wtt.",
20
Added:
"theme_color": "red",
21
Added:
"background_color": "red"
22
Added:
}
app/views/pwa/service-worker.js
@@ -0,0 +1,26 @@
1
Added:
// Add a service worker for processing Web Push notifications:
2
Added:
//
3
Added:
// self.addEventListener("push", async (event) => {
4
Added:
// const { title, options } = await event.data.json()
5
Added:
// event.waitUntil(self.registration.showNotification(title, options))
6
Added:
// })
7
Added:
//
8
Added:
// self.addEventListener("notificationclick", function(event) {
9
Added:
// event.notification.close()
10
Added:
// event.waitUntil(
11
Added:
// clients.matchAll({ type: "window" }).then((clientList) => {
12
Added:
// for (let i = 0; i < clientList.length; i++) {
13
Added:
// let client = clientList[i]
14
Added:
// let clientPath = (new URL(client.url)).pathname
15
Added:
//
16
Added:
// if (clientPath == event.notification.data.path && "focus" in client) {
17
Added:
// return client.focus()
18
Added:
// }
19
Added:
// }
20
Added:
//
21
Added:
// if (clients.openWindow) {
22
Added:
// return clients.openWindow(event.notification.data.path)
23
Added:
// }
24
Added:
// })
25
Added:
// )
26
Added:
// })
app/views/registrations/new.html.erb
@@ -0,0 +1,17 @@
1
Added:
<h1>Sign Up</h1>
2
Added:
3
Added:
<%= form_with model: @user, url: registration_path, method: :post, local: true do |f| %>
4
Added:
<div>
5
Added:
<%= f.label :email_address %>
6
Added:
<%= f.email_field :email_address, required: true %>
7
Added:
</div>
8
Added:
<div>
9
Added:
<%= f.label :password %>
10
Added:
<%= f.password_field :password, required: true %>
11
Added:
</div>
12
Added:
<div>
13
Added:
<%= f.label :password_confirmation %>
14
Added:
<%= f.password_field :password_confirmation, required: true %>
15
Added:
</div>
16
Added:
<%= f.submit "Sign Up" %>
17
Added:
<% end %>
app/views/scores/_form.html.erb
@@ -0,0 +1,19 @@
1
Added:
<%= form_with url: form_url, method: form_method, local: true do |f| %>
2
Added:
<% ScoringCriterium.grouped_by_category.each do |category, criteria| %>
3
Added:
<fieldset>
4
Added:
<legend><%= category.titlecase %></legend>
5
Added:
<% criteria.each do |criterium| %>
6
Added:
<% current_score = existing_scores.find { |score| score.scoring_criterium_id == criterium.id } %>
7
Added:
<p>
8
Added:
<%= select_tag "scores[#{criterium.id}][value]",
9
Added:
options_for_select(1..5, current_score&.value),
10
Added:
required: true,
11
Added:
prompt: "Score" %>
12
Added:
<%= label_tag "scores[#{criterium.id}][value]",
13
Added:
criterium.name.capitalize %>
14
Added:
</p>
15
Added:
<% end %>
16
Added:
</fieldset>
17
Added:
<% end %>
18
Added:
<%= f.submit submit_text %>
19
Added:
<% end %>
app/views/scores/edit_all.html.erb
@@ -0,0 +1,7 @@
1
Added:
<h1>Modifier les Notes pour la Tartiflette nº<%= @tartiflette.scoring_id %></h1>
2
Added:
3
Added:
<%= render "form",
4
Added:
form_url: tartiflette_update_scores_path(@tartiflette),
5
Added:
form_method: :patch,
6
Added:
existing_scores: @scores,
7
Added:
submit_text: "Mettre à jour mes scores" %>
app/views/scores/new.html.erb
@@ -0,0 +1,7 @@
1
Added:
<h1>Noter la Tartiflette nº<%= @tartiflette.scoring_id %></h1>
2
Added:
3
Added:
<%= render "form",
4
Added:
form_url: tartiflette_scores_path(@tartiflette),
5
Added:
form_method: :post,
6
Added:
existing_scores: [],
7
Added:
submit_text: "Envoyer mes scores" %>
app/views/sessions/new.html.erb
@@ -0,0 +1,20 @@
1
Added:
<%= tag.div(flash[:alert], style: "color:red") if flash[:alert] %>
2
Added:
<%= tag.div(flash[:notice], style: "color:green") if flash[:notice] %>
3
Added:
4
Added:
<%= form_with url: session_path do |form| %>
5
Added:
<%= form.email_field :email_address,
6
Added:
required: true,
7
Added:
autofocus: true,
8
Added:
autocomplete: "username",
9
Added:
placeholder: "Enter your email address",
10
Added:
value: params[:email_address] %><br>
11
Added:
<%= form.password_field :password,
12
Added:
required: true,
13
Added:
autocomplete: "current-password",
14
Added:
placeholder: "Enter your password",
15
Added:
maxlength: 72 %><br>
16
Added:
<%= form.submit "Sign in" %>
17
Added:
<% end %>
18
Added:
<br>
19
Added:
20
Added:
<%= link_to "Forgot password?", new_password_path %>
app/views/tartiflettes/index.html.erb
@@ -0,0 +1,3 @@
1
Added:
<h1>Tartiflettes</h1>
2
Added:
3
Added:
<p>Toutes les tartiflettes</p>
app/views/tartiflettes/show.html.erb
@@ -0,0 +1,3 @@
1
Added:
<h1>Tartiflette nº<%= @tartiflette.scoring_id %></h1>
2
Added:
3
Added:
<p>Scores obtenus pour une tartiflette donnée.</p>
bin/brakeman
@@ -0,0 +1,7 @@
1
Added:
#!/usr/bin/env ruby
2
Added:
require "rubygems"
3
Added:
require "bundler/setup"
4
Added:
5
Added:
ARGV.unshift("--ensure-latest")
6
Added:
7
Added:
load Gem.bin_path("brakeman", "brakeman")
bin/dev
@@ -0,0 +1,2 @@
1
Added:
#!/usr/bin/env ruby
2
Added:
exec "./bin/rails", "server", *ARGV
bin/docker-entrypoint
@@ -0,0 +1,14 @@
1
Added:
#!/bin/bash -e
2
Added:
3
Added:
# Enable jemalloc for reduced memory usage and latency.
4
Added:
if [ -z "${LD_PRELOAD+x}" ]; then
5
Added:
LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit)
6
Added:
export LD_PRELOAD
7
Added:
fi
8
Added:
9
Added:
# If running the rails server then create or migrate existing database
10
Added:
if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
11
Added:
./bin/rails db:prepare
12
Added:
fi
13
Added:
14
Added:
exec "${@}"
bin/rails
@@ -0,0 +1,4 @@
1
Added:
#!/usr/bin/env ruby
2
Added:
APP_PATH = File.expand_path("../config/application", __dir__)
3
Added:
require_relative "../config/boot"
4
Added:
require "rails/commands"
bin/rake
@@ -0,0 +1,4 @@
1
Added:
#!/usr/bin/env ruby
2
Added:
require_relative "../config/boot"
3
Added:
require "rake"
4
Added:
Rake.application.run
bin/rubocop
@@ -0,0 +1,8 @@
1
Added:
#!/usr/bin/env ruby
2
Added:
require "rubygems"
3
Added:
require "bundler/setup"
4
Added:
5
Added:
# explicit rubocop config increases performance slightly while avoiding config confusion.
6
Added:
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7
Added:
8
Added:
load Gem.bin_path("rubocop", "rubocop")
bin/setup
@@ -0,0 +1,34 @@
1
Added:
#!/usr/bin/env ruby
2
Added:
require "fileutils"
3
Added:
4
Added:
APP_ROOT = File.expand_path("..", __dir__)
5
Added:
6
Added:
def system!(*args)
7
Added:
system(*args, exception: true)
8
Added:
end
9
Added:
10
Added:
FileUtils.chdir APP_ROOT do
11
Added:
# This script is a way to set up or update your development environment automatically.
12
Added:
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
13
Added:
# Add necessary setup steps to this file.
14
Added:
15
Added:
puts "== Installing dependencies =="
16
Added:
system("bundle check") || system!("bundle install")
17
Added:
18
Added:
# puts "\n== Copying sample files =="
19
Added:
# unless File.exist?("config/database.yml")
20
Added:
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
21
Added:
# end
22
Added:
23
Added:
puts "\n== Preparing database =="
24
Added:
system! "bin/rails db:prepare"
25
Added:
26
Added:
puts "\n== Removing old logs and tempfiles =="
27
Added:
system! "bin/rails log:clear tmp:clear"
28
Added:
29
Added:
unless ARGV.include?("--skip-server")
30
Added:
puts "\n== Starting development server =="
31
Added:
STDOUT.flush # flush the output before exec(2) so that it displays
32
Added:
exec "bin/dev"
33
Added:
end
34
Added:
end
bin/thrust
@@ -0,0 +1,5 @@
1
Added:
#!/usr/bin/env ruby
2
Added:
require "rubygems"
3
Added:
require "bundler/setup"
4
Added:
5
Added:
load Gem.bin_path("thruster", "thrust")
config.ru
@@ -0,0 +1,6 @@
1
Added:
# This file is used by Rack-based servers to start the application.
2
Added:
3
Added:
require_relative "config/environment"
4
Added:
5
Added:
run Rails.application
6
Added:
Rails.application.load_server
config/application.rb
@@ -0,0 +1,27 @@
1
Added:
require_relative "boot"
2
Added:
3
Added:
require "rails/all"
4
Added:
5
Added:
# Require the gems listed in Gemfile, including any gems
6
Added:
# you've limited to :test, :development, or :production.
7
Added:
Bundler.require(*Rails.groups)
8
Added:
9
Added:
module Wtt
10
Added:
class Application < Rails::Application
11
Added:
# Initialize configuration defaults for originally generated Rails version.
12
Added:
config.load_defaults 8.0
13
Added:
14
Added:
# Please, add to the `ignore` list any other `lib` subdirectories that do
15
Added:
# not contain `.rb` files, or that should not be reloaded or eager loaded.
16
Added:
# Common ones are `templates`, `generators`, or `middleware`, for example.
17
Added:
config.autoload_lib(ignore: %w[assets tasks])
18
Added:
19
Added:
# Configuration for the application, engines, and railties goes here.
20
Added:
#
21
Added:
# These settings can be overridden in specific environments using the files
22
Added:
# in config/environments, which are processed later.
23
Added:
#
24
Added:
# config.time_zone = "Central Time (US & Canada)"
25
Added:
# config.eager_load_paths << Rails.root.join("extras")
26
Added:
end
27
Added:
end
config/boot.rb
@@ -0,0 +1,4 @@
1
Added:
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2
Added:
3
Added:
require "bundler/setup" # Set up gems listed in the Gemfile.
4
Added:
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
config/cable.yml
@@ -0,0 +1,10 @@
1
Added:
development:
2
Added:
adapter: async
3
Added:
4
Added:
test:
5
Added:
adapter: test
6
Added:
7
Added:
production:
8
Added:
adapter: redis
9
Added:
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
Added:
channel_prefix: wtt_production
config/credentials.yml.enc
@@ -0,0 +1,1 @@
1
Added:
iKFpQhNINyw1BILCAFy1MJWDKOtLZyVBbYsywi1CnfdosMyNkL6EXg79AfcF0O321lz1/iUX6J6EmajknndFndgioK/o9TvP3vPBSP8mK7dYsa+3Fo+c1yhgIJI5xCHWXaDRQMQuiZiMeQ3VtoiYNmdIO/Fe1ACv8J/oildwzPdMqkf/z45zbJpl0KPfyEfcvYlsARI8Fe0KoL8ugchn6AcVRNl7vYWxO5cZmup9NBGNLOBUWtvpav61Sm3EmlVxOKGFCQMwpd0sYKVAjvpRJud/TU2ayysLecwtFLZWdTfONspx0A+z/ptXzKoGdM9ySmCMyMWhAOw3d/cXiuTWdEqYsb8q6IDxjH95q8kx51rS9XiqqWdAhV+wqNG3u0FESod5MINw5yApGrTiUKFwODmaTOU6Qk5lO2frIrFbAO+ifqVcpQVhCRkfiJmlkcuqGB5GvI2X/l/PiRIvyUCoxilGgbBKxGM/n/+FIWXVm8YB2ImMR1lCeaIA--Qvr/LtgDlCKSbLf2--rVY240eaUZyJ9wJWf9tr5w==
config/database.yml
@@ -0,0 +1,41 @@
1
Added:
# SQLite. Versions 3.8.0 and up are supported.
2
Added:
# gem install sqlite3
3
Added:
#
4
Added:
# Ensure the SQLite 3 gem is defined in your Gemfile
5
Added:
# gem "sqlite3"
6
Added:
#
7
Added:
default: &default
8
Added:
adapter: sqlite3
9
Added:
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
Added:
timeout: 5000
11
Added:
12
Added:
development:
13
Added:
<<: *default
14
Added:
database: storage/development.sqlite3
15
Added:
16
Added:
# Warning: The database defined as "test" will be erased and
17
Added:
# re-generated from your development database when you run "rake".
18
Added:
# Do not set this db to the same as development or production.
19
Added:
test:
20
Added:
<<: *default
21
Added:
database: storage/test.sqlite3
22
Added:
23
Added:
24
Added:
# Store production database in the storage/ directory, which by default
25
Added:
# is mounted as a persistent Docker volume in config/deploy.yml.
26
Added:
production:
27
Added:
primary:
28
Added:
<<: *default
29
Added:
database: storage/production.sqlite3
30
Added:
cache:
31
Added:
<<: *default
32
Added:
database: storage/production_cache.sqlite3
33
Added:
migrations_paths: db/cache_migrate
34
Added:
queue:
35
Added:
<<: *default
36
Added:
database: storage/production_queue.sqlite3
37
Added:
migrations_paths: db/queue_migrate
38
Added:
cable:
39
Added:
<<: *default
40
Added:
database: storage/production_cable.sqlite3
41
Added:
migrations_paths: db/cable_migrate
config/deploy.yml
@@ -0,0 +1,116 @@
1
Added:
# Name of your application. Used to uniquely configure containers.
2
Added:
service: wtt
3
Added:
4
Added:
# Name of the container image.
5
Added:
image: blendoit/wtt
6
Added:
7
Added:
# Deploy to these servers.
8
Added:
servers:
9
Added:
web:
10
Added:
- 192.162.71.223
11
Added:
# job:
12
Added:
# hosts:
13
Added:
# - 192.168.0.1
14
Added:
# cmd: bin/jobs
15
Added:
16
Added:
# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server.
17
Added:
# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer.
18
Added:
#
19
Added:
# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
20
Added:
proxy:
21
Added:
ssl: true
22
Added:
host: wtt.mlnp.fr
23
Added:
24
Added:
# Credentials for your image host.
25
Added:
registry:
26
Added:
# Specify the registry server, if you're not using Docker Hub
27
Added:
# server: registry.digitalocean.com / ghcr.io / ...
28
Added:
username: blendoit
29
Added:
30
Added:
# Always use an access token rather than real password when possible.
31
Added:
password:
32
Added:
- KAMAL_REGISTRY_PASSWORD
33
Added:
34
Added:
# Inject ENV variables into containers (secrets come from .kamal/secrets).
35
Added:
env:
36
Added:
secret:
37
Added:
- RAILS_MASTER_KEY
38
Added:
clear:
39
Added:
# Run the Solid Queue Supervisor inside the web server's Puma process to do jobs.
40
Added:
# When you start using multiple servers, you should split out job processing to a dedicated machine.
41
Added:
SOLID_QUEUE_IN_PUMA: true
42
Added:
43
Added:
# Set number of processes dedicated to Solid Queue (default: 1)
44
Added:
# JOB_CONCURRENCY: 3
45
Added:
46
Added:
# Set number of cores available to the application on each server (default: 1).
47
Added:
# WEB_CONCURRENCY: 2
48
Added:
49
Added:
# Match this to any external database server to configure Active Record correctly
50
Added:
# Use wtt-db for a db accessory server on same machine via local kamal docker network.
51
Added:
# DB_HOST: 192.168.0.2
52
Added:
53
Added:
# Log everything from Rails
54
Added:
# RAILS_LOG_LEVEL: debug
55
Added:
56
Added:
# Aliases are triggered with "bin/kamal <alias>". You can overwrite arguments on invocation:
57
Added:
# "bin/kamal logs -r job" will tail logs from the first server in the job section.
58
Added:
aliases:
59
Added:
console: app exec --interactive --reuse "bin/rails console"
60
Added:
shell: app exec --interactive --reuse "bash"
61
Added:
logs: app logs -f
62
Added:
dbc: app exec --interactive --reuse "bin/rails dbconsole"
63
Added:
64
Added:
65
Added:
# Use a persistent storage volume for sqlite database files and local Active Storage files.
66
Added:
# Recommended to change this to a mounted volume path that is backed up off server.
67
Added:
volumes:
68
Added:
- "wtt_storage:/rails/storage"
69
Added:
70
Added:
71
Added:
# Bridge fingerprinted assets, like JS and CSS, between versions to avoid
72
Added:
# hitting 404 on in-flight requests. Combines all files from new and old
73
Added:
# version inside the asset_path.
74
Added:
asset_path: /rails/public/assets
75
Added:
76
Added:
# Configure the image builder.
77
Added:
builder:
78
Added:
arch: amd64
79
Added:
80
Added:
# # Build image via remote server (useful for faster amd64 builds on arm64 computers)
81
Added:
# remote: ssh://docker@docker-builder-server
82
Added:
#
83
Added:
# # Pass arguments and secrets to the Docker build process
84
Added:
# args:
85
Added:
# RUBY_VERSION: ruby-3.3.6
86
Added:
# secrets:
87
Added:
# - GITHUB_TOKEN
88
Added:
# - RAILS_MASTER_KEY
89
Added:
90
Added:
# Use a different ssh user than root
91
Added:
ssh:
92
Added:
user: mpeter
93
Added:
94
Added:
# Use accessory services (secrets come from .kamal/secrets).
95
Added:
# accessories:
96
Added:
# db:
97
Added:
# image: mysql:8.0
98
Added:
# host: 192.168.0.2
99
Added:
# # Change to 3306 to expose port to the world instead of just local network.
100
Added:
# port: "127.0.0.1:3306:3306"
101
Added:
# env:
102
Added:
# clear:
103
Added:
# MYSQL_ROOT_HOST: '%'
104
Added:
# secret:
105
Added:
# - MYSQL_ROOT_PASSWORD
106
Added:
# files:
107
Added:
# - config/mysql/production.cnf:/etc/mysql/my.cnf
108
Added:
# - db/production.sql:/docker-entrypoint-initdb.d/setup.sql
109
Added:
# directories:
110
Added:
# - data:/var/lib/mysql
111
Added:
# redis:
112
Added:
# image: redis:7.0
113
Added:
# host: 192.168.0.2
114
Added:
# port: 6379
115
Added:
# directories:
116
Added:
# - data:/data
config/environment.rb
@@ -0,0 +1,5 @@
1
Added:
# Load the Rails application.
2
Added:
require_relative "application"
3
Added:
4
Added:
# Initialize the Rails application.
5
Added:
Rails.application.initialize!
config/environments/development.rb
@@ -0,0 +1,72 @@
1
Added:
require "active_support/core_ext/integer/time"
2
Added:
3
Added:
Rails.application.configure do
4
Added:
# Settings specified here will take precedence over those in config/application.rb.
5
Added:
6
Added:
# Make code changes take effect immediately without server restart.
7
Added:
config.enable_reloading = true
8
Added:
9
Added:
# Do not eager load code on boot.
10
Added:
config.eager_load = false
11
Added:
12
Added:
# Show full error reports.
13
Added:
config.consider_all_requests_local = true
14
Added:
15
Added:
# Enable server timing.
16
Added:
config.server_timing = true
17
Added:
18
Added:
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
19
Added:
# Run rails dev:cache to toggle Action Controller caching.
20
Added:
if Rails.root.join("tmp/caching-dev.txt").exist?
21
Added:
config.action_controller.perform_caching = true
22
Added:
config.action_controller.enable_fragment_cache_logging = true
23
Added:
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
24
Added:
else
25
Added:
config.action_controller.perform_caching = false
26
Added:
end
27
Added:
28
Added:
# Change to :null_store to avoid any caching.
29
Added:
config.cache_store = :memory_store
30
Added:
31
Added:
# Store uploaded files on the local file system (see config/storage.yml for options).
32
Added:
config.active_storage.service = :local
33
Added:
34
Added:
# Don't care if the mailer can't send.
35
Added:
config.action_mailer.raise_delivery_errors = false
36
Added:
37
Added:
# Make template changes take effect immediately.
38
Added:
config.action_mailer.perform_caching = false
39
Added:
40
Added:
# Set localhost to be used by links generated in mailer templates.
41
Added:
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
42
Added:
43
Added:
# Print deprecation notices to the Rails logger.
44
Added:
config.active_support.deprecation = :log
45
Added:
46
Added:
# Raise an error on page load if there are pending migrations.
47
Added:
config.active_record.migration_error = :page_load
48
Added:
49
Added:
# Highlight code that triggered database queries in logs.
50
Added:
config.active_record.verbose_query_logs = true
51
Added:
52
Added:
# Append comments with runtime information tags to SQL queries in logs.
53
Added:
config.active_record.query_log_tags_enabled = true
54
Added:
55
Added:
# Highlight code that enqueued background job in logs.
56
Added:
config.active_job.verbose_enqueue_logs = true
57
Added:
58
Added:
# Raises error for missing translations.
59
Added:
# config.i18n.raise_on_missing_translations = true
60
Added:
61
Added:
# Annotate rendered view with file names.
62
Added:
config.action_view.annotate_rendered_view_with_filenames = true
63
Added:
64
Added:
# Uncomment if you wish to allow Action Cable access from any origin.
65
Added:
# config.action_cable.disable_request_forgery_protection = true
66
Added:
67
Added:
# Raise error when a before_action's only/except options reference missing actions.
68
Added:
config.action_controller.raise_on_missing_callback_actions = true
69
Added:
70
Added:
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
71
Added:
# config.generators.apply_rubocop_autocorrect_after_generate!
72
Added:
end
config/environments/production.rb
@@ -0,0 +1,89 @@
1
Added:
require "active_support/core_ext/integer/time"
2
Added:
3
Added:
Rails.application.configure do
4
Added:
# Settings specified here will take precedence over those in config/application.rb.
5
Added:
6
Added:
# Code is not reloaded between requests.
7
Added:
config.enable_reloading = false
8
Added:
9
Added:
# Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
10
Added:
config.eager_load = true
11
Added:
12
Added:
# Full error reports are disabled.
13
Added:
config.consider_all_requests_local = false
14
Added:
15
Added:
# Turn on fragment caching in view templates.
16
Added:
config.action_controller.perform_caching = true
17
Added:
18
Added:
# Cache assets for far-future expiry since they are all digest stamped.
19
Added:
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
20
Added:
21
Added:
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
22
Added:
# config.asset_host = "http://assets.example.com"
23
Added:
24
Added:
# Store uploaded files on the local file system (see config/storage.yml for options).
25
Added:
config.active_storage.service = :local
26
Added:
27
Added:
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
28
Added:
config.assume_ssl = true
29
Added:
30
Added:
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
Added:
config.force_ssl = true
32
Added:
33
Added:
# Skip http-to-https redirect for the default health check endpoint.
34
Added:
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
35
Added:
36
Added:
# Log to STDOUT with the current request id as a default log tag.
37
Added:
config.log_tags = [ :request_id ]
38
Added:
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
39
Added:
40
Added:
# Change to "debug" to log everything (including potentially personally-identifiable information!)
41
Added:
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
42
Added:
43
Added:
# Prevent health checks from clogging up the logs.
44
Added:
config.silence_healthcheck_path = "/up"
45
Added:
46
Added:
# Don't log any deprecations.
47
Added:
config.active_support.report_deprecations = false
48
Added:
49
Added:
# Replace the default in-process memory cache store with a durable alternative.
50
Added:
# config.cache_store = :mem_cache_store
51
Added:
52
Added:
# Replace the default in-process and non-durable queuing backend for Active Job.
53
Added:
# config.active_job.queue_adapter = :resque
54
Added:
55
Added:
# Ignore bad email addresses and do not raise email delivery errors.
56
Added:
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
57
Added:
# config.action_mailer.raise_delivery_errors = false
58
Added:
59
Added:
# Set host to be used by links generated in mailer templates.
60
Added:
config.action_mailer.default_url_options = { host: "example.com" }
61
Added:
62
Added:
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
63
Added:
# config.action_mailer.smtp_settings = {
64
Added:
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
65
Added:
# password: Rails.application.credentials.dig(:smtp, :password),
66
Added:
# address: "smtp.example.com",
67
Added:
# port: 587,
68
Added:
# authentication: :plain
69
Added:
# }
70
Added:
71
Added:
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72
Added:
# the I18n.default_locale when a translation cannot be found).
73
Added:
config.i18n.fallbacks = true
74
Added:
75
Added:
# Do not dump schema after migrations.
76
Added:
config.active_record.dump_schema_after_migration = false
77
Added:
78
Added:
# Only use :id for inspections in production.
79
Added:
config.active_record.attributes_for_inspect = [ :id ]
80
Added:
81
Added:
# Enable DNS rebinding protection and other `Host` header attacks.
82
Added:
# config.hosts = [
83
Added:
# "example.com", # Allow requests from example.com
84
Added:
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
85
Added:
# ]
86
Added:
#
87
Added:
# Skip DNS rebinding protection for the default health check endpoint.
88
Added:
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
89
Added:
end
config/environments/test.rb
@@ -0,0 +1,53 @@
1
Added:
# The test environment is used exclusively to run your application's
2
Added:
# test suite. You never need to work with it otherwise. Remember that
3
Added:
# your test database is "scratch space" for the test suite and is wiped
4
Added:
# and recreated between test runs. Don't rely on the data there!
5
Added:
6
Added:
Rails.application.configure do
7
Added:
# Settings specified here will take precedence over those in config/application.rb.
8
Added:
9
Added:
# While tests run files are not watched, reloading is not necessary.
10
Added:
config.enable_reloading = false
11
Added:
12
Added:
# Eager loading loads your entire application. When running a single test locally,
13
Added:
# this is usually not necessary, and can slow down your test suite. However, it's
14
Added:
# recommended that you enable it in continuous integration systems to ensure eager
15
Added:
# loading is working properly before deploying your code.
16
Added:
config.eager_load = ENV["CI"].present?
17
Added:
18
Added:
# Configure public file server for tests with cache-control for performance.
19
Added:
config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
20
Added:
21
Added:
# Show full error reports.
22
Added:
config.consider_all_requests_local = true
23
Added:
config.cache_store = :null_store
24
Added:
25
Added:
# Render exception templates for rescuable exceptions and raise for other exceptions.
26
Added:
config.action_dispatch.show_exceptions = :rescuable
27
Added:
28
Added:
# Disable request forgery protection in test environment.
29
Added:
config.action_controller.allow_forgery_protection = false
30
Added:
31
Added:
# Store uploaded files on the local file system in a temporary directory.
32
Added:
config.active_storage.service = :test
33
Added:
34
Added:
# Tell Action Mailer not to deliver emails to the real world.
35
Added:
# The :test delivery method accumulates sent emails in the
36
Added:
# ActionMailer::Base.deliveries array.
37
Added:
config.action_mailer.delivery_method = :test
38
Added:
39
Added:
# Set host to be used by links generated in mailer templates.
40
Added:
config.action_mailer.default_url_options = { host: "example.com" }
41
Added:
42
Added:
# Print deprecation notices to the stderr.
43
Added:
config.active_support.deprecation = :stderr
44
Added:
45
Added:
# Raises error for missing translations.
46
Added:
# config.i18n.raise_on_missing_translations = true
47
Added:
48
Added:
# Annotate rendered view with file names.
49
Added:
# config.action_view.annotate_rendered_view_with_filenames = true
50
Added:
51
Added:
# Raise error when a before_action's only/except options reference missing actions.
52
Added:
config.action_controller.raise_on_missing_callback_actions = true
53
Added:
end
config/initializers/assets.rb
@@ -0,0 +1,7 @@
1
Added:
# Be sure to restart your server when you modify this file.
2
Added:
3
Added:
# Version of your assets, change this if you want to expire all your assets.
4
Added:
Rails.application.config.assets.version = "1.0"
5
Added:
6
Added:
# Add additional assets to the asset load path.
7
Added:
# Rails.application.config.assets.paths << Emoji.images_path
config/initializers/content_security_policy.rb
@@ -0,0 +1,25 @@
1
Added:
# Be sure to restart your server when you modify this file.
2
Added:
3
Added:
# Define an application-wide content security policy.
4
Added:
# See the Securing Rails Applications Guide for more information:
5
Added:
# https://guides.rubyonrails.org/security.html#content-security-policy-header
6
Added:
7
Added:
# Rails.application.configure do
8
Added:
# config.content_security_policy do |policy|
9
Added:
# policy.default_src :self, :https
10
Added:
# policy.font_src :self, :https, :data
11
Added:
# policy.img_src :self, :https, :data
12
Added:
# policy.object_src :none
13
Added:
# policy.script_src :self, :https
14
Added:
# policy.style_src :self, :https
15
Added:
# # Specify URI for violation reports
16
Added:
# # policy.report_uri "/csp-violation-report-endpoint"
17
Added:
# end
18
Added:
#
19
Added:
# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
20
Added:
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21
Added:
# config.content_security_policy_nonce_directives = %w(script-src style-src)
22
Added:
#
23
Added:
# # Report violations without enforcing the policy.
24
Added:
# # config.content_security_policy_report_only = true
25
Added:
# end
config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,8 @@
1
Added:
# Be sure to restart your server when you modify this file.
2
Added:
3
Added:
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4
Added:
# Use this to limit dissemination of sensitive information.
5
Added:
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6
Added:
Rails.application.config.filter_parameters += [
7
Added:
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
8
Added:
]
config/initializers/inflections.rb
@@ -0,0 +1,16 @@
1
Added:
# Be sure to restart your server when you modify this file.
2
Added:
3
Added:
# Add new inflection rules using the following format. Inflections
4
Added:
# are locale specific, and you may define rules for as many different
5
Added:
# locales as you wish. All of these examples are active by default:
6
Added:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
7
Added:
# inflect.plural /^(ox)$/i, "\\1en"
8
Added:
# inflect.singular /^(ox)en/i, "\\1"
9
Added:
# inflect.irregular "person", "people"
10
Added:
# inflect.uncountable %w( fish sheep )
11
Added:
# end
12
Added:
13
Added:
# These inflection rules are supported but not enabled by default:
14
Added:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
15
Added:
# inflect.acronym "RESTful"
16
Added:
# end
config/locales/en.yml
@@ -0,0 +1,31 @@
1
Added:
# Files in the config/locales directory are used for internationalization and
2
Added:
# are automatically loaded by Rails. If you want to use locales other than
3
Added:
# English, add the necessary files in this directory.
4
Added:
#
5
Added:
# To use the locales, use `I18n.t`:
6
Added:
#
7
Added:
# I18n.t "hello"
8
Added:
#
9
Added:
# In views, this is aliased to just `t`:
10
Added:
#
11
Added:
# <%= t("hello") %>
12
Added:
#
13
Added:
# To use a different locale, set it with `I18n.locale`:
14
Added:
#
15
Added:
# I18n.locale = :es
16
Added:
#
17
Added:
# This would use the information in config/locales/es.yml.
18
Added:
#
19
Added:
# To learn more about the API, please read the Rails Internationalization guide
20
Added:
# at https://guides.rubyonrails.org/i18n.html.
21
Added:
#
22
Added:
# Be aware that YAML interprets the following case-insensitive strings as
23
Added:
# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
24
Added:
# must be quoted to be interpreted as strings. For example:
25
Added:
#
26
Added:
# en:
27
Added:
# "yes": yup
28
Added:
# enabled: "ON"
29
Added:
30
Added:
en:
31
Added:
hello: "Hello world"
config/puma.rb
@@ -0,0 +1,41 @@
1
Added:
# This configuration file will be evaluated by Puma. The top-level methods that
2
Added:
# are invoked here are part of Puma's configuration DSL. For more information
3
Added:
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
4
Added:
#
5
Added:
# Puma starts a configurable number of processes (workers) and each process
6
Added:
# serves each request in a thread from an internal thread pool.
7
Added:
#
8
Added:
# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
9
Added:
# should only set this value when you want to run 2 or more workers. The
10
Added:
# default is already 1.
11
Added:
#
12
Added:
# The ideal number of threads per worker depends both on how much time the
13
Added:
# application spends waiting for IO operations and on how much you wish to
14
Added:
# prioritize throughput over latency.
15
Added:
#
16
Added:
# As a rule of thumb, increasing the number of threads will increase how much
17
Added:
# traffic a given process can handle (throughput), but due to CRuby's
18
Added:
# Global VM Lock (GVL) it has diminishing returns and will degrade the
19
Added:
# response time (latency) of the application.
20
Added:
#
21
Added:
# The default is set to 3 threads as it's deemed a decent compromise between
22
Added:
# throughput and latency for the average Rails application.
23
Added:
#
24
Added:
# Any libraries that use a connection pool or another resource pool should
25
Added:
# be configured to provide at least as many connections as the number of
26
Added:
# threads. This includes Active Record's `pool` parameter in `database.yml`.
27
Added:
threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
28
Added:
threads threads_count, threads_count
29
Added:
30
Added:
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
31
Added:
port ENV.fetch("PORT", 3000)
32
Added:
33
Added:
# Allow puma to be restarted by `bin/rails restart` command.
34
Added:
plugin :tmp_restart
35
Added:
36
Added:
# Run the Solid Queue supervisor inside of Puma for single-server deployments
37
Added:
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
38
Added:
39
Added:
# Specify the PID file. Defaults to tmp/pids/server.pid in development.
40
Added:
# In other environments, only set the PID file if requested.
41
Added:
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
config/routes.rb
@@ -0,0 +1,46 @@
1
Added:
Rails.application.routes.draw do
2
Added:
root to: "home#index"
3
Added:
4
Added:
resource :session
5
Added:
resource :registration, only: [ "new", "create" ]
6
Added:
resources :passwords, param: :token
7
Added:
# get "/sign_up", to: "registrations#new", as: :sign_up
8
Added:
# post "/sign_up", to: "registrations#create"
9
Added:
# delete "/log_out", to: "sessions#destroy", as: :log_out
10
Added:
11
Added:
post "/code_of_honor/toggle",
12
Added:
to: "code_of_honor#toggle",
13
Added:
as: :toggle_code_of_honor
14
Added:
15
Added:
resources :tartiflettes do
16
Added:
get "scores/edit",
17
Added:
to: "scores#edit_all",
18
Added:
as: :edit_scores
19
Added:
patch "scores",
20
Added:
to: "scores#update_all",
21
Added:
as: :update_scores
22
Added:
resources :scores, only: [ :new, :create ]
23
Added:
end
24
Added:
25
Added:
namespace :admin do
26
Added:
get "dashboard",
27
Added:
to: "dashboard#index",
28
Added:
as: :dashboard
29
Added:
get "scores/export",
30
Added:
to: "scores#export",
31
Added:
as: :scores_export
32
Added:
end
33
Added:
34
Added:
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
35
Added:
36
Added:
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
37
Added:
# Can be used by load balancers and uptime monitors to verify that the app is live.
38
Added:
get "up" => "rails/health#show", as: :rails_health_check
39
Added:
40
Added:
# Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb)
41
Added:
# get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
42
Added:
# get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
43
Added:
44
Added:
# Defines the root path route ("/")
45
Added:
# root "posts#index"
46
Added:
end
config/storage.yml
@@ -0,0 +1,34 @@
1
Added:
test:
2
Added:
service: Disk
3
Added:
root: <%= Rails.root.join("tmp/storage") %>
4
Added:
5
Added:
local:
6
Added:
service: Disk
7
Added:
root: <%= Rails.root.join("storage") %>
8
Added:
9
Added:
# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
Added:
# amazon:
11
Added:
# service: S3
12
Added:
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
Added:
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
Added:
# region: us-east-1
15
Added:
# bucket: your_own_bucket-<%= Rails.env %>
16
Added:
17
Added:
# Remember not to checkin your GCS keyfile to a repository
18
Added:
# google:
19
Added:
# service: GCS
20
Added:
# project: your_project
21
Added:
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
Added:
# bucket: your_own_bucket-<%= Rails.env %>
23
Added:
24
Added:
# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
Added:
# microsoft:
26
Added:
# service: AzureStorage
27
Added:
# storage_account_name: your_account_name
28
Added:
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
Added:
# container: your_container_name-<%= Rails.env %>
30
Added:
31
Added:
# mirror:
32
Added:
# service: Mirror
33
Added:
# primary: local
34
Added:
# mirrors: [ amazon, google, microsoft ]
db/migrate/20241226110255_create_tartiflettes.rb
@@ -0,0 +1,9 @@
1
Added:
class CreateTartiflettes < ActiveRecord::Migration[8.0]
2
Added:
def change
3
Added:
create_table :tartiflettes do |t|
4
Added:
t.integer :scoring_id
5
Added:
6
Added:
t.timestamps
7
Added:
end
8
Added:
end
9
Added:
end
db/migrate/20241226113752_create_scores.rb
@@ -0,0 +1,11 @@
1
Added:
class CreateScores < ActiveRecord::Migration[8.0]
2
Added:
def change
3
Added:
create_table :scores do |t|
4
Added:
t.references :tartiflette, null: false, foreign_key: true
5
Added:
t.references :scoring_criterium, null: false, foreign_key: true
6
Added:
t.integer :value
7
Added:
8
Added:
t.timestamps
9
Added:
end
10
Added:
end
11
Added:
end
db/migrate/20241226113815_create_scoring_criteria.rb
@@ -0,0 +1,10 @@
1
Added:
class CreateScoringCriteria < ActiveRecord::Migration[8.0]
2
Added:
def change
3
Added:
create_table :scoring_criteria do |t|
4
Added:
t.string :name
5
Added:
t.string :category
6
Added:
7
Added:
t.timestamps
8
Added:
end
9
Added:
end
10
Added:
end
db/migrate/20241227180909_create_users.rb
@@ -0,0 +1,11 @@
1
Added:
class CreateUsers < ActiveRecord::Migration[8.0]
2
Added:
def change
3
Added:
create_table :users do |t|
4
Added:
t.string :email_address, null: false
5
Added:
t.string :password_digest, null: false
6
Added:
7
Added:
t.timestamps
8
Added:
end
9
Added:
add_index :users, :email_address, unique: true
10
Added:
end
11
Added:
end
db/migrate/20241227180910_create_sessions.rb
@@ -0,0 +1,11 @@
1
Added:
class CreateSessions < ActiveRecord::Migration[8.0]
2
Added:
def change
3
Added:
create_table :sessions do |t|
4
Added:
t.references :user, null: false, foreign_key: true
5
Added:
t.string :ip_address
6
Added:
t.string :user_agent
7
Added:
8
Added:
t.timestamps
9
Added:
end
10
Added:
end
11
Added:
end
db/migrate/20241227181134_add_admin_to_users.rb
@@ -0,0 +1,5 @@
1
Added:
class AddAdminToUsers < ActiveRecord::Migration[8.0]
2
Added:
def change
3
Added:
add_column :users, :admin, :boolean, default: false
4
Added:
end
5
Added:
end
db/schema.rb
@@ -0,0 +1,58 @@
1
Added:
# This file is auto-generated from the current state of the database. Instead
2
Added:
# of editing this file, please use the migrations feature of Active Record to
3
Added:
# incrementally modify your database, and then regenerate this schema definition.
4
Added:
#
5
Added:
# This file is the source Rails uses to define your schema when running `bin/rails
6
Added:
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
Added:
# be faster and is potentially less error prone than running all of your
8
Added:
# migrations from scratch. Old migrations may fail to apply correctly if those
9
Added:
# migrations use external dependencies or application code.
10
Added:
#
11
Added:
# It's strongly recommended that you check this file into your version control system.
12
Added:
13
Added:
ActiveRecord::Schema[8.0].define(version: 2024_12_27_181134) do
14
Added:
create_table "scores", force: :cascade do |t|
15
Added:
t.integer "tartiflette_id", null: false
16
Added:
t.integer "scoring_criterium_id", null: false
17
Added:
t.integer "value"
18
Added:
t.datetime "created_at", null: false
19
Added:
t.datetime "updated_at", null: false
20
Added:
t.index ["scoring_criterium_id"], name: "index_scores_on_scoring_criterium_id"
21
Added:
t.index ["tartiflette_id"], name: "index_scores_on_tartiflette_id"
22
Added:
end
23
Added:
24
Added:
create_table "scoring_criteria", force: :cascade do |t|
25
Added:
t.string "name"
26
Added:
t.string "category"
27
Added:
t.datetime "created_at", null: false
28
Added:
t.datetime "updated_at", null: false
29
Added:
end
30
Added:
31
Added:
create_table "sessions", force: :cascade do |t|
32
Added:
t.integer "user_id", null: false
33
Added:
t.string "ip_address"
34
Added:
t.string "user_agent"
35
Added:
t.datetime "created_at", null: false
36
Added:
t.datetime "updated_at", null: false
37
Added:
t.index ["user_id"], name: "index_sessions_on_user_id"
38
Added:
end
39
Added:
40
Added:
create_table "tartiflettes", force: :cascade do |t|
41
Added:
t.integer "scoring_id"
42
Added:
t.datetime "created_at", null: false
43
Added:
t.datetime "updated_at", null: false
44
Added:
end
45
Added:
46
Added:
create_table "users", force: :cascade do |t|
47
Added:
t.string "email_address", null: false
48
Added:
t.string "password_digest", null: false
49
Added:
t.datetime "created_at", null: false
50
Added:
t.datetime "updated_at", null: false
51
Added:
t.boolean "admin", default: false
52
Added:
t.index ["email_address"], name: "index_users_on_email_address", unique: true
53
Added:
end
54
Added:
55
Added:
add_foreign_key "scores", "scoring_criteria"
56
Added:
add_foreign_key "scores", "tartiflettes"
57
Added:
add_foreign_key "sessions", "users"
58
Added:
end
db/seeds.rb
@@ -0,0 +1,41 @@
1
Added:
# This file should ensure the existence of records required to run the application in every environment (production,
2
Added:
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
3
Added:
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
4
Added:
#
5
Added:
# Example:
6
Added:
#
7
Added:
# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
8
Added:
# MovieGenre.find_or_create_by!(name: genre_name)
9
Added:
# end
10
Added:
11
Added:
User.create!(
12
Added:
email_address: "wtt@marius-peter.com",
13
Added:
password: "password",
14
Added:
password_confirmation: "password",
15
Added:
admin: true
16
Added:
)
17
Added:
puts "Seeded admin account"
18
Added:
19
Added:
(1..8).each do |id|
20
Added:
Tartiflette.create!(scoring_id: id)
21
Added:
end
22
Added:
puts "Seeded tartiflettes"
23
Added:
24
Added:
{ visuel: [ "présence de la pastille",
25
Added:
"croûte dorée",
26
Added:
"lardons apparents" ],
27
Added:
texture: [ "pommes de terre fondantes",
28
Added:
"lardons grillés",
29
Added:
"oignons biens cuits" ],
30
Added:
goût: [ "reblochon savoureux",
31
Added:
"lardons appétants",
32
Added:
"vin blanc équilibré" ],
33
Added:
special: [ "on en reveut !",
34
Added:
"quelqu'un cherche à dépasser les maestros...",
35
Added:
"on reconnaît la patte du tartifleur" ]
36
Added:
}.each do |category, names|
37
Added:
names.each do |name|
38
Added:
ScoringCriterium.create!(name: name, category: category)
39
Added:
end
40
Added:
end
41
Added:
puts "Seeded scoring criteria"
lib/tasks/.keep
log/.keep
public/400.html
@@ -0,0 +1,114 @@
1
Added:
<!doctype html>
2
Added:
3
Added:
<html lang="en">
4
Added:
5
Added:
<head>
6
Added:
7
Added:
<title>The server cannot process the request due to a client error (400 Bad Request)</title>
8
Added:
9
Added:
<meta charset="utf-8">
10
Added:
<meta name="viewport" content="initial-scale=1, width=device-width">
11
Added:
<meta name="robots" content="noindex, nofollow">
12
Added:
13
Added:
<style>
14
Added:
15
Added:
*, *::before, *::after {
16
Added:
box-sizing: border-box;
17
Added:
}
18
Added:
19
Added:
* {
20
Added:
margin: 0;
21
Added:
}
22
Added:
23
Added:
html {
24
Added:
font-size: 16px;
25
Added:
}
26
Added:
27
Added:
body {
28
Added:
background: #FFF;
29
Added:
color: #261B23;
30
Added:
display: grid;
31
Added:
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
32
Added:
font-size: clamp(1rem, 2.5vw, 2rem);
33
Added:
-webkit-font-smoothing: antialiased;
34
Added:
font-style: normal;
35
Added:
font-weight: 400;
36
Added:
letter-spacing: -0.0025em;
37
Added:
line-height: 1.4;
38
Added:
min-height: 100vh;
39
Added:
place-items: center;
40
Added:
text-rendering: optimizeLegibility;
41
Added:
-webkit-text-size-adjust: 100%;
42
Added:
}
43
Added:
44
Added:
a {
45
Added:
color: inherit;
46
Added:
font-weight: 700;
47
Added:
text-decoration: underline;
48
Added:
text-underline-offset: 0.0925em;
49
Added:
}
50
Added:
51
Added:
b, strong {
52
Added:
font-weight: 700;
53
Added:
}
54
Added:
55
Added:
i, em {
56
Added:
font-style: italic;
57
Added:
}
58
Added:
59
Added:
main {
60
Added:
display: grid;
61
Added:
gap: 1em;
62
Added:
padding: 2em;
63
Added:
place-items: center;
64
Added:
text-align: center;
65
Added:
}
66
Added:
67
Added:
main header {
68
Added:
width: min(100%, 12em);
69
Added:
}
70
Added:
71
Added:
main header svg {
72
Added:
height: auto;
73
Added:
max-width: 100%;
74
Added:
width: 100%;
75
Added:
}
76
Added:
77
Added:
main article {
78
Added:
width: min(100%, 30em);
79
Added:
}
80
Added:
81
Added:
main article p {
82
Added:
font-size: 75%;
83
Added:
}
84
Added:
85
Added:
main article br {
86
Added:
87
Added:
display: none;
88
Added:
89
Added:
@media(min-width: 48em) {
90
Added:
display: inline;
91
Added:
}
92
Added:
93
Added:
}
94
Added:
95
Added:
</style>
96
Added:
97
Added:
</head>
98
Added:
99
Added:
<body>
100
Added:
101
Added:
<!-- This file lives in public/400.html -->
102
Added:
103
Added:
<main>
104
Added:
<header>
105
Added:
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm140.456 133.2831c-40.823 0-64.884-35.146-64.884-85.7015 0-50.5554 24.061-85.700907 64.884-85.700907 40.822 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.062 85.7015-64.884 85.7015zm0-133.2831c-17.573 0-22.71 21.8984-22.71 47.5816 0 25.6835 5.137 47.5815 22.71 47.5815 17.302 0 22.709-21.898 22.709-47.5815 0-25.6832-5.407-47.5816-22.709-47.5816z" fill="#f0eff0"/><path d="m123.606 85.4445c3.212 1.0523 5.538 4.2089 5.538 8.0301 0 6.1472-4.209 9.5254-11.298 9.5254h-15.617v-34.0033h14.565c7.089 0 11.353 3.1566 11.353 9.2484 0 3.6551-2.049 6.3134-4.541 7.1994zm-12.904-2.9905h5.095c2.603 0 3.988-.9968 3.988-3.1013 0-2.1044-1.385-3.0459-3.988-3.0459h-5.095zm0 6.6456v6.5902h5.981c2.492 0 3.877-1.3291 3.877-3.2674 0-2.049-1.385-3.3228-3.877-3.3228zm43.786 13.9004h-8.362v-1.274c-.831.831-3.323 1.717-5.981 1.717-4.929 0-9.083-2.769-9.083-8.0301 0-4.818 4.154-7.9193 9.581-7.9193 2.049 0 4.486.6646 5.483 1.3845v-1.606c0-1.606-.942-2.9905-3.046-2.9905-1.606 0-2.548.7199-2.935 1.8275h-8.197c.72-4.8181 4.985-8.6393 11.409-8.6393 7.088 0 11.131 3.7659 11.131 10.2453zm-8.362-6.9779v-1.4399c-.554-1.0522-2.049-1.7167-3.655-1.7167-1.717 0-3.434.7199-3.434 2.3813 0 1.7168 1.717 2.4367 3.434 2.4367 1.606 0 3.101-.6645 3.655-1.6614zm27.996 6.9779v-1.994c-1.163 1.329-3.599 2.548-6.147 2.548-7.199 0-11.131-5.8151-11.131-13.0145s3.932-13.0143 11.131-13.0143c2.548 0 4.984 1.2184 6.147 2.5475v-13.0697h8.695v35.997zm0-9.1931v-6.5902c-.664-1.3291-2.159-2.326-3.821-2.326-2.99 0-4.763 2.4368-4.763 5.6488s1.773 5.5934 4.763 5.5934c1.717 0 3.157-.9415 3.821-2.326zm35.471-2.049h-3.101v11.2421h-8.806v-34.0033h15.285c7.31 0 12.35 4.1535 12.35 11.5744 0 5.1503-2.603 8.6947-6.757 10.2453l7.975 12.1836h-9.858zm-3.101-15.2849v8.1962h5.538c3.156 0 4.596-1.606 4.596-4.0981s-1.44-4.0981-4.596-4.0981zm36.957 17.8323h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm30.98 27.5234v-10.799c-1.163 1.329-3.6 2.548-6.147 2.548-7.2 0-11.132-5.9259-11.132-13.0145 0-7.144 3.932-13.0143 11.132-13.0143 2.547 0 4.984 1.2184 6.147 2.5475v-1.9937h8.695v33.726zm0-17.9981v-6.5902c-.665-1.3291-2.105-2.326-3.821-2.326-2.991 0-4.763 2.4368-4.763 5.6488s1.772 5.5934 4.763 5.5934c1.661 0 3.156-.9415 3.821-2.326zm36.789-15.7279v24.921h-8.695v-2.16c-1.329 1.551-3.821 2.714-6.646 2.714-5.482 0-8.75-3.5999-8.75-9.1379v-16.3371h8.64v14.288c0 2.1045.996 3.5997 3.212 3.5997 1.606 0 3.101-1.0522 3.544-2.769v-15.1187zm19.084 16.2263h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.963 5.095 11.963 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm13.428 11.0206h8.474c.387 1.3845 1.606 2.1598 3.156 2.1598 1.44 0 2.548-.5538 2.548-1.7168 0-.9414-.72-1.2737-1.939-1.5506l-4.873-.9969c-4.154-.886-6.867-2.8797-6.867-7.2547 0-5.3165 4.762-8.4178 10.633-8.4178 6.812 0 10.522 3.1567 11.297 8.0855h-8.03c-.277-1.0522-1.052-1.9937-3.046-1.9937-1.273 0-2.326.5538-2.326 1.6614 0 .7753.554 1.163 1.717 1.3845l4.929 1.163c4.541 1.0522 6.978 3.4335 6.978 7.4763 0 5.3168-4.818 8.2518-10.91 8.2518-6.369 0-10.965-2.88-11.741-8.2518zm27.538-.8861v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.205v6.7564h-5.205v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.993-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.871 0-9.193-2.769-9.193-9.0819z" fill="#d30001"/></svg>
106
Added:
</header>
107
Added:
<article>
108
Added:
<p><strong>The server cannot process the request due to a client error.</strong> Please check the request and try again. If you’re the application owner check the logs for more information.</p>
109
Added:
</article>
110
Added:
</main>
111
Added:
112
Added:
</body>
113
Added:
114
Added:
</html>
public/404.html
@@ -0,0 +1,114 @@
1
Added:
<!doctype html>
2
Added:
3
Added:
<html lang="en">
4
Added:
5
Added:
<head>
6
Added:
7
Added:
<title>The page you were looking for doesn’t exist (404 Not found)</title>
8
Added:
9
Added:
<meta charset="utf-8">
10
Added:
<meta name="viewport" content="initial-scale=1, width=device-width">
11
Added:
<meta name="robots" content="noindex, nofollow">
12
Added:
13
Added:
<style>
14
Added:
15
Added:
*, *::before, *::after {
16
Added:
box-sizing: border-box;
17
Added:
}
18
Added:
19
Added:
* {
20
Added:
margin: 0;
21
Added:
}
22
Added:
23
Added:
html {
24
Added:
font-size: 16px;
25
Added:
}
26
Added:
27
Added:
body {
28
Added:
background: #FFF;
29
Added:
color: #261B23;
30
Added:
display: grid;
31
Added:
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
32
Added:
font-size: clamp(1rem, 2.5vw, 2rem);
33
Added:
-webkit-font-smoothing: antialiased;
34
Added:
font-style: normal;
35
Added:
font-weight: 400;
36
Added:
letter-spacing: -0.0025em;
37
Added:
line-height: 1.4;
38
Added:
min-height: 100vh;
39
Added:
place-items: center;
40
Added:
text-rendering: optimizeLegibility;
41
Added:
-webkit-text-size-adjust: 100%;
42
Added:
}
43
Added:
44
Added:
a {
45
Added:
color: inherit;
46
Added:
font-weight: 700;
47
Added:
text-decoration: underline;
48
Added:
text-underline-offset: 0.0925em;
49
Added:
}
50
Added:
51
Added:
b, strong {
52
Added:
font-weight: 700;
53
Added:
}
54
Added:
55
Added:
i, em {
56
Added:
font-style: italic;
57
Added:
}
58
Added:
59
Added:
main {
60
Added:
display: grid;
61
Added:
gap: 1em;
62
Added:
padding: 2em;
63
Added:
place-items: center;
64
Added:
text-align: center;
65
Added:
}
66
Added:
67
Added:
main header {
68
Added:
width: min(100%, 12em);
69
Added:
}
70
Added:
71
Added:
main header svg {
72
Added:
height: auto;
73
Added:
max-width: 100%;
74
Added:
width: 100%;
75
Added:
}
76
Added:
77
Added:
main article {
78
Added:
width: min(100%, 30em);
79
Added:
}
80
Added:
81
Added:
main article p {
82
Added:
font-size: 75%;
83
Added:
}
84
Added:
85
Added:
main article br {
86
Added:
87
Added:
display: none;
88
Added:
89
Added:
@media(min-width: 48em) {
90
Added:
display: inline;
91
Added:
}
92
Added:
93
Added:
}
94
Added:
95
Added:
</style>
96
Added:
97
Added:
</head>
98
Added:
99
Added:
<body>
100
Added:
101
Added:
<!-- This file lives in public/404.html -->
102
Added:
103
Added:
<main>
104
Added:
<header>
105
Added:
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm165.328-35.41581-45.689 100.02991h26.224v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.184v-31.901l50.285-103.27391z" fill="#f0eff0"/><path d="m157.758 68.9967v34.0033h-7.199l-14.233-19.8814v19.8814h-8.584v-34.0033h8.307l13.125 18.7184v-18.7184zm28.454 21.5428c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.528 0c0-3.4336-1.496-5.8703-4.209-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.209-2.3813 4.209-5.8149zm13.184 3.8766v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.205v6.7564h-5.205v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm37.027 8.5839h-8.806v-34.0033h23.924v7.6978h-15.118v6.7564h13.9v7.5316h-13.9zm41.876-12.4605c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.529 0c0-3.4336-1.495-5.8703-4.208-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.208-2.3813 4.208-5.8149zm35.337-12.4605v24.921h-8.695v-2.16c-1.329 1.551-3.821 2.714-6.646 2.714-5.482 0-8.75-3.5999-8.75-9.1379v-16.3371h8.64v14.288c0 2.1045.997 3.5997 3.212 3.5997 1.606 0 3.101-1.0522 3.544-2.769v-15.1187zm4.076 24.921v-24.921h8.694v2.1598c1.385-1.5506 3.822-2.7136 6.701-2.7136 5.538 0 8.806 3.5997 8.806 9.1377v16.3371h-8.639v-14.2327c0-2.049-1.053-3.5443-3.268-3.5443-1.717 0-3.156.9969-3.6 2.7136v15.0634zm44.113 0v-1.994c-1.163 1.329-3.6 2.548-6.147 2.548-7.2 0-11.132-5.8151-11.132-13.0145s3.932-13.0143 11.132-13.0143c2.547 0 4.984 1.2184 6.147 2.5475v-13.0697h8.695v35.997zm0-9.1931v-6.5902c-.665-1.3291-2.16-2.326-3.821-2.326-2.991 0-4.763 2.4368-4.763 5.6488s1.772 5.5934 4.763 5.5934c1.717 0 3.156-.9415 3.821-2.326z" fill="#d30001"/></svg>
106
Added:
</header>
107
Added:
<article>
108
Added:
<p><strong>The page you were looking for doesn’t exist.</strong> You may have mistyped the address or the page may have moved. If you’re the application owner check the logs for more information.</p>
109
Added:
</article>
110
Added:
</main>
111
Added:
112
Added:
</body>
113
Added:
114
Added:
</html>
public/406-unsupported-browser.html
@@ -0,0 +1,114 @@
1
Added:
<!doctype html>
2
Added:
3
Added:
<html lang="en">
4
Added:
5
Added:
<head>
6
Added:
7
Added:
<title>Your browser is not supported (406 Not Acceptable)</title>
8
Added:
9
Added:
<meta charset="utf-8">
10
Added:
<meta name="viewport" content="initial-scale=1, width=device-width">
11
Added:
<meta name="robots" content="noindex, nofollow">
12
Added:
13
Added:
<style>
14
Added:
15
Added:
*, *::before, *::after {
16
Added:
box-sizing: border-box;
17
Added:
}
18
Added:
19
Added:
* {
20
Added:
margin: 0;
21
Added:
}
22
Added:
23
Added:
html {
24
Added:
font-size: 16px;
25
Added:
}
26
Added:
27
Added:
body {
28
Added:
background: #FFF;
29
Added:
color: #261B23;
30
Added:
display: grid;
31
Added:
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
32
Added:
font-size: clamp(1rem, 2.5vw, 2rem);
33
Added:
-webkit-font-smoothing: antialiased;
34
Added:
font-style: normal;
35
Added:
font-weight: 400;
36
Added:
letter-spacing: -0.0025em;
37
Added:
line-height: 1.4;
38
Added:
min-height: 100vh;
39
Added:
place-items: center;
40
Added:
text-rendering: optimizeLegibility;
41
Added:
-webkit-text-size-adjust: 100%;
42
Added:
}
43
Added:
44
Added:
a {
45
Added:
color: inherit;
46
Added:
font-weight: 700;
47
Added:
text-decoration: underline;
48
Added:
text-underline-offset: 0.0925em;
49
Added:
}
50
Added:
51
Added:
b, strong {
52
Added:
font-weight: 700;
53
Added:
}
54
Added:
55
Added:
i, em {
56
Added:
font-style: italic;
57
Added:
}
58
Added:
59
Added:
main {
60
Added:
display: grid;
61
Added:
gap: 1em;
62
Added:
padding: 2em;
63
Added:
place-items: center;
64
Added:
text-align: center;
65
Added:
}
66
Added:
67
Added:
main header {
68
Added:
width: min(100%, 12em);
69
Added:
}
70
Added:
71
Added:
main header svg {
72
Added:
height: auto;
73
Added:
max-width: 100%;
74
Added:
width: 100%;
75
Added:
}
76
Added:
77
Added:
main article {
78
Added:
width: min(100%, 30em);
79
Added:
}
80
Added:
81
Added:
main article p {
82
Added:
font-size: 75%;
83
Added:
}
84
Added:
85
Added:
main article br {
86
Added:
87
Added:
display: none;
88
Added:
89
Added:
@media(min-width: 48em) {
90
Added:
display: inline;
91
Added:
}
92
Added:
93
Added:
}
94
Added:
95
Added:
</style>
96
Added:
97
Added:
</head>
98
Added:
99
Added:
<body>
100
Added:
101
Added:
<!-- This file lives in public/406-unsupported-browser.html -->
102
Added:
103
Added:
<main>
104
Added:
<header>
105
Added:
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm202.906 9.7326h-41.093c-2.433-7.2994-7.84-12.4361-17.302-12.4361-16.221 0-25.413 17.5728-25.954 34.8752v1.3517c5.137-7.0291 16.221-12.4361 30.82-12.4361 33.524 0 54.881 24.0612 54.881 53.7998 0 33.253-23.791 58.396-61.64 58.396-21.628 0-39.741-10.003-50.825-27.576-9.733-14.599-13.788-32.442-13.788-54.3406 0-51.9072 24.331-89.485807 66.236-89.485807 32.712 0 53.258 18.654107 58.665 47.851907zm-82.727 66.2355c0 13.247 9.463 22.439 22.71 22.439 12.977 0 22.439-9.192 22.439-22.439 0-13.517-9.462-22.7091-22.439-22.7091-13.247 0-22.71 9.1921-22.71 22.7091z" fill="#f0eff0"/><path d="m100.761 68.9967v34.0033h-7.1991l-14.2326-19.8814v19.8814h-8.5839v-34.0033h8.307l13.125 18.7184v-18.7184zm28.454 21.5428c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.529 0c0-3.4336-1.495-5.8703-4.208-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.208-2.3813 4.208-5.8149zm13.185 3.8766v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.205v6.7564h-5.205v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm39.02-25.4194h9.083l12.958 34.0033h-9.027l-2.436-6.5902h-12.35l-2.381 6.5902h-8.806zm4.431 10.5222-3.489 9.5807h6.978zm17.44 11.0206c0-7.6978 5.095-13.0143 12.572-13.0143 6.701 0 10.854 3.9874 11.574 9.8023h-8.418c-.221-1.4953-1.384-2.6029-3.156-2.6029-2.437 0-3.988 2.2706-3.988 5.8149s1.551 5.7595 3.988 5.7595c1.772 0 2.935-1.0522 3.156-2.5475h8.418c-.72 5.7596-4.873 9.8025-11.574 9.8025-7.477 0-12.572-5.3167-12.572-13.0145zm25.676 0c0-7.6978 5.095-13.0143 12.572-13.0143 6.701 0 10.854 3.9874 11.574 9.8023h-8.418c-.221-1.4953-1.384-2.6029-3.156-2.6029-2.437 0-3.988 2.2706-3.988 5.8149s1.551 5.7595 3.988 5.7595c1.772 0 2.935-1.0522 3.156-2.5475h8.418c-.72 5.7596-4.873 9.8025-11.574 9.8025-7.477 0-12.572-5.3167-12.572-13.0145zm42.013 3.7658h8.031c-.887 5.7597-5.206 9.2487-11.686 9.2487-7.642 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.317-13.0143 12.516-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.319 4.5965 1.773 0 3.157-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm23.4 16.7244v10.799h-8.694v-33.726h8.694v1.9937c1.163-1.3291 3.6-2.5475 6.148-2.5475 7.199 0 11.131 5.8703 11.131 13.0143 0 7.0886-3.932 13.0145-11.131 13.0145-2.548 0-4.985-1.219-6.148-2.548zm0-13.7893v6.5902c.665 1.3845 2.16 2.326 3.822 2.326 2.99 0 4.762-2.3814 4.762-5.5934s-1.772-5.6488-4.762-5.6488c-1.717 0-3.157.9969-3.822 2.326zm21.892 7.1994v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.206v6.7564h-5.206v8.307c0 1.9383.941 2.769 2.658 2.769.942 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm39.458 8.5839h-8.363v-1.274c-.83.831-3.322 1.717-5.981 1.717-4.928 0-9.082-2.769-9.082-8.0301 0-4.818 4.154-7.9193 9.581-7.9193 2.049 0 4.486.6646 5.482 1.3845v-1.606c0-1.606-.941-2.9905-3.045-2.9905-1.606 0-2.548.7199-2.936 1.8275h-8.196c.72-4.8181 4.984-8.6393 11.408-8.6393 7.089 0 11.132 3.7659 11.132 10.2453zm-8.363-6.9779v-1.4399c-.553-1.0522-2.049-1.7167-3.655-1.7167-1.716 0-3.433.7199-3.433 2.3813 0 1.7168 1.717 2.4367 3.433 2.4367 1.606 0 3.102-.6645 3.655-1.6614zm20.742 4.9839v1.994h-8.694v-35.997h8.694v13.0697c1.163-1.3291 3.6-2.5475 6.148-2.5475 7.199 0 11.131 5.8149 11.131 13.0143s-3.932 13.0145-11.131 13.0145c-2.548 0-4.985-1.219-6.148-2.548zm0-13.7893v6.5902c.665 1.3845 2.105 2.326 3.822 2.326 2.99 0 4.762-2.3814 4.762-5.5934s-1.772-5.6488-4.762-5.6488c-1.662 0-3.157.9969-3.822 2.326zm28.759-20.2137v35.997h-8.695v-35.997zm19.172 27.3023h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.516-13.0143 7.642 0 11.962 5.095 11.962 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.157-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.434 1.2737-3.988 3.5997h7.532c-.111-2.0491-1.384-3.5997-3.544-3.5997z" fill="#d30001"/></svg>
106
Added:
</header>
107
Added:
<article>
108
Added:
<p><strong>Your browser is not supported.</strong><br> Please upgrade your browser to continue.</p>
109
Added:
</article>
110
Added:
</main>
111
Added:
112
Added:
</body>
113
Added:
114
Added:
</html>
public/422.html
@@ -0,0 +1,114 @@
1
Added:
<!doctype html>
2
Added:
3
Added:
<html lang="en">
4
Added:
5
Added:
<head>
6
Added:
7
Added:
<title>The change you wanted was rejected (422 Unprocessable Entity)</title>
8
Added:
9
Added:
<meta charset="utf-8">
10
Added:
<meta name="viewport" content="initial-scale=1, width=device-width">
11
Added:
<meta name="robots" content="noindex, nofollow">
12
Added:
13
Added:
<style>
14
Added:
15
Added:
*, *::before, *::after {
16
Added:
box-sizing: border-box;
17
Added:
}
18
Added:
19
Added:
* {
20
Added:
margin: 0;
21
Added:
}
22
Added:
23
Added:
html {
24
Added:
font-size: 16px;
25
Added:
}
26
Added:
27
Added:
body {
28
Added:
background: #FFF;
29
Added:
color: #261B23;
30
Added:
display: grid;
31
Added:
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
32
Added:
font-size: clamp(1rem, 2.5vw, 2rem);
33
Added:
-webkit-font-smoothing: antialiased;
34
Added:
font-style: normal;
35
Added:
font-weight: 400;
36
Added:
letter-spacing: -0.0025em;
37
Added:
line-height: 1.4;
38
Added:
min-height: 100vh;
39
Added:
place-items: center;
40
Added:
text-rendering: optimizeLegibility;
41
Added:
-webkit-text-size-adjust: 100%;
42
Added:
}
43
Added:
44
Added:
a {
45
Added:
color: inherit;
46
Added:
font-weight: 700;
47
Added:
text-decoration: underline;
48
Added:
text-underline-offset: 0.0925em;
49
Added:
}
50
Added:
51
Added:
b, strong {
52
Added:
font-weight: 700;
53
Added:
}
54
Added:
55
Added:
i, em {
56
Added:
font-style: italic;
57
Added:
}
58
Added:
59
Added:
main {
60
Added:
display: grid;
61
Added:
gap: 1em;
62
Added:
padding: 2em;
63
Added:
place-items: center;
64
Added:
text-align: center;
65
Added:
}
66
Added:
67
Added:
main header {
68
Added:
width: min(100%, 12em);
69
Added:
}
70
Added:
71
Added:
main header svg {
72
Added:
height: auto;
73
Added:
max-width: 100%;
74
Added:
width: 100%;
75
Added:
}
76
Added:
77
Added:
main article {
78
Added:
width: min(100%, 30em);
79
Added:
}
80
Added:
81
Added:
main article p {
82
Added:
font-size: 75%;
83
Added:
}
84
Added:
85
Added:
main article br {
86
Added:
87
Added:
display: none;
88
Added:
89
Added:
@media(min-width: 48em) {
90
Added:
display: inline;
91
Added:
}
92
Added:
93
Added:
}
94
Added:
95
Added:
</style>
96
Added:
97
Added:
</head>
98
Added:
99
Added:
<body>
100
Added:
101
Added:
<!-- This file lives in public/422.html -->
102
Added:
103
Added:
<main>
104
Added:
<header>
105
Added:
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm130.453 51.63681c0-8.9215-6.218-15.4099-15.681-15.4099-10.273 0-15.95 7.5698-16.491 16.4913h-44.608c3.244-30.8199 25.683-55.421707 61.099-55.421707 36.498 0 59.477 20.816907 59.477 51.636807 0 21.3577-14.869 36.7676-31.901 52.7186l-27.305 27.035h59.747v37.308h-120.306v-27.846l57.044-56.7736c11.084-11.8954 18.925-20.0059 18.925-29.7385zm140.455 0c0-8.9215-6.218-15.4099-15.68-15.4099-10.274 0-15.951 7.5698-16.492 16.4913h-44.608c3.245-30.8199 25.684-55.421707 61.1-55.421707 36.497 0 59.477 20.816907 59.477 51.636807 0 21.3577-14.87 36.7676-31.902 52.7186l-27.305 27.035h59.747v37.308h-120.305v-27.846l57.043-56.7736c11.085-11.8954 18.925-20.0059 18.925-29.7385z" fill="#f0eff0"/><path d="m19.3936 103.554c-8.9715 0-14.84183-5.0952-14.84183-14.4544v-20.1029h8.86083v19.3276c0 4.8181 2.2706 7.3102 5.981 7.3102 3.6551 0 5.9257-2.4921 5.9257-7.3102v-19.3276h8.8608v20.1583c0 9.3038-5.8149 14.399-14.7865 14.399zm18.734-.554v-24.921h8.6947v2.1598c1.3845-1.5506 3.8212-2.7136 6.701-2.7136 5.538 0 8.8054 3.5997 8.8054 9.1377v16.3371h-8.6393v-14.2327c0-2.049-1.0522-3.5443-3.2674-3.5443-1.7168 0-3.1567.9969-3.5997 2.7136v15.0634zm36.8584-1.994v10.799h-8.6946v-33.726h8.6946v1.9937c1.163-1.3291 3.5997-2.5475 6.1472-2.5475 7.1994 0 11.1314 5.8703 11.1314 13.0143 0 7.0886-3.932 13.0145-11.1314 13.0145-2.5475 0-4.9842-1.219-6.1472-2.548zm0-13.7893v6.5902c.6646 1.3845 2.1599 2.326 3.8213 2.326 2.9905 0 4.7626-2.3814 4.7626-5.5934s-1.7721-5.6488-4.7626-5.6488c-1.7168 0-3.1567.9969-3.8213 2.326zm36.789-9.2485v8.3624c-1.052-.5538-2.215-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.6949v-24.921h8.6949v2.2152c1.218-1.6614 3.156-2.769 5.648-2.769 1.108 0 1.994.2215 2.382.443zm26.769 12.5713c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.528 0c0-3.4336-1.496-5.8703-4.209-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.209-2.3813 4.209-5.8149zm10.352 0c0-7.6978 5.095-13.0143 12.571-13.0143 6.701 0 10.855 3.9874 11.574 9.8023h-8.417c-.222-1.4953-1.385-2.6029-3.157-2.6029-2.437 0-3.987 2.2706-3.987 5.8149s1.55 5.7595 3.987 5.7595c1.772 0 2.935-1.0522 3.157-2.5475h8.417c-.719 5.7596-4.873 9.8025-11.574 9.8025-7.476 0-12.571-5.3167-12.571-13.0145zm42.013 3.7658h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.516-13.0143 7.642 0 11.962 5.095 11.962 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.434 1.2737-3.988 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.544-3.5997zm13.428 11.0206h8.473c.387 1.3845 1.606 2.1598 3.156 2.1598 1.44 0 2.548-.5538 2.548-1.7168 0-.9414-.72-1.2737-1.938-1.5506l-4.874-.9969c-4.153-.886-6.867-2.8797-6.867-7.2547 0-5.3165 4.763-8.4178 10.633-8.4178 6.812 0 10.522 3.1567 11.297 8.0855h-8.03c-.277-1.0522-1.052-1.9937-3.046-1.9937-1.273 0-2.326.5538-2.326 1.6614 0 .7753.554 1.163 1.717 1.3845l4.929 1.163c4.541 1.0522 6.978 3.4335 6.978 7.4763 0 5.3168-4.818 8.2518-10.91 8.2518-6.369 0-10.965-2.88-11.74-8.2518zm24.269 0h8.474c.387 1.3845 1.606 2.1598 3.156 2.1598 1.44 0 2.548-.5538 2.548-1.7168 0-.9414-.72-1.2737-1.939-1.5506l-4.873-.9969c-4.154-.886-6.867-2.8797-6.867-7.2547 0-5.3165 4.763-8.4178 10.633-8.4178 6.812 0 10.522 3.1567 11.297 8.0855h-8.03c-.277-1.0522-1.052-1.9937-3.046-1.9937-1.273 0-2.326.5538-2.326 1.6614 0 .7753.554 1.163 1.717 1.3845l4.929 1.163c4.541 1.0522 6.978 3.4335 6.978 7.4763 0 5.3168-4.818 8.2518-10.91 8.2518-6.369 0-10.965-2.88-11.741-8.2518zm47.918 7.6978h-8.363v-1.274c-.831.831-3.323 1.717-5.981 1.717-4.929 0-9.082-2.769-9.082-8.0301 0-4.818 4.153-7.9193 9.581-7.9193 2.049 0 4.485.6646 5.482 1.3845v-1.606c0-1.606-.941-2.9905-3.046-2.9905-1.606 0-2.547.7199-2.935 1.8275h-8.196c.72-4.8181 4.984-8.6393 11.408-8.6393 7.089 0 11.132 3.7659 11.132 10.2453zm-8.363-6.9779v-1.4399c-.554-1.0522-2.049-1.7167-3.655-1.7167-1.717 0-3.434.7199-3.434 2.3813 0 1.7168 1.717 2.4367 3.434 2.4367 1.606 0 3.101-.6645 3.655-1.6614zm20.742 4.9839v1.994h-8.695v-35.997h8.695v13.0697c1.163-1.3291 3.6-2.5475 6.147-2.5475 7.2 0 11.132 5.8149 11.132 13.0143s-3.932 13.0145-11.132 13.0145c-2.547 0-4.984-1.219-6.147-2.548zm0-13.7893v6.5902c.665 1.3845 2.105 2.326 3.821 2.326 2.991 0 4.763-2.3814 4.763-5.5934s-1.772-5.6488-4.763-5.6488c-1.661 0-3.156.9969-3.821 2.326zm28.759-20.2137v35.997h-8.695v-35.997zm19.172 27.3023h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm25.461-15.2849h24.311v7.6424h-15.561v5.3165h14.232v7.4763h-14.232v5.8703h15.561v7.6978h-24.311zm27.942 34.0033v-24.921h8.694v2.1598c1.385-1.5506 3.822-2.7136 6.701-2.7136 5.538 0 8.806 3.5997 8.806 9.1377v16.3371h-8.639v-14.2327c0-2.049-1.053-3.5443-3.268-3.5443-1.717 0-3.157.9969-3.6 2.7136v15.0634zm29.991-8.5839v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.206v6.7564h-5.206v8.307c0 1.9383.941 2.769 2.658 2.769.942 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm26.161-16.3371v24.921h-8.694v-24.921zm.61-6.7564c0 2.8244-2.271 4.652-4.929 4.652s-4.929-1.8276-4.929-4.652c0-2.8797 2.271-4.7073 4.929-4.7073s4.929 1.8276 4.929 4.7073zm5.382 23.0935v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.206v6.7564h-5.206v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm29.22 17.3889h-8.584l3.655-9.414-9.303-24.312h9.026l4.763 14.1773 4.652-14.1773h8.639z" fill="#d30001"/></svg>
106
Added:
</header>
107
Added:
<article>
108
Added:
<p><strong>The change you wanted was rejected.</strong> Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.</p>
109
Added:
</article>
110
Added:
</main>
111
Added:
112
Added:
</body>
113
Added:
114
Added:
</html>
public/500.html
@@ -0,0 +1,114 @@
1
Added:
<!doctype html>
2
Added:
3
Added:
<html lang="en">
4
Added:
5
Added:
<head>
6
Added:
7
Added:
<title>We’re sorry, but something went wrong (500 Internal Server Error)</title>
8
Added:
9
Added:
<meta charset="utf-8">
10
Added:
<meta name="viewport" content="initial-scale=1, width=device-width">
11
Added:
<meta name="robots" content="noindex, nofollow">
12
Added:
13
Added:
<style>
14
Added:
15
Added:
*, *::before, *::after {
16
Added:
box-sizing: border-box;
17
Added:
}
18
Added:
19
Added:
* {
20
Added:
margin: 0;
21
Added:
}
22
Added:
23
Added:
html {
24
Added:
font-size: 16px;
25
Added:
}
26
Added:
27
Added:
body {
28
Added:
background: #FFF;
29
Added:
color: #261B23;
30
Added:
display: grid;
31
Added:
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
32
Added:
font-size: clamp(1rem, 2.5vw, 2rem);
33
Added:
-webkit-font-smoothing: antialiased;
34
Added:
font-style: normal;
35
Added:
font-weight: 400;
36
Added:
letter-spacing: -0.0025em;
37
Added:
line-height: 1.4;
38
Added:
min-height: 100vh;
39
Added:
place-items: center;
40
Added:
text-rendering: optimizeLegibility;
41
Added:
-webkit-text-size-adjust: 100%;
42
Added:
}
43
Added:
44
Added:
a {
45
Added:
color: inherit;
46
Added:
font-weight: 700;
47
Added:
text-decoration: underline;
48
Added:
text-underline-offset: 0.0925em;
49
Added:
}
50
Added:
51
Added:
b, strong {
52
Added:
font-weight: 700;
53
Added:
}
54
Added:
55
Added:
i, em {
56
Added:
font-style: italic;
57
Added:
}
58
Added:
59
Added:
main {
60
Added:
display: grid;
61
Added:
gap: 1em;
62
Added:
padding: 2em;
63
Added:
place-items: center;
64
Added:
text-align: center;
65
Added:
}
66
Added:
67
Added:
main header {
68
Added:
width: min(100%, 12em);
69
Added:
}
70
Added:
71
Added:
main header svg {
72
Added:
height: auto;
73
Added:
max-width: 100%;
74
Added:
width: 100%;
75
Added:
}
76
Added:
77
Added:
main article {
78
Added:
width: min(100%, 30em);
79
Added:
}
80
Added:
81
Added:
main article p {
82
Added:
font-size: 75%;
83
Added:
}
84
Added:
85
Added:
main article br {
86
Added:
87
Added:
display: none;
88
Added:
89
Added:
@media(min-width: 48em) {
90
Added:
display: inline;
91
Added:
}
92
Added:
93
Added:
}
94
Added:
95
Added:
</style>
96
Added:
97
Added:
</head>
98
Added:
99
Added:
<body>
100
Added:
101
Added:
<!-- This file lives in public/500.html -->
102
Added:
103
Added:
<main>
104
Added:
<header>
105
Added:
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m101.23 93.8427c-8.1103 0-15.4098 3.7849-19.7354 8.3813h-36.2269v-99.21891h103.8143v37.03791h-68.3984v24.8722c5.1366-2.7035 15.1396-5.9477 24.6014-5.9477 35.146 0 56.233 22.7094 56.233 55.4215 0 34.605-23.791 57.315-60.558 57.315-37.8492 0-61.64-22.169-63.8028-55.963h42.9857c1.0814 10.814 9.1919 19.195 21.6281 19.195 11.355 0 19.465-8.381 19.465-20.547 0-11.625-7.299-20.5463-20.006-20.5463zm138.833 77.8613c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm140.456 133.2831c-40.823 0-64.884-35.146-64.884-85.7015 0-50.5554 24.061-85.700907 64.884-85.700907 40.822 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.062 85.7015-64.884 85.7015zm0-133.2831c-17.573 0-22.71 21.8984-22.71 47.5816 0 25.6835 5.137 47.5815 22.71 47.5815 17.302 0 22.709-21.898 22.709-47.5815 0-25.6832-5.407-47.5816-22.709-47.5816z" fill="#f0eff0"/><path d="m23.1377 68.9967v34.0033h-8.9162v-34.0033zm4.3157 34.0033v-24.921h8.6947v2.1598c1.3845-1.5506 3.8212-2.7136 6.701-2.7136 5.538 0 8.8054 3.5997 8.8054 9.1377v16.3371h-8.6393v-14.2327c0-2.049-1.0522-3.5443-3.2674-3.5443-1.7168 0-3.1567.9969-3.5997 2.7136v15.0634zm29.9913-8.5839v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.5839v6.8671h5.2058v6.7564h-5.2058v8.307c0 1.9383.9415 2.769 2.6583 2.769.9414 0 1.9937-.2216 2.769-.5538v7.3654c-.9969.443-2.8798.775-4.8181.775-5.8703 0-9.1931-2.769-9.1931-9.0819zm32.3666-.1108h8.0301c-.8861 5.7597-5.2057 9.2487-11.6852 9.2487-7.6424 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.3165-13.0143 12.5159-13.0143 7.6424 0 11.9621 5.095 11.9621 12.5159v2.1598h-16.1156c.2769 2.9905 1.8275 4.5965 4.3196 4.5965 1.7722 0 3.1567-.7753 3.6551-2.4921zm-3.8212-10.0237c-2.0491 0-3.4336 1.2737-3.9874 3.5997h7.5317c-.1107-2.0491-1.3845-3.5997-3.5443-3.5997zm31.4299-6.3134v8.3624c-1.052-.5538-2.215-.7753-3.599-.7753-2.382 0-3.988 1.0522-4.431 2.8244v14.6203h-8.694v-24.921h8.694v2.2152c1.219-1.6614 3.157-2.769 5.649-2.769 1.108 0 1.994.2215 2.381.443zm2.949 25.0318v-24.921h8.694v2.1598c1.385-1.5506 3.821-2.7136 6.701-2.7136 5.538 0 8.806 3.5997 8.806 9.1377v16.3371h-8.64v-14.2327c0-2.049-1.052-3.5443-3.267-3.5443-1.717 0-3.157.9969-3.6 2.7136v15.0634zm50.371 0h-8.363v-1.274c-.83.831-3.323 1.717-5.981 1.717-4.929 0-9.082-2.769-9.082-8.0301 0-4.818 4.153-7.9193 9.581-7.9193 2.049 0 4.485.6646 5.482 1.3845v-1.606c0-1.606-.941-2.9905-3.046-2.9905-1.606 0-2.547.7199-2.935 1.8275h-8.196c.72-4.8181 4.984-8.6393 11.408-8.6393 7.089 0 11.132 3.7659 11.132 10.2453zm-8.363-6.9779v-1.4399c-.554-1.0522-2.049-1.7167-3.655-1.7167-1.717 0-3.433.7199-3.433 2.3813 0 1.7168 1.716 2.4367 3.433 2.4367 1.606 0 3.101-.6645 3.655-1.6614zm20.742-29.0191v35.997h-8.694v-35.997zm13.036 25.9178h9.248c.72 2.326 2.714 3.489 5.483 3.489 2.713 0 4.596-1.163 4.596-3.2674 0-1.6061-1.052-2.326-3.212-2.8244l-6.534-1.3845c-4.985-1.1076-8.751-3.7105-8.751-9.47 0-6.6456 5.538-11.0206 13.07-11.0206 8.307 0 13.014 4.5411 13.956 10.4114h-8.695c-.72-1.8829-2.27-3.3228-5.205-3.3228-2.548 0-4.265 1.1076-4.265 2.9905 0 1.4953 1.052 2.326 2.825 2.7137l6.645 1.5506c5.815 1.3845 9.027 4.5412 9.027 9.8023 0 6.9778-5.87 10.9654-13.291 10.9654-8.141 0-13.679-3.9322-14.897-10.6332zm46.509 1.3845h8.031c-.887 5.7597-5.206 9.2487-11.686 9.2487-7.642 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.317-13.0143 12.516-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.319 4.5965 1.773 0 3.157-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm31.431-6.3134v8.3624c-1.053-.5538-2.216-.7753-3.6-.7753-2.381 0-3.988 1.0522-4.431 2.8244v14.6203h-8.694v-24.921h8.694v2.2152c1.219-1.6614 3.157-2.769 5.649-2.769 1.108 0 1.994.2215 2.382.443zm18.288 25.0318h-7.809l-9.47-24.921h8.861l4.763 14.288 4.652-14.288h8.528zm25.614-8.6947h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.642 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.516-13.0143 7.642 0 11.962 5.095 11.962 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.157-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.434 1.2737-3.988 3.5997h7.532c-.111-2.0491-1.384-3.5997-3.544-3.5997zm31.43-6.3134v8.3624c-1.052-.5538-2.215-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.695v-24.921h8.695v2.2152c1.218-1.6614 3.157-2.769 5.649-2.769 1.107 0 1.993.2215 2.381.443zm13.703-8.9715h24.312v7.6424h-15.562v5.3165h14.232v7.4763h-14.232v5.8703h15.562v7.6978h-24.312zm44.667 8.9715v8.3624c-1.052-.5538-2.215-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.695v-24.921h8.695v2.2152c1.218-1.6614 3.156-2.769 5.648-2.769 1.108 0 1.994.2215 2.382.443zm19.673 0v8.3624c-1.053-.5538-2.216-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.695v-24.921h8.695v2.2152c1.218-1.6614 3.156-2.769 5.648-2.769 1.108 0 1.994.2215 2.382.443zm26.769 12.5713c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.529 0c0-3.4336-1.495-5.8703-4.208-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.208-2.3813 4.208-5.8149zm28.082-12.5713v8.3624c-1.052-.5538-2.215-.7753-3.6-.7753-2.381 0-3.987 1.0522-4.43 2.8244v14.6203h-8.695v-24.921h8.695v2.2152c1.218-1.6614 3.157-2.769 5.649-2.769 1.107 0 1.993.2215 2.381.443z" fill="#d30001"/></svg>
106
Added:
</header>
107
Added:
<article>
108
Added:
<p><strong>We’re sorry, but something went wrong.</strong><br> If you’re the application owner check the logs for more information.</p>
109
Added:
</article>
110
Added:
</main>
111
Added:
112
Added:
</body>
113
Added:
114
Added:
</html>
public/icon.png
Binary files differ
public/icon.svg
@@ -0,0 +1,3 @@
1
Added:
<svg width="512" height="512" xmlns="http://www.w3.org/2000/svg">
2
Added:
<circle cx="256" cy="256" r="256" fill="red"/>
3
Added:
</svg>
public/robots.txt
@@ -0,0 +1,1 @@
1
Added:
# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
script/.keep
storage/.keep
test/application_system_test_case.rb
@@ -0,0 +1,5 @@
1
Added:
require "test_helper"
2
Added:
3
Added:
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4
Added:
driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ]
5
Added:
end
test/controllers/.keep
test/controllers/home_controller_test.rb
@@ -0,0 +1,16 @@
1
Added:
require "test_helper"
2
Added:
3
Added:
class HomeControllerTest < ActionDispatch::IntegrationTest
4
Added:
test "should get index" do
5
Added:
get root_url
6
Added:
assert_response :success
7
Added:
assert_select "h1", "World Tartiflette Tour 2024"
8
Added:
end
9
Added:
10
Added:
test "should list tartiflettes in the index" do
11
Added:
tartiflette = Tartiflette.create!(scoring_id: 1)
12
Added:
get root_url
13
Added:
assert_response :success
14
Added:
assert_select "li", tartiflette.scoring_id.to_s
15
Added:
end
16
Added:
end
test/controllers/scores_controller_test.rb
@@ -0,0 +1,70 @@
1
Added:
require "test_helper"
2
Added:
3
Added:
class ScoresControllerTest < ActionDispatch::IntegrationTest
4
Added:
setup do
5
Added:
@tartiflette = Tartiflette.create!(scoring_id: 1)
6
Added:
@criterium = ScoringCriterium.create!(name: "Taste", category: "Flavor")
7
Added:
@score = Score.create!(tartiflette: @tartiflette, scoring_criterium: @criterium, value: 4)
8
Added:
end
9
Added:
10
Added:
test "should get new score form" do
11
Added:
get new_tartiflette_score_path(@tartiflette)
12
Added:
assert_response :success
13
Added:
assert_select "form"
14
Added:
assert_select "select[name=?]", "scores[#{@criterium.id}][value]"
15
Added:
end
16
Added:
17
Added:
test "should create scores for tartiflette" do
18
Added:
assert_difference("Score.count", 1) do
19
Added:
post tartiflette_scores_path(@tartiflette), params: {
20
Added:
scores: { @criterium.id => { value: 5 } }
21
Added:
}
22
Added:
end
23
Added:
assert_redirected_to root_path
24
Added:
end
25
Added:
26
Added:
# test "should not create scores if already scored" do
27
Added:
# session = { :scored_tartiflettes => [ @tartiflette.id ] }
28
Added:
# assert_no_difference("Score.count") do
29
Added:
# post tartiflette_scores_path(@tartiflette), params: {
30
Added:
# scores: { @criterium.id => { value: 5 } }
31
Added:
# }
32
Added:
# end
33
Added:
# assert_redirected_to root_path
34
Added:
# assert_match /Vous avez déja noté cette tartiflette/, flash[:alert]
35
Added:
# end
36
Added:
37
Added:
test "should not create scores with invalid data" do
38
Added:
assert_no_difference("Score.count") do
39
Added:
post tartiflette_scores_path(@tartiflette), params: {
40
Added:
scores: { @criterium.id => { value: nil } }
41
Added:
}
42
Added:
end
43
Added:
assert_response :unprocessable_entity
44
Added:
end
45
Added:
46
Added:
test "should get edit scores form" do
47
Added:
get tartiflette_edit_scores_path(@tartiflette)
48
Added:
assert_response :success
49
Added:
assert_select "form"
50
Added:
assert_select "select[name=?]", "scores[#{@criterium.id}][value]"
51
Added:
end
52
Added:
53
Added:
test "should update scores for tartiflette" do
54
Added:
patch tartiflette_update_scores_path(@tartiflette), params: {
55
Added:
scores: { @score.id => { value: 3 } }
56
Added:
}
57
Added:
assert_redirected_to root_path
58
Added:
@score.reload
59
Added:
assert_equal 3, @score.value
60
Added:
end
61
Added:
62
Added:
# test "should not update scores with invalid data" do
63
Added:
# patch tartiflette_update_scores_path(@tartiflette), params: {
64
Added:
# scores: { @score.id => { value: nil } }
65
Added:
# }
66
Added:
# @score.reload
67
Added:
# assert_not_equal nil, @score.value
68
Added:
# assert_redirected_to tartiflette_edit_scores_path(@tartiflette)
69
Added:
# end
70
Added:
end
test/fixtures/files/.keep
test/fixtures/scores.yml
@@ -0,0 +1,11 @@
1
Added:
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
Added:
3
Added:
one:
4
Added:
tartiflette: one
5
Added:
scoring_criterium: one
6
Added:
value: 1
7
Added:
8
Added:
two:
9
Added:
tartiflette: two
10
Added:
scoring_criterium: two
11
Added:
value: 2
test/fixtures/scoring_criteria.yml
@@ -0,0 +1,50 @@
1
Added:
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
Added:
3
Added:
one:
4
Added:
category: visuel
5
Added:
name: présence de la pastille
6
Added:
7
Added:
two:
8
Added:
category: visuel
9
Added:
name: croûte dorée
10
Added:
11
Added:
three:
12
Added:
category: visuel
13
Added:
name: lardons apparents
14
Added:
15
Added:
16
Added:
four:
17
Added:
category: texture
18
Added:
name: Pommes de terre fondantes
19
Added:
20
Added:
five:
21
Added:
category: texture
22
Added:
name: lardons grillés
23
Added:
24
Added:
six:
25
Added:
category: texture
26
Added:
name: oignons biens cuits
27
Added:
28
Added:
29
Added:
seven:
30
Added:
category: goût
31
Added:
name: Reblochon savoureux
32
Added:
33
Added:
eight:
34
Added:
category: goût
35
Added:
name: lardons appétants
36
Added:
37
Added:
nine:
38
Added:
category: goût
39
Added:
name: vin blanc équilibré
40
Added:
41
Added:
42
Added:
ten:
43
Added:
category: special
44
Added:
name: on en reveut !
45
Added:
eleven:
46
Added:
category: special
47
Added:
name: Quelqu'un cherche à dépasser les maestros...
48
Added:
twelve:
49
Added:
category: special
50
Added:
name: on reconnaît la patte du tartifleur
test/fixtures/tartiflettes.yml
@@ -0,0 +1,7 @@
1
Added:
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
Added:
3
Added:
one:
4
Added:
scoring_id: 1
5
Added:
6
Added:
two:
7
Added:
scoring_id: 2
test/fixtures/users.yml
@@ -0,0 +1,9 @@
1
Added:
<% password_digest = BCrypt::Password.create("password") %>
2
Added:
3
Added:
one:
4
Added:
email_address: one@example.com
5
Added:
password_digest: <%= password_digest %>
6
Added:
7
Added:
two:
8
Added:
email_address: two@example.com
9
Added:
password_digest: <%= password_digest %>
test/helpers/.keep
test/integration/.keep
test/mailers/.keep
test/mailers/previews/passwords_mailer_preview.rb
@@ -0,0 +1,7 @@
1
Added:
# Preview all emails at http://localhost:3000/rails/mailers/passwords_mailer
2
Added:
class PasswordsMailerPreview < ActionMailer::Preview
3
Added:
# Preview this email at http://localhost:3000/rails/mailers/passwords_mailer/reset
4
Added:
def reset
5
Added:
PasswordsMailer.reset(User.take)
6
Added:
end
7
Added:
end
test/models/.keep
test/models/score_test.rb
@@ -0,0 +1,41 @@
1
Added:
require "test_helper"
2
Added:
3
Added:
class ScoreTest < ActiveSupport::TestCase
4
Added:
def setup
5
Added:
@score = scores(:one)
6
Added:
end
7
Added:
8
Added:
test "should be valid with valid attributes" do
9
Added:
assert @score.valid?
10
Added:
end
11
Added:
12
Added:
test "should have associated tartiflette" do
13
Added:
@score.tartiflette = nil
14
Added:
assert_not @score.valid?, "Score has no associated tartiflette."
15
Added:
end
16
Added:
17
Added:
test "should have associated scoring_criterium" do
18
Added:
@score.scoring_criterium = nil
19
Added:
assert_not @score.valid?, "Score has no associated scoring_criterium."
20
Added:
end
21
Added:
22
Added:
test "should have value" do
23
Added:
@score.value = nil
24
Added:
assert_not @score.valid?, "Score has no value."
25
Added:
end
26
Added:
27
Added:
test "value should be between 1 and 5" do
28
Added:
@score.value = 3
29
Added:
assert @score.valid?, "Score value is invalid."
30
Added:
end
31
Added:
32
Added:
test "value should be greater than or equal to 1" do
33
Added:
@score.value = 0
34
Added:
assert_not @score.valid?, "Score is less than 1."
35
Added:
end
36
Added:
37
Added:
test "value should be less than or equal to 5" do
38
Added:
@score.value = 6
39
Added:
assert_not @score.valid?, "Score is greater than 5."
40
Added:
end
41
Added:
end
test/models/scoring_criterium_test.rb
@@ -0,0 +1,21 @@
1
Added:
require "test_helper"
2
Added:
3
Added:
class ScoringCriteriumTest < ActiveSupport::TestCase
4
Added:
def setup
5
Added:
@scoring_criterium = scoring_criteria(:one)
6
Added:
end
7
Added:
8
Added:
test "should be valid with valid attributes" do
9
Added:
assert @scoring_criterium.valid?
10
Added:
end
11
Added:
12
Added:
test "should have category" do
13
Added:
@scoring_criterium.category = nil
14
Added:
assert_not @scoring_criterium.valid?, "Scoring Criterium has no category."
15
Added:
end
16
Added:
17
Added:
test "should have name" do
18
Added:
@scoring_criterium.name = nil
19
Added:
assert_not @scoring_criterium.valid?, "Scoring Criterium has no name."
20
Added:
end
21
Added:
end
test/models/tartiflette_test.rb
@@ -0,0 +1,11 @@
1
Added:
require "test_helper"
2
Added:
3
Added:
class TartifletteTest < ActiveSupport::TestCase
4
Added:
def setup
5
Added:
@tartiflette = tartiflettes(:one)
6
Added:
end
7
Added:
8
Added:
test "should be valid with valid attributes" do
9
Added:
assert @tartiflette.valid?
10
Added:
end
11
Added:
end
test/models/user_test.rb
@@ -0,0 +1,7 @@
1
Added:
require "test_helper"
2
Added:
3
Added:
class UserTest < ActiveSupport::TestCase
4
Added:
# test "the truth" do
5
Added:
# assert true
6
Added:
# end
7
Added:
end
test/services/tartiflette_scoring_service.rb
@@ -0,0 +1,48 @@
1
Added:
require "test_helper"
2
Added:
3
Added:
class TartifletteScoringServiceTest < ActiveSupport::TestCase
4
Added:
setup do
5
Added:
@tartiflette = Tartiflette.new(scoring_id: 1)
6
Added:
@session = {}
7
Added:
end
8
Added:
9
Added:
test "should check if tartiflette is already scored" do
10
Added:
@session[:scored_tartiflettes] = [ @tartiflette.id ]
11
Added:
assert TartifletteScoringService.scored?(@tartiflette, @session)
12
Added:
end
13
Added:
14
Added:
test "should mark tartiflette as scored" do
15
Added:
TartifletteScoringService.mark_as_scored(@tartiflette, @session)
16
Added:
assert_includes @session[:scored_tartiflettes], @tartiflette.id
17
Added:
end
18
Added:
19
Added:
test "should calculate average of all scores for a tartiflette" do
20
Added:
Score.create!(tartiflette: @tartiflette,
21
Added:
scoring_criterium: scoring_criteria(:one),
22
Added:
value: 4)
23
Added:
Score.create!(tartiflette: @tartiflette,
24
Added:
scoring_criterium: scoring_criteria(:two),
25
Added:
value: 5)
26
Added:
assert_equal 4.5, TartifletteScoringService.average_score(@tartiflette)
27
Added:
end
28
Added:
29
Added:
test "should calculate average score by category for a tartiflette" do
30
Added:
Score.create!(tartiflette: @tartiflette,
31
Added:
scoring_criterium: scoring_criteria(:one),
32
Added:
value: 1)
33
Added:
Score.create!(tartiflette: @tartiflette,
34
Added:
scoring_criterium: scoring_criteria(:one),
35
Added:
value: 2)
36
Added:
Score.create!(tartiflette: @tartiflette,
37
Added:
scoring_criterium: scoring_criteria(:four),
38
Added:
value: 4)
39
Added:
Score.create!(tartiflette: @tartiflette,
40
Added:
scoring_criterium: scoring_criteria(:four),
41
Added:
value: 5)
42
Added:
average_score_by_category = { scoring_criteria(:one)[:category] => 1.5,
43
Added:
scoring_criteria(:four)[:category] => 4.5
44
Added:
}
45
Added:
assert_equal average_score_by_category,
46
Added:
TartifletteScoringService.average_score_by_category(@tartiflette)
47
Added:
end
48
Added:
end
test/system/.keep
test/test_helper.rb
@@ -0,0 +1,15 @@
1
Added:
ENV["RAILS_ENV"] ||= "test"
2
Added:
require_relative "../config/environment"
3
Added:
require "rails/test_help"
4
Added:
5
Added:
module ActiveSupport
6
Added:
class TestCase
7
Added:
# Run tests in parallel with specified workers
8
Added:
parallelize(workers: :number_of_processors)
9
Added:
10
Added:
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
11
Added:
fixtures :all
12
Added:
13
Added:
# Add more helper methods to be used by all tests here...
14
Added:
end
15
Added:
end
tmp/.keep
tmp/pids/.keep
tmp/storage/.keep
vendor/.gitignore
@@ -0,0 +1,1 @@
1
Added:
bundle/