Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
shells
signup-site
Commits
f8b3f23c
Commit
f8b3f23c
authored
Jul 15, 2017
by
Cool Fire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split portions off into logical subfiles
parent
df4261f8
Pipeline
#325
passed with stages
in 1 minute and 31 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
38 deletions
+49
-38
routes/code.rb
routes/code.rb
+28
-0
routes/details.rb
routes/details.rb
+18
-0
signup_site.rb
signup_site.rb
+3
-38
No files found.
routes/code.rb
0 → 100644
View file @
f8b3f23c
# frozen_string_literal: true
# Invite code handling
class
SignupSite
<
Sinatra
::
Base
get
'/enter-code'
do
ec
=
YAML
.
load_file
(
'content/enter-code.yaml'
)
@header
=
ec
[
'header'
]
@body
=
ec
[
'body'
]
@form
=
erb
:enter_code
@progress
=
25
erb
:index
end
post
'/check-code'
do
if
(
!
params
.
key?
:input_invite
)
||
params
[
:input_invite
].
empty?
||
params
[
:input_invite
]
!~
/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/
@header
=
'Insomnia 24/7 shells signup'
@body
=
'Invite code appears to be invalid. Please try again.'
@progress
=
25
erb
:index
else
session
[
:invite
]
=
Rack
::
Utils
.
escape_html
(
params
[
:input_invite
])
redirect
'/enter-details'
,
302
end
end
end
routes/details.rb
0 → 100644
View file @
f8b3f23c
# frozen_string_literal: true
# Singup details handling
class
SignupSite
<
Sinatra
::
Base
get
'/enter-details'
do
ed
=
YAML
.
load_file
(
'content/enter-details.yaml'
)
@header
=
ed
[
'header'
]
@blurb
=
ed
[
'blurb'
]
@body
=
ed
[
'body'
]
@form
=
erb
:enter_details
@progress
=
50
erb
:index
end
post
'/check-details'
do
# Some checking stuff
end
end
signup_site.rb
View file @
f8b3f23c
...
...
@@ -17,42 +17,7 @@ class SignupSite < Sinatra::Base
@progress
=
0
erb
:index
end
get
'/enter-code'
do
ec
=
YAML
.
load_file
(
'content/enter-code.yaml'
)
@header
=
ec
[
'header'
]
@body
=
ec
[
'body'
]
@form
=
erb
:enter_code
@progress
=
25
erb
:index
end
post
'/check-code'
do
if
(
!
params
.
key?
:input_invite
)
||
params
[
:input_invite
].
empty?
||
params
[
:input_invite
]
!~
/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/
@header
=
'Insomnia 24/7 shells signup'
@body
=
'Invite code appears to be invalid. Please try again.'
@progress
=
25
erb
:index
else
session
[
:invite
]
=
Rack
::
Utils
.
escape_html
(
params
[
:input_invite
])
redirect
'/enter-details'
,
302
end
end
get
'/enter-details'
do
ed
=
YAML
.
load_file
(
'content/enter-details.yaml'
)
@header
=
ed
[
'header'
]
@blurb
=
ed
[
'blurb'
]
@body
=
ed
[
'body'
]
@form
=
erb
:enter_details
@progress
=
50
erb
:index
end
post
'/check-details'
do
# Some checking stuff
end
end
require_relative
'routes/code'
require_relative
'routes/details'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment