signup_site.rb 894 Bytes
Newer Older
Cool Fire's avatar
Cool Fire committed
1 2
# frozen_string_literal: true

Cool Fire's avatar
Cool Fire committed
3 4
require 'mysql2'
require 'pony'
Cool Fire's avatar
Cool Fire committed
5
require 'sinatra/base'
Cool Fire's avatar
Cool Fire committed
6
require 'yaml'
Cool Fire's avatar
Cool Fire committed
7 8 9

# Main class for signup site
class SignupSite < Sinatra::Base
10 11
  set :sessions, :expire_after => 60 * 60 * 4
  set :session_store, Rack::Session::Pool
12
  set :title, 'Shell signup - Insomnia 24/7'
13
  set :gitid, IO.read('.current')
Cool Fire's avatar
Cool Fire committed
14
  set :config, YAML.load_file('config.yaml')
15 16
  set :static, true
  set :static_cache_control, [:public, {:max_age => 3600}]
Cool Fire's avatar
Cool Fire committed
17 18

  get '/' do
19 20 21 22 23 24 25 26
    landing   = YAML.load_file('content/landing.yaml')
    @header   = landing['header']
    @blurb    = landing['blurb']
    @body     = landing['body']
    @form     = erb :landing
    @progress = 0
    erb :index
  end
Cool Fire's avatar
Cool Fire committed
27
end
28

Cool Fire's avatar
Cool Fire committed
29 30
require_relative 'helpers/email'
require_relative 'helpers/mysql'
31 32
require_relative 'routes/code'
require_relative 'routes/details'
33
require_relative 'routes/error'
Cool Fire's avatar
Cool Fire committed
34
require_relative 'routes/finished'