devise-foundation-views 0.1.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +76 -0
- data/.gitignore +32 -3
- data/.rspec +1 -0
- data/.rubocop.yml +44 -0
- data/CHANGELOG.md +76 -0
- data/CODE_OF_CONDUCT.md +9 -0
- data/Gemfile +9 -2
- data/README.md +102 -25
- data/Rakefile +6 -2
- data/UPGRADE_GUIDE.md +87 -0
- data/app/assets/stylesheets/devise_foundation_layout.css +49 -0
- data/app/assets/stylesheets/devise_foundation_views.css +53 -0
- data/app/assets/stylesheets/devise_foundation_views_less.less +47 -8
- data/app/assets/stylesheets/devise_foundation_views_scss.scss +48 -8
- data/app/views/devise/confirmations/new.html.erb +18 -25
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -10
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -14
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -12
- data/app/views/devise/passwords/edit.html.erb +25 -27
- data/app/views/devise/passwords/new.html.erb +16 -23
- data/app/views/devise/registrations/edit.html.erb +51 -35
- data/app/views/devise/registrations/new.html.erb +29 -29
- data/app/views/devise/sessions/new.html.erb +32 -30
- data/app/views/devise/shared/_error_messages.html.erb +17 -0
- data/app/views/devise/shared/_foundation_layout.html.erb +12 -0
- data/app/views/devise/shared/_links.html.erb +22 -20
- data/app/views/devise/unlocks/new.html.erb +16 -23
- data/app/views/devise_haml/confirmations/new.html.haml +10 -15
- data/app/views/devise_haml/mailer/confirmation_instructions.html.haml +3 -3
- data/app/views/devise_haml/mailer/reset_password_instructions.html.haml +5 -5
- data/app/views/devise_haml/mailer/unlock_instructions.html.haml +4 -4
- data/app/views/devise_haml/passwords/edit.html.haml +16 -17
- data/app/views/devise_haml/passwords/new.html.haml +10 -14
- data/app/views/devise_haml/registrations/edit.html.haml +32 -23
- data/app/views/devise_haml/registrations/new.html.haml +18 -18
- data/app/views/devise_haml/sessions/new.html.haml +20 -20
- data/app/views/devise_haml/shared/_error_messages.html.haml +9 -0
- data/app/views/devise_haml/shared/_foundation_layout.html.haml +7 -0
- data/app/views/devise_haml/shared/_links.html.haml +20 -19
- data/app/views/devise_haml/unlocks/new.html.haml +10 -14
- data/app/views/devise_slim/confirmations/new.html.slim +10 -14
- data/app/views/devise_slim/mailer/confirmation_instructions.html.slim +3 -4
- data/app/views/devise_slim/mailer/reset_password_instructions.html.slim +5 -6
- data/app/views/devise_slim/mailer/unlock_instructions.html.slim +4 -4
- data/app/views/devise_slim/passwords/edit.html.slim +16 -18
- data/app/views/devise_slim/passwords/new.html.slim +10 -14
- data/app/views/devise_slim/registrations/edit.html.slim +32 -24
- data/app/views/devise_slim/registrations/new.html.slim +18 -19
- data/app/views/devise_slim/sessions/new.html.slim +20 -20
- data/app/views/devise_slim/shared/_error_messages.html.slim +9 -0
- data/app/views/devise_slim/shared/_foundation_layout.html.slim +7 -0
- data/app/views/devise_slim/shared/_links.html.slim +20 -19
- data/app/views/devise_slim/unlocks/new.html.slim +10 -15
- data/bin/console +8 -0
- data/bin/setup +5 -0
- data/devise-foundation-views.gemspec +28 -17
- data/lib/devise-foundation-views.rb +16 -19
- data/lib/devise_foundation_views_helper.rb +3 -17
- data/lib/devise_layout_helper.rb +18 -0
- data/lib/generators/devise/views/foundation_layout/foundation_layout_generator.rb +34 -0
- data/lib/generators/devise/views/foundation_layout/templates/layouts/devise.html.erb +37 -0
- data/lib/generators/devise/views/foundation_templates/foundation_templates_generator.rb +19 -15
- data/lib/version.rb +3 -1
- data/locales/uk.yml +1 -1
- metadata +108 -19
- data/.travis.yml +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f083dbb4f2d313f4ffe12ddab3219987e467b6b16928ae8dbb1cda0159b27fd7
|
|
4
|
+
data.tar.gz: cb3d36dc121e01fd4757a245a5e53f8db83b5b780224117df6bd2a744c074b1b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 51cdc7245666b758e0e793cb41de8dabc396db6e2963607fcf38250645c7d567bd4d970bfa7109bc6e0267b2f0d7af411f2a4b046360c9ae375290ffb1e04a4e
|
|
7
|
+
data.tar.gz: 3ea320a14f827589bdfb6b2f21494dc79ee26f97501773a783281ede31e670727b3250175929ee74c5633be03c5f4819d39534fd6732b850a1adbbbe17d91451
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master, modernize ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master, modernize ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
ruby: ['3.0', '3.1', '3.2', '3.3']
|
|
16
|
+
rails: ['6.0', '6.1', '7.0', '7.1', '7.2', '8.0']
|
|
17
|
+
exclude:
|
|
18
|
+
- ruby: '3.0'
|
|
19
|
+
rails: '7.2'
|
|
20
|
+
- ruby: '3.0'
|
|
21
|
+
rails: '8.0'
|
|
22
|
+
|
|
23
|
+
env:
|
|
24
|
+
RAILS_VERSION: ${{ matrix.rails }}
|
|
25
|
+
DEVISE_VERSION: '~> 4.9'
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Set up Ruby
|
|
31
|
+
uses: ruby/setup-ruby@v1
|
|
32
|
+
with:
|
|
33
|
+
ruby-version: ${{ matrix.ruby }}
|
|
34
|
+
bundler-cache: true
|
|
35
|
+
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: bundle exec rake
|
|
38
|
+
|
|
39
|
+
- name: Run RuboCop
|
|
40
|
+
run: bundle exec rubocop
|
|
41
|
+
|
|
42
|
+
test-devise-5:
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
env:
|
|
45
|
+
RAILS_VERSION: '7.2'
|
|
46
|
+
DEVISE_VERSION: '~> 5.0'
|
|
47
|
+
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
|
|
51
|
+
- name: Set up Ruby
|
|
52
|
+
uses: ruby/setup-ruby@v1
|
|
53
|
+
with:
|
|
54
|
+
ruby-version: '3.3'
|
|
55
|
+
bundler-cache: true
|
|
56
|
+
|
|
57
|
+
- name: Run tests
|
|
58
|
+
run: bundle exec rake
|
|
59
|
+
|
|
60
|
+
- name: Run RuboCop
|
|
61
|
+
run: bundle exec rubocop
|
|
62
|
+
|
|
63
|
+
security:
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/checkout@v4
|
|
68
|
+
|
|
69
|
+
- name: Set up Ruby
|
|
70
|
+
uses: ruby/setup-ruby@v1
|
|
71
|
+
with:
|
|
72
|
+
ruby-version: '3.3'
|
|
73
|
+
bundler-cache: true
|
|
74
|
+
|
|
75
|
+
- name: Security audit
|
|
76
|
+
run: bundle exec bundle-audit --update
|
data/.gitignore
CHANGED
|
@@ -1,9 +1,38 @@
|
|
|
1
|
+
## Ruby/Bundler
|
|
1
2
|
/.bundle/
|
|
2
|
-
|
|
3
|
+
/vendor/bundle/
|
|
3
4
|
/Gemfile.lock
|
|
5
|
+
|
|
6
|
+
## Documentation
|
|
7
|
+
/.yardoc/
|
|
4
8
|
/_yardoc/
|
|
5
|
-
/coverage/
|
|
6
9
|
/doc/
|
|
7
|
-
/
|
|
10
|
+
/rdoc/
|
|
11
|
+
|
|
12
|
+
## Testing
|
|
13
|
+
/coverage/
|
|
8
14
|
/spec/reports/
|
|
15
|
+
/test/tmp/
|
|
16
|
+
/test/version_tmp/
|
|
17
|
+
|
|
18
|
+
## Build artifacts
|
|
19
|
+
/pkg/
|
|
9
20
|
/tmp/
|
|
21
|
+
*.gem
|
|
22
|
+
|
|
23
|
+
## IDE and OS files
|
|
24
|
+
.DS_Store
|
|
25
|
+
.idea/
|
|
26
|
+
.vscode/
|
|
27
|
+
*.swp
|
|
28
|
+
*.swo
|
|
29
|
+
*~
|
|
30
|
+
.ruby-version
|
|
31
|
+
.ruby-gemset
|
|
32
|
+
|
|
33
|
+
## Environment
|
|
34
|
+
.env
|
|
35
|
+
.env.local
|
|
36
|
+
|
|
37
|
+
## Logs
|
|
38
|
+
npm-debug.log
|
data/.rspec
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
TargetRubyVersion: 3.0
|
|
3
|
+
NewCops: enable
|
|
4
|
+
SuggestExtensions: false
|
|
5
|
+
Exclude:
|
|
6
|
+
- 'vendor/**/*'
|
|
7
|
+
- 'bin/**/*'
|
|
8
|
+
- 'lib/generators/**/*'
|
|
9
|
+
- 'lib/devise-foundation-views.rb'
|
|
10
|
+
|
|
11
|
+
Style/Documentation:
|
|
12
|
+
Enabled: false
|
|
13
|
+
|
|
14
|
+
Style/StringLiterals:
|
|
15
|
+
Enabled: true
|
|
16
|
+
EnforcedStyle: double_quotes
|
|
17
|
+
|
|
18
|
+
Style/FrozenStringLiteralComment:
|
|
19
|
+
Enabled: true
|
|
20
|
+
EnforcedStyle: always
|
|
21
|
+
|
|
22
|
+
Layout/LineLength:
|
|
23
|
+
Max: 120
|
|
24
|
+
Exclude:
|
|
25
|
+
- '*.gemspec'
|
|
26
|
+
|
|
27
|
+
Metrics/BlockLength:
|
|
28
|
+
Exclude:
|
|
29
|
+
- 'spec/**/*'
|
|
30
|
+
- '*.gemspec'
|
|
31
|
+
|
|
32
|
+
Gemspec/DevelopmentDependencies:
|
|
33
|
+
Enabled: false
|
|
34
|
+
|
|
35
|
+
Gemspec/AddRuntimeDependency:
|
|
36
|
+
Enabled: false
|
|
37
|
+
|
|
38
|
+
Metrics/MethodLength:
|
|
39
|
+
Exclude:
|
|
40
|
+
- 'lib/devise_foundation_views_helper.rb'
|
|
41
|
+
|
|
42
|
+
Metrics/AbcSize:
|
|
43
|
+
Exclude:
|
|
44
|
+
- 'lib/devise_foundation_views_helper.rb'
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.0.1] - 2026-05-30
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Plain CSS asset `devise_foundation_views.css` (no Sass compiler required)
|
|
10
|
+
- Optional `devise_foundation_layout.css` for centered Devise-only pages
|
|
11
|
+
- `DeviseLayoutHelper#devise_page_title` for auth page titles
|
|
12
|
+
- Generator `rails g devise:views:foundation_layout`
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- `devise_foundation_layout.css` header comment no longer triggers a bogus Sprockets `require` directive
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- `devise_foundation_views_less.less` synced with SCSS (labels, inputs, cell spacing)
|
|
21
|
+
- README: Sprockets without Sass, sign-out with `button_to`, optional layout generator
|
|
22
|
+
- `_foundation_layout` h2 uses `devise-form-card__title` for layout styling
|
|
23
|
+
|
|
24
|
+
## [1.0.0] - 2026-05-30
|
|
25
|
+
|
|
26
|
+
First modern release on RubyGems (from **0.1.1**).
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- **Foundation 6** markup (`grid-container`, `grid-x`, `cell`, `callout`, `button expanded`)
|
|
31
|
+
- **`devise/shared/_error_messages`** partial (matches current Devise generator output)
|
|
32
|
+
- **`devise/shared/_foundation_layout`** wrapper partial for consistent form cards
|
|
33
|
+
- Devise **5.x** support (`devise >= 4.9, < 6.0`; Devise 5 requires Rails 7+)
|
|
34
|
+
- Views aligned with [heartcombo/devise](https://github.com/heartcombo/devise) main templates:
|
|
35
|
+
- `autocomplete` attributes on fields
|
|
36
|
+
- `pending_reconfirmation?` on registration edit and confirmation resend
|
|
37
|
+
- `button_to` for account deletion with `turbo_confirm`
|
|
38
|
+
- OmniAuth sign-in via `button_to` with `data: { turbo: false }`
|
|
39
|
+
- Explicit `railties` runtime dependency (>= 6.0, < 9.0)
|
|
40
|
+
- GitHub Actions CI with Ruby and Rails matrix (including Devise 5 job)
|
|
41
|
+
- RuboCop configuration and bundler-audit in CI
|
|
42
|
+
- RSpec test suite
|
|
43
|
+
- CHANGELOG, UPGRADE_GUIDE, and CODE_OF_CONDUCT
|
|
44
|
+
- bin/setup and bin/console
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- All ERB, HAML, and Slim view templates rewritten for **Foundation 6** (was Foundation 5 in 0.x)
|
|
49
|
+
- `foundation_devise_error_messages!` now renders the shared error partial (deprecated in favor of the partial)
|
|
50
|
+
- Stylesheets updated for `.devise-form-card`
|
|
51
|
+
- Modernized gemspec and development dependencies
|
|
52
|
+
- Minimum Ruby **3.0**, Rails **6.0**, Devise **4.9+**
|
|
53
|
+
|
|
54
|
+
### Removed
|
|
55
|
+
|
|
56
|
+
- Foundation 5 classes (`medium-6`, `large-12 columns`, `alert-box`, `button expand`)
|
|
57
|
+
- Travis CI
|
|
58
|
+
|
|
59
|
+
### Breaking Changes (from 0.1.1)
|
|
60
|
+
|
|
61
|
+
- **Ruby** >= 3.0 (was >= 1.9.3)
|
|
62
|
+
- **Rails** >= 6.0
|
|
63
|
+
- **Foundation 6 required** in the host application (0.x used Foundation 5 markup)
|
|
64
|
+
- **View markup changed** — re-run `rails g devise:views:foundation_templates` after upgrading
|
|
65
|
+
- Prefer `render "devise/shared/error_messages", resource: resource` over `foundation_devise_error_messages!`
|
|
66
|
+
|
|
67
|
+
See [UPGRADE_GUIDE.md](UPGRADE_GUIDE.md).
|
|
68
|
+
|
|
69
|
+
## [0.1.1] - 2016-05-06
|
|
70
|
+
|
|
71
|
+
- Foundation 5 styled Devise views for ERB, HAML, and Slim
|
|
72
|
+
- Locale generators and helper methods
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
For upgrade instructions, see [UPGRADE_GUIDE.md](UPGRADE_GUIDE.md)
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Contributor Code of Conduct
|
|
2
|
+
|
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
|
4
|
+
|
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
|
6
|
+
|
|
7
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting the project maintainers.
|
|
8
|
+
|
|
9
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0.
|
data/Gemfile
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
2
4
|
|
|
3
|
-
# Specify your gem's dependencies in devise-foundation-views.gemspec
|
|
4
5
|
gemspec
|
|
6
|
+
|
|
7
|
+
if (rails_version = ENV.fetch("RAILS_VERSION", nil))
|
|
8
|
+
gem "railties", "~> #{rails_version}.0"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
gem "devise", ENV.fetch("DEVISE_VERSION", "~> 4.9")
|
data/README.md
CHANGED
|
@@ -1,53 +1,130 @@
|
|
|
1
1
|
# DeviseFoundationViews
|
|
2
2
|
|
|
3
|
-
[](https://hakiri.io/github/ethirajsrinivasan/devise-foundation-views/master)
|
|
3
|
+
[](https://github.com/ethirajsrinivasan/devise-foundation-views/actions/workflows/ci.yml)
|
|
4
|
+
[](https://badge.fury.io/rb/devise-foundation-views)
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
Devise authentication views styled with **Foundation for Sites 6**, aligned with the current [Devise](https://github.com/heartcombo/devise) view templates.
|
|
7
|
+
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
- Ruby >= 3.0
|
|
11
|
+
- Rails >= 6.0
|
|
12
|
+
- [Devise](https://github.com/heartcombo/devise) >= 4.9, < 6.0
|
|
13
|
+
- **Devise 5** requires **Rails 7+**
|
|
14
|
+
- **Foundation 6** CSS in your application (not included in this gem)
|
|
8
15
|
|
|
9
16
|
## Installation
|
|
10
17
|
|
|
11
|
-
Add
|
|
18
|
+
Add to your Gemfile:
|
|
12
19
|
|
|
13
20
|
```ruby
|
|
14
|
-
gem 'devise-foundation-views'
|
|
21
|
+
gem 'devise-foundation-views', '~> 1.0.1'
|
|
15
22
|
```
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
```bash
|
|
25
|
+
bundle install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Include gem styles in `application.css`.
|
|
29
|
+
|
|
30
|
+
**Sprockets without Sass** (recommended — no `sassc` required):
|
|
18
31
|
|
|
19
|
-
|
|
32
|
+
```css
|
|
33
|
+
*= require devise_foundation_views
|
|
34
|
+
```
|
|
20
35
|
|
|
21
|
-
|
|
36
|
+
**With Sass** (requires `sassc` or `dartsass-rails` in the host app):
|
|
22
37
|
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
```css
|
|
39
|
+
*= require devise_foundation_views_scss
|
|
40
|
+
```
|
|
25
41
|
|
|
26
|
-
|
|
27
|
-
*= require devise_foundation_views_less
|
|
42
|
+
Or Less:
|
|
28
43
|
|
|
29
|
-
|
|
44
|
+
```css
|
|
45
|
+
*= require devise_foundation_views_less
|
|
46
|
+
```
|
|
30
47
|
|
|
31
|
-
|
|
48
|
+
Ensure your app loads **Foundation 6** (e.g. via `foundation-rails`, npm, or CDN).
|
|
32
49
|
|
|
33
|
-
|
|
50
|
+
### Centered auth layout (optional)
|
|
34
51
|
|
|
35
|
-
|
|
52
|
+
Copy a minimal Devise-only layout (centered card, no app chrome):
|
|
36
53
|
|
|
37
|
-
|
|
54
|
+
```bash
|
|
55
|
+
rails g devise:views:foundation_layout
|
|
56
|
+
```
|
|
38
57
|
|
|
39
|
-
|
|
58
|
+
Then add to `ApplicationController`:
|
|
40
59
|
|
|
41
|
-
|
|
60
|
+
```ruby
|
|
61
|
+
layout :layout_for_controller
|
|
42
62
|
|
|
43
|
-
|
|
63
|
+
private
|
|
64
|
+
|
|
65
|
+
def layout_for_controller
|
|
66
|
+
devise_controller? ? "devise" : "application"
|
|
67
|
+
end
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
And in `application.css`:
|
|
71
|
+
|
|
72
|
+
```css
|
|
73
|
+
*= require devise_foundation_layout
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Sign out without Turbo
|
|
77
|
+
|
|
78
|
+
If you do not use Turbo, sign out must use **DELETE**, not GET:
|
|
79
|
+
|
|
80
|
+
```erb
|
|
81
|
+
<%= button_to "Sign out", destroy_user_session_path, method: :delete, class: "button" %>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`link_to ..., data: { turbo_method: :delete }` only works when `turbo-rails` is loaded.
|
|
85
|
+
|
|
86
|
+
## Generators
|
|
87
|
+
|
|
88
|
+
Copy locale files:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
rails g devise:views:locale it
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Copy Foundation-styled Devise views into your app:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
rails g devise:views:foundation_templates
|
|
98
|
+
rails g devise:views:foundation_templates slim
|
|
99
|
+
rails g devise:views:foundation_templates haml
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Features (1.0.x)
|
|
103
|
+
|
|
104
|
+
- Foundation 6 XY grid layout (`grid-container`, `grid-x`, `cell`)
|
|
105
|
+
- `devise/shared/_error_messages` partial (Devise standard)
|
|
106
|
+
- ERB, HAML, and Slim templates
|
|
107
|
+
- Devise 4.9+ and 5.x compatible fields (`autocomplete`, `pending_reconfirmation?`, Turbo confirm on delete)
|
|
108
|
+
- OmniAuth providers use `button_to` with `data-turbo="false"`
|
|
109
|
+
|
|
110
|
+
## Error messages
|
|
111
|
+
|
|
112
|
+
Prefer the shared partial (used in all bundled views):
|
|
113
|
+
|
|
114
|
+
```erb
|
|
115
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
`foundation_devise_error_messages!` remains available but is deprecated.
|
|
119
|
+
|
|
120
|
+
## Upgrading from 0.x
|
|
121
|
+
|
|
122
|
+
Version **1.0.0** requires Ruby 3.0+, Rails 6.0+, **Foundation 6**, and Devise 4.9+. See [UPGRADE_GUIDE.md](UPGRADE_GUIDE.md).
|
|
44
123
|
|
|
45
124
|
## Contributing
|
|
46
125
|
|
|
47
|
-
Bug reports and pull requests are welcome
|
|
126
|
+
Bug reports and pull requests are welcome at https://github.com/ethirajsrinivasan/devise-foundation-views.
|
|
48
127
|
|
|
49
128
|
## License
|
|
50
129
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
This gem is based on the idea of devise-bootstrap-views
|
|
130
|
+
MIT — see [LICENSE.txt](LICENSE.txt).
|
data/Rakefile
CHANGED
data/UPGRADE_GUIDE.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Upgrade Guide: Devise-Foundation-Views
|
|
2
|
+
|
|
3
|
+
## 1.0.0 → 1.0.1
|
|
4
|
+
|
|
5
|
+
Patch release — no view markup changes required.
|
|
6
|
+
|
|
7
|
+
1. Update Gemfile: `gem 'devise-foundation-views', '~> 1.0.1'`
|
|
8
|
+
2. Prefer plain CSS (no Sass): `*= require devise_foundation_views` in `application.css`
|
|
9
|
+
3. Optional: `rails g devise:views:foundation_layout` for a centered Devise-only layout
|
|
10
|
+
4. Optional: `*= require devise_foundation_layout` when using that layout
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 0.x → 1.0.0
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
**1.0.0** is the first modern release on RubyGems. It combines Ruby/Rails/Devise modernization with **Foundation 6** views aligned with current [Devise](https://github.com/heartcombo/devise) templates.
|
|
19
|
+
|
|
20
|
+
## What Changed
|
|
21
|
+
|
|
22
|
+
| Component | 0.1.1 | 1.0.0 |
|
|
23
|
+
|-----------|-------|-------|
|
|
24
|
+
| Ruby | >= 1.9.3 | **>= 3.0** |
|
|
25
|
+
| Rails | (implicit) | **>= 6.0** |
|
|
26
|
+
| Devise | (implicit) | **>= 4.9, < 6.0** (5.x on Rails 7+) |
|
|
27
|
+
| Foundation CSS | 5.x markup | **6.x** (XY grid) |
|
|
28
|
+
| View templates | Foundation 5 | Foundation 6 + current Devise fields |
|
|
29
|
+
|
|
30
|
+
## Upgrade Steps
|
|
31
|
+
|
|
32
|
+
### 1. Update Gemfile
|
|
33
|
+
|
|
34
|
+
```ruby
|
|
35
|
+
gem 'devise-foundation-views', '~> 1.0'
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For Devise 5 (Rails 7+ only):
|
|
39
|
+
|
|
40
|
+
```ruby
|
|
41
|
+
gem 'devise', '~> 5.0'
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Upgrade Ruby, Rails, and Foundation
|
|
45
|
+
|
|
46
|
+
- Ruby 3.0+ and Rails 6.0+ (Rails 7+ for Devise 5)
|
|
47
|
+
- Install **Foundation for Sites 6** in your app (this gem does not bundle Foundation CSS)
|
|
48
|
+
|
|
49
|
+
### 3. Regenerate views (if copied into your app)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
rails g devise:views:foundation_templates
|
|
53
|
+
rails g devise:views:foundation_templates slim
|
|
54
|
+
rails g devise:views:foundation_templates haml
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 4. Update error messages (if customized)
|
|
58
|
+
|
|
59
|
+
```erb
|
|
60
|
+
<%# Before %>
|
|
61
|
+
<%= foundation_devise_error_messages! %>
|
|
62
|
+
|
|
63
|
+
<%# After %>
|
|
64
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 5. Verify stylesheets
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
*= require devise_foundation_views_scss
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Ensure Foundation 6 CSS loads in your application.
|
|
74
|
+
|
|
75
|
+
### Markup changes (Foundation 5 → 6)
|
|
76
|
+
|
|
77
|
+
| 0.x (Foundation 5) | 1.0.0 (Foundation 6) |
|
|
78
|
+
|--------------------|----------------------|
|
|
79
|
+
| `row` / `columns` | `grid-x` / `cell` |
|
|
80
|
+
| `alert-box alert` | `callout alert` |
|
|
81
|
+
| `button expand` | `button expanded` |
|
|
82
|
+
| `.login-box` | `.devise-form-card` |
|
|
83
|
+
|
|
84
|
+
## Getting Help
|
|
85
|
+
|
|
86
|
+
- [GitHub Issues](https://github.com/ethirajsrinivasan/devise-foundation-views/issues)
|
|
87
|
+
- [CHANGELOG.md](CHANGELOG.md)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* Optional layout styles for a dedicated Devise layout (rails g devise:views:foundation_layout). */
|
|
2
|
+
|
|
3
|
+
html.devise-layout-root,
|
|
4
|
+
body.devise-layout {
|
|
5
|
+
height: 100%;
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
body.devise-layout {
|
|
10
|
+
background: #e6e6e6;
|
|
11
|
+
min-height: 100vh;
|
|
12
|
+
min-height: 100dvh;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.devise-layout__main {
|
|
16
|
+
min-height: 100vh;
|
|
17
|
+
min-height: 100dvh;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding: 2rem 1rem;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.devise-layout__main--tall {
|
|
27
|
+
align-items: flex-start;
|
|
28
|
+
padding-top: 3rem;
|
|
29
|
+
padding-bottom: 3rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
body.devise-layout .devise-foundation-views {
|
|
33
|
+
width: 100%;
|
|
34
|
+
max-width: 28rem;
|
|
35
|
+
margin: 0 !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
body.devise-layout .devise-form-card {
|
|
39
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
body.devise-layout .devise-form-card__title {
|
|
43
|
+
font-size: 1.75rem;
|
|
44
|
+
font-weight: 400;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
body.devise-layout .devise-links {
|
|
48
|
+
text-align: center;
|
|
49
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Foundation 6 styles for Devise forms (host app must include Foundation CSS).
|
|
3
|
+
* Use this file with Sprockets when you do not have a Sass compiler (sassc/dartsass).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.devise-foundation-views {
|
|
7
|
+
margin: 2rem 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.devise-foundation-views .devise-form-card {
|
|
11
|
+
background: #fff;
|
|
12
|
+
border: 1px solid #e6e6e6;
|
|
13
|
+
border-radius: 0.25rem;
|
|
14
|
+
padding: 2rem 1.5rem 1.5rem;
|
|
15
|
+
margin-bottom: 1rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.devise-foundation-views .devise-form-card h2 {
|
|
19
|
+
margin-bottom: 1.5rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.devise-foundation-views .devise-form-card label {
|
|
23
|
+
display: block;
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
margin-bottom: 0.35rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.devise-foundation-views .devise-form-card input[type="email"],
|
|
29
|
+
.devise-foundation-views .devise-form-card input[type="password"],
|
|
30
|
+
.devise-foundation-views .devise-form-card input[type="text"],
|
|
31
|
+
.devise-foundation-views .devise-form-card input[type="tel"] {
|
|
32
|
+
width: 100%;
|
|
33
|
+
margin-bottom: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.devise-foundation-views .devise-form-card .cell {
|
|
37
|
+
margin-bottom: 1.25rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.devise-foundation-views .devise-form-card .help-text {
|
|
41
|
+
margin-top: -0.5rem;
|
|
42
|
+
margin-bottom: 0.5rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.devise-foundation-views .devise-form-card .button.expanded {
|
|
46
|
+
margin-top: 0.5rem;
|
|
47
|
+
margin-bottom: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.devise-foundation-views .devise-links {
|
|
51
|
+
margin-top: 1.5rem;
|
|
52
|
+
line-height: 1.8;
|
|
53
|
+
}
|