rails_app 0.5.0 → 0.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +8 -0
- data/lib/rails_app/cli.rb +4 -3
- data/lib/rails_app/command.rb +8 -3
- data/lib/rails_app/template/app_bulma/assets/stylesheets/application.bulma.scss +43 -0
- data/lib/rails_app/template/app_bulma/views/devise/confirmations/new.html.erb +16 -0
- data/lib/rails_app/template/app_bulma/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/lib/rails_app/template/app_bulma/views/devise/mailer/email_changed.html.erb +7 -0
- data/lib/rails_app/template/app_bulma/views/devise/mailer/password_change.html.erb +3 -0
- data/lib/rails_app/template/app_bulma/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/lib/rails_app/template/app_bulma/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/lib/rails_app/template/app_bulma/views/devise/passwords/edit.html.erb +25 -0
- data/lib/rails_app/template/app_bulma/views/devise/passwords/new.html.erb +16 -0
- data/lib/rails_app/template/app_bulma/views/devise/registrations/edit.html.erb +43 -0
- data/lib/rails_app/template/app_bulma/views/devise/registrations/new.html.erb +29 -0
- data/lib/rails_app/template/app_bulma/views/devise/sessions/new.html.erb +26 -0
- data/lib/rails_app/template/app_bulma/views/devise/shared/_error_messages.html.erb +15 -0
- data/lib/rails_app/template/app_bulma/views/devise/shared/_links.html.erb +25 -0
- data/lib/rails_app/template/app_bulma/views/devise/unlocks/new.html.erb +16 -0
- data/lib/rails_app/template/app_bulma/views/layouts/application.html.erb +19 -0
- data/lib/rails_app/template/app_bulma/views/layouts/mailer.html.erb +13 -0
- data/lib/rails_app/template/app_bulma/views/layouts/mailer.text.erb +1 -0
- data/lib/rails_app/template/app_bulma/views/shared/_navbar.html.erb +33 -0
- data/lib/rails_app/template/app_bulma/views/static/home.html.erb +2 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/application.tailwind.css +18 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/alerts.css +8 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/buttons.css +30 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/cards.css +3 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/forms.css +21 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/links.css +39 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/pagination.css +39 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/tables.css +19 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/components/typography.css +32 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/custom.css +3 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/flatpickr_themes/light.css +809 -0
- data/lib/rails_app/template/app_tailwind/assets/stylesheets/simple_calendar.css +94 -0
- data/lib/rails_app/template/app_tailwind/postcss.config.js +10 -0
- data/lib/rails_app/template/app_tailwind/tailwind.config.js +37 -0
- data/lib/rails_app/template/app_tailwind/views/devise/confirmations/new.html.erb +16 -0
- data/lib/rails_app/template/app_tailwind/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/lib/rails_app/template/app_tailwind/views/devise/mailer/email_changed.html.erb +7 -0
- data/lib/rails_app/template/app_tailwind/views/devise/mailer/password_change.html.erb +3 -0
- data/lib/rails_app/template/app_tailwind/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/lib/rails_app/template/app_tailwind/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/lib/rails_app/template/app_tailwind/views/devise/passwords/edit.html.erb +25 -0
- data/lib/rails_app/template/app_tailwind/views/devise/passwords/new.html.erb +16 -0
- data/lib/rails_app/template/app_tailwind/views/devise/registrations/edit.html.erb +50 -0
- data/lib/rails_app/template/app_tailwind/views/devise/registrations/new.html.erb +31 -0
- data/lib/rails_app/template/app_tailwind/views/devise/sessions/new.html.erb +30 -0
- data/lib/rails_app/template/app_tailwind/views/devise/shared/_error_messages.html.erb +15 -0
- data/lib/rails_app/template/app_tailwind/views/devise/shared/_links.html.erb +25 -0
- data/lib/rails_app/template/app_tailwind/views/devise/unlocks/new.html.erb +16 -0
- data/lib/rails_app/template/app_tailwind/views/layouts/application.html.erb +28 -0
- data/lib/rails_app/template/app_tailwind/views/layouts/mailer.html.erb +13 -0
- data/lib/rails_app/template/app_tailwind/views/layouts/mailer.text.erb +1 -0
- data/lib/rails_app/template/app_tailwind/views/shared/_navbar.html.erb +23 -0
- data/lib/rails_app/template/app_tailwind/views/static/home.html.erb +2 -0
- data/lib/rails_app/template/template.rb +13 -5
- data/lib/rails_app/version.rb +1 -1
- data/screenshot_cli.png +0 -0
- data/screenshot_cli_db.png +0 -0
- metadata +55 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 82dcc08138eb02ce0aafb95ddd5ac1122f2ed79d4510262c3991bc8c2a5eaeb4
|
|
4
|
+
data.tar.gz: 47207c80b368ed13984db09d55f437332c9ea97d64d105582f6ef4b95ca27cf7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a12f159b7870cc8036d68fa1547de18420292166df000b4e8f72f4d78bff6207020081f264602afe0e9da164dc37d6a25ab0d094b6c577ddcad09c4000a99772
|
|
7
|
+
data.tar.gz: 8bd93c9bec6c3b2542d58d288b93e57c55f3c87e68d0a3f82fdabf0cc377c83efa3afac28a806b262ee54f245cf7276fe11de122ecfb0adda77e83fb0dcaa26c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.0](https://github.com/eclectic-coding/rails_app/tree/0.6.0) (2024-04-04)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/eclectic-coding/rails_app/compare/0.5.0...0.6.0)
|
|
6
|
+
|
|
7
|
+
**Implemented enhancements:**
|
|
8
|
+
|
|
9
|
+
- Add option to select database adapter [\#19](https://github.com/eclectic-coding/rails_app/issues/19)
|
|
10
|
+
- Add option for Tailwind [\#10](https://github.com/eclectic-coding/rails_app/issues/10)
|
|
11
|
+
- Add option for Bulma styling system [\#9](https://github.com/eclectic-coding/rails_app/issues/9)
|
|
12
|
+
- Add option to select database adapter [\#20](https://github.com/eclectic-coding/rails_app/pull/20) ([eclectic-coding](https://github.com/eclectic-coding))
|
|
13
|
+
- Add option for tailwind [\#18](https://github.com/eclectic-coding/rails_app/pull/18) ([eclectic-coding](https://github.com/eclectic-coding))
|
|
14
|
+
- Add option for bulma styling system [\#17](https://github.com/eclectic-coding/rails_app/pull/17) ([eclectic-coding](https://github.com/eclectic-coding))
|
|
15
|
+
|
|
3
16
|
## [0.5.0](https://github.com/eclectic-coding/rails_app/tree/0.5.0) (2024-04-04)
|
|
4
17
|
|
|
5
18
|
[Full Changelog](https://github.com/eclectic-coding/rails_app/compare/0.4.0...0.5.0)
|
data/README.md
CHANGED
|
@@ -25,6 +25,10 @@ The user will be prompted to enter the name of the new Rails application, and th
|
|
|
25
25
|
|
|
26
26
|

|
|
27
27
|
|
|
28
|
+
Also, you can select your database of choice:
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
28
32
|
The template will then create a new Rails application with the selected options.
|
|
29
33
|
|
|
30
34
|
### Testing
|
|
@@ -43,6 +47,10 @@ The template includes the following code quality tools:
|
|
|
43
47
|
|
|
44
48
|
All of this tools can be run using the following command, which also will run the test suite: `bin/ci`
|
|
45
49
|
|
|
50
|
+
In addition, the template includes:
|
|
51
|
+
- the `annotate` gem to annotate models and and factories with schema information
|
|
52
|
+
- the `bullet` gem to help identify and remove N+1 queries
|
|
53
|
+
|
|
46
54
|
## Development
|
|
47
55
|
|
|
48
56
|
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/lib/rails_app/cli.rb
CHANGED
|
@@ -11,14 +11,15 @@ module RailsApp
|
|
|
11
11
|
assets = prompt.select("How would you like to manage assets?", %w[propshaft sprockets])
|
|
12
12
|
styling_choices = [
|
|
13
13
|
{name: "Bootstrap", value: "bootstrap"},
|
|
14
|
-
{name: "Tailwind CSS", value: "
|
|
15
|
-
{name: "Bulma", value: "bulma"
|
|
14
|
+
{name: "Tailwind CSS", value: "tailwind"},
|
|
15
|
+
{name: "Bulma", value: "bulma"},
|
|
16
16
|
{name: "PostCSS", value: "postcss"},
|
|
17
17
|
{name: "SASS", value: "sass"}
|
|
18
18
|
]
|
|
19
19
|
styling = prompt.select("How would you like to manage styling?", styling_choices)
|
|
20
|
+
database = prompt.select("Which database would you like to use?", %w[postgresql sqlite3 mysql trilogy oracle sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc])
|
|
20
21
|
|
|
21
|
-
Command.new(app_name: app_name, assets: assets, styling: styling).run
|
|
22
|
+
Command.new(app_name: app_name, assets: assets, styling: styling, database: database).run
|
|
22
23
|
end
|
|
23
24
|
end
|
|
24
25
|
end
|
data/lib/rails_app/command.rb
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module RailsApp
|
|
4
4
|
class Command
|
|
5
|
-
attr_reader :app_name, :
|
|
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,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,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 %>
|
data/lib/rails_app/template/app_bulma/views/devise/mailer/reset_password_instructions.html.erb
ADDED
|
@@ -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 @@
|
|
|
1
|
+
<%= yield %>
|
|
@@ -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,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
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.btn {
|
|
2
|
+
@apply focus:ring-4 font-medium focus:outline-none;
|
|
3
|
+
@apply px-5 py-2.5;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.btn-sm {
|
|
7
|
+
@apply focus:ring-4 font-medium focus:outline-none;
|
|
8
|
+
@apply px-3 py-1.5;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.btn-primary {
|
|
12
|
+
@apply text-sm font-medium text-white;
|
|
13
|
+
@apply bg-primary-700 hover:bg-primary-800 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.btn-outline-primary {
|
|
17
|
+
@apply text-sm font-medium text-primary-700;
|
|
18
|
+
@apply border border-primary-700 hover:bg-primary-700 hover:text-white focus:ring-primary-300 dark:border-primary-600 dark:hover:bg-primary-600 dark:hover:text-white dark:focus:ring-primary-800;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.btn-success {
|
|
22
|
+
@apply text-sm font-medium text-white;
|
|
23
|
+
@apply bg-success-700 hover:bg-success-800 focus:ring-success-300 dark:bg-success-600 dark:hover:bg-success-700 dark:focus:ring-success-800;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.btn-outline-success {
|
|
27
|
+
@apply text-sm font-medium text-success-700;
|
|
28
|
+
@apply border border-success-700 hover:bg-success-700 hover:text-white focus:ring-success-300 dark:border-success-600 dark:hover:bg-success-600 dark:hover:text-white dark:focus:ring-success-800;
|
|
29
|
+
}
|
|
30
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.form-control {
|
|
3
|
+
@apply bg-gray-50 border border-gray-300 text-gray-900 text-sm focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.form-control-sm {
|
|
7
|
+
@apply block w-full p-2 text-gray-900 border border-gray-300 bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.form-label {
|
|
11
|
+
@apply block mb-1 pr-1 text-sm font-medium text-gray-900 dark:text-white;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.form-check-input {
|
|
15
|
+
@apply w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.form-select {
|
|
19
|
+
@apply bg-gray-50 border border-gray-300 text-gray-900 text-sm focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.nav-link {
|
|
2
|
+
@apply block py-2 px-3 text-gray-900 rounded md:border-0 md:p-0;
|
|
3
|
+
@apply text-gray-900 capitalize hover:bg-gray-200 md:dark:hover:text-red-500 md:hover:bg-transparent md:border-0 md:hover:text-red-700 md:p-0;
|
|
4
|
+
@apply dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent;
|
|
5
|
+
|
|
6
|
+
&.active {
|
|
7
|
+
@apply text-red-500;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&.hover {
|
|
11
|
+
@apply text-red-500;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
a {
|
|
15
|
+
@apply text-gray-200;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.nav-link-dropdown {
|
|
20
|
+
@apply block text-gray-900 px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white;
|
|
21
|
+
|
|
22
|
+
&.active {
|
|
23
|
+
@apply text-red-500;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.nav-dropdown-menu {
|
|
28
|
+
@apply z-10 hidden font-normal bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 dark:divide-gray-600;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.nav-dropdown-button {
|
|
32
|
+
@apply flex items-center justify-between w-full py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 md:w-auto dark:text-white md:dark:hover:text-blue-500 dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.admin-nav-link-active {
|
|
36
|
+
svg {
|
|
37
|
+
@apply text-white;
|
|
38
|
+
}
|
|
39
|
+
}
|