semantic_ui_views_generator 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/generators/semantic/devise_generator.rb +61 -0
- data/lib/generators/semantic/install_generator.rb +21 -15
- data/lib/generators/semantic/templates/devise/erb/confirmations/new.html.erb.tt +34 -0
- data/lib/generators/semantic/templates/devise/erb/mailer/confirmation_instructions.html.erb +5 -0
- data/lib/generators/semantic/templates/devise/erb/mailer/email_changed.html.erb +7 -0
- data/lib/generators/semantic/templates/devise/erb/mailer/password_change.html.erb +3 -0
- data/lib/generators/semantic/templates/devise/erb/mailer/reset_password_instructions.html.erb +8 -0
- data/lib/generators/semantic/templates/devise/erb/mailer/unlock_instructions.html.erb +7 -0
- data/lib/generators/semantic/templates/devise/erb/passwords/edit.html.erb.tt +44 -0
- data/lib/generators/semantic/templates/devise/erb/passwords/new.html.erb.tt +35 -0
- data/lib/generators/semantic/templates/devise/erb/registrations/edit.html.erb.tt +54 -0
- data/lib/generators/semantic/templates/devise/erb/registrations/new.html.erb.tt +47 -0
- data/lib/generators/semantic/templates/devise/erb/sessions/new.html.erb.tt +47 -0
- data/lib/generators/semantic/templates/devise/erb/shared/_error_messages.html.erb +12 -0
- data/lib/generators/semantic/templates/devise/erb/shared/_links.html.erb +25 -0
- data/lib/generators/semantic/templates/devise/erb/unlocks/new.html.erb.tt +32 -0
- data/lib/generators/semantic/templates/devise/haml/confirmations/new.html.haml.tt +28 -0
- data/lib/generators/semantic/templates/devise/haml/mailer/confirmation_instructions.html.haml +4 -0
- data/lib/generators/semantic/templates/devise/haml/mailer/email_changed.html.haml +8 -0
- data/lib/generators/semantic/templates/devise/haml/mailer/password_change.html.haml +3 -0
- data/lib/generators/semantic/templates/devise/haml/mailer/reset_password_instructions.html.haml +6 -0
- data/lib/generators/semantic/templates/devise/haml/mailer/unlock_instructions.html.haml +5 -0
- data/lib/generators/semantic/templates/devise/haml/passwords/edit.html.haml.tt +35 -0
- data/lib/generators/semantic/templates/devise/haml/passwords/new.html.haml.tt +28 -0
- data/lib/generators/semantic/templates/devise/haml/registrations/edit.html.haml.tt +45 -0
- data/lib/generators/semantic/templates/devise/haml/registrations/new.html.haml.tt +37 -0
- data/lib/generators/semantic/templates/devise/haml/sessions/new.html.haml.tt +37 -0
- data/lib/generators/semantic/templates/devise/haml/shared/_error_messages.html.haml +7 -0
- data/lib/generators/semantic/templates/devise/haml/shared/_links.html.haml +13 -0
- data/lib/generators/semantic/templates/devise/haml/unlocks/new.html.haml.tt +27 -0
- data/lib/generators/semantic/templates/devise/simple_form/erb/confirmations/new.html.erb.tt +33 -0
- data/lib/generators/semantic/templates/devise/simple_form/erb/passwords/edit.html.erb.tt +33 -0
- data/lib/generators/semantic/templates/devise/simple_form/erb/passwords/new.html.erb.tt +30 -0
- data/lib/generators/semantic/templates/devise/simple_form/erb/registrations/edit.html.erb.tt +39 -0
- data/lib/generators/semantic/templates/devise/simple_form/erb/registrations/new.html.erb.tt +33 -0
- data/lib/generators/semantic/templates/devise/simple_form/erb/sessions/new.html.erb.tt +32 -0
- data/lib/generators/semantic/templates/devise/simple_form/erb/unlocks/new.html.erb.tt +32 -0
- data/lib/generators/semantic/templates/devise/simple_form/haml/confirmations/new.html.haml.tt +26 -0
- data/lib/generators/semantic/templates/devise/simple_form/haml/passwords/edit.html.haml.tt +27 -0
- data/lib/generators/semantic/templates/devise/simple_form/haml/passwords/new.html.haml.tt +24 -0
- data/lib/generators/semantic/templates/devise/simple_form/haml/registrations/edit.html.haml.tt +34 -0
- data/lib/generators/semantic/templates/devise/simple_form/haml/registrations/new.html.haml.tt +27 -0
- data/lib/generators/semantic/templates/devise/simple_form/haml/sessions/new.html.haml.tt +26 -0
- data/lib/generators/semantic/templates/devise/simple_form/haml/unlocks/new.html.haml.tt +26 -0
- data/lib/generators/semantic/templates/devise/simple_form/slim/confirmations/new.html.slim.tt +26 -0
- data/lib/generators/semantic/templates/devise/simple_form/slim/passwords/edit.html.slim.tt +25 -0
- data/lib/generators/semantic/templates/devise/simple_form/slim/passwords/new.html.slim.tt +22 -0
- data/lib/generators/semantic/templates/devise/simple_form/slim/registrations/edit.html.slim.tt +36 -0
- data/lib/generators/semantic/templates/devise/simple_form/slim/registrations/new.html.slim.tt +29 -0
- data/lib/generators/semantic/templates/devise/simple_form/slim/sessions/new.html.slim.tt +28 -0
- data/lib/generators/semantic/templates/devise/simple_form/slim/unlocks/new.html.slim.tt +28 -0
- data/lib/generators/semantic/templates/devise/slim/confirmations/new.html.slim.tt +28 -0
- data/lib/generators/semantic/templates/devise/slim/mailer/confirmation_instructions.html.slim +5 -0
- data/lib/generators/semantic/templates/devise/slim/mailer/email_changed.html.slim +6 -0
- data/lib/generators/semantic/templates/devise/slim/mailer/password_change.html.slim +2 -0
- data/lib/generators/semantic/templates/devise/slim/mailer/reset_password_instructions.html.slim +7 -0
- data/lib/generators/semantic/templates/devise/slim/mailer/unlock_instructions.html.slim +6 -0
- data/lib/generators/semantic/templates/devise/slim/passwords/edit.html.slim.tt +35 -0
- data/lib/generators/semantic/templates/devise/slim/passwords/new.html.slim.tt +28 -0
- data/lib/generators/semantic/templates/devise/slim/registrations/edit.html.slim.tt +45 -0
- data/lib/generators/semantic/templates/devise/slim/registrations/new.html.slim.tt +37 -0
- data/lib/generators/semantic/templates/devise/slim/sessions/new.html.slim.tt +37 -0
- data/lib/generators/semantic/templates/devise/slim/shared/_error_messages.html.slim +7 -0
- data/lib/generators/semantic/templates/devise/slim/shared/_links.html.slim +13 -0
- data/lib/generators/semantic/templates/devise/slim/unlocks/new.html.slim.tt +27 -0
- data/lib/semantic_ui_views_generator/version.rb +1 -1
- data/semantic_ui_views_generator.gemspec +1 -0
- metadata +66 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92aab57b70b5bf069f69136a2943f2d0e1be6170a4bc28999192726c3b729306
|
4
|
+
data.tar.gz: e0b67036694ab770a5aaae1b430493017ef63cb8321178540f82a1eadcbac860
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a55ce4eabe6aba2e6a66a772d1457146fced806cebad922962b1b9d45964c7193cf5343f6a2f10e32f806e7d4927c5c1b10f5d485725a9b24f8761a00b30efb
|
7
|
+
data.tar.gz: 30baff9b54a5228f67bebf70fa382ac1ca676c1f620acac756446bf495802a7eec76aa48997ec7ac272e9d598c9498fa5a87ae9edda7c58b9b6d7df504186d73
|
data/README.md
CHANGED
@@ -47,6 +47,8 @@ Options:
|
|
47
47
|
# Default: false
|
48
48
|
--layout # Over-write your application layout file with a Semantic UI based layout
|
49
49
|
# Default: false
|
50
|
+
--devise # If you want to generate semantic based devise views
|
51
|
+
# Default: false
|
50
52
|
```
|
51
53
|
|
52
54
|
## Options
|
@@ -84,7 +86,7 @@ Ensure you have [Pagy](https://github.com/ddnexus/pagy) gem installed
|
|
84
86
|
```ruby
|
85
87
|
gem 'pagy'
|
86
88
|
|
87
|
-
# Make sure you have the
|
89
|
+
# Make sure you have the semantic-ui pagy helper included
|
88
90
|
# config/initializers/pagy.rb
|
89
91
|
require 'pagy/extras/semantic'
|
90
92
|
```
|
@@ -108,6 +110,11 @@ Generate semantic views with slim and using simple_form
|
|
108
110
|
rails g semantic:install --template_engine=slim --simpleform
|
109
111
|
```
|
110
112
|
|
113
|
+
Generate semantic scaffolds, devise views, while using simpleform, metatags, and slim template engine.
|
114
|
+
```shell
|
115
|
+
rails g semantic:install --devise --simpleform --metatags --template_engine=slim
|
116
|
+
```
|
117
|
+
|
111
118
|
### Extras
|
112
119
|
|
113
120
|
* If you like to use the [meta-tags](https://github.com/kpumuk/meta-tags) gem to add page titles based on the views.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Semantic
|
4
|
+
module Generators
|
5
|
+
class DeviseGenerator < ::Rails::Generators::Base
|
6
|
+
hide!
|
7
|
+
desc 'Overwrite default devise views'
|
8
|
+
source_root ::File.expand_path('../templates/devise', __FILE__)
|
9
|
+
|
10
|
+
class_option :template_engine, type: :string, default: 'erb', aliases: '-t', desc: 'Set template engine to generate the views with'
|
11
|
+
class_option :metatags, type: :boolean, default: false, aliases: "-m", desc: 'If views will assign pages title using metatags gem'
|
12
|
+
class_option :simpleform, type: :boolean, default: false, aliases: '-sf', desc: 'Enable SimpleForms for the form generating'
|
13
|
+
|
14
|
+
def copy_confirmation
|
15
|
+
template "#{file_template_location('confirmations/new')}.tt", "app/views/devise/confirmations/new.html.#{options[:template_engine]}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def copy_mailers
|
19
|
+
directory "#{options[:template_engine]}/mailer", 'app/views/devise/mailer'
|
20
|
+
end
|
21
|
+
|
22
|
+
def copy_passwords
|
23
|
+
%i[edit new].map do |file|
|
24
|
+
template "#{file_template_location("passwords/#{file}")}.tt", "app/views/devise/passwords/#{file}.html.#{options[:template_engine]}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def copy_registrations
|
29
|
+
%i[edit new].map do |file|
|
30
|
+
template "#{file_template_location("registrations/#{file}")}.tt", "app/views/devise/registrations/#{file}.html.#{options[:template_engine]}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def copy_sessions
|
35
|
+
template "#{file_template_location('sessions/new')}.tt", "app/views/devise/sessions/new.html.#{options[:template_engine]}"
|
36
|
+
end
|
37
|
+
|
38
|
+
def copy_unlock
|
39
|
+
template "#{options[:template_engine]}/unlocks/new.html.#{options[:template_engine]}.tt", "app/views/devise/unlocks/new.html.#{options[:template_engine]}"
|
40
|
+
end
|
41
|
+
|
42
|
+
# Copy shared files that have no meta-tags or template associated with them
|
43
|
+
def copy_shared
|
44
|
+
directory "#{options[:template_engine]}/shared", 'app/views/devise/shared'
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
def file_template_location(file_location = '')
|
49
|
+
return '' if file_location.blank?
|
50
|
+
# Dpending if simpleform is to be used, it will return a path similar to one of the following:
|
51
|
+
# => slim/unlocks/new.html.slim || simple_form/slim/unlocks/new.html.slim
|
52
|
+
"#{simple_path}#{options[:template_engine]}/#{file_location}.html.#{options[:template_engine]}"
|
53
|
+
end
|
54
|
+
|
55
|
+
# If simpleform is going ot be used with the forms return a simple_form path
|
56
|
+
def simple_path
|
57
|
+
options[:simpleform] ? 'simple_form/' : ''
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rails/generators'
|
2
|
+
require_relative 'devise_generator'
|
2
3
|
|
3
4
|
module Semantic
|
4
5
|
module Generators
|
@@ -8,6 +9,7 @@ module Semantic
|
|
8
9
|
|
9
10
|
class_option :template_engine, type: :string, default: 'erb', aliases: '-t', desc: 'Set template engine to generate the views with'
|
10
11
|
# Boolean flags that can be flagged by adding to the generator call ie: --pagination or --metag_tags
|
12
|
+
class_option :devise, type: :boolean, default: false, desc: 'If views for devise will be required by the generator'
|
11
13
|
class_option :layout, type: :boolean, default: false, aliases: "-l", desc: 'Over-write your application layout file with a Semantic UI based layout'
|
12
14
|
class_option :metatags, type: :boolean, default: false, aliases: "-m", desc: 'If views will assign pages title using metatags gem'
|
13
15
|
class_option :pagination, type: :boolean, default: false, aliases: '-p', desc: 'Toggle if pagination will be used with the index view/controller (based off of Pagy)'
|
@@ -43,25 +45,29 @@ module Semantic
|
|
43
45
|
pagy_helper = (options[:pagination] ? 'include Pagy::Frontend' : '')
|
44
46
|
helper_str = <<~HELPER
|
45
47
|
#{pagy_helper}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
'
|
52
|
-
|
53
|
-
'
|
54
|
-
|
55
|
-
'
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
48
|
+
# For generating SemanitcUI based flash[:notices]
|
49
|
+
def flash_class(level)
|
50
|
+
case level
|
51
|
+
when 'success'
|
52
|
+
'positive'
|
53
|
+
when 'error'
|
54
|
+
'negative'
|
55
|
+
when 'alert'
|
56
|
+
'negative'
|
57
|
+
when 'notice'
|
58
|
+
'info'
|
59
|
+
else
|
60
|
+
'info'
|
61
|
+
end
|
60
62
|
end
|
61
|
-
end
|
62
63
|
HELPER
|
63
64
|
inject_into_file 'app/helpers/application_helper.rb', helper_str, after: "module ApplicationHelper\n", force: true
|
64
65
|
end
|
66
|
+
|
67
|
+
def invoke_devise_generator
|
68
|
+
# Generate semantic based devise views if devise is being used
|
69
|
+
invoke('semantic:devise') if options[:devise]
|
70
|
+
end
|
65
71
|
end
|
66
72
|
end
|
67
73
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<style type="text/css">
|
2
|
+
body > .grid { height: 90%; }
|
3
|
+
.column { max-width: 450px; }
|
4
|
+
@media (min-width: 768px){
|
5
|
+
.column { max-width: 600px; }
|
6
|
+
}
|
7
|
+
</style>
|
8
|
+
<div class="ui middle aligned center aligned grid grey">
|
9
|
+
<div class="column">
|
10
|
+
<%- if options[:metatags] %>
|
11
|
+
<h2 class="ui center aligned dividing header teal"><i class="signup icon"></i><%%= title('Sign up') %></h2>
|
12
|
+
<% else -%>
|
13
|
+
<h2 class="ui center aligned dividing header teal"><i class="signup icon"></i>Sign up</h2>
|
14
|
+
<%- end %>
|
15
|
+
<div class="ui large form <%%= "error" if resource.errors.any? %>">
|
16
|
+
<%%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
17
|
+
<div class="ui error message">
|
18
|
+
<%%= render 'devise/shared/error_messages' %>
|
19
|
+
</div>
|
20
|
+
<div class="field">
|
21
|
+
<%%= f.label :email %><br />
|
22
|
+
<%%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) ,placeholder: "Enter your email" %>
|
23
|
+
</div>
|
24
|
+
<div class="actions">
|
25
|
+
<%%= f.submit 'Resend confirmation instructions', class: 'ui submit button teal fluid' %>
|
26
|
+
</div>
|
27
|
+
<%% end %>
|
28
|
+
<div class="ui horizontal divider">or</div>
|
29
|
+
<div class="ui horizontal list">
|
30
|
+
<%%= render 'devise/shared/links' %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
@@ -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,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,44 @@
|
|
1
|
+
<style type="text/css">
|
2
|
+
body > .grid { height: 90%; }
|
3
|
+
.column { max-width: 450px; }
|
4
|
+
@media (min-width: 768px){
|
5
|
+
.column { max-width: 600px; }
|
6
|
+
}
|
7
|
+
</style>
|
8
|
+
<div class="ui middle aligned center aligned grid">
|
9
|
+
<div class="column">
|
10
|
+
<%- if options[:metatags] %>
|
11
|
+
<h2 class="ui center aligned dividing header teal"><i class="lock icon"></i><%%= title('Change your password') %></h2>
|
12
|
+
<% else -%>
|
13
|
+
<h2 class="ui center aligned dividing header teal"><i class="lock icon"></i>Change your password</h2>
|
14
|
+
<%- end %>
|
15
|
+
<div class="ui form large <%%= "error" if resource.errors.any? %>">
|
16
|
+
<%%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
17
|
+
<div class="ui error message">
|
18
|
+
<%%= render 'devise/shared/error_messages' %>
|
19
|
+
</div>
|
20
|
+
<%%= f.hidden_field :reset_password_token %>
|
21
|
+
<div class="field">
|
22
|
+
<%%= f.label :password, "New password" %>
|
23
|
+
<%% if @minimum_password_length %>
|
24
|
+
<div class="ui pointing below label">
|
25
|
+
<%%= @minimum_password_length %> characters minimum
|
26
|
+
</div>
|
27
|
+
<%% end %>
|
28
|
+
<%%= f.password_field :password, autofocus: true, autocomplete: "off" , placeholder: "Enter new password" %>
|
29
|
+
</div>
|
30
|
+
<div class="field">
|
31
|
+
<%%= f.label :password_confirmation, "Confirm new password" %>
|
32
|
+
<%%= f.password_field :password_confirmation, autocomplete: "off" , placeholder: "Confirm new password" %>
|
33
|
+
</div>
|
34
|
+
<div class="actions">
|
35
|
+
<%%= f.submit "Change my password",class: "ui submit button teal fluid" %>
|
36
|
+
</div>
|
37
|
+
<%% end %>
|
38
|
+
<div class="ui horizontal divider">or</div>
|
39
|
+
<div class="ui horizontal list">
|
40
|
+
<%%= render "devise/shared/links" %>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</div>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<style type="text/css">
|
2
|
+
body > .grid { height: 90%; }
|
3
|
+
.column { max-width: 450px; }
|
4
|
+
@media (min-width: 768px){
|
5
|
+
.column { max-width: 600px; }
|
6
|
+
}
|
7
|
+
</style>
|
8
|
+
<div class="ui middle aligned center aligned grid">
|
9
|
+
<div class="column">
|
10
|
+
<%- if options[:metatags] %>
|
11
|
+
<h2 class="ui center aligned dividing header teal"><i class="lock icon"></i><%%= title('Forgot your password?') %></h2>
|
12
|
+
<% else -%>
|
13
|
+
<h2 class="ui center aligned dividing header teal"><i class="lock icon"></i>Forgot your password?</h2>
|
14
|
+
<%- end %>
|
15
|
+
<div class="ui form large <%%= "error" if resource.errors.any? %>">
|
16
|
+
<%%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
17
|
+
<div class="ui error message">
|
18
|
+
<%%= render 'devise/shared/error_messages' %>
|
19
|
+
</div>
|
20
|
+
<div class="field">
|
21
|
+
<%%= f.label :email %>
|
22
|
+
<%%= f.email_field :email, autofocus: true ,placeholder: "Enter your registered email"%>
|
23
|
+
</div>
|
24
|
+
<br>
|
25
|
+
<div class="actions">
|
26
|
+
<%%= f.submit "Send me reset password instructions",class: "ui submit button teal fluid" %>
|
27
|
+
</div>
|
28
|
+
<%% end %>
|
29
|
+
<div class="ui horizontal divider">or</div>
|
30
|
+
<div class="ui horizontal list">
|
31
|
+
<%%= render "devise/shared/links" %>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
</div>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<style type="text/css">
|
2
|
+
body > .grid { height: 90%; }
|
3
|
+
.column { max-width: 450px; }
|
4
|
+
@media (min-width: 768px){
|
5
|
+
.column { max-width: 600px; }
|
6
|
+
}
|
7
|
+
</style>
|
8
|
+
<div class="ui middle aligned center aligned grid">
|
9
|
+
<div class="column">
|
10
|
+
<%- if options[:metatags] %>
|
11
|
+
<h2 class="ui center aligned dividing header teal"><i class="lock icon"></i><%%= title("Edit #{resource_name.to_s.humanize}") %></h2>
|
12
|
+
<% else -%>
|
13
|
+
<h2 class="ui center aligned dividing header teal"><i class="lock icon"></i>Edit <%%= resource_name.to_s.humanize %></h2>
|
14
|
+
<%- end %>
|
15
|
+
<div class="ui form large <%%= "error" if resource.errors.any? %>">
|
16
|
+
<%%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
17
|
+
<%%= render 'devise/shared/error_messages' %>
|
18
|
+
<div class="field">
|
19
|
+
<%%= f.label :email %>
|
20
|
+
<%%= f.email_field :email, autofocus: true %>
|
21
|
+
</div>
|
22
|
+
<%% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
23
|
+
<div>Currently waiting confirmation for: <%%= resource.unconfirmed_email %></div>
|
24
|
+
<%% end %>
|
25
|
+
<div class="field">
|
26
|
+
<%%= f.label :password %>
|
27
|
+
<%% if @minimum_password_length %>
|
28
|
+
<div class="ui pointing below label">
|
29
|
+
<%%= @minimum_password_length %> characters minimum
|
30
|
+
</div>
|
31
|
+
<%% end %>
|
32
|
+
<%%= f.password_field :password, autocomplete: "off", placeholder: "Enter new password (leave blank if you don't want to change it)" %>
|
33
|
+
</div>
|
34
|
+
<div class="field">
|
35
|
+
<%%= f.label :password_confirmation %>
|
36
|
+
<%%= f.password_field :password_confirmation, autocomplete: "off" ,placeholder: "Confirm new password" %>
|
37
|
+
</div>
|
38
|
+
<div class="field">
|
39
|
+
<%%= f.label :current_password %>
|
40
|
+
<%%= f.password_field :current_password, autocomplete: "off",placeholder: "(we need your current password to confirm your changes)" %>
|
41
|
+
</div>
|
42
|
+
<div class="actions">
|
43
|
+
<%%= f.submit "Update", class: "ui submit button fluid teal" %>
|
44
|
+
</div>
|
45
|
+
<%% end %>
|
46
|
+
<div class="ui horizontal divider">or</div>
|
47
|
+
<h4 class="ui light grey header">Cancel my account</h4>
|
48
|
+
<p>Unhappy? <%%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete ,class: "ui submit button red tiny "%></p>
|
49
|
+
<div class="ui horizontal list ">
|
50
|
+
<div class="item"><%%= link_to "Back", :back %></div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
</div>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<style type="text/css">
|
2
|
+
body > .grid { height: 90%; }
|
3
|
+
.column { max-width: 450px; }
|
4
|
+
@media (min-width: 768px){
|
5
|
+
.column { max-width: 600px; }
|
6
|
+
}
|
7
|
+
</style>
|
8
|
+
<div class="ui middle aligned center aligned grid grey">
|
9
|
+
<div class="column">
|
10
|
+
<%- if options[:metatags] %>
|
11
|
+
<h2 class="ui center aligned dividing header teal"><i class="signup icon"></i><%%= title("Sign up") %></h2>
|
12
|
+
<% else -%>
|
13
|
+
<h2 class="ui center aligned dividing header teal"><i class="signup icon"></i>Sign up</h2>
|
14
|
+
<%- end %>
|
15
|
+
<div class="ui large form <%%= "error" if resource.errors.any? %>">
|
16
|
+
<%%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
17
|
+
<div class="ui error message">
|
18
|
+
<%%= render 'devise/shared/error_messages' %>
|
19
|
+
</div>
|
20
|
+
<div class="field ">
|
21
|
+
<%%= f.label :email %>
|
22
|
+
<%%= f.email_field :email, autofocus: true ,placeholder: "mail@example.com"%>
|
23
|
+
</div>
|
24
|
+
<div class="field ">
|
25
|
+
<%%= f.label :password %>
|
26
|
+
<%% if @minimum_password_length %>
|
27
|
+
<div class="ui pointing below label">
|
28
|
+
<%%= @minimum_password_length %> characters minimum
|
29
|
+
</div>
|
30
|
+
<%% end %>
|
31
|
+
<%%= f.password_field :password, autocomplete: "off" ,placeholder: "Enter Password", data: { toggle: "tooltip", placement: "left" }%>
|
32
|
+
</div>
|
33
|
+
<div class="field">
|
34
|
+
<%%= f.label :password_confirmation %>
|
35
|
+
<%%= f.password_field :password_confirmation, autocomplete: "off" ,placeholder: "Confirm Password" %>
|
36
|
+
</div>
|
37
|
+
<div class="actions">
|
38
|
+
<%%= f.submit "Sign up", class: "ui submit button fluid teal" %>
|
39
|
+
</div>
|
40
|
+
<%% end %>
|
41
|
+
<div class="ui horizontal divider">or</div>
|
42
|
+
<div class="ui horizontal list">
|
43
|
+
<%%= render "devise/shared/links" %>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</div>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<style type="text/css">
|
2
|
+
body > .grid { height: 90%; }
|
3
|
+
.column { max-width: 450px; }
|
4
|
+
@media (min-width: 768px){
|
5
|
+
.column { max-width: 600px; }
|
6
|
+
}
|
7
|
+
</style>
|
8
|
+
<div class="ui middle aligned center aligned grid">
|
9
|
+
<div class="column">
|
10
|
+
<%- if options[:metatags] %>
|
11
|
+
<h2 class="ui center aligned dividing header teal"><i class="sign in icon"></i><%%= title('Log in') %></h2>
|
12
|
+
<% else -%>
|
13
|
+
<h2 class="ui center aligned dividing header teal"><i class="sign in icon"></i>Log in</h2>
|
14
|
+
<%- end %>
|
15
|
+
<div class="ui large form ">
|
16
|
+
<%%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
17
|
+
<div class="field">
|
18
|
+
<%%= f.label :email %>
|
19
|
+
<div class="ui left icon input">
|
20
|
+
<%%= f.email_field :email, autofocus: true ,placeholder:"Email"%>
|
21
|
+
<i class="user icon"></i>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div class="field">
|
25
|
+
<%%= f.label :password %>
|
26
|
+
<div class="ui left icon input">
|
27
|
+
<%%= f.password_field :password, autocomplete: "off" ,placeholder:"Password"%>
|
28
|
+
<i class="lock icon"></i>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
<%% if devise_mapping.rememberable? -%>
|
32
|
+
<div class="ui checkbox">
|
33
|
+
<%%= f.check_box :remember_me %>
|
34
|
+
<%%= f.label :remember_me %> <br>
|
35
|
+
</div>
|
36
|
+
<%% end -%>
|
37
|
+
<div class="actions">
|
38
|
+
<%%= f.submit "Log in", class: "ui submit button fluid teal"%>
|
39
|
+
</div>
|
40
|
+
<%% end %>
|
41
|
+
<div class="ui horizontal divider">or</div>
|
42
|
+
<div class="ui horizontal list">
|
43
|
+
<%%= render "devise/shared/links" %>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</div>
|