plutonium 0.43.2 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/Rakefile +24 -6
  4. data/app/assets/plutonium.css +1 -1
  5. data/config/initializers/pagy.rb +1 -4
  6. data/gemfiles/rails_7.gemfile.lock +10 -5
  7. data/gemfiles/rails_8.0.gemfile.lock +9 -5
  8. data/gemfiles/rails_8.1.gemfile.lock +9 -5
  9. data/lib/generators/pu/invites/install_generator.rb +69 -11
  10. data/lib/generators/pu/invites/templates/INSTRUCTIONS +4 -1
  11. data/lib/generators/pu/invites/templates/app/interactions/invite_user_interaction.rb.tt +1 -1
  12. data/lib/generators/pu/invites/templates/app/interactions/user_invite_user_interaction.rb.tt +1 -1
  13. data/lib/generators/pu/invites/templates/packages/invites/app/controllers/invites/user_invitations_controller.rb.tt +5 -1
  14. data/lib/generators/pu/invites/templates/packages/invites/app/controllers/invites/welcome_controller.rb.tt +14 -24
  15. data/lib/generators/pu/invites/templates/packages/invites/app/mailers/invites/user_invite_mailer.rb.tt +2 -0
  16. data/lib/generators/pu/invites/templates/packages/invites/app/views/invites/user_invitations/show.html.erb.tt +3 -2
  17. data/lib/generators/pu/invites/templates/packages/invites/app/views/invites/welcome/pending_invitation.html.erb.tt +3 -2
  18. data/lib/generators/pu/lib/plutonium_generators/concerns/logger.rb +2 -0
  19. data/lib/generators/pu/lib/plutonium_generators/concerns/package_selector.rb +4 -6
  20. data/lib/generators/pu/lib/plutonium_generators/concerns/rodauth_redirects.rb +41 -0
  21. data/lib/generators/pu/lib/plutonium_generators/generator.rb +5 -1
  22. data/lib/generators/pu/lib/plutonium_generators/non_interactive_prompt.rb +27 -0
  23. data/lib/generators/pu/rodauth/templates/app/models/account.rb.tt +4 -0
  24. data/lib/generators/pu/saas/entity_generator.rb +16 -0
  25. data/lib/generators/pu/saas/membership_generator.rb +4 -3
  26. data/lib/generators/pu/saas/portal/USAGE +15 -0
  27. data/lib/generators/pu/saas/portal_generator.rb +122 -0
  28. data/lib/generators/pu/saas/setup/USAGE +17 -22
  29. data/lib/generators/pu/saas/setup_generator.rb +62 -9
  30. data/lib/generators/pu/saas/welcome/USAGE +27 -0
  31. data/lib/generators/pu/saas/welcome/templates/app/controllers/authenticated_controller.rb.tt +18 -0
  32. data/lib/generators/pu/saas/welcome/templates/app/controllers/welcome_controller.rb.tt +69 -0
  33. data/lib/generators/pu/saas/welcome/templates/app/views/layouts/welcome.html.erb.tt +33 -0
  34. data/lib/generators/pu/saas/welcome/templates/app/views/welcome/onboarding.html.erb.tt +51 -0
  35. data/lib/generators/pu/saas/welcome/templates/app/views/welcome/select_entity.html.erb.tt +22 -0
  36. data/lib/generators/pu/saas/welcome_generator.rb +197 -0
  37. data/lib/plutonium/auth/sequel_adapter.rb +1 -2
  38. data/lib/plutonium/core/controller.rb +18 -8
  39. data/lib/plutonium/core/controllers/association_resolver.rb +19 -6
  40. data/lib/plutonium/invites/concerns/cancel_invite.rb +3 -1
  41. data/lib/plutonium/invites/concerns/invite_user.rb +1 -1
  42. data/lib/plutonium/railtie.rb +1 -1
  43. data/lib/plutonium/resource/controller.rb +2 -3
  44. data/lib/plutonium/resource/controllers/crud_actions/index_action.rb +1 -1
  45. data/lib/plutonium/resource/controllers/presentable.rb +2 -0
  46. data/lib/plutonium/ui/form/components/resource_select.rb +1 -1
  47. data/lib/plutonium/ui/form/components/secure_association.rb +2 -2
  48. data/lib/plutonium/ui/form/components/secure_polymorphic_association.rb +6 -11
  49. data/lib/plutonium/ui/table/components/pagy_info.rb +1 -7
  50. data/lib/plutonium/ui/table/components/pagy_pagination.rb +4 -6
  51. data/lib/plutonium/version.rb +1 -1
  52. data/package.json +1 -1
  53. data/plutonium.gemspec +2 -2
  54. metadata +18 -10
