rails_app 0.5.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +30 -1
  4. data/bin/rails_app +1 -1
  5. data/lib/rails_app/cli.rb +16 -7
  6. data/lib/rails_app/command.rb +8 -3
  7. data/lib/rails_app/options_data.rb +57 -0
  8. data/lib/rails_app/rails_app.rb +2 -2
  9. data/lib/rails_app/template/app_bulma/assets/stylesheets/application.bulma.scss +43 -0
  10. data/lib/rails_app/template/app_bulma/views/devise/confirmations/new.html.erb +16 -0
  11. data/lib/rails_app/template/app_bulma/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  12. data/lib/rails_app/template/app_bulma/views/devise/mailer/email_changed.html.erb +7 -0
  13. data/lib/rails_app/template/app_bulma/views/devise/mailer/password_change.html.erb +3 -0
  14. data/lib/rails_app/template/app_bulma/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  15. data/lib/rails_app/template/app_bulma/views/devise/mailer/unlock_instructions.html.erb +7 -0
  16. data/lib/rails_app/template/app_bulma/views/devise/passwords/edit.html.erb +25 -0
  17. data/lib/rails_app/template/app_bulma/views/devise/passwords/new.html.erb +16 -0
  18. data/lib/rails_app/template/app_bulma/views/devise/registrations/edit.html.erb +43 -0
  19. data/lib/rails_app/template/app_bulma/views/devise/registrations/new.html.erb +29 -0
  20. data/lib/rails_app/template/app_bulma/views/devise/sessions/new.html.erb +26 -0
  21. data/lib/rails_app/template/app_bulma/views/devise/shared/_error_messages.html.erb +15 -0
  22. data/lib/rails_app/template/app_bulma/views/devise/shared/_links.html.erb +25 -0
  23. data/lib/rails_app/template/app_bulma/views/devise/unlocks/new.html.erb +16 -0
  24. data/lib/rails_app/template/app_bulma/views/layouts/application.html.erb +19 -0
  25. data/lib/rails_app/template/app_bulma/views/layouts/mailer.html.erb +13 -0
  26. data/lib/rails_app/template/app_bulma/views/layouts/mailer.text.erb +1 -0
  27. data/lib/rails_app/template/app_bulma/views/shared/_navbar.html.erb +33 -0
  28. data/lib/rails_app/template/app_bulma/views/static/home.html.erb +2 -0
  29. data/lib/rails_app/template/app_tailwind/assets/stylesheets/application.tailwind.css +18 -0
  30. data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/alerts.css +8 -0
  31. data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/buttons.css +30 -0
  32. data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/cards.css +3 -0
  33. data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/forms.css +21 -0
  34. data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/links.css +39 -0
  35. data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/pagination.css +39 -0
  36. data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/tables.css +19 -0
  37. data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/typography.css +32 -0
  38. data/lib/rails_app/template/app_tailwind/assets/stylesheets/custom.css +3 -0
  39. data/lib/rails_app/template/app_tailwind/assets/stylesheets/flatpickr_themes/light.css +809 -0
  40. data/lib/rails_app/template/app_tailwind/assets/stylesheets/simple_calendar.css +94 -0
  41. data/lib/rails_app/template/app_tailwind/postcss.config.js +10 -0
  42. data/lib/rails_app/template/app_tailwind/tailwind.config.js +37 -0
  43. data/lib/rails_app/template/app_tailwind/views/devise/confirmations/new.html.erb +16 -0
  44. data/lib/rails_app/template/app_tailwind/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  45. data/lib/rails_app/template/app_tailwind/views/devise/mailer/email_changed.html.erb +7 -0
  46. data/lib/rails_app/template/app_tailwind/views/devise/mailer/password_change.html.erb +3 -0
  47. data/lib/rails_app/template/app_tailwind/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  48. data/lib/rails_app/template/app_tailwind/views/devise/mailer/unlock_instructions.html.erb +7 -0
  49. data/lib/rails_app/template/app_tailwind/views/devise/passwords/edit.html.erb +25 -0
  50. data/lib/rails_app/template/app_tailwind/views/devise/passwords/new.html.erb +16 -0
  51. data/lib/rails_app/template/app_tailwind/views/devise/registrations/edit.html.erb +50 -0
  52. data/lib/rails_app/template/app_tailwind/views/devise/registrations/new.html.erb +31 -0
  53. data/lib/rails_app/template/app_tailwind/views/devise/sessions/new.html.erb +30 -0
  54. data/lib/rails_app/template/app_tailwind/views/devise/shared/_error_messages.html.erb +15 -0
  55. data/lib/rails_app/template/app_tailwind/views/devise/shared/_links.html.erb +25 -0
  56. data/lib/rails_app/template/app_tailwind/views/devise/unlocks/new.html.erb +16 -0
  57. data/lib/rails_app/template/app_tailwind/views/layouts/application.html.erb +28 -0
  58. data/lib/rails_app/template/app_tailwind/views/layouts/mailer.html.erb +13 -0
  59. data/lib/rails_app/template/app_tailwind/views/layouts/mailer.text.erb +1 -0
  60. data/lib/rails_app/template/app_tailwind/views/shared/_navbar.html.erb +23 -0
  61. data/lib/rails_app/template/app_tailwind/views/static/home.html.erb +2 -0
  62. data/lib/rails_app/template/template.rb +13 -5
  63. data/lib/rails_app/version.rb +1 -1
  64. data/lib/rails_app.rb +1 -0
  65. data/screenshot_cli.png +0 -0
  66. data/screenshot_cli_db.png +0 -0
  67. metadata +56 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8b906accbb46439adce6dab7127ca3fc9e8ef311e0818e2cdc29abedfb6fa05
