maquina-generators 0.6.0 → 0.7.0

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -0
  3. data/lib/generators/maquina/clave/clave_generator.rb +48 -0
  4. data/lib/generators/maquina/clave/templates/app/controllers/registration/verifications_controller.rb.tt +10 -1
  5. data/lib/generators/maquina/clave/templates/app/controllers/session/verifications_controller.rb.tt +10 -1
  6. data/lib/generators/maquina/clave/templates/app/models/email_verification.rb.tt +18 -0
  7. data/lib/generators/maquina/clave/templates/config/locales/clave.en.yml +2 -0
  8. data/lib/generators/maquina/clave/templates/config/locales/clave.es.yml +2 -0
  9. data/lib/generators/maquina/csp_reports/USAGE +18 -0
  10. data/lib/generators/maquina/csp_reports/csp_reports_generator.rb +231 -0
  11. data/lib/generators/maquina/csp_reports/templates/app/controllers/csp_reports_controller.rb +24 -0
  12. data/lib/generators/maquina/csp_reports/templates/app/models/security/csp_violation.rb +89 -0
  13. data/lib/generators/maquina/csp_reports/templates/app/models/security/csp_violation_report.rb +30 -0
  14. data/lib/generators/maquina/csp_reports/templates/app/views/backstage/security/_csp_violations.html.erb +42 -0
  15. data/lib/generators/maquina/csp_reports/templates/db/create_csp_violations.rb.tt +23 -0
  16. data/lib/maquina_generators/version.rb +1 -1
  17. data/test/generators/maquina/clave_generator_test.rb +74 -0
  18. data/test/generators/maquina/csp_reports_generator_test.rb +151 -0
  19. data/test/tmp/.gitignore +5 -0
  20. data/test/tmp/.rubocop.yml +11 -0
  21. data/test/tmp/.standard.yml +1 -0
  22. data/test/tmp/Gemfile +13 -1
  23. data/test/tmp/Procfile.dev +3 -0
  24. data/test/tmp/README.md +89 -0
  25. data/test/tmp/app/controllers/home_controller.rb +6 -0
  26. data/test/tmp/app/javascript/application.js +1 -0
  27. data/test/tmp/app/views/home/index.html.erb +204 -0
  28. data/test/tmp/app/views/layouts/application.html.erb +10 -0
  29. data/test/tmp/config/application.rb +15 -0
  30. data/test/tmp/config/database.yml +90 -0
  31. data/test/tmp/config/database.yml.example +90 -0
  32. data/test/tmp/config/environments/development.rb +8 -0
  33. data/test/tmp/config/environments/production.rb +6 -0
  34. data/test/tmp/config/initializers/generators.rb +4 -0
  35. data/test/tmp/config/routes.rb +1 -2
  36. metadata +27 -14
  37. data/test/tmp/app/controllers/application_controller.rb +0 -2
  38. data/test/tmp/app/controllers/registrations_controller.rb +0 -37
  39. data/test/tmp/app/models/account.rb +0 -5
  40. data/test/tmp/app/models/current.rb +0 -5
  41. data/test/tmp/app/models/user.rb +0 -12
  42. data/test/tmp/app/views/registrations/new.html.erb +0 -72
  43. data/test/tmp/app/views/sessions/new.html.erb +0 -46
  44. data/test/tmp/config/locales/registration.en.yml +0 -44
  45. data/test/tmp/config/locales/registration.es.yml +0 -44
  46. data/test/tmp/db/migrate/20260927024163_create_accounts.rb +0 -9
  47. data/test/tmp/db/migrate/20260927024164_add_account_fields_to_users.rb +0 -7
