add portal start copy (#109)

This commit is contained in:
nora 2025-12-15 12:09:56 -05:00 committed by GitHub
parent 2c19dbc689
commit 92eebe783b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 38 additions and 5 deletions

View file

@ -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

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View file

@ -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

View file

@ -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>

View 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>

View file

@ -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"