rails_base 0.60.0 → 0.61.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2382233d63801820a6f6b4b68f03f6eea0b3e79915edbf6d9da3c03500c91f98
4
- data.tar.gz: 90b9db35b59889f0efc3ba402d852731f1c071667d9a24a87f5583d57b292372
3
+ metadata.gz: f94ae56f9f525b93289e14773189cf437328e50ef8b2e4c7f374bc157730ddcc
4
+ data.tar.gz: 8bd40fe32d2bbb0e700e283cd0769121d385844bca3dd02dfd7e426bc32db057
5
5
  SHA512:
6
- metadata.gz: e0fbebe271f5e0ff50dc7255a22c27d8b2fdff93272298d9026019d37bd4362e6883c4c653eb440aeb89dc3ab32aa87084a53a950a1ca213bbdea1297ec8b78f
7
- data.tar.gz: 25f855f707777734d74b33f682484adcbb8958dfbb6fa7ad12aa965619c2d7610f48f3cb348772469a5231a5e52c95f57360a6cb8dd486a396f9f7241f6ba07f
6
+ metadata.gz: 168ac878736a648e77e471b420a3efa0fac9244fd3c0ae594d09737db68e8ebfb99fa8077e48b63813ddde04f7ad59ca0fd52556da1db192f0fc0b6217c6f90c
7
+ data.tar.gz: '091ca1be6b369f1d5a03677a6b115e69e1dd5d9cdd07032b648e9650a358999b07bf2a2d0c25a531b92048dc6e2d304ae265fd7459e8b9cb7cc8d3e7554994f5'
@@ -192,6 +192,16 @@
192
192
  <% end %>
193
193
  }
194
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
+
195
205
  _rails_base_reload_base_footer();
196
206
 
197
207
  <% unless defined?(@error_page) %>
@@ -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>
@@ -1,6 +1,6 @@
1
1
  module RailsBase
2
2
  MAJOR = '0'
3
- MINOR = '60'
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.60.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-10-02 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