@@ -0,0 +1,10 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>TestApp</title>
5
+ <%= yield :head %>
6
+ </head>
7
+ <body data-turbo-refresh-method="morph" data-turbo-refresh-scroll="preserve">
8
+ <%= yield %>
9
+ </body>
10
+ </html>
@@ -0,0 +1,15 @@
1
+ require_relative "boot"
2
+ require "rails/all"
3
+
4
+ module TestApp
5
+ class Application < Rails::Application
6
+
7
+ # Use Solid Queue as the Active Job backend in all environments except test
8
+ config.active_job.queue_adapter = :solid_queue unless Rails.env.test?
9
+ config.solid_queue.connects_to = {database: {writing: :queue}}
10
+
11
+ # Don't wrap form fields with errors in an extra div
12
+ config.action_view.field_error_proc = proc { |html_tag, _instance| html_tag }
13
+ config.load_defaults 7.2
14
+ end
15
+ end
@@ -0,0 +1,90 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ max_connections: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ primary:
14
+ <<: *default
15
+ database: storage/development.sqlite3
16
+ queue:
17
+ <<: *default
18
+ database: storage/development_queue.sqlite3
19
+ migrations_paths: db/queue_migrate
20
+ cache:
21
+ <<: *default
22
+ database: storage/development_cache.sqlite3
23
+ migrations_paths: db/cache_migrate
24
+ cable:
25
+ <<: *default
26
+ database: storage/development_cable.sqlite3
27
+ migrations_paths: db/cable_migrate
28
+ errors:
29
+ <<: *default
30
+ database: storage/development_errors.sqlite3
31
+ migrations_paths: db/errors_migrate
32
+ security:
33
+ <<: *default
34
+ database: storage/development_security.sqlite3
35
+ migrations_paths: db/security_migrate
36
+
37
+ # Warning: The database defined as "test" will be erased and
38
+ # re-generated from your development database when you run "rake".
39
+ # Do not set this db to the same as development or production.
40
+ test:
41
+ primary:
42
+ <<: *default
43
+ database: storage/test.sqlite3
44
+ queue:
45
+ <<: *default
46
+ database: storage/test_queue.sqlite3
47
+ migrations_paths: db/queue_migrate
48
+ cache:
49
+ <<: *default
50
+ database: storage/test_cache.sqlite3
51
+ migrations_paths: db/cache_migrate
52
+ cable:
53
+ <<: *default
54
+ database: storage/test_cable.sqlite3
55
+ migrations_paths: db/cable_migrate
56
+ errors:
57
+ <<: *default
58
+ database: storage/test_errors.sqlite3
59
+ migrations_paths: db/errors_migrate
60
+ security:
61
+ <<: *default
62
+ database: storage/test_security.sqlite3
63
+ migrations_paths: db/security_migrate
64
+
65
+ # Store production database in the storage/ directory, which by default
66
+ # is mounted as a persistent Docker volume in config/deploy.yml.
67
+ production:
68
+ primary:
69
+ <<: *default
70
+ database: storage/production.sqlite3
71
+ queue:
72
+ <<: *default
73
+ database: storage/production_queue.sqlite3
74
+ migrations_paths: db/queue_migrate
75
+ cache:
76
+ <<: *default
77
+ database: storage/production_cache.sqlite3
78
+ migrations_paths: db/cache_migrate
79
+ cable:
80
+ <<: *default
81
+ database: storage/production_cable.sqlite3
82
+ migrations_paths: db/cable_migrate
83
+ errors:
84
+ <<: *default
85
+ database: storage/production_errors.sqlite3
86
+ migrations_paths: db/errors_migrate
87
+ security:
88
+ <<: *default
89
+ database: storage/production_security.sqlite3
90
+ migrations_paths: db/security_migrate
@@ -0,0 +1,90 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ max_connections: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ primary:
14
+ <<: *default
15
+ database: storage/development.sqlite3
16
+ queue:
17
+ <<: *default
18
+ database: storage/development_queue.sqlite3
19
+ migrations_paths: db/queue_migrate
20
+ cache:
21
+ <<: *default
22
+ database: storage/development_cache.sqlite3
23
+ migrations_paths: db/cache_migrate
24
+ cable:
25
+ <<: *default
26
+ database: storage/development_cable.sqlite3
27
+ migrations_paths: db/cable_migrate
28
+ errors:
29
+ <<: *default
30
+ database: storage/development_errors.sqlite3
31
+ migrations_paths: db/errors_migrate
32
+ security:
33
+ <<: *default
34
+ database: storage/development_security.sqlite3
35
+ migrations_paths: db/security_migrate
36
+
37
+ # Warning: The database defined as "test" will be erased and
38
+ # re-generated from your development database when you run "rake".
39
+ # Do not set this db to the same as development or production.
40
+ test:
41
+ primary:
42
+ <<: *default
43
+ database: storage/test.sqlite3
44
+ queue:
45
+ <<: *default
46
+ database: storage/test_queue.sqlite3
47
+ migrations_paths: db/queue_migrate
48
+ cache:
49
+ <<: *default
50
+ database: storage/test_cache.sqlite3
51
+ migrations_paths: db/cache_migrate
52
+ cable:
53
+ <<: *default
54
+ database: storage/test_cable.sqlite3
55
+ migrations_paths: db/cable_migrate
56
+ errors:
57
+ <<: *default
58
+ database: storage/test_errors.sqlite3
59
+ migrations_paths: db/errors_migrate
60
+ security:
61
+ <<: *default
62
+ database: storage/test_security.sqlite3
63
+ migrations_paths: db/security_migrate
64
+
65
+ # Store production database in the storage/ directory, which by default
66
+ # is mounted as a persistent Docker volume in config/deploy.yml.
67
+ production:
68
+ primary:
69
+ <<: *default
70
+ database: storage/production.sqlite3
71
+ queue:
72
+ <<: *default
73
+ database: storage/production_queue.sqlite3
74
+ migrations_paths: db/queue_migrate
75
+ cache:
76
+ <<: *default
77
+ database: storage/production_cache.sqlite3
78
+ migrations_paths: db/cache_migrate
79
+ cable:
80
+ <<: *default
81
+ database: storage/production_cable.sqlite3
82
+ migrations_paths: db/cable_migrate
83
+ errors:
84
+ <<: *default
85
+ database: storage/production_errors.sqlite3
86
+ migrations_paths: db/errors_migrate
87
+ security:
88
+ <<: *default
89
+ database: storage/production_security.sqlite3
90
+ migrations_paths: db/security_migrate
@@ -0,0 +1,8 @@
1
+ Rails.application.configure do
2
+ config.cache_classes = false
3
+
4
+ # Use letter_opener for email delivery
5
+ config.action_mailer.delivery_method = :letter_opener
6
+ config.action_mailer.perform_deliveries = true
7
+ config.action_mailer.default_url_options = {host: "localhost", port: 3000}
8
+ end
@@ -0,0 +1,6 @@
1
+ Rails.application.configure do
2
+ config.cache_classes = true
3
+
4
+ # Set host for URL generation
5
+ config.action_mailer.default_url_options = {host: ENV.fetch("APPLICATION_HOST", "example.com")}
6
+ end
@@ -0,0 +1,4 @@
1
+ Rails.application.config.generators do |g|
2
+ g.stylesheets false
3
+ g.helper false
4
+ end
@@ -1,4 +1,3 @@
1
1
  Rails.application.routes.draw do
