devise-bootstrap-form 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eba5fdc6f0531e026e8aca13381f2befd5a99c5b9489aa5ebd3e8b0281ef890d
4
- data.tar.gz: 3966109984c9cd2f861a7151c23e0958600babe2c5756f1518d5bfa91f2ef78c
3
+ metadata.gz: e9f4f512d9aec46299cf96863bbc67fb56c297bb78c02733535d729ed5ad53d7
4
+ data.tar.gz: f92f4bd410f63afd7f7b093a7ffe12218245cf63d2b7e5164960230efdee3370
5
5
  SHA512:
6
- metadata.gz: 07e793153c7ad34be04a8da081259d06c89350e7ffe7767ae9faf8fdfa1da097de640b2dfa2bf62c2c3d3a9c261696eaa64410849667afd13d32f58e5af891ed
7
- data.tar.gz: a5d4025d26e22fa603600e1ee5146e5d0b53603f3534f20b3200dfb0e456cbaa030f5d73b53e428f5dba830cf2bae397f6a7b709bf22bc69c94de92c8fba9cbf
6
+ metadata.gz: da59caa8cd1eb13663d70c9d6fb0f9228247778c8e55df40a12f154f23f261a19834bd3eb36a579ee759c875ca7d3fcda1e3d613c5d612a94bce760cf1ad83bb
7
+ data.tar.gz: bb08c554aa8bc6e918013782775feb8d2b0633ac91e29e9103d1ad8318b650e71769a988ead4b5f27adb61eca2a4d5522ffb3828f561dbe8f75149756677655c
data/.rubocop.yml CHANGED
@@ -8,6 +8,7 @@ Style/StringLiterals:
8
8
  ConsistentQuotesInMultiline: false
9
9
  Exclude:
10
10
  - "test/rails_app/app/mailers/*"
11
+ - "test/es_rails_app/app/mailers/*"
11
12
 
12
13
  Layout/AlignParameters:
13
14
  # Alignment of parameters in multi-line method calls.
@@ -76,11 +77,41 @@ AllCops:
76
77
  - test/rails_app/Gemfile
77
78
  - test/rails_app/Guardfile
78
79
  - test/rails_app/Rakefile
80
+ - "test/es_rails_app/bin/**/*"
81
+ - "test/es_rails_app/config/**/*"
82
+ - test/es_rails_app/config.ru
83
+ - "test/es_rails_app/db/**/*"
84
+ - "test/es_rails_app/log/**/*"
85
+ - "test/es_rails_app/tmp/**/*"
86
+ - "test/es_rails_app/vendor/**/*"
87
+ # - test/es_rails_app/config/boot.rb
88
+ # - test/es_rails_app/config/application.rb
89
+ # - test/es_rails_app/config/environment.rb
90
+ # - "test/es_rails_app/config/environments/*"
91
+ # - "test/es_rails_app/config/initializers/*"
92
+ # - test/es_rails_app/db/schema.rb
93
+ - "test/es_rails_app/node_modules/**/*"
94
+ - "test/es_rails_app/bower_components/**/*"
95
+ - test/es_rails_app/Gemfile
96
+ - test/es_rails_app/Guardfile
97
+ - test/es_rails_app/Rakefile
79
98
 
80
99
  Metrics/BlockLength:
81
100
  Exclude:
82
101
  - devise-bootstrap-form.gemspec
83
102
 
103
+ Metrics/AbcSize:
104
+ Exclude:
105
+ - test/**/*.rb
106
+
107
+ Metrics/ClassLength:
108
+ Exclude:
109
+ - test/**/*.rb
110
+
111
+ Metrics/MethodLength:
112
+ Exclude:
113
+ - test/**/*.rb
114
+
84
115
  # TODO: Remove this when minimum Ruby is 2.3.
85
116
  Layout/IndentHeredoc:
86
117
  Exclude:
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ## [Pending Release][0.1.0]
1
+ ## [Pending Release][0.0.0]
2
2
 
3
3
  ### Breaking changes
4
4
 
@@ -10,4 +10,37 @@
10
10
 
11
11
  ### Bugfixes
12
12
 