4
- data.tar.gz: 54be8a47f22b245c1c8810c14819e7e4630d756e960d4d17c215bef003639b86
3
+ metadata.gz: 534816163e2b9fc2c353d1a2afb4568c8bd9b3355b46fcbe1b132b83cb89acad
4
+ data.tar.gz: e2e50fd1ebe97b1981da6713e49cc7595c8f11c58bb600b67e7b99088a745252
5
5
  SHA512:
6
- metadata.gz: 1f7a2931dd0f7f6b798876ae41ffed36c0111fc47f40113a261e5ff124865b42fc69b6080a910148843a45623404ec7cb931107815b16079d884f4e04bfdb50c
7
- data.tar.gz: 188fe26e84ed2b1182a31689505883bda5d2932790aceb58b2139b8bea7eb68d6a720588c338f969d6697574f4d29cd49bc34b64021bacc9b05df8c5280b0fb5
6
+ metadata.gz: d5242d9c1382772a58599ab08658745d6eac76a12c78ef2b83395af317a777abd022885028c5f664087882a4b6fed1331b831a0cc5dec9bd760746b5268ceb05
7
+ data.tar.gz: b3dcfc4ecbe21b2c96435606cb44bd7867f1de8d8da66075d50b9852db7d294580639434fdbef7f2fe4e81f72dcad879a5c336eeb5cf5a7ba1ea3b513a8fde16
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.0](https://github.com/eclectic-coding/rails_app/tree/0.7.0) (2024-04-04)
4
+
5
+ [Full Changelog](https://github.com/eclectic-coding/rails_app/compare/0.6.0...0.7.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - handle optional CLI ARGV [\#21](https://github.com/eclectic-coding/rails_app/issues/21)
10
+ - Add user option to select other styling systems [\#2](https://github.com/eclectic-coding/rails_app/issues/2)
11
+ - Handle optional cli argv [\#22](https://github.com/eclectic-coding/rails_app/pull/22) ([eclectic-coding](https://github.com/eclectic-coding))
12
+
13
+ ## [0.6.0](https://github.com/eclectic-coding/rails_app/tree/0.6.0) (2024-04-04)
14
+
15
+ [Full Changelog](https://github.com/eclectic-coding/rails_app/compare/0.5.0...0.6.0)
16
+
17
+ **Implemented enhancements:**
18
+
19
+ - Add option to select database adapter [\#19](https://github.com/eclectic-coding/rails_app/issues/19)
20
+ - Add option for Tailwind [\#10](https://github.com/eclectic-coding/rails_app/issues/10)
21
+ - Add option for Bulma styling system [\#9](https://github.com/eclectic-coding/rails_app/issues/9)
22
+ - Add option to select database adapter [\#20](https://github.com/eclectic-coding/rails_app/pull/20) ([eclectic-coding](https://github.com/eclectic-coding))
23
+ - Add option for tailwind [\#18](https://github.com/eclectic-coding/rails_app/pull/18) ([eclectic-coding](https://github.com/eclectic-coding))
24
+ - Add option for bulma styling system [\#17](https://github.com/eclectic-coding/rails_app/pull/17) ([eclectic-coding](https://github.com/eclectic-coding))
25
+
3
26
  ## [0.5.0](https://github.com/eclectic-coding/rails_app/tree/0.5.0) (2024-04-04)
4
27
 
5
28
  [Full Changelog](https://github.com/eclectic-coding/rails_app/compare/0.4.0...0.5.0)
data/README.md CHANGED
@@ -25,9 +25,34 @@ The user will be prompted to enter the name of the new Rails application, and th
25
25
 
26
26
  ![](./screenshot_cli.png)
27
27
 
28
+ Also, you can select your database of choice:
29
+
30
+ ![](./screenshot_cli_db.png)
31
+
28
32
  The template will then create a new Rails application with the selected options.
29
33
 
30
- ### Testing
34
+ ### Optional CLI Syntax
35
+
36
+ There is an additional syntax, available starting with release `v. 0.7.0`, which allows you to use `rails_app` very similarly to the `rails new` command:
37
+
38
+ ```bash
39
+ rails_app new my_app -a propshaft --css bootstrap -d postgresql
40
+ ```
41
+ I few things to note:
42
+ - the `app_name` must be first, just like with `rails new`
43
+ - the following arguments and flags must be separated by a space `-a propshaft`. Since, the parser ignores the flag and checks for the specific keywords only, you technically can use the follow: `rails_app my_app propshaft bootstrap postgresql`.
44
+
45
+ If you use this syntax, the template will not prompt you the application name, and subsequent options will be preselected for you.
46
+
47
+ Right not this syntax only supports the following options:
48
+ - app name
49
+ - assets pipeline
50
+ - styling
51
+ - database
52
+
53
+ More options will be added in future releases.
54
+
55
+ ## Testing
31
56
  The template includes RSpec for testing, which includes pre configured:
32
57
  - FactoryBot
33
58
  - Faker
@@ -43,6 +68,10 @@ The template includes the following code quality tools:
43
68
 
44
69
  All of this tools can be run using the following command, which also will run the test suite: `bin/ci`
45
70
 
71
+ In addition, the template includes:
72
+ - the `annotate` gem to annotate models and and factories with schema information
73
+ - the `bullet` gem to help identify and remove N+1 queries
74
+
46
75
  ## Development
47
76
 
48
77
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/bin/rails_app CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require "rails_app"
4
4
 
5
- RailsApp::App.rails_app
5
+ RailsApp::App.rails_app(ARGV)
data/lib/rails_app/cli.rb CHANGED
@@ -4,21 +4,30 @@ require "tty-prompt"
4
4
 
5
5
  module RailsApp
6
6
  class CLI
7
- def self.start
7
+ def self.start(args)
8
8
  prompt = TTY::Prompt.new
9
9
 
10
- app_name = prompt.ask("What is the name of your application?", required: true)
11
- assets = prompt.select("How would you like to manage assets?", %w[propshaft sprockets])
10
+ options_data = OptionsData.new(args)
11
+
12
+ app_name = options_data.app_name || prompt.ask("What is the name of your application?", required: true)
13
+
14
+ assets = prompt.select("How would you like to manage assets?", %w[propshaft sprockets], default: options_data.default_assets)
12
15
  styling_choices = [
13
16
  {name: "Bootstrap", value: "bootstrap"},
14
- {name: "Tailwind CSS", value: "tailwindcss", disabled: "(coming soon)"},
15
- {name: "Bulma", value: "bulma", disabled: "(coming soon)"},
17
+ {name: "Tailwind CSS", value: "tailwind"},
18
+ {name: "Bulma", value: "bulma"},
16
19
  {name: "PostCSS", value: "postcss"},
17
20
  {name: "SASS", value: "sass"}
18
21
  ]
19
- styling = prompt.select("How would you like to manage styling?", styling_choices)
22
+ styling = prompt.select("How would you like to manage styling?", styling_choices, default: options_data.default_styling)
23
+
24
+ database = prompt.select("Which database would you like to use?",
25
+ %w[postgresql sqlite3 mysql trilogy oracle sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc],
26
+ default: options_data.default_database)
27
+
28
+ # save configuration
20
29
 
21
- Command.new(app_name: app_name, assets: assets, styling: styling).run
30
+ Command.new(app_name: app_name, assets: assets, styling: styling, database: database).run
22
31
  end
23
32
  end
24
33
  end
@@ -2,12 +2,13 @@
2
2
 
3
3
  module RailsApp
4
4
  class Command
5
- attr_reader :app_name, :bundling, :assets
5
+ attr_reader :app_name, :assets, :styling, :database
6
6
 
7
- def initialize(app_name:, assets:, styling:)
7
+ def initialize(app_name:, assets:, styling:, database:)
8
8
  @app_name = app_name
9
9
  @assets = assets
10
10
  @styling = styling
11
+ @database = database
11
12
  end
12
13
 
13
14
  def template
@@ -15,7 +16,7 @@ module RailsApp
15
16
  end
16
17
 
17
18
  def run
18
- command = "rails new #{@app_name} --no-rc #{skip_spring} #{asset_management} #{javascript_bundling} #{styling_framework} #{testing_framework} -m #{template}"
19
+ command = "rails new #{@app_name} --no-rc #{skip_spring} #{database_adapter} #{asset_management} #{javascript_bundling} #{styling_framework} #{testing_framework} -m #{template}"
19
20
  puts command
20
21
  system(command)
21
22
  end
@@ -24,6 +25,10 @@ module RailsApp
24
25
  "--skip-spring"
25
26
  end
26
27
 
28
+ def database_adapter
29
+ "-d #{@database}" unless database == "sqlite3"
30
+ end
31
+
27
32
  def javascript_bundling
28
33
  "-j esbuild"
29
34
  end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsApp
4
+ class OptionsData
5
+ attr_reader :options
6
+
7
+ def initialize(args)
8
+ @options = args.flat_map { |arg| arg.split(" ") }
9
+ end
10
+
11
+ def app_name
12
+ @options[0]
13
+ end
14
+
15
+ def default_assets
16
+ @options.include?("sprockets") ? "sprockets" : "propshaft"
17
+ end
18
+
19
+ def default_styling
20
+ if @options.include?("tailwind")
21
+ "tailwind"
22
+ elsif @options.include?("bulma")
23
+ "bulma"
24
+ elsif @options.include?("postcss")
25
+ "postcss"
26
+ elsif @options.include?("sass")
27
+ "sass"
28
+ elsif @options.include?("bootstrap")
29
+ "bootstrap"
30
+ end
31
+ end
32
+
33
+ def default_database
34
+ if @options.include?("postgresql")
35
+ "postgresql"
36
+ elsif @options.include?("mysql")
37
+ "mysql"
38
+ elsif @options.include?("trilogy")
39
+ "trilogy"
40
+ elsif @options.include?("oracle")
41
+ "oracle"
42
+ elsif @options.include?("sqlserver")
43
+ "sqlserver"
44
+ elsif @options.include?("jdbcmysql")
45
+ "jdbcmysql"
46
+ elsif @options.include?("jdbcsqlite3")
47
+ "jdbcsqlite3"
48
+ elsif @options.include?("jdbcpostgresql")
49
+ "jdbcpostgresql"
50
+ elsif @options.include?("jdbc")
51
+ "jdbc"
52
+ else
53
+ "sqlite3"
54
+ end
55
+ end
56
+ end
57
+ end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module RailsApp
4
4
  class App
5
- def self.rails_app
6
- RailsApp::CLI.start
5
+ def self.rails_app(args)
6
+ RailsApp::CLI.start(args)
7
7
  end
8
8
  end
9
9
  end
@@ -0,0 +1,43 @@
1
+ // @charset "utf-8";
2
+
3
+ // Import a Google Font
4
+ // @import url('https://fonts.googleapis.com/css?family=Nunito:400,700');
5
+
6
+ // Set your brand colors
7
+ // $purple: #8A4D76;
8
+ // $pink: #FA7C91;
9
+ // $brown: #757763;
10
+ // $beige-light: #D0D1CD;
11
+ // $beige-lighter: #EFF0EB;
12
+
13
+ // Update Bulma's global variables
14
+ // $family-sans-serif: "Nunito", sans-serif;
15
+ // $grey-dark: $brown;
16
+ // $grey-light: $beige-light;
17
+ // $primary: $purple;
18
+ // $link: $pink;
19
+ // $widescreen-enabled: false;
20
+ // $fullhd-enabled: false;
21
+
22
+ // Update some of Bulma's component variables
23
+ // $body-background-color: $beige-lighter;
24
+ // $control-border-width: 2px;
25
+ // $input-border-color: transparent;
26
+ // $input-shadow: none;
27
+
28
+ // Import only what you need from Bulma
29
+ // @import "bulma/sass/utilities/_all.sass";
30
+ // @import "bulma/sass/base/_all.sass";
31
+ // @import "bulma/sass/elements/button.sass";
32
+ // @import "bulma/sass/elements/container.sass";
33
+ // @import "bulma/sass/elements/title.sass";
34
+ // @import "bulma/sass/form/_all.sass";
35
+ // @import "bulma/sass/components/navbar.sass";
36
+ // @import "bulma/sass/layout/hero.sass";
37
+ // @import "bulma/sass/layout/section.sass";
38
+
39
+ @import 'bulma/bulma';
40
+
41
+ body.has-background-white {
42
+ min-height: 100vh;
43
+ }
@@ -0,0 +1,16 @@
1
+ <h2>Resend confirmation instructions</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
+
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
9
+ </div>
10
+
11
+ <div class="actions">
12
+ <%= f.submit "Resend confirmation instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,5 @@
1
+ <p>Welcome <%= @email %>!</p>
2
+
3
+ <p>You can confirm your account email through the link below:</p>
4
+
5
+ <p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @email %>!</p>
2
+
3
+ <% if @resource.try(:unconfirmed_email?) %>
4
+ <p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
5
+ <% else %>
6
+ <p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
7
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>We're contacting you to notify you that your password has been changed.</p>
@@ -0,0 +1,8 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Someone has requested a link to change your password. You can do this through the link below.</p>
4
+
5
+ <p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
6
+
7
+ <p>If you didn't request this, please ignore this email.</p>
8
+ <p>Your password won't change until you access the link above and create a new one.</p>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
4
+
5
+ <p>Click the link below to unlock your account:</p>
6
+
7
+ <p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
@@ -0,0 +1,25 @@
1
+ <h2>Change your password</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
+ <%= f.hidden_field :reset_password_token %>
6
+
7
+ <div class="field">
8
+ <%= f.label :password, "New password" %><br />
9
+ <% if @minimum_password_length %>
10
+ <em>(<%= @minimum_password_length %> characters minimum)</em><br />
11
+ <% end %>
12
+ <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
13
+ </div>
14
+
15
+ <div class="field">
16
+ <%= f.label :password_confirmation, "Confirm new password" %><br />
17
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
18
+ </div>
19
+
20
+ <div class="actions">
21
+ <%= f.submit "Change my password" %>
22
+ </div>
23
+ <% end %>
24
+
25
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,16 @@
1
+ <h2>Forgot your password?</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
+
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9
+ </div>
10
+
11
+ <div class="actions">
12
+ <%= f.submit "Send me reset password instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,43 @@
1
+ <h2>Edit <%= resource_name.to_s.humanize %></h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
+
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9
+ </div>
10
+
11
+ <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
12
+ <div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
13
+ <% end %>
14
+
15
+ <div class="field">
16
+ <%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
17
+ <%= f.password_field :password, autocomplete: "new-password" %>
18
+ <% if @minimum_password_length %>
19
+ <br />
20
+ <em><%= @minimum_password_length %> characters minimum</em>
21
+ <% end %>
22
+ </div>
23
+
24
+ <div class="field">
25
+ <%= f.label :password_confirmation %><br />
26
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
27
+ </div>
28
+
29
+ <div class="field">
30
+ <%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
31
+ <%= f.password_field :current_password, autocomplete: "current-password" %>
32
+ </div>
33
+
34
+ <div class="actions">
35
+ <%= f.submit "Update" %>
36
+ </div>
37
+ <% end %>
38
+
39
+ <h3>Cancel my account</h3>
40
+
41
+ <div>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete %></div>
42
+
43
+ <%= link_to "Back", :back %>
@@ -0,0 +1,29 @@
1
+ <h2 class="title">Sign up</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
+
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9
+ </div>
10
+
11
+ <div class="field">
12
+ <%= f.label :password %>
13
+ <% if @minimum_password_length %>
14
+ <em>(<%= @minimum_password_length %> characters minimum)</em>
15
+ <% end %><br />
16
+ <%= f.password_field :password, autocomplete: "new-password" %>
17
+ </div>
18
+
19
+ <div class="field">
20
+ <%= f.label :password_confirmation %><br />
21
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
22
+ </div>
23
+
24
+ <div class="actions">
25
+ <%= f.submit "Sign up" %>
26
+ </div>
27
+ <% end %>
28
+
29
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,26 @@
1
+ <h2>Log in</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
4
+ <div class="field">
5
+ <%= f.label :email %><br />
6
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
7
+ </div>
8
+
9
+ <div class="field">
10
+ <%= f.label :password %><br />
11
+ <%= f.password_field :password, autocomplete: "current-password" %>
12
+ </div>
13
+
14
+ <% if devise_mapping.rememberable? %>
15
+ <div class="field">
16
+ <%= f.check_box :remember_me %>
17
+ <%= f.label :remember_me %>
18
+ </div>
19
+ <% end %>
20
+
21
+ <div class="actions">
22
+ <%= f.submit "Log in" %>
23
+ </div>
24
+ <% end %>
25
+
26
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,15 @@
1
+ <% if resource.errors.any? %>
2
+ <div id="error_explanation" data-turbo-cache="false">
3
+ <h2>
4
+ <%= I18n.t("errors.messages.not_saved",
5
+ count: resource.errors.count,
6
+ resource: resource.class.model_name.human.downcase)
7
+ %>
8
+ </h2>
9
+ <ul>
10
+ <% resource.errors.full_messages.each do |message| %>
11
+ <li><%= message %></li>
12
+ <% end %>
13
+ </ul>
14
+ </div>
15
+ <% end %>
@@ -0,0 +1,25 @@
1
+ <%- if controller_name != 'sessions' %>
2
+ <%= link_to "Log in", new_session_path(resource_name) %><br />
3
+ <% end %>
4
+
5
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
+ <% end %>
8
+
9
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
+ <% end %>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
+ <% end %>
16
+
17
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
+ <% end %>
20
+
21
+ <%- if devise_mapping.omniauthable? %>
22
+ <%- resource_class.omniauth_providers.each do |provider| %>
23
+ <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br />
24
+ <% end %>
25
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <h2>Resend unlock instructions</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
+
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9
+ </div>
10
+
11
+ <div class="actions">
12
+ <%= f.submit "Resend unlock instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Catapp</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
10
+ <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
11
+ </head>
12
+
13
+ <body class="has-background-white has-text-dark">
14
+ <%= render "shared/navbar" %>
15
+ <main class="container">
16
+ <%= yield %>
17
+ </main>
18
+ </body>
19
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1,33 @@
1
+ <nav class="navbar" role="navigation" aria-label="main navigation">
2
+ <div class="navbar-brand">
3
+ <a class="navbar-item" href="https://bulma.io">
4
+ TestApp
5
+ </a>
6
+
7
+ <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
8
+ <span aria-hidden="true"></span>
9
+ <span aria-hidden="true"></span>
10
+ <span aria-hidden="true"></span>
11
+ <span aria-hidden="true"></span>
12
+ </a>
13
+ </div>
14
+
15
+ <div id="navbarBasicExample" class="navbar-menu">
16
+ <div class="navbar-end">
17
+ <div class="navbar-item">
18
+ <div class="buttons">
19
+ <% if user_signed_in? %>
20
+ <%= button_to "Log out", destroy_user_session_path, method: :delete, class: "button is-primary" %>
21
+ <% else %>
22
+ <%= link_to new_user_session_path, class: "button is-primary" do %>
23
+ <strong>Login</strong>
24
+ <% end %>
25
+ <%= link_to new_user_registration_path, class: "button is-primary" do %>
26
+ <strong>Sign up</strong>
27
+ <% end %>
28
+ <% end %>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </nav>
@@ -0,0 +1,2 @@
1
+ <h1>Static#home</h1>
2
+ <p>Find me in app/views/static/home.html.erb</p>
@@ -0,0 +1,18 @@
1
+ @import "tailwindcss/base";
2
+ @import "tailwindcss/components";
3
+
4
+ @import "components/alerts.css";
5
+ @import "components/buttons.css";
6
+ @import "components/cards.css";
7
+ @import "components/forms.css";
8
+ @import "components/links.css";
9
+ @import "components/pagination.css";
10
+ @import "components/tables.css";
11
+ @import "components/typography.css";
12
+
13
+ @import "tailwindcss/utilities";
14
+
15
+ /* Additional styles */
16
+ @import "./custom.css";
17
+ @import "flatpickr_themes/light.css";
18
+ @import "simple_calendar.css";
@@ -0,0 +1,8 @@
1
+ .notice {
2
+ @apply flex items-center w-full max-w-xs p-4 mb-4 text-gray-500 bg-white rounded-lg shadow;
3
+ @apply dark:text-gray-400 dark:bg-gray-800;
4
+
5
+ button {
6
+ @apply ms-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex items-center justify-center h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700;
7
+ }
8
+ }