2
- # Registration routes (generated by maquina:registration)
3
- resources :registrations, only: [:new, :create]
2
+ root "home#index"
4
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maquina-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Alberto Chavez
@@ -67,7 +67,8 @@ dependencies:
67
67
  version: '0.8'
68
68
  description: 'Rails generators that write standalone code into your app: passwordless
69
69
  (clave) and password (registration) authentication, Rack::Attack rules with a Security
70
- dashboard, Solid Errors, Mission Control Jobs, Solid Queue, and a full app setup.'
70
+ dashboard, Content Security Policy reports, Solid Errors, Mission Control Jobs,
71
+ Solid Queue, and a full app setup.'
71
72
  email:
72
73
  - mario.chavez@gmail.com
73
74
  executables: []
@@ -117,6 +118,13 @@ files:
117
118
  - lib/generators/maquina/clave/templates/migration_create_sessions.rb.tt
118
119
  - lib/generators/maquina/clave/templates/migration_create_users.rb.tt
119
120
  - lib/generators/maquina/clave/templates/test/test_helpers/session_test_helper.rb.tt
121
+ - lib/generators/maquina/csp_reports/USAGE
122
+ - lib/generators/maquina/csp_reports/csp_reports_generator.rb
123
+ - lib/generators/maquina/csp_reports/templates/app/controllers/csp_reports_controller.rb
124
+ - lib/generators/maquina/csp_reports/templates/app/models/security/csp_violation.rb
125
+ - lib/generators/maquina/csp_reports/templates/app/models/security/csp_violation_report.rb
126
+ - lib/generators/maquina/csp_reports/templates/app/views/backstage/security/_csp_violations.html.erb
127
+ - lib/generators/maquina/csp_reports/templates/db/create_csp_violations.rb.tt
120
128
  - lib/generators/maquina/mission_control_jobs/USAGE
