rails_base 0.56.0 → 0.61.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: 8848ee352824c072f2cb33947b77f92e4516a2bb606fc327c0af9a13c0239eeb
4
- data.tar.gz: d6a05900f769175ddda5500073ae3158eecd9442c71955f29fd770ee8f2ce65e
3
+ metadata.gz: f94ae56f9f525b93289e14773189cf437328e50ef8b2e4c7f374bc157730ddcc
4
+ data.tar.gz: 8bd40fe32d2bbb0e700e283cd0769121d385844bca3dd02dfd7e426bc32db057
5
5
  SHA512:
6
- metadata.gz: dc283c62b445089c071258a6363a6bc77fd184ba19d34dd06d6ba26a7962b2a6b2ad31e47140af7ba1d682ce6275e9c7612d3e494ffab1d3c8e78d1604daefae
7
- data.tar.gz: fc68932462a62c9b13738f9254d46026fdfcd2ff9f62da33032d747292c7eed50ac646a0a5f0982400cff1e7c9ae7e07f6f1514c95b07c1dd9f7bf3262c2be93
6
+ metadata.gz: 168ac878736a648e77e471b420a3efa0fac9244fd3c0ae594d09737db68e8ebfb99fa8077e48b63813ddde04f7ad59ca0fd52556da1db192f0fc0b6217c6f90c
7
+ data.tar.gz: '091ca1be6b369f1d5a03677a6b115e69e1dd5d9cdd07032b648e9650a358999b07bf2a2d0c25a531b92048dc6e2d304ae265fd7459e8b9cb7cc8d3e7554994f5'
@@ -24,7 +24,7 @@
24
24
 
25
25
  <%=
26
26
  if RailsBase.config.app.favicon_path
27
- favicon_link_tag 'rails_base/favicon.ico'
27
+ favicon_link_tag(RailsBase.config.app.favicon_path)
28
28
  end
29
29
  %>
30
30
  </head>
@@ -178,15 +178,31 @@
178
178
  # dont load these when error page happens. The full stack of librarires are not
179
179
  # rendered and jquery/bootstrap are missing
180
180
  %>