@@ -0,0 +1,122 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators/base"
4
+ require_relative "../lib/plutonium_generators"
5
+
6
+ module Pu
7
+ module Saas
8
+ class PortalGenerator < ::Rails::Generators::Base
9
+ include PlutoniumGenerators::Generator
10
+
11
+ desc "Generate a SaaS portal with entity scoping, entity management, and navigation helpers"
12
+
13
+ class_option :entity_model, type: :string, required: true,
14
+ desc: "The entity model name (e.g., Organization)"
15
+
16
+ class_option :user_model, type: :string, default: "User",
17
+ desc: "The user model name"
18
+
19
+ class_option :portal_name, type: :string, default: "Dashboard",
20
+ desc: "Portal name (e.g., Dashboard generates DashboardPortal)"
21
+
22
+ class_option :rodauth, type: :string, default: "user",
23
+ desc: "Rodauth configuration name"
24
+
25
+ def start
26
+ create_portal
27
+ connect_entity_to_portal
28
+ customize_entity_policy
29
+ add_entity_url_helper
30
+ rescue => e
31
+ exception "#{self.class} failed:", e
32
+ end
33
+
34
+ private
35
+
36
+ def create_portal
37
+ generate "pu:pkg:portal", "#{options[:portal_name]} --auth=#{rodauth_config} --scope=#{entity_model}"
38
+ end
39
+
40
+ def connect_entity_to_portal
41
+ # Shell out so the subprocess can load the newly created entity model
42
+ generate "pu:res:conn", "#{entity_model} --dest=#{portal_package} --singular --policy"
43
+ end
44
+
45
+ def customize_entity_policy
46
+ content = <<-RUBY
47
+
48
+ def update?
49
+ current_membership&.owner?
50
+ end
51
+
52
+ def destroy?
53
+ false
54
+ end
55
+
56
+ def permitted_attributes_for_read
57
+ [:name]
58
+ end
59
+
60
+ def permitted_attributes_for_update
61
+ [:name]
62
+ end
63
+
64
+ def permitted_associations
65
+ []
66
+ end
67
+ RUBY
68
+ inject_into_file entity_policy_path, content, after: /include #{portal_engine}::ResourcePolicy\n/
69
+ end
70
+
71
+ def add_entity_url_helper
72
+ content = <<-RUBY
73
+
74
+ included do
75
+ helper_method :entity_url, :user_entities
76
+ end
77
+
78
+ private
79
+
80
+ # Returns the URL to the current entity's show page.
81
+ def entity_url
82
+ resource_url_for(current_scoped_entity)
83
+ end
84
+
85
+ # Returns all entities the current user belongs to (for the entity switcher).
86
+ def user_entities
87
+ @user_entities ||= current_user.#{entity_table.pluralize}
88
+ end
89
+ RUBY
90
+ inject_into_file concerns_controller_path, content, after: /# add concerns above\.\n/
91
+ end
92
+
93
+ def entity_model
94
+ options[:entity_model].camelize
95
+ end
96
+
97
+ def entity_table
98
+ options[:entity_model].underscore
99
+ end
100
+
101
+ def rodauth_config
102
+ options[:rodauth]
103
+ end
104
+
105
+ def portal_engine
106
+ "#{options[:portal_name].camelize}Portal"
107
+ end
108
+
109
+ def portal_package
110
+ portal_engine.underscore
111
+ end
112
+
113
+ def concerns_controller_path
114
+ "packages/#{portal_package}/app/controllers/#{portal_package}/concerns/controller.rb"
115
+ end
116
+
117
+ def entity_policy_path
118
+ "packages/#{portal_package}/app/policies/#{portal_package}/#{entity_table}_policy.rb"
119
+ end
120
+ end
121
+ end
122
+ end
@@ -1,27 +1,22 @@
1
1
  Description:
2
- Generate a complete SaaS setup with user account, entity, and membership.
3
- This is the recommended way to set up multi-tenant authentication.
2
+ Generate a complete SaaS setup with user account, entity, membership,
3
+ portal, welcome flow, invites, and profile.
4
+
5
+ This is the recommended way to bootstrap a multi-tenant SaaS app.
4
6
 
5
7
  Example:
6
- rails g pu:saas:setup --user Customer --entity Organization
7
- rails g pu:saas:setup --user Customer --entity Organization --roles=member,admin,owner
8
- rails g pu:saas:setup --user Customer --entity Organization --no-allow-signup
9
- rails g pu:saas:setup --user Customer --entity Organization --user-attributes=name:string
10
- rails g pu:saas:setup --user Customer --entity Organization --skip-entity
8
+ rails g pu:saas:setup --user=User --entity=Organization
11
9
 
12
- This creates:
13
- 1. User account (Customer) with Rodauth authentication
14
- 2. Entity model (Organization) with unique name
15
- 3. Membership model (OrganizationCustomer) with role enum
10
+ Full setup with all defaults:
11
+ - User model with Rodauth authentication
12
+ - Entity model with unique name and dynamic path parameter
13
+ - Membership model with owner/admin/member roles
14
+ - DashboardPortal with entity scoping
15
+ - Welcome/onboarding flow
16
+ - User invites package
17
+ - User profile resource
16
18
 
17
- Options:
18
- --user User model name (required)
19
- --entity Entity model name (required)
20
- --allow-signup Allow public registration (default: true)
21
- --roles Comma-separated membership roles (default: member,owner)
22
- --skip-entity Skip entity model generation
23
- --skip-membership Skip membership model generation
24
- --user-attributes Additional user model attributes
25
- --entity-attributes Additional entity model attributes
26
- --membership-attributes Additional membership model attributes
27
- --dest Destination package (default: main_app)
19
+ Customize:
20
+ rails g pu:saas:setup --user=User --entity=Organization --portal-name=Customer
21
+ rails g pu:saas:setup --user=User --entity=Organization --no-invites --no-profile
22
+ rails g pu:saas:setup --user=User --entity=Organization --no-portal
@@ -8,10 +8,10 @@ module Pu
8
8
  class SetupGenerator < ::Rails::Generators::Base
9
9
  include PlutoniumGenerators::Generator
10
10
 
11
- desc "Generate a complete SaaS setup with user, entity, and membership"
11
+ desc "Generate a complete SaaS setup with user, entity, membership, portal, and welcome flow"
12
12
 
13
13
  class_option :user, type: :string, required: true,
14
- desc: "The user model name (e.g., Customer)"
14
+ desc: "The user model name (e.g., User)"
15
15
 
16
16
  class_option :entity, type: :string, required: true,
17
17
  desc: "The entity model name (e.g., Organization)"
@@ -19,8 +19,8 @@ module Pu
19
19
  class_option :allow_signup, type: :boolean, default: true,
20
20
  desc: "Whether to allow users to sign up to the platform"
21
21
 
22
- class_option :roles, type: :array, default: %w[member owner],
23
- desc: "Available roles for memberships"
22
+ class_option :roles, type: :array, default: %w[admin member],
23
+ desc: "Additional roles for memberships (owner is always included as the first role)"
24
24
 
25
25
  class_option :skip_entity, type: :boolean, default: false,
26
26
  desc: "Skip entity model generation"
@@ -37,6 +37,21 @@ module Pu
37
37
  class_option :membership_attributes, type: :array, default: [],
38
38
  desc: "Additional attributes for the membership model"
39
39
 
40
+ class_option :portal, type: :boolean, default: true,
41
+ desc: "Generate a portal with entity scoping"
42
+
43
+ class_option :portal_name, type: :string, default: "Dashboard",
44
+ desc: "Portal name (e.g., Dashboard generates DashboardPortal)"
45
+
46
+ class_option :welcome, type: :boolean, default: true,
47
+ desc: "Generate the welcome/onboarding flow"
48
+
49
+ class_option :invites, type: :boolean, default: true,
50
+ desc: "Generate the user invites package"
51
+
52
+ class_option :profile, type: :boolean, default: true,
53
+ desc: "Generate user profile resource"
54
+
40
55
  class_option :api_client, type: :string, default: nil,
41
56
  desc: "Generate an API client model (e.g., ApiClient)"
42
57
 
@@ -48,6 +63,10 @@ module Pu
48
63
  generate_user
49
64
  generate_entity unless options[:skip_entity]
50
65
  generate_membership unless options[:skip_membership]
66
+ generate_portal if options[:portal] && !options[:skip_entity]
67
+ generate_profile if options[:profile]
68
+ generate_welcome if options[:welcome] && !options[:skip_entity] && options[:portal]
69
+ generate_invites if options[:invites] && !options[:skip_entity] && !options[:skip_membership]
51
70
  generate_api_client if options[:api_client].present?