121
129
  - lib/generators/maquina/mission_control_jobs/mission_control_jobs_generator.rb
122
130
  - lib/generators/maquina/mission_control_jobs/templates/app/controllers/backstage_controller.rb.tt
@@ -252,6 +260,7 @@ files:
252
260
  - lib/maquina_generators/version.rb
253
261
  - test/generators/maquina/app_generator_test.rb
254
262
  - test/generators/maquina/clave_generator_test.rb
263
+ - test/generators/maquina/csp_reports_generator_test.rb
255
264
  - test/generators/maquina/failures_mcp_tools_test.rb
256
265
  - test/generators/maquina/mission_control_jobs_generator_test.rb
257
266
  - test/generators/maquina/rack_attack_generator_test.rb
@@ -260,19 +269,23 @@ files:
260
269
  - test/generators/maquina/solid_errors_generator_test.rb
261
270
  - test/generators/maquina/solid_queue_generator_test.rb
262
271
  - test/test_helper.rb
272
+ - test/tmp/.gitignore
273
+ - test/tmp/.rubocop.yml
274
+ - test/tmp/.standard.yml
263
275
  - test/tmp/Gemfile
264
- - test/tmp/app/controllers/application_controller.rb
265
- - test/tmp/app/controllers/registrations_controller.rb
266
- - test/tmp/app/models/account.rb
267
- - test/tmp/app/models/current.rb
268
- - test/tmp/app/models/user.rb
269
- - test/tmp/app/views/registrations/new.html.erb
270
- - test/tmp/app/views/sessions/new.html.erb
271
- - test/tmp/config/locales/registration.en.yml
272
- - test/tmp/config/locales/registration.es.yml
276
+ - test/tmp/Procfile.dev
277
+ - test/tmp/README.md
278
+ - test/tmp/app/controllers/home_controller.rb
279
+ - test/tmp/app/javascript/application.js
280
+ - test/tmp/app/views/home/index.html.erb
281
+ - test/tmp/app/views/layouts/application.html.erb
282
+ - test/tmp/config/application.rb
283
+ - test/tmp/config/database.yml
284
+ - test/tmp/config/database.yml.example
285
+ - test/tmp/config/environments/development.rb
286
+ - test/tmp/config/environments/production.rb
287
+ - test/tmp/config/initializers/generators.rb
273
288
  - test/tmp/config/routes.rb
274
- - test/tmp/db/migrate/20260927024163_create_accounts.rb
275
- - test/tmp/db/migrate/20260927024164_add_account_fields_to_users.rb
276
289
  homepage: https://maquina.app
277
290
  licenses:
278
291
  - MIT
@@ -293,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
306
  - !ruby/object:Gem::Version
294
307
  version: '0'
295
308
  requirements: []
296
- rubygems_version: 4.0.17
309
+ rubygems_version: 4.0.20
297
310
  specification_version: 4