181
- <% case footer_mode_case %>
182
- <% when :sticky %>
183
- $('#base-footer').addClass('fixed-bottom')
184
- <% when :bottom %>
185
- if($('#_body_base_container').height() <= window.innerHeight){
181
+ function _rails_base_reload_base_footer(){
182
+ <% case footer_mode_case %>
183
+ <% when :sticky %>
186
184
  $('#base-footer').addClass('fixed-bottom')
185
+ <% when :bottom %>
186
+ if($('#_body_base_container').height() <= window.innerHeight){
187
+ $('#base-footer').addClass('fixed-bottom')
188
+ } else {
189
+ $('#base-footer').removeClass('fixed-bottom')
190
+ }
191
+ <% else %>
192
+ <% end %>
187
193
  }
188
- <% else %>
189
- <% end %>
194
+
195
+ function _rails_base_toggle_base_footer(status){
196
+ if(status=='show') {
197
+ $('#base-footer').show()
198
+ } else if(status=='hide') {
199
+ $('#base-footer').hide()
200
+ } else {
201
+ $('#base-footer').toggle()
202
+ }
203
+ }
204
+
205
+ _rails_base_reload_base_footer();
190
206
 
191
207
  <% unless defined?(@error_page) %>
192
208
  $(document).ready(function(){
@@ -1,14 +1,17 @@
1
1
  <h2 class='text-center'>Forgot your password?</h2>
2
2
  <%= render "devise/shared/error_messages", resource: resource %>
3
3
 
4
+ <% submit_id = "submit_id_#{Time.now.to_i}" %>
4
5
 
5
- <%= form_for(:user, as: :user, url: RailsBase.url_routes.user_password_path, html: { method: :post }) do |f| %>
6
+ <%= form_for(:user, as: :user, url: RailsBase.url_routes.user_password_path, html: { method: :post, class: 'forgot_password' }) do |f| %>
6
7
 
7
8
  <div class="field form-group row">
8
9
  <div class="col-md-10 offset-md-1">
9
- <%= f.label :email, class: 'text-center' %><br />
10
+ <%= f.label :email, class: 'text-center' %><br>
10
11
  <%= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: :email, class: 'form-control'%>
11
- </div>
12
+ <div class="invalid-feedback">
13
+ Password Confirmation does not match Password
14
+ </div>
12
15
  </div>
13
16
  </div>
14
17
 
@@ -16,7 +19,7 @@
16
19
  <div class="col-md-10 offset-md-1 text-center">
17
20
  <div class="row">
18
21
  <div class="col-md-9">
19
- <%= f.submit "Send me reset password instructions", class: "btn btn_success btn-block" %>
22
+ <%= f.submit "Send me reset password instructions", class: "btn btn_success btn-block #{submit_id}" %>
20
23
  </div>
21
24
  <div class="col-md-3">
22
25
  <a class="btn btn_primary btn-block" href="<%= RailsBase.url_routes.new_user_session_path %>" role="button">Sign in</a>
@@ -25,3 +28,12 @@
25
28
  </div>
26
29
  </div>
27
30
  <% end %>
31
+
32
+ <%
33
+ values = [
34
+ { name: '#user_email', criteria: { required: true, pattern: :email }}
35
+ ]
36
+ function_name = 'forgot_password'
37
+ %>
38
+
39
+ <%= render partial: 'rails_base/shared/custom_form_validation_javascript', locals: { function_name: function_name, values: values } %>
@@ -1,7 +1,9 @@
1
1
  <p>Hello <%= @user.full_name %>!</p>
2
2
 
3
3
  <p>
4
- Welcome to <%= RailsBase.config.app.communication_name %>. Where you have the ability to keep track of all of your optiosn accross different companies and life events
4
+ Welcome to <%= RailsBase.config.app.communication_name %>.
5
+ </br>
6
+ <%= RailsBase.config.mailer.verification_content(@user) %>
5
7
  </br>
6
8
  Please finish your registration by following this <a href="<%=@sso_url_for_user%>" target="_blank"> Registration Link </a>
7
9
  </br>
@@ -59,7 +59,7 @@
59
59
  </br>
60
60
  <div class='row'>
61
61
  <div class='col'>
62
- <a class="btn btn_info btn-block" href="<%=RailsBase.url_routes.user_settings_path%>" role="button">Modify User</a>
62
+ <a class="btn btn_info btn-block" href="<%=RailsBase.url_routes.user_settings_path %>" role="button">Modify User</a>
63
63
  </div>
64
64
  </div>
65
65
  </br>
@@ -69,6 +69,14 @@
69
69
  </div>
70
70
  </div>
71
71
  </br>
72
+ <% if RailsBase.config.templates.logged_in_header_modal %>
73
+ <div class='row'>
74
+ <div class='col'>
75
+ <%= render partial: RailsBase.config.templates.logged_in_header_modal, locals: { current_user: current_user } %>
76
+ </div>
77
+ </div>
78
+ </br>
79
+ <% end %>
72
80
  <div class="dropdown-divider"></div>
73
81
  <div class='row'>
74
82
  <div class='col'>
@@ -0,0 +1,62 @@
1
+
2
+ <%
3
+ id = options.fetch(:id)
4
+ title = options.fetch(:title_id)
5
+ body = options.fetch(:body_id)
6
+ use_fa_icon = options[:fa_icon] != false
7
+ if use_fa_icon
8
+ fa_icon_open = options.dig(:fa_icon, :open) || 'fa-caret-right'
9
+ fa_icon_closed = options.dig(:fa_icon, :closed) || 'fa-caret-down'
10
+ fa_icon_only = options.dig(:fa_icon, :collapse_only) || false
11
+ fa_icon_span_class = "fa-icon-span-class-#{rand(100..100_000)}_id-#{id}"
12
+ fa_icon_span_id = "id-#{fa_icon_span_class}"
13
+ end
14
+ start_open = !(options[:default_closed] || false)
15
+ close_display = start_open ? 'inline' : 'none'
16
+ open_display = !start_open ? 'inline' : 'none'
17
+ id_transposed = "id_transposed_#{rand(100_000..999_999)}"
18
+ %>
19
+
20
+ <% if use_fa_icon %>
21
+ <span id="<%= fa_icon_span_id %>" class="float-md-left fa-icon-span <%= fa_icon_span_class %> ">
22
+ <i class="fa <%= fa_icon_open %> open" aria-hidden="true" style="display:<%= open_display %>"></i>
23
+ <i class="fa <%= fa_icon_closed %> closed" aria-hidden="true" style="display:<%= close_display %>"></i>
24
+ </span>
25
+ <% end %>
26
+
27
+ <script type="text/javascript">
28
+ $(`#<%= body %>`).addClass('collapse')
29
+ <% if start_open %>
30
+ $(`#<%= body %>`).addClass('show')
31
+ <% end %>
32
+ <% if use_fa_icon %>
33
+ // Initialize fa <%= id %>
34
+ $(`#<%= fa_icon_span_id %>`).prependTo(`#<%= title %>`);
35
+ <% end %>
36
+
37
+ <% if use_fa_icon && fa_icon_only %>
38
+ var <%= id_transposed %> = `#<%= fa_icon_span_id %>`
39
+ <% else %>
40
+ var <%= id_transposed %> = `#<%= title %>`
41
+ <% end %>
42
+
43
+ $(<%= id_transposed %>).click(function(event){
44
+ _rails_base_toggle_base_footer('hide')
45
+ $(`#<%= body %>`).collapse('toggle')
46
+ <% if use_fa_icon %>
47
+ $(`#<%= fa_icon_span_id %> .open`).toggle()
48
+ $(`#<%= fa_icon_span_id %> .closed`).toggle()
49
+ <% end %>
50
+ });
51
+
52
+ $(`#<%= body %>`).on('shown.bs.collapse', function () {
53
+ _rails_base_reload_base_footer();
54
+ _rails_base_toggle_base_footer('show')
55
+ })
56
+
57
+ $(`#<%= body %>`).on('hidden.bs.collapse', function () {
58
+ _rails_base_reload_base_footer();
59
+ _rails_base_toggle_base_footer('show')
60
+ })
61
+
62
+ </script>
@@ -11,6 +11,7 @@ require 'rails_base/configuration/appearance'
11
11
  require 'rails_base/configuration/user'
12
12
  require 'rails_base/configuration/login_behavior'
13
13
  require 'rails_base/configuration/active_job'
14
+ require 'rails_base/configuration/templates'
14
15
 
15
16
  module RailsBase
16
17
  class Config
@@ -28,7 +29,8 @@ module RailsBase
28
29
  appearance: nil,
29
30
  user: nil,
30
31
  active_job: nil,
31
- login_behavior: nil
32
+ login_behavior: nil,
33
+ templates: nil,
32
34
  }
33
35
  attr_reader *VARIABLES.keys
34
36
 
@@ -107,7 +107,12 @@ module RailsBase
107
107
  default: 'mailers',
108
108
  on_assignment: ->(val, _instance) { ACTION_MAILER_PROC.call(:deliver_later_queue_name, val) },
109
109
  description: 'The active job queue to send twilio messages from. Ensure that adapter is bound to the queue',
110
- }
110
+ },
111
+ verification_content: {
112
+ type: :string_proc,
113
+ default: ->(user) { "We are pleased to have you here" },
114
+ description: 'Description of app for verification mailer. User is passed in.',
115
+ },
111
116
  }