13
- * Your contribution here!
13
+ * None.
14
+
15
+ ## [0.2.0][] (2018-09-30)
16
+
17
+ ### Breaking changes
18
+
19
+ * None.
20
+
21
+ ### New features
22
+
23
+ * Initial support for internationalization.
24
+
25
+ ### Bugfixes
26
+
27
+ * None.
28
+
29
+ ## [0.1.0][] (2018-08-27)
30
+
31
+ ### Breaking changes
32
+
33
+ * N/A.
34
+
35
+ ### New features
36
+
37
+ * Devise forms using [`bootstrap_form`](https://github.com/bootstrap-ruby/bootstrap_form).
38
+
39
+ ### Bugfixes
40
+
41
+ * N/A.
42
+
43
+ ```
44
+ [0.2.0]: https://github.com/lcreid/devise-bootstrap-form/compare/v0.1.0..v0.2.0
45
+ [0.1.0]: https://github.com/lcreid/devise-bootstrap-form/compare/...v0.2.0
46
+ ```
data/CONTRIBUTING.md CHANGED
@@ -8,12 +8,12 @@ If you find a bug or have an idea for a feature:
8
8
 
9
9
  ## Testing
10
10
  ### Manual and Exploratory Testing
11
- There is a test app in `test/rails_app`.
11
+ There are test apps in `test/rails_app`, for the default locale, and `es_rails_app` for a Spanish locale.
12
12
 
13
13
  To use the `devise-bootstrap-form` gem:
14
14
 
15
15
  ```
16
- cd rails_app
16
+ cd test/rails_app # or cd test/es_rails_app
17
17
  # Generate the view in the test app
18
18
  rails g devise:views:bootstrap_form
19
19
  rails s -b 0.0.0.0 &
@@ -27,7 +27,7 @@ rake test
27
27
  ```
28
28
 
29
29
  ## Gotchas
30
- To test that the views work for a model other than the default `User`, the test app uses `Person` as the Devise model. It's a bit frustrating to remember that you can't just cut and paste examples that assume the model is `User`.
30
+ To test that the views work for a model other than the default `User`, the test apps use `Person` as the Devise model. It's a bit frustrating to remember that you can't just cut and paste examples that assume the model is `User`.
31
31
 
32
32
  ## Coding guidelines
33
33
 
data/README.md CHANGED
@@ -4,11 +4,9 @@ This gem gives you a nicer place to start customizing views for your Devise mode
4
4
 
5
5
  It also makes the Devise views simpler, because the code to define forms using `bootstrap_form` is simpler than the code for a "raw" Rails form. So any customization you do to the Devise views will be simpler.
6
6
 
7
- You can find usage information below, but the gist of it is you'll run `rails g devise:views:bootstrap-form` instead of the normal `rails g devise:views`.
7
+ You can find usage information below, but the gist of it is you'll run `rails g devise:views:bootstrap_form` instead of the normal `rails g devise:views`.
8
8
 
9
- If you want to switch back to what Devise gives you, no problem. Just remove the `app/views/devise` folder. You will then use the default Devise views, or you can run the normal Devise `rails g devise:views` generator command and customize the default Devise views.
10
-
11
- If you're just looking for Bootstrap markup on your Devise views, and don't want to use `bootstrap_form`, then you should look into the [`devise-bootstrapped`](https://github.com/king601/devise-bootstrapped) gem, or one of its forks.
9
+ If you're just looking for Bootstrap markup on your Devise views, and don't want to use `bootstrap_form`, then you should look into the [`devise-bootstrapped`](https://github.com/king601/devise-bootstrapped) gem, or [`devise-bootstrap-views`](https://github.com/hisea/devise-bootstrap-views).
12
10
 
13
11
  ## Installation
14
12
 
@@ -17,8 +15,9 @@ Add these lines to your application's `Gemfile`:
17
15
  ```ruby
18
16
  gem 'bootstrap', '~> 4.0'
19
17
  gem "bootstrap_form", ">= 4.0.0.alpha1"
20
- gem 'devise'
21
- gem 'devise-bootstrap-form', github: "lcreid/devise-bootstrap-form"
18
+ gem 'devise' # gem 'devise-i18n'
19
+ # gem 'devise_invitable'
20
+ gem 'devise-bootstrap-form'
22
21
  ```
23
22
 
24
23
  And then execute:
@@ -26,14 +25,15 @@ And then execute:
26
25
  bundle install
27
26
  ```
28
27
 
29
- There are additional installation instructions for both [`bootstrap_form`](https://github.com/bootstrap-ruby/bootstrap_form#installation) and [`bootstrap`](https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails) that yu must complete before using `devise-bootstrap-form`.
28
+ There are additional installation instructions for [`bootstrap_form`](https://github.com/bootstrap-ruby/bootstrap_form#installation), [`bootstrap`](https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails), [`devise`](https://github.com/plataformatec/devise) that you must complete before using `devise-bootstrap-form`, and
29
+ [`devise-i18n`](https://github.com/tigrish/devise-i18n).
30
30
 
31
31
  ## Usage
32
32
 
33
- To use the Bootstrap views generator you'll want to have Devise installed per normal installation. Once you've installed Devise and generated your user model you can generate the views with:
33
+ Once all the gems are installed and configured, and the user model is generated, you can generate the Bootstrap Form views with:
34
34
 
35
35
  ```bash
36
- rails generate devise:views:bootstrap-form
36
+ rails generate devise:views:bootstrap_form
37
37
  ```
38
38
 
39
39
  If you've already generated the Devise views you can use the `-f` argument to force an override, but that will erase any of the changes you've made to the views.
@@ -44,6 +44,8 @@ Generate the mailer views from normal Devise, as they're not included in `devise
44
44
  rails generate devise:views -v mailer
45
45
  ```
46
46
 
47
+ To switch back to what Devise gives you, remove the `app/views/devise` folder. Your application will then use the default Devise views, or you can run the normal Devise `rails g devise:views` generator command and customize the default Devise views.
48
+
47
49
  ## Generated Layout
48
50
 
49
51
  Each of the forms in enclosed in the following:
@@ -85,9 +87,9 @@ You may want to adjust to your own tastes. For example, if the layout used by yo
85
87
  }
86
88
  ```
87
89
 
88
- from `app/assets/stylesheets/devise_bootstrap_form.scss` file.
90
+ from `app/assets/stylesheets/devise_bootstrap_form.scss`.
89
91
 
90
- Of course, you can also modify the views to change the surrounding `div`s to your needs.
92
+ You can also modify the views to change the surrounding `div`s to your needs, or change the SASS in `app/assets/stylesheets/devise_bootstrap_form.scss`.
91
93
 
92
94
  If you don't want the `devise_bootstrap_form`-generated styles at all, remove the following line from `app/asserts/application.scss`:
93
95
 
@@ -95,6 +97,11 @@ If you don't want the `devise_bootstrap_form`-generated styles at all, remove th
95
97
  @include "devise_bootstrap_form.scss";
96
98
  ```
97
99
 
100
+ ## Internationalization
101
+ If your `Gemfile` includes `devise-i18n`, `devise-bootstrap-form` will generate views with translations. If you're also using `devise_invitable`, you have to manually copy its translations into your application from the [`devise_invitable` wiki](https://github.com/scambra/devise_invitable/wiki/I18n).
102
+
103
+ Also, don't forget to add `gem "rails-i18n"` to your `Gemfile`.
104
+
98
105
  ## Contributing
99
106
 
100
107
  This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).
@@ -0,0 +1,23 @@
1
+ <div class="devise-bootstrap-form">
2
+ <div class="devise-bootstrap-form-row">
3
+ <div class="devise-bootstrap-form-col">
4
+ <h2 class="text-center"><%= t('.resend_confirmation_instructions') %></h2>
5
+
6
+ <%= bootstrap_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
7
+ <%= devise_error_messages! %>
8
+
9
+ <%= f.email_field :email,
10
+ autofocus: true,
11
+ autocomplete: "email",
12
+ value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
13
+ <%= f.form_group do %>
14
+ <%= f.submit t('.resend_confirmation_instructions'), class: 'btn btn-primary btn-lg btn-block' %>
15
+ <% end %>
16
+ <% end %>
17
+
18
+ <div class="text-center">
19
+ <%= render "devise/shared/links" %>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
@@ -0,0 +1,4 @@
1
+ <p><%= t('.greeting', recipient: @email) %></p>
2
+
3
+ <p><%= t('.instruction') %></p>
4
+ <p><%= link_to t('.action'), confirmation_url(@resource, confirmation_token: @token) %></p>
@@ -0,0 +1,7 @@
1
+ <p><%= t('.greeting', recipient: @email) %></p>
2
+
3
+ <% if @resource.try(:unconfirmed_email?) %>
4
+ <p><%= t('.message', email: @resource.unconfirmed_email) %></p>
5
+ <% else %>
6
+ <p><%= t('.message', email: @resource.email) %></p>
7
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <p><%= t('.greeting', recipient: @resource.email) %></p>
2
+
3
+ <p><%= t('.message') %></p>
@@ -0,0 +1,8 @@
1
+ <p><%= t('.greeting', recipient: @resource.email) %></p>
2
+
3
+ <p><%= t('.instruction') %></p>
4
+
5
+ <p><%= link_to t('.action'), edit_password_url(@resource, reset_password_token: @token) %></p>
6
+
7
+ <p><%= t('.instruction_2') %></p>
8
+ <p><%= t('.instruction_3') %></p>
@@ -0,0 +1,7 @@
1
+ <p><%= t('.greeting', recipient: @resource.email) %></p>
2
+
3
+ <p><%= t('.message') %></p>
4
+
5
+ <p><%= t('.instruction') %></p>
6
+
7
+ <p><%= link_to t('.action'), unlock_url(@resource, unlock_token: @token) %></p>
@@ -0,0 +1,29 @@
1
+ <div class="devise-bootstrap-form">
2
+ <div class="devise-bootstrap-form-row">
3
+ <div class="devise-bootstrap-form-col">
4
+ <h2 class="text-center"><%= t('.change_your_password') %></h2>
5
+
6
+ <%= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
7
+ <%= devise_error_messages! %>
8
+ <%= f.hidden_field :reset_password_token %>
9
+
10
+ <%= f.password_field :password,
11
+ autofocus: true,
12
+ autocomplete: "new-password",
13
+ help: "t('devise.shared.minimum_password_length', count: @minimum_password_length)",
14
+ label: t('.new_password') %>
15
+ <%= f.password_field :password_confirmation,
16
+ label: t('.confirm_new_password'),
17
+ autocomplete: "off",
18
+ class: "required" %>
19
+ <%= f.form_group do %>
20
+ <%= f.submit t('.change_my_password'), class: 'btn btn-primary btn-block btn-lg' %>
21
+ <% end %>
22
+ <% end %>
23
+
24
+ <div class="text-center">
25
+ <%= render "devise/shared/links" %>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </div>
@@ -0,0 +1,19 @@
1
+ <div class="devise-bootstrap-form">
2
+ <div class="devise-bootstrap-form-row">
3
+ <div class="devise-bootstrap-form-col">
4
+ <h2 class="text-center"><%= t('.forgot_your_password') %></h2>
5
+
6
+ <%= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
7
+ <%= devise_error_messages! %>
8
+ <br>
9
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
10
+ <%= f.form_group do %>
11
+ <%= f.submit t('.send_me_reset_password_instructions'), class: 'btn btn-primary btn-block btn-lg' %>
12
+ <% end %>
13
+ <% end %>
14
+ <div class="text-center">
15
+ <%= render "devise/shared/links" %>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
@@ -0,0 +1,33 @@
1
+ <div class="devise-bootstrap-form">
2
+ <div class="devise-bootstrap-form-row">
3
+ <div class="devise-bootstrap-form-col">
4
+ <h2 class="text-center">t('.title', resource: resource_name.to_s.humanize)</h2>
5
+ <%= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
6
+ <%= devise_error_messages! %>
7
+
8
+ <%= f.email_field :email %>
9
+
10
+ <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
11
+ <div><%= t('.currently_waiting_confirmation_for_email', email: resource.unconfirmed_email) %></div>
12
+ <% end %>
13
+
14
+ <%= f.password_field :password, autocomplete: "off", help: t('.leave_blank_if_you_don_t_want_to_change_it') + " " + t('devise.shared.minimum_password_length', count: @minimum_password_length) %>
15
+ <%= f.password_field :password_confirmation, autocomplete: "off", class: "required" %>
16
+ <%= f.password_field :current_password,
17
+ autocomplete: "off",
18
+ class: "required",
19
+ help: t('.we_need_your_current_password_to_confirm_your_changes') %>
20
+
21
+ <%= f.form_group do %>
22
+ <%= f.submit t('.update'), class: "btn btn-lg btn-block btn-primary" %>
23
+ <% end %>
24
+ <% end %>
25
+
26
+ <h2><%= t('.cancel_my_account') %></h2>
27
+
28
+ <p><%= t('.unhappy') %> <%= button_to t('.cancel_my_account'), registration_path(resource_name), class: "btn btn-block btn-danger", data: { confirm: t('.are_you_sure') }, method: :delete %></p>
29
+
30
+ <%= link_to t('devise.shared.links.back'), :back %>
31
+ </div>
32
+ </div>
33
+ </div>
@@ -0,0 +1,25 @@
1
+ <div class="devise-bootstrap-form">
2
+ <div class="devise-bootstrap-form-row">
3
+ <div class="devise-bootstrap-form-col">
4
+ <h2 class="text-center"><%= t('.sign_up') %></h2>
5
+ <%= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
6
+ <%= devise_error_messages! %>
7
+
8
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9
+ <%= f.password_field :password,
10
+ autocomplete: "new-password",
11
+ help: t('devise.shared.minimum_password_length', count: @minimum_password_length) %>
12
+ <%= f.password_field :password_confirmation,
13
+ autocomplete: "new-password",
14
+ label_class: "required" %>
15
+
16
+ <%= f.form_group do %>
17
+ <%= f.submit t('.sign_up'), class: "btn btn-primary btn-block btn-lg" %>
18
+ <% end %>
19
+ <% end %>
20
+ <div class="text-center">
21
+ <%= render "devise/shared/links" %>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
@@ -0,0 +1,24 @@
1
+ <div class="devise-bootstrap-form">
2
+ <div class="devise-bootstrap-form-row">
3
+ <div class="devise-bootstrap-form-col">
4
+ <h2 class="text-center"><%= t('.sign_in') %></h2>
5
+ <%= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
6
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
7
+ <%= f.password_field :password, autocomplete: "current-password", placeholder: 'Password' %>
8
+
9
+ <% if devise_mapping.rememberable? -%>
10
+ <%= f.form_group do %>
11
+ <%= f.check_box :remember_me %>
12
+ <% end %>
13
+ <% end -%>
14
+
15
+ <%= f.form_group do %>
16
+ <%= f.submit t('.sign_in'), class: "btn btn-primary btn-block btn-lg" %>
17
+ <% end %>
18
+ <% end %>
19
+ <div class="text-center">
20
+ <%= render "devise/shared/links" %>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
@@ -0,0 +1,25 @@
1
+ <%- if controller_name != 'sessions' %>
2
+ <%= link_to t(".sign_in"), new_session_path(resource_name) %><br />
3
+ <% end -%>
4
+
5
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to t(".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 t(".forgot_your_password"), new_password_path(resource_name) %><br />
11
+ <% end -%>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to t('.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 t('.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
+ <%= link_to t('.sign_in_with_provider', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider) %><br />
24
+ <% end -%>
25
+ <% end -%>
@@ -0,0 +1,20 @@
1
+ <div class="devise-bootstrap-form">
2
+ <div class="devise-bootstrap-form-row">
3
+ <div class="devise-bootstrap-form-col">
4
+ <h2 class="text-center"><%= t('.resend_unlock_instructions') %></h2>
5
+
6
+ <%= bootstrap_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
7
+ <%= devise_error_messages! %>
8
+
9
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
10
+ <%= f.form_group do %>
11
+ <%= f.submit t('.resend_unlock_instructions'), class: "btn btn-primary btn-block btn-lg" %>
12
+ <% end %>
13
+ <% end %>
14
+
15
+ <div class="text-center">
16
+ <%= render "devise/shared/links" %>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
@@ -2,12 +2,12 @@
2
2
 
3
3
  lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "devise/bootstrap_form/version"
5
+ require "devise_bootstrap_form/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = "devise-bootstrap-form"
9
- spec.version = Devise::BootstrapForm::VERSION
10
- spec.authors = ["Andrew Fomera", "Larry Reid"]
9
+ spec.version = DeviseBootstrapForm::VERSION
10
+ spec.authors = ["Larry Reid"]
11
11
  spec.email = ["larry.reid@jadesystems.ca"]
12
12
 
13
13
  spec.summary = "Generates nicer views for Devise that use Bootstrap via the `bootstrap_form` gem."
@@ -17,7 +17,8 @@ gem. If you plan to use, or are using, `bootstrap_form` in your app, your Devise
17
17
  forms will be consistent with the rest of your forms.
18
18
 
19
19
  The generator will detect if you're using `devise_invitable`, and will generate
20
- `bootstrap_form` forms for its views as well.
20
+ `bootstrap_form` forms for its views as well. If you're using `devise-i18n`, the
21
+ forms will use translations.
21
22
  DESC
22
23
  spec.homepage = "https://github.com/lcreid/devise-bootstrap-form"
23
24
  spec.license = "MIT"
@@ -2,5 +2,5 @@
2
2
 
3
3
  require "rails/railtie"
4
4
  require "rails/engine/railties"
5
- require "devise/bootstrap_form/version"
5
+ require "devise_bootstrap_form/version"
6
6
  require "generators/devise/views/bootstrap_form_generator"
@@ -0,0 +1,4 @@
1
+ module DeviseBootstrapForm
2
+ class Railtie < ::Rails::Railtie
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DeviseBootstrapForm
4
+ VERSION = "0.2.0".freeze
5
+ end
@@ -10,6 +10,10 @@ module Devise
10
10
  def invitable
11
11
  Object.const_get(:DeviseInvitable).is_a?(Module) rescue false # rubocop:disable Style/RescueModifier
12
12
  end
13
+
14
+ def i18n
15
+ Object.const_get(:DeviseI18n).is_a?(Module) rescue false # rubocop:disable Style/RescueModifier
16
+ end
13
17
  end
14
18
 
15
19
  desc "Copies views styled for Bootstrap 4 via the `bootstrap_form` gem"
@@ -18,7 +22,8 @@ module Devise
18
22
 
19
23
  def copy_views
20
24
  %w[confirmations passwords registrations sessions shared unlocks].each do |dir|
21
- directory File.join("views/devise", dir), "app/views/devise/#{dir}"
25
+ directory File.join("views/#{BootstrapFormGenerator.i18n ? 'i18n' : 'devise'}", dir),
26
+ "app/views/devise/#{dir}"
22
27
  end
23
28
 
24
29
  if BootstrapFormGenerator.invitable # rubocop:disable Style/GuardClause
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-bootstrap-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Andrew Fomera
8
7
  - Larry Reid
9
8
  autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2018-10-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bootstrap_form
@@ -101,7 +100,8 @@ description: |
101
100
  forms will be consistent with the rest of your forms.
102
101
 
103
102
  The generator will detect if you're using `devise_invitable`, and will generate
104
- `bootstrap_form` forms for its views as well.
103
+ `bootstrap_form` forms for its views as well. If you're using `devise-i18n`, the
104
+ forms will use translations.
105
105
  email:
106
106
  - larry.reid@jadesystems.ca
107
107
  executables: []
@@ -135,12 +135,25 @@ files:
135
135
  - app/views/devise/sessions/new.html.erb
136
136
  - app/views/devise/shared/_links.html.erb
137
137
  - app/views/devise/unlocks/new.html.erb
138
+ - app/views/i18n/confirmations/new.html.erb
139
+ - app/views/i18n/mailer/confirmation_instructions.html.erb
140
+ - app/views/i18n/mailer/email_changed.html.erb
141
+ - app/views/i18n/mailer/password_change.html.erb
142
+ - app/views/i18n/mailer/reset_password_instructions.html.erb
143
+ - app/views/i18n/mailer/unlock_instructions.html.erb
144
+ - app/views/i18n/passwords/edit.html.erb
145
+ - app/views/i18n/passwords/new.html.erb
146
+ - app/views/i18n/registrations/edit.html.erb
147
+ - app/views/i18n/registrations/new.html.erb
148
+ - app/views/i18n/sessions/new.html.erb
149
+ - app/views/i18n/shared/_links.html.erb
150
+ - app/views/i18n/unlocks/new.html.erb
138
151
  - bin/console
139
152
  - bin/setup
140
153
  - devise-bootstrap-form.gemspec
141
- - lib/devise/bootstrap_form.rb
142
- - lib/devise/bootstrap_form/railtie.rb
143
- - lib/devise/bootstrap_form/version.rb
154
+ - lib/devise_bootstrap_form.rb
155
+ - lib/devise_bootstrap_form/railtie.rb
156
+ - lib/devise_bootstrap_form/version.rb
144
157
  - lib/generators/devise/views/bootstrap_form_generator.rb
145
158
  homepage: https://github.com/lcreid/devise-bootstrap-form
146
159
  licenses:
@@ -1,6 +0,0 @@
1
- module Devise
2
- module BootstrapForm
3
- class Railtie < ::Rails::Railtie
4
- end
5
- end
6
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Devise
4
- module BootstrapForm
5
- VERSION = "0.1.0".freeze
6
- end
7
- end