298
311
  summary: Rails generators from the Maquina umbrella
299
312
  test_files: []
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- end
@@ -1,37 +0,0 @@
1
- class RegistrationsController < ApplicationController
2
- allow_unauthenticated_access
3
- rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_registration_path, alert: t("registrations.create.rate_limited") }
4
-
5
- def new
6
- @user = User.new
7
- end
8
-
9
- def create
10
- account = nil
11
- user = nil
12
-
13
- ActiveRecord::Base.transaction do
14
- account = Account.create!(name: registration_params[:account_name])
15
- user = account.users.create!(
16
- name: registration_params[:name],
17
- email_address: registration_params[:email_address],
18
- password: registration_params[:password],
19
- password_confirmation: registration_params[:password_confirmation],
20
- role: :admin
21
- )
22
- end
23
-
24
- start_new_session_for user
25
- redirect_to root_path, notice: t("registrations.create.success")
26
- rescue ActiveRecord::RecordInvalid
27
- @user = User.new(registration_params.except(:password, :password_confirmation, :account_name))
28
- @account_name = registration_params[:account_name]
29
- render :new, status: :unprocessable_entity
30
- end
31
-
32
- private
33
-
34
- def registration_params
35
- params.permit(:name, :email_address, :password, :password_confirmation, :account_name)
36
- end
37
- end
@@ -1,5 +0,0 @@
1
- class Account < ApplicationRecord
2
- has_many :users, dependent: :destroy
3
-
4
- validates :name, allow_blank: true, length: { maximum: 100 }
5
- end
@@ -1,5 +0,0 @@
1
- class Current < ActiveSupport::CurrentAttributes
2
- attribute :session
3
- delegate :user, to: :session, allow_nil: true
4
- delegate :account, to: :user, allow_nil: true
5
- end
@@ -1,12 +0,0 @@
1
- class User < ApplicationRecord
2
- has_secure_password
3
- has_many :sessions, dependent: :destroy
4
-
5
- belongs_to :account
6
-
7
- normalizes :email_address, with: ->(e) { e.strip.downcase }
8
-
9
- validates :name, allow_blank: true, length: { maximum: 100 }
10
-
11
- enum :role, {member: "member", admin: "admin"}, default: "member"
12
- end
@@ -1,72 +0,0 @@
1
- <div class="flex flex-1 items-center justify-center px-4 py-8">
2
- <div class="w-full max-w-md">
3
- <div class="bg-card rounded-xl shadow-sm border border-border p-8">
4
- <h1 class="text-2xl font-bold text-foreground text-center mb-8">
5
- <%= t(".title") %>
6
- </h1>
7
-
8
- <%= form_with url: registrations_path, method: :post, class: "space-y-6" do |form| %>
9
- <div>
10
- <%= form.label :account_name, t(".account_name"), class: "block text-sm font-medium text-foreground mb-2", data: { component: "label" } %>
11
- <span class="text-xs text-muted-foreground"><%= t(".optional") %></span>
12
- <%= form.text_field :account_name,
13
- autofocus: true,
14
- value: @account_name,
15
- placeholder: t(".account_name_placeholder"),
16
- data: { component: "input" },
17
- class: "w-full px-4 py-3 border border-input rounded-lg focus:ring-2 focus:ring-ring focus:border-ring transition-colors" %>
18
- </div>
19
-
20
- <div>
21
- <%= form.label :name, t(".name"), class: "block text-sm font-medium text-foreground mb-2", data: { component: "label" } %>
22
- <span class="text-xs text-muted-foreground"><%= t(".optional") %></span>
23
- <%= form.text_field :name,
24
- value: @user.name,
25
- placeholder: t(".name_placeholder"),
26
- data: { component: "input" },
27
- class: "w-full px-4 py-3 border border-input rounded-lg focus:ring-2 focus:ring-ring focus:border-ring transition-colors" %>
28
- </div>
29
-
30
- <div>
31
- <%= form.label :email_address, t(".email"), class: "block text-sm font-medium text-foreground mb-2", data: { component: "label" } %>
32
- <%= form.email_field :email_address,
33
- required: true,
34
- autocomplete: "email",
35
- value: @user.email_address,
36
- placeholder: t(".email_placeholder"),
37
- data: { component: "input" },
38
- class: "w-full px-4 py-3 border border-input rounded-lg focus:ring-2 focus:ring-ring focus:border-ring transition-colors" %>
39
- </div>
40
-
41
- <div>
42
- <%= form.label :password, t(".password"), class: "block text-sm font-medium text-foreground mb-2", data: { component: "label" } %>
43
- <%= form.password_field :password,
44
- required: true,
45
- autocomplete: "new-password",
46
- placeholder: t(".password_placeholder"),
47
- data: { component: "input" },
48
- class: "w-full px-4 py-3 border border-input rounded-lg focus:ring-2 focus:ring-ring focus:border-ring transition-colors" %>
49
- </div>
50
-
51
- <div>
52
- <%= form.label :password_confirmation, t(".password_confirmation"), class: "block text-sm font-medium text-foreground mb-2", data: { component: "label" } %>
53
- <%= form.password_field :password_confirmation,
54
- required: true,
55
- autocomplete: "new-password",
56
- placeholder: t(".password_confirmation_placeholder"),
57
- data: { component: "input" },
58
- class: "w-full px-4 py-3 border border-input rounded-lg focus:ring-2 focus:ring-ring focus:border-ring transition-colors" %>
59
- </div>
60
-
61
- <div>
62
- <%= form.submit t(".submit"), data: { component: "button", variant: "primary" }, class: "w-full px-4 py-3 text-base font-medium text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors cursor-pointer" %>
63
- </div>
64
- <% end %>
65
-
66
- <p class="mt-6 text-center text-sm text-muted-foreground">
67
- <%= t(".have_account") %>
68
- <%= link_to t(".sign_in"), new_session_path, class: "font-medium text-primary hover:text-primary/80" %>
69
- </p>
70
- </div>
71
- </div>
72
- </div>
@@ -1,46 +0,0 @@
1
- <div class="flex flex-1 items-center justify-center px-4 py-8">
2
- <div class="w-full max-w-md">
3
- <div class="bg-card rounded-xl shadow-sm border border-border p-8">
4
- <h1 class="text-2xl font-bold text-foreground text-center mb-8">
5
- <%= t(".title") %>
6
- </h1>
7
-
8
- <%= form_with url: session_path, method: :post, class: "space-y-6" do |form| %>
9
- <div>
10
- <%= form.label :email_address, t(".email"), class: "block text-sm font-medium text-foreground mb-2", data: { component: "label" } %>
11
- <%= form.email_field :email_address,
12
- required: true,
13
- autofocus: true,
14
- autocomplete: "email",
15
- placeholder: t(".email_placeholder"),
16
- value: params[:email_address],
17
- data: { component: "input" },
18
- class: "w-full px-4 py-3 border border-input rounded-lg focus:ring-2 focus:ring-ring focus:border-ring transition-colors" %>
19
- </div>
20
-
21
- <div>
22
- <%= form.label :password, t(".password"), class: "block text-sm font-medium text-foreground mb-2", data: { component: "label" } %>
23
- <%= form.password_field :password,
24
- required: true,
25
- autocomplete: "current-password",
26
- placeholder: t(".password_placeholder"),
27
- data: { component: "input" },
28
- class: "w-full px-4 py-3 border border-input rounded-lg focus:ring-2 focus:ring-ring focus:border-ring transition-colors" %>
29
- </div>
30
-
31
- <div>
32
- <%= form.submit t(".submit"), data: { component: "button", variant: "primary" }, class: "w-full px-4 py-3 text-base font-medium text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors cursor-pointer" %>
33
- </div>
34
- <% end %>
35
-
36
- <div class="mt-6 flex items-center justify-between text-sm text-muted-foreground">
37
- <p>
38
- <%= link_to t(".forgot_password"), new_password_path, class: "font-medium text-primary hover:text-primary/80" %>
39
- </p>
40
- <p>
41
- <%= link_to t(".sign_up"), new_registration_path, class: "font-medium text-primary hover:text-primary/80" %>
42
- </p>
43
- </div>
44
- </div>
45
- </div>
46
- </div>
@@ -1,44 +0,0 @@
1
- en:
2
- registrations:
3
- new:
4
- title: "Create account"
5
- account_name: "Account name"
6
- account_name_placeholder: "Your company or team"
7
- name: "Your name"
8
- name_placeholder: "Jane Doe"
9
- email: "Email address"
10
- email_placeholder: "you@example.com"
11
- password: "Password"
12
- password_placeholder: "At least 8 characters"
13
- password_confirmation: "Confirm password"
14
- password_confirmation_placeholder: "Repeat your password"
15
- submit: "Sign up"
16
- have_account: "Already have an account?"
17
- sign_in: "Sign in"
18
- optional: "(optional)"
19
- create:
20
- success: "Your account has been created. Welcome!"
21
- rate_limited: "Too many attempts. Please wait a few minutes and try again."
22
-
23
- sessions:
24
- new:
25
- title: "Sign in"
26
- email: "Email address"
27
- email_placeholder: "you@example.com"
28
- password: "Password"
29
- password_placeholder: "Enter your password"
30
- submit: "Sign in"
31
- forgot_password: "Forgot password?"
32
- sign_up: "Sign up"
33
-
34
- activerecord:
35
- models:
36
- account:
37
- one: "Account"
38
- other: "Accounts"
39
- attributes:
40
- account:
41
- name: "Name"
42
- user:
43
- name: "Name"
44
- role: "Role"
@@ -1,44 +0,0 @@
1
- es:
2
- registrations:
3
- new:
4
- title: "Crear cuenta"
5
- account_name: "Nombre de la cuenta"
6
- account_name_placeholder: "Tu empresa o equipo"
7
- name: "Tu nombre"
8
- name_placeholder: "Maria Lopez"
9
- email: "Correo electronico"
10
- email_placeholder: "tu@correo.com"
11
- password: "Contrasena"
12
- password_placeholder: "Al menos 8 caracteres"
13
- password_confirmation: "Confirmar contrasena"
14
- password_confirmation_placeholder: "Repite tu contrasena"
15
- submit: "Registrarse"
16
- have_account: "Ya tienes cuenta?"
17
- sign_in: "Inicia sesion"
18
- optional: "(opcional)"
19
- create:
20
- success: "Tu cuenta ha sido creada. Bienvenido!"
21
- rate_limited: "Demasiados intentos. Por favor, espera unos minutos e intenta de nuevo."
22
-
23
- sessions:
24
- new:
25
- title: "Iniciar sesion"
26
- email: "Correo electronico"
27
- email_placeholder: "tu@correo.com"
28
- password: "Contrasena"
29
- password_placeholder: "Ingresa tu contrasena"
30
- submit: "Iniciar sesion"
31
- forgot_password: "Olvidaste tu contrasena?"
32
- sign_up: "Registrate"
33
-
34
- activerecord:
35
- models:
36
- account:
37
- one: "Cuenta"
38
- other: "Cuentas"
39
- attributes:
40
- account:
41
- name: "Nombre"
42
- user:
43
- name: "Nombre"
44
- role: "Rol"
@@ -1,9 +0,0 @@
1
- class CreateAccounts < ActiveRecord::Migration[8.1]
2
- def change
3
- create_table :accounts do |t|
4
- t.string :name, null: false
5
-
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,7 +0,0 @@
1
- class AddAccountFieldsToUsers < ActiveRecord::Migration[8.1]
2
- def change
3
- add_reference :users, :account, null: false, foreign_key: true
4
- add_column :users, :role, :string, default: "member", null: false
5
- add_column :users, :name, :string
6
- end
7
- end