mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-20 00:25:21 +00:00
add portal start copy (#109)
This commit is contained in:
parent
2c19dbc689
commit
92eebe783b
7 changed files with 38 additions and 5 deletions
|
|
@ -2,8 +2,8 @@ module PortalFlow
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_action :validate_portal_return_url, only: [ :portal ]
|
||||
before_action :store_return_url, only: [ :portal ]
|
||||
before_action :validate_portal_return_url, only: [ :start, :portal ]
|
||||
before_action :store_return_url, only: [ :start, :portal ]
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
class Portal::VerificationsController < Portal::BaseController
|
||||
include VerificationFlow
|
||||
|
||||
def start
|
||||
@identity = current_identity
|
||||
status = @identity.verification_status
|
||||
|
||||
case status
|
||||
when "verified"
|
||||
redirect_to_portal_return(status: :verified)
|
||||
when "pending"
|
||||
redirect_to_portal_return(status: :pending)
|
||||
end
|
||||
end
|
||||
|
||||
def portal
|
||||
@identity = current_identity
|
||||
status = @identity.verification_status
|
||||
|
|
|
|||
BIN
app/frontend/images/emoji/hyper-dino-wave-flip.gif
Normal file
BIN
app/frontend/images/emoji/hyper-dino-wave-flip.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
|
|
@ -57,4 +57,8 @@ module ApplicationHelper
|
|||
options.each { |key, value| svg[key.to_s] = value }
|
||||
doc.to_html.html_safe
|
||||
end
|
||||
|
||||
def emoji_image(name, alt: name)
|
||||
vite_image_tag("images/emoji/#{name}", alt: alt, style: "height: 1em; vertical-align: baseline;")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@
|
|||
</div>
|
||||
|
||||
<div class="page-sections">
|
||||
<%= render "shared/verifications/document_form", form_url: portal_verify_path %>
|
||||
<%= render "shared/verifications/document_form", form_url: portal_verify_document_path %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
16
app/views/portal/verifications/start.html.erb
Normal file
16
app/views/portal/verifications/start.html.erb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<% content_for(:portal_wrapper, true) %>
|
||||
<div class="container-sm">
|
||||
<div class="page-sections">
|
||||
<article>
|
||||
<h1>hey! <%= emoji_image "hyper-dino-wave-flip.gif" %></h1>
|
||||
<p>We're excited to send you stuff!</p>
|
||||
<p>First, we need to verify you're under 18.</p>
|
||||
<p>In the past year, Hack Club has given out ~$1M in grants to students like you, and with that comes a lot of adults trying to slip in.</p>
|
||||
<p>This quick check helps us make sure our resources go to real teenage hackers.</p>
|
||||
|
||||
<div class="status-actions">
|
||||
<%= link_to "alright! →", portal_verify_document_path, role: "button" %>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -295,8 +295,9 @@ Rails.application.routes.draw do
|
|||
end
|
||||
|
||||
namespace :portal do
|
||||
get "verify", to: "verifications#portal"
|
||||
post "verify", to: "verifications#create"
|
||||
get "verify", to: "verifications#start"
|
||||
get "verify/document", to: "verifications#portal", as: :verify_document
|
||||
post "verify/document", to: "verifications#create"
|
||||
delete "verify", to: "verifications#cancel"
|
||||
get "address", to: "addresses#portal"
|
||||
post "address", to: "addresses#create"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue