revise_auth-jets 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,71 +1,62 @@
1
- <h1>Profile</h1>
1
+ <% content_for :form_block do %>
2
+ <div class="mb-4 text-center">
3
+ <h2 class="mb-1">Profile</h2>
4
+ </div>
2
5
 
3
- <%= form_with model: current_user, url: profile_email_path do |form| %>
4
- <fieldset>
5
- <legend>Change Email Address</legend>
6
6
 
7
- <% if current_user.unconfirmed_email? %>
8
- <p>Waiting for confirmation of <%= current_user.unconfirmed_email %></p>
9
- <% end %>
10
-
11
- <% if form.object.errors.any? %>
12
- <ul>
13
- <% form.object.errors.full_messages.each do |message| %>
14
- <li><%= message %></li>
15
- <% end %>
16
- </ul>
17
- <% end %>
18
-
19
- <p>Your email address is: <%= current_user.email %>
20
- <p>To change your email, we will send a confirmation email to your new address to complete the change.</p>
21
-
22
- <div>
23
- <%= form.label :unconfirmed_email, "Email address" %>
24
- <%= form.email_field :unconfirmed_email, required: true %>
7
+ <%= form_with model: current_user, local: true, url: profile_email_path do |form| %>
8
+ <%= render "shared/error_messages", resource: current_user %>
9
+ <div class="form-group">
10
+ <%= form.label :name, "Full name" %>
11
+ <%= form.text_field :name, autofocus: true, autocomplete: "name", placeholder: "Steve Jobs", class: "form-control" %>
25
12
  </div>
26
13
 
27
- <div>
28
- <%= form.button "Save Changes" %>
14
+ <div class="form-group">
15
+ <%= form.label :email %>
16
+ <%= form.email_field :email, autocomplete: "email", placeholder: "you@example.com", class: "form-control" %>
29
17
  </div>
30
- </fieldset>
31
- <% end %>
32
18
 
33
- <%= form_with model: current_user, url: profile_password_path do |form| %>
34
- <fieldset>
35
- <legend>Change Password</legend>
19
+ <div class="mt-2 form-group">
20
+ <%= form.button "Update", disable_with: "Saving", class: "btn btn-primary" %>
21
+ </div>
22
+ <% end %>
36
23
 
37
- <% if form.object.errors.any? %>
38
- <ul>
39
- <% form.object.errors.full_messages.each do |message| %>
40
- <li><%= message %></li>
41
- <% end %>
42
- </ul>
43
- <% end %>
44
24
 
45
- <div>
25
+ <%= form_with model: current_user, local: true, url: profile_password_path do |form| %>
26
+ <%= render "shared/error_messages", resource: current_user %>
27
+ <div class="form-group">
46
28
  <%= label_tag :current_password %>
47
- <%= password_field_tag :current_password, nil, required: true %>
29
+ <%= password_field_tag :current_password, nil, required: true, class: "form-control" %>
48
30
  </div>
49
31
 
50
- <div>
32
+ <div class="form-group">
51
33
  <%= form.label :password, "New password" %>
52
- <%= form.password_field :password, required: true %>
34
+ <%= form.password_field :password, required: true, class: "form-control" %>
53
35
  </div>
54
36
 
55
- <div>
37
+ <div class="form-group">
56
38
  <%= form.label :password_confirmation %>
57
- <%= form.password_field :password_confirmation, required: true %>
39
+ <%= form.password_field :password_confirmation, required: true, class: "form-control" %>
58
40
  </div>
59
-
60
- <div>
61
- <%= form.button "Save Changes" %>
41
+ <div class="mt-2 form-group">
42
+ <%= form.button "Update Password", disable_with: "Saving", class: "btn btn-primary" %>
62
43
  </div>
63
- </fieldset>
64
- <% end %>
44
+ <% end %>
45
+
46
+ <div class="flex flex-wrap flex-end">
47
+ <div class="flex-1">
48
+ <h3 class="mb-4">Cancel my account</h3>
49
+ <div class="mt-2">
50
+ <%= form_with url: profile_path, local: true, method: :delete do |form| %>
51
+ <fieldset>
52
+ <%= form.button "Delete account", class: "btn btn-danger btn-outline primary" %>
53
+ </fieldset>
54
+ <% end %>
55
+ </div>
56
+ </div>
57
+ </div>
58
+
59
+
65
60
 
66
- <%= form_with url: profile_path, method: :delete do |form| %>
67
- <fieldset>
68
- <legend>Delete my account</legend>
69
- <%= form.button "Delete account", data: { turbo_confirm: "Are you sure?" } %>
70
- </fieldset>
71
61
  <% end %>
62
+ <%= render "revise_auth/shared/form_block" %>
@@ -1,30 +1,34 @@
1
- <h1>Sign Up</h1>
2
-
3
- <%= form_with local: true, model: @user, url: sign_up_path do |form| %>
4
- <% if form.object.errors.any? %>
5
- <ul>
6
- <% form.object.errors.full_messages.each do |message| %>
7
- <li><%= message %></li>
8
- <% end %>
9
- </ul>
10
- <% end %>
11
-
12
- <div>
13
- <%= form.label :email %>
14
- <%= form.email_field :email, required: true, autofocus: true %>
1
+ <% content_for :form_block do %>
2
+ <div class="mb-4 text-center">
3
+ <h2 class="mb-1">Sign Up</h2>
4
+ <%= link_to "Log in", login_path, class: "font-semibold" %>
15
5
  </div>
16
6
 
17
- <div>
18
- <%= form.label :password %>
19
- <%= form.password_field :password, required: true %>
20
- </div>
7
+ <%= form_with local: true, model: @user, url: sign_up_path do |f| %>
8
+ <%= render "shared/error_messages", resource: @user %>
21
9
 
22
- <div>
23
- <%= form.label :password_confirmation %>
24
- <%= form.password_field :password_confirmation, required: true %>
25
- </div>
10
+ <div class="form-group">
11
+ <%= f.label :email %>
12
+ <%= f.email_field :email, autocomplete: "email", placeholder: true, class: "form-control" %>
13
+ </div>
14
+
15
+ <div class="form-group">
16
+ <%= f.label :password %>
17
+ <%= f.password_field :password, autocomplete: "new-password", placeholder: true, class: "form-control" %>
18
+ </div>
19
+
20
+ <div class="form-group">
21
+ <%= f.label :password_confirmation%>
22
+ <%= f.password_field :password_confirmation, autocomplete: "new-password", placeholder: true, required: true, class: "form-control" %>
23
+ </div>
24
+
25
+
26
+ <div class="form-group">
27
+ <%= f.button "Sign Up", disable_with: "Submitting", class: "btn btn-primary btn-expanded" %>
28
+ </div>
29
+ <% end %>
26
30
 
27
- <div>
28
- <%= form.button "Sign Up" %>
29
- </div>
30
31
  <% end %>
32
+
33
+ <%= render "revise_auth/shared/form_block" %>
34
+
@@ -1,17 +1,32 @@
1
- <h1>Log in</h1>
2
-
3
- <%= form_with(url: login_path, local: true) do |form| %>
4
- <div>
5
- <%= form.label :email %>
6
- <%= form.email_field :email, required: true, autofocus: true %>
1
+ <% content_for :form_block do %>
2
+ <div class="mb-4 text-center">
3
+ <h2 class="mb-px">Log In</h2>
4
+ <%= link_to "Sign Up", sign_up_path, class: "font-semibold" %>
7
5
  </div>
8
6
 
9
- <div>
10
- <%= form.label :password %>
11
- <%= form.password_field :password, required: true %>
12
- </div>
7
+ <%= form_with(url: login_path, local: true) do |f| %>
8
+ <div class="form-group">
9
+ <%= f.label :email %>
10
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: true, class: "form-control" %>
11
+ </div>
12
+
13
+ <div class="form-group">
14
+ <%= f.label :password %>
15
+ <%= f.password_field :password, autocomplete: "current-password", placeholder: true, class: "form-control" %>
16
+ </div>
17
+
18
+ <div class="form-group">
19
+ <%= f.check_box :remember_me, class: "form-checkbox" %>
20
+ <%= f.label :remember_me, class: "inline-block" %>
21
+ </div>
22
+
23
+ <div class="form-group">
24
+ <%= f.submit "SIgn In", class: "btn btn-primary btn-expanded" %>
25
+ </div>
26
+ <% end %>
13
27
 
14
- <div>
15
- <%= form.button "Login" %>
16
- </div>
17
28
  <% end %>
29
+
30
+ <%= render "revise_auth/shared/form_block" %>
31
+
32
+
@@ -0,0 +1,7 @@
1
+ <div class="container px-4 mx-auto my-10 lg:px-0">
2
+ <div class="w-full m-auto lg:w-1/2">
3
+ <div class="p-4 bg-white border border-gray-200 dark:bg-gray-900 dark:border-gray-700 rounded-lg shadow-sm lg:p-10">
4
+ <%= yield :form_block %>
5
+ </div>
6
+ </div>
7
+ </div>
@@ -0,0 +1,18 @@
1
+ <% if resource.errors.any? %>
2
+ <div class="alert alert-error mb-6 bg-red-500 text-white dark:bg-red-700 dark:text-red-200" role="alert">
3
+ <div class="flex items-start justify-start">
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="fill-current icon mr-4 mt-1 flex-no-shrink text-white dark:text-red-200" role="img" aria-labelledby="f1yx75u7nv0lvn6ck4z10w7lksjmk2f">
5
+ <title id="f1yx75u7nv0lvn6ck4z10w7lksjmk2f">Icons/close outline</title>
6
+ <path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm1.41-1.41A8 8 0 1 0 15.66 4.34 8 8 0 0 0 4.34 15.66zm9.9-8.49L11.41 10l2.83 2.83-1.41 1.41L10 11.41l-2.83 2.83-1.41-1.41L8.59 10 5.76 7.17l1.41-1.41L10 8.59l2.83-2.83 1.41 1.41z"></path>
7
+ </svg>
8
+
9
+ <div>
10
+ <ul class="dark:text-red-200">
11
+ <% resource.errors.full_messages.each do |message| %>
12
+ <li><%= message %></li>
13
+ <% end %>
14
+ </ul>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ <% end %>
@@ -11,6 +11,10 @@ module ReviseAuth
11
11
  template "app/config/routes.rb", "config/routes.rb"
12
12
  end
13
13
 
14
+ def copy_styles
15
+ template "app/stylesheet/theme.scss", "app/javascripts/packs"
16
+ end
17
+
14
18
  def copy_controllers
15
19
  template "app/controllers/main_controller.rb", "app/controllers/main_controller.rb"
16
20
  template "app/controllers/revise_auth_controller.rb", "app/controllers/revise_auth_controller.rb"
@@ -1,3 +1,3 @@
1
1
  module ReviseAuth
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revise_auth-jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremiah Parrack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-14 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt
@@ -42,12 +42,15 @@ files:
42
42
  - app/controllers/revise_auth/sessions_controller.rb
43
43
  - app/controllers/revise_auth_controller.rb
44
44
  - app/mailers/revise_auth/mailer.rb
45
+ - app/stylesheet/theme.scss
45
46
  - app/views/main/authenticated.html.erb
46
47
  - app/views/main/index.html.erb
47
48
  - app/views/revise_auth/mailer/confirm_email.html.erb
48
49
  - app/views/revise_auth/registrations/edit.html.erb
49
50
  - app/views/revise_auth/registrations/new.html.erb
50
51
  - app/views/revise_auth/sessions/new.html.erb
52
+ - app/views/revise_auth/shared/_form_block.html.erb
53
+ - app/views/shared/_error_messages.html.erb
51
54
  - config/locales/de.yml
52
55
  - config/locales/el.yml
53
56
  - config/locales/en.yml