112
117
 
113
118
  attr_accessor *DEFAULT_VALUES.keys
@@ -0,0 +1,18 @@
1
+ require 'rails_base/configuration/base'
2
+
3
+ module RailsBase
4
+ module Configuration
5
+ class Templates < Base
6
+
7
+ DEFAULT_VALUES = {
8
+ logged_in_header_modal: {
9
+ type: :string_nil,
10
+ default: nil,
11
+ description: 'The template to render in the logged in header modal. `current_user` is passed in',
12
+ },
13
+ }
14
+
15
+ attr_accessor *DEFAULT_VALUES.keys
16
+ end
17
+ end
18
+ end
@@ -1,6 +1,6 @@
1
1
  module RailsBase
2
2
  MAJOR = '0'
3
- MINOR = '56'
3
+ MINOR = '61'
4
4
  PATCH = '0'
5
5
  VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}"
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.56.0
4
+ version: 0.61.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Taylor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-05 00:00:00.000000000 Z
11
+ date: 2021-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -531,6 +531,7 @@ files:
531
531
  - app/views/rails_base/shared/_reset_password_form.html.erb
532
532
  - app/views/rails_base/shared/_session_create_form.html.erb
533
533
  - app/views/rails_base/shared/_session_timeout_modal.html.erb
534
+ - app/views/rails_base/shared/_standardized_collapse.html.erb
534
535
  - app/views/rails_base/switch_user/_widget.html.erb
535
536
  - app/views/rails_base/user_settings/_confirm_destroy_user.html.erb
536
537
  - app/views/rails_base/user_settings/_destroy_user.html.erb
@@ -590,6 +591,7 @@ files:
590
591
  - lib/rails_base/configuration/mfa.rb
591
592
  - lib/rails_base/configuration/owner.rb
592
593
  - lib/rails_base/configuration/redis.rb
594
+ - lib/rails_base/configuration/templates.rb
593
595
  - lib/rails_base/configuration/user.rb
594
596
  - lib/rails_base/engine.rb
595
597
  - lib/rails_base/version.rb