52
71
  rescue => e
53
72
  exception "#{self.class} failed:", e
@@ -62,7 +81,6 @@ module Pu
62
81
  end
63
82
 
64
83
  def generate_user
65
- # Use class-based invocation to avoid Thor's invoke caching
66
84
  klass = Rails::Generators.find_by_namespace("pu:saas:user")
67
85
  klass.new(
68
86
  [options[:user]],
@@ -76,7 +94,6 @@ module Pu
76
94
  end
77
95
 
78
96
  def generate_entity
79
- # Use class-based invocation to avoid Thor's invoke caching
80
97
  klass = Rails::Generators.find_by_namespace("pu:saas:entity")
81
98
  klass.new(
82
99
  [options[:entity]],
@@ -90,7 +107,6 @@ module Pu
90
107
  end
91
108
 
92
109
  def generate_membership
93
- # Use class-based invocation to avoid Thor's invoke caching
94
110
  klass = Rails::Generators.find_by_namespace("pu:saas:membership")
95
111
  klass.new(
96
112
  [],
@@ -106,8 +122,34 @@ module Pu
106
122
  ).invoke_all
107
123
  end
108
124
 
125
+ def generate_portal
126
+ generate "pu:saas:portal",
127
+ "--entity-model=#{options[:entity]} --user-model=#{options[:user]}" \
128
+ " --portal-name=#{options[:portal_name]}" \
129
+ " --rodauth=#{rodauth_config}"
130
+ end
131
+
132
+ def generate_profile
133
+ generate "pu:profile:setup",
134
+ "--user-model=#{options[:user]} --dest=main_app" \
135
+ "#{" --portal=#{portal_package}" if options[:portal]}"
136
+ end
137
+
138
+ def generate_welcome
139
+ generate "pu:saas:welcome",
140
+ "--user-model=#{options[:user]} --entity-model=#{options[:entity]}" \
141
+ " --portal=#{portal_engine}" \
142
+ " --rodauth=#{rodauth_config}" \
143
+ "#{" --profile" if options[:profile]}"
144
+ end
145
+
146
+ def generate_invites
147
+ generate "pu:invites:install",
148
+ "--entity-model=#{options[:entity]} --user-model=#{options[:user]} --dest=main_app" \
149
+ " --rodauth=#{rodauth_config}"
150
+ end
151
+
109
152
  def generate_api_client
110
- # Use class-based invocation to avoid Thor's invoke caching
111
153
  klass = Rails::Generators.find_by_namespace("pu:saas:api_client")
112
154
  api_client_options = {
113
155
  roles: options[:api_client_roles],
@@ -116,11 +158,22 @@ module Pu
116
158
  skip: options[:skip]
117
159
  }
118
160
 
119
- # Scope to entity if entity is being generated
120
161
  api_client_options[:entity] = options[:entity] unless options[:skip_entity]
121
162
 
122
163
  klass.new([options[:api_client]], api_client_options).invoke_all
123
164
  end
165
+
166
+ def rodauth_config
167
+ options[:user].underscore
168
+ end
169
+
170
+ def portal_package
171
+ "#{options[:portal_name].underscore}_portal"
172
+ end
173
+
174
+ def portal_engine
175
+ "#{options[:portal_name].camelize}Portal"
176
+ end
124
177
  end
125
178
  end
126
179
  end
@@ -0,0 +1,27 @@
1
+ Description:
2
+ Generates a post-login welcome flow with onboarding and entity selection.
3
+
4
+ This creates the controllers, views, and routes needed to bridge
5
+ authentication and the main portal:
6
+
7
+ - AuthenticatedController: base controller requiring login
8
+ - WelcomeController: routing hub (invite check -> onboarding -> entity selection -> portal)
9
+ - Onboarding view: create first entity (and optional profile)
10
+ - Entity selection view: choose from multiple entities
11
+
12
+ Example:
13
+ rails g pu:saas:welcome --user-model=User --entity-model=Organization --portal=CustomerPortal
14
+
15
+ This generates:
16
+ app/controllers/authenticated_controller.rb
17
+ app/controllers/welcome_controller.rb
18
+ app/views/welcome/onboarding.html.erb
19
+ app/views/welcome/select_entity.html.erb
20
+
21
+ And adds routes:
22
+ GET /welcome -> welcome#index
23
+ GET /welcome/onboard -> welcome#new_entity
24
+ POST /welcome/onboard -> welcome#onboard
25
+
26
+ Options:
27
+ --profile Include profile setup in onboarding form
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AuthenticatedController < ApplicationController
4
+ <% if rodauth? -%>
5
+ include Plutonium::Auth::Rodauth(:<%= rodauth_config %>)
6
+
7
+ before_action { rodauth.require_authentication }
8
+ <% else -%>
9
+ before_action :require_authenticated
10
+
11
+ private
12
+
13
+ def require_authenticated
14
+ # TODO: Implement based on your authentication system
15
+ redirect_to "/login" unless current_user
16
+ end
17
+ <% end -%>
18
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ class WelcomeController < AuthenticatedController
4
+ layout "welcome"
5
+
6
+ def index
7
+ entities = current_user.<%= entity_table.pluralize %>.to_a
8
+ if entities.none?
9
+ @<%= entity_table %> = <%= entity_model %>.new
10
+ <% if profile? -%>
11
+ @profile = current_user.profile || current_user.build_profile
12
+ <% end -%>
13
+ render :onboarding
14
+ elsif entities.one?
15
+ redirect_to portal_root_path(entities.first)
16
+ else
17
+ @entities = entities
18
+ render :select_entity
19
+ end
20
+ end
21
+
22
+ def new_entity
23
+ @<%= entity_table %> = <%= entity_model %>.new
24
+ <% if profile? -%>
25
+ @profile = current_user.profile || current_user.build_profile
26
+ <% end -%>
27
+ render :onboarding
28
+ end
29
+
30
+ def onboard
31
+ @<%= entity_table %> = <%= entity_model %>.new(<%= entity_table %>_params)
32
+ <% if profile? -%>
33
+ @profile = current_user.profile || current_user.build_profile
34
+ @profile.assign_attributes(profile_params)
35
+
36
+ if @<%= entity_table %>.valid? && @profile.valid?
37
+ <% else -%>
38
+ if @<%= entity_table %>.valid?
39
+ <% end -%>
40
+ ActiveRecord::Base.transaction do
41
+ @<%= entity_table %>.save!
42
+ <%= membership_model %>.create!(<%= entity_table %>: @<%= entity_table %>, <%= user_table %>: current_user, role: :owner)
43
+ <% if profile? -%>
44
+ @profile.save!
45
+ <% end -%>
46
+ end
47
+ redirect_to portal_root_path(@<%= entity_table %>), notice: "Welcome! Your workspace is ready."
48
+ else
49
+ render :onboarding, status: :unprocessable_entity
50
+ end
51
+ end
52
+
53
+ private
54
+
55
+ def <%= entity_table %>_params
56
+ params.require(:<%= entity_table %>).permit(:name)
57
+ end
58
+ <% if profile? -%>
59
+
60
+ def profile_params
61
+ params.require(:profile).permit(:name)
62
+ end
63
+ <% end -%>
64
+
65
+ def portal_root_path(<%= entity_table %>)
66
+ <%= portal_engine %>::Engine.routes.url_helpers.<%= entity_table %>_root_path(<%= entity_table %>: <%= entity_table %>)
67
+ end
68
+ helper_method :portal_root_path
69
+ end
@@ -0,0 +1,33 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Welcome</title>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1">
7
+ <meta name="csrf-param" content="authenticity_token" />
8
+ <meta name="csrf-token" content="<%%= form_authenticity_token %>" />
9
+ <%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
10
+ <%%= javascript_importmap_tags %>
11
+ </head>
12
+ <body class="antialiased min-h-screen bg-[var(--pu-body)]">
13
+ <main class="p-4 min-h-screen flex flex-col items-center justify-center gap-2 px-6 py-8 mx-auto lg:py-0">
14
+ <%% if flash.any? %>
15
+ <%% flash.each do |type, message| %>
16
+ <div class="fixed z-50 top-16 inset-x-0 mx-auto flex items-center w-full max-w-md p-4 rounded-[var(--pu-radius-lg)]"
17
+ style="box-shadow: var(--pu-shadow-md); background: <%%= type == 'alert' ? 'var(--color-danger-50)' : 'var(--color-success-50)' %>; color: <%%= type == 'alert' ? 'var(--color-danger-600)' : 'var(--color-success-600)' %>"
18
+ role="alert">
19
+ <div class="ms-3 text-sm font-normal"><%%= message %></div>
20
+ </div>
21
+ <%% end %>
22
+ <%% end %>
23
+
24
+ <!-- Main content card -->
25
+ <div class="w-full sm:max-w-md bg-[var(--pu-card-bg)] border border-[var(--pu-card-border)] rounded-[var(--pu-radius-lg)]"
26
+ style="box-shadow: var(--pu-shadow-lg)">
27
+ <div class="p-6 space-y-4 md:space-y-6 sm:p-8">
28
+ <%%= yield %>
29
+ </div>
30
+ </div>
31
+ </main>
32
+ </body>
33
+ </html>
@@ -0,0 +1,51 @@
1
+ <h1 class="text-lg font-bold leading-tight tracking-tight text-[var(--pu-text)] md:text-xl text-center">
2
+ Welcome! Let's get you set up.
3
+ </h1>
4
+
5
+ <%%= form_with(url: welcome_onboard_path, method: :post, class: "space-y-4 md:space-y-6") do |f| %>
6
+ <% if profile? -%>
7
+ <%% if @<%= entity_table %>.errors.any? || @profile.errors.any? %>
8
+ <% else -%>
9
+ <%% if @<%= entity_table %>.errors.any? %>
10
+ <% end -%>
11
+ <div class="p-4 rounded-[var(--pu-radius-lg)] bg-[color:var(--color-danger-50)] text-[color:var(--color-danger-600)]">
12
+ <ul class="list-disc list-inside text-sm">
13
+ <%% @<%= entity_table %>.errors.full_messages.each do |message| %>
14
+ <li><%%= message %></li>
15
+ <%% end %>
16
+ <% if profile? -%>
17
+ <%% @profile.errors.full_messages.each do |message| %>
18
+ <li><%%= message %></li>
19
+ <%% end %>
20
+ <% end -%>
21
+ </ul>
22
+ </div>
23
+ <%% end %>
24
+ <% if profile? -%>
25
+
26
+ <%%= f.fields_for :profile, @profile do |pf| %>
27
+ <div>
28
+ <%%= pf.label :name, "Your Name", class: "block mb-2 text-sm font-medium text-[var(--pu-text)]" %>
29
+ <%%= pf.text_field :name,
30
+ class: "pu-input w-full",
31
+ placeholder: "e.g. Jane Smith",
32
+ autofocus: true %>
33
+ </div>
34
+ <%% end %>
35
+ <% end -%>
36
+
37
+ <%%= f.fields_for :<%= entity_table %>, @<%= entity_table %> do |ef| %>
38
+ <div>
39
+ <%%= ef.label :name, "Workspace Name", class: "block mb-2 text-sm font-medium text-[var(--pu-text)]" %>
40
+ <%%= ef.text_field :name,
41
+ class: "pu-input w-full",
42
+ placeholder: "e.g. Acme Corp",
43
+ <% unless profile? -%>
44
+ autofocus: true,
45
+ <% end -%>
46
+ required: true %>
47
+ </div>
48
+ <%% end %>
49
+
50
+ <%%= f.submit "Get Started", class: "w-full pu-btn pu-btn-md pu-btn-primary" %>
51
+ <%% end %>
@@ -0,0 +1,22 @@
1
+ <h1 class="text-lg font-bold leading-tight tracking-tight text-[var(--pu-text)] md:text-xl text-center">
2
+ Select a Workspace
3
+ </h1>
4
+
5
+ <div class="space-y-2">
6
+ <%% @entities.each do |<%= entity_table %>| %>
7
+ <a href="<%%= portal_root_path(<%= entity_table %>) %>"
8
+ class="flex items-center gap-3 w-full p-4 text-left bg-[var(--pu-surface-alt)] border border-[var(--pu-border)] rounded-[var(--pu-radius-lg)] hover:border-[var(--color-primary-500)] hover:bg-[var(--pu-surface)] transition-colors">
9
+ <div class="flex-1">
10
+ <p class="font-medium text-[var(--pu-text)]"><%%= <%= entity_table %>.name %></p>
11
+ </div>
12
+ <%%= render Phlex::TablerIcons::ChevronRight.new(class: "w-5 h-5 text-[var(--pu-text-muted)]") %>
13
+ </a>
14
+ <%% end %>
15
+ </div>
16
+
17
+ <div class="pt-2">
18
+ <a href="<%%= welcome_onboard_path %>"
19
+ class="w-full block pu-btn pu-btn-md pu-btn-outline text-center">
20
+ Create New Workspace
21
+ </a>
22
+ </div>