active_scaffold 4.3.1 → 4.3.2

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: 8426370774f998d440d6ba62749ce0debb8b5caf5a050330b21c77eb34849e17
4
- data.tar.gz: 60f8897a05d79cc248c5059321b42152361f5f79b24069586e46b2bd209e738e
3
+ metadata.gz: d91707ceb87840fe28313d879f1c013d577ee96ed32bebe8943a39179cdbf380
4
+ data.tar.gz: 43e8949c1b351f672f11c99f6df2cf274262df5e3fbd7ce1c75b10f49c290ef3
5
5
  SHA512:
6
- metadata.gz: be457e4b9bc57e9e4f657642912ff5396bad888107ef9a9e27ee3cf0457e5cf8e872f2d20ee08379fa1c42105e223f8e4fd9ae43d64c6f7eececa1c6212250e4
7
- data.tar.gz: 7c764c174e950240a3da87b096ed7891ed571c81880e7f42161744a591c3de626f5b14914ddb0d7b7c9500b12e48d2be2b06bd11d071f3174467da42d3627cbf
6
+ metadata.gz: a28f9c8088844f67c7cd5dea3c9221f15d998d6fcb89617639bb5092501e21a5ac2d5c49927877244d5b2b99579da370272203caec7b3159c9035dafdc02f7c1
7
+ data.tar.gz: c49905306ccda62812b8ca6ed24d25fc4c490948f56cfd2a1ab9e403fc483962080f4b0911e29db9dce97572fd82473a5a65de3f0c5a26bce95a1449058fcece
data/CHANGELOG.rdoc CHANGED
@@ -1,4 +1,10 @@
1
- - Fix escaping URL in JS response, fixing auto paginate and response for actions with render_parent
1
+ = 4.3.2
2
+ - Fix adding tab in tabbed forms
3
+
4
+ = 4.3.1
5
+ - Support Ruby 4
6
+ - Fix date picker options translated as strings, preserving boolean and integer values
7
+ - Fix escaping URLs in JavaScript responses, fixing auto pagination and actions with render_parent
2
8
 
3
9
  = 4.3.0
4
10
  - Support translating enums (or options for :select form_ui on any column) nested in the pluralized name of the column, activerecord.attributes.model_name.pluralized_column.enum_value, defaults to old way activerecord.attributes.model_name.enum_value
@@ -150,6 +150,14 @@
150
150
  if (opts.disabled) jQuery(this).find('.ui-slider-handle').hide();
151
151
  });
152
152
  },
153
+ activate_tab: function(tab_ctrl) {
154
+ tab_ctrl = jQuery(tab_ctrl);
155
+ var tabbed = tab_ctrl.closest('.tabbed');
156
+ tabbed.find('.nav-tabs .active').removeClass('active');
157
+ tabbed.find('.tab-content .active').removeClass('in active');
158
+ tab_ctrl.addClass('active');
159
+ jQuery(tab_ctrl.attr('href')).addClass('in active');
160
+ },
153
161
  load_embedded: function(element) {
154
162
  jQuery('.active-scaffold-component .load-embedded', element).each(function(index, item) {
155
163
  item = jQuery(item);
@@ -1572,11 +1580,7 @@
1572
1580
  jQuery(document).on('click', '.active-scaffold .tabbed .nav-tabs a', function(e) {
1573
1581
  if (typeof jQuery().tab == 'function') return; // bootstrap tab plugin is loaded and will handle tabs
1574
1582
  e.preventDefault();
1575
- var tab_ctrl = jQuery(this), tabbed = tab_ctrl.closest('.tabbed')
1576
- tabbed.find('.nav-tabs .active').removeClass('active');
1577
- tabbed.find('.tab-content .active').removeClass('in active');
1578
- tab_ctrl.closest('li').addClass('active');
1579
- jQuery(tab_ctrl.attr('href')).addClass('in active');
1583
+ ActiveScaffold.activate_tab(this);
1580
1584
  });
1581
1585
 
1582
1586
  jQuery(document).on('turbolinks:before-visit turbo:before-visit', function() {
@@ -8,8 +8,7 @@
8
8
  tab_content = render('form', columns: @column, subsection_id: "#{subsection_id}-#{tab_id_suffix}", form_action: @form_action, scope: @scope, tab_value: tab_record || tab_value, tab_id: tab_id_suffix, tabbed_by: @column.tabbed_by)
9
9
  tab = active_scaffold_tab_content(tab_id, true, tab_content)
10
10
  %>
11
- jQuery('#<%= subsection_id %> .tab-content > .tab-pane.active').removeClass('in active');
12
11
  ActiveScaffold.create_associated_record_form('<%= subsection_id %> .tab-content', '<%= j tab %>', {singular: false});
13
- jQuery('#<%= subsection_id %> .nav-tabs').find('.nav-item.active').removeClass('active').end().append('<%= j active_scaffold_tab(tab_label, tab_id, true) %>');
12
+ ActiveScaffold.activate_tab(jQuery('<%= j active_scaffold_tab(tab_label, tab_id, true) %>').appendTo('#<%= subsection_id %> .nav-tabs').find('a'));
14
13
  jQuery('#<%= @source_id %> option[value=<%= tab_value %>]').hide().parent().val('');
15
- <% end %>
14
+ <% end %>
@@ -6,7 +6,7 @@ module ActiveScaffold
6
6
  module TabsHelpers
7
7
  def active_scaffold_tabbed_by(column, record, scope, subsection_id, &)
8
8
  add_tab_url = params_for(action: 'render_field', tabbed_by: column.tabbed_by, id: record.to_param, column: column.label)
9
- refresh_opts = {refresh_link: {text: 'Add tab', class: 'refresh-link add-tab'}}
9
+ refresh_opts = {field_selector: "##{subsection_id}_input", refresh_link: {text: 'Add tab', class: 'refresh-link add-tab'}}
10
10
  tab_options = send(override_helper_per_model(:active_scaffold_tab_options, record.class), column, record)
11
11
  used_tabs = send(override_helper_per_model(:active_scaffold_current_tabs, record.class), column, record, tab_options)
12
12
  input_helper = override_helper_per_model(:active_scaffold_input_for_tabbed, record.class)
@@ -4,7 +4,7 @@ module ActiveScaffold
4
4
  module Version
5
5
  MAJOR = 4
6
6
  MINOR = 3
7
- PATCH = 1
7
+ PATCH = 2
8
8
  FIX = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, FIX].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.1
4
+ version: 4.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Many, see README
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-17 00:00:00.000000000 Z
11
+ date: 2026-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ice_nine