active_scaffold 3.4.4 → 3.4.5

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
  SHA1:
3
- metadata.gz: e2ef74ce45fee06f01b9150802312b245e2eb226
4
- data.tar.gz: 7be6ae4331a71c54488362305825ca222dc39d05
3
+ metadata.gz: 9f474117432310ae21c926433541aa5849b9303b
4
+ data.tar.gz: 1ebb3ec0f64123d0afc586b4015e29a4d634a294
5
5
  SHA512:
6
- metadata.gz: 7f30bfe3a5091311f0f03a0a9b74b2fdf92f0237bedd728020c32a818d6eb6fd5acb08c77ecbb948487bab097b79d5c17e7b8928021a72125531f086fd6f7041
7
- data.tar.gz: a99a94a0321aaabda253e299d9eec2acc37ea7519db77ce8b1f3e843949b62316983d5523093b636b1dbd490e5b2ec970ba79c5cc6ce773472b3510657da596a
6
+ metadata.gz: 33bfb4cd1023bc82fe3c2974f4725794688b8a96e11033c62081f16dce820e6d31ae09a321949e70605312aa51d87c17a60c373378b9fda71079512803e418f3
7
+ data.tar.gz: 1f351e2a0d0e5b49cfb952c6763fb0ecd826cc91788ddd8c4cb7c6999a2e02ccdee0f7e1867c730ce09f27029de4e9655a39b3da13d4812d363d14cdb24c322a
data/CHANGELOG CHANGED
@@ -1,4 +1,10 @@
1
- = 3.4.4 (not released yet)
1
+ = 3.4.5
2
+ - Fix default sorting on ruby 1.8
3
+ - Fix add existing button, broken on 3.4.4
4
+ - add active_scaffold_checkbox_option so rendering li of checkbox_list can be overrided
5
+ - Fix set_parent for render field on main form columns
6
+
7
+ = 3.4.4
2
8
  - Fix set_parent for render field on blank records added by default on subforms
3
9
  - Enable sorting on selected draggable list, so it can be used on config_list
4
10
  - Remove unfinished nested_auto_open feature, it was working only if render_component is used, which is not recommended way
@@ -433,7 +433,7 @@ var ActiveScaffold = {
433
433
  jQuery('.as-js-button', element).show();
434
434
  },
435
435
  load_embedded: function(element) {
436
- $('.active-scaffold-component .load-embedded', element).each(function(index, item) {
436
+ jQuery('.active-scaffold-component .load-embedded', element).each(function(index, item) {
437
437
  item = jQuery(item);
438
438
  item.closest('.active-scaffold-component').load(item.attr('href'), function() {
439
439
  jQuery(this).trigger('as:element_updated');
@@ -41,7 +41,7 @@ add_new_url = params_for(:controller => controller_path, :action => 'edit_associ
41
41
  add_existing_id = "#{sub_form_id(:association => column.name, :id => parent_record.id || temporary_id || 99999999999)}-add-existing"
42
42
  add_existing_label = column.plural_association? ? :add_existing : :replace_existing %>
43
43
  <%= select_tag 'associated_id', '<option value="">'.html_safe + as_(:_select_) + '</option>'.html_safe + select_options %>
44
- <%= link_to as_(add_existing_label), edit_associated_url, :id => add_existing_id, :remote => true, :class=> "subform-button as_#{add_existing_label}", :style => "display: none;" %>
44
+ <%= link_to as_(add_existing_label), edit_associated_url, :id => add_existing_id, :remote => true, :class=> "as-js-button as_#{add_existing_label}", :style => "display: none;" %>
45
45
  <% end -%>
46
46
  <% end -%>
47
47
  </div>
@@ -11,7 +11,7 @@
11
11
  <%= render :partial => 'update_calculations', :formats => [:js] %>
12
12
  <% else %>
13
13
  <% if @action_link.try(:position) %>
14
- ActiveScaffold.find_action_link('<%= element_row_id(:action => action_name) %>').close();
14
+ ActiveScaffold.find_action_link('<%= element_form_id(:action => action_name) %>').close();
15
15
  <% end %>
16
16
  <%= render :partial => 'refresh_list' %>
17
17
  <% end %>
@@ -24,8 +24,6 @@ de:
24
24
  click_to_edit: "Zum Editieren anklicken"
25
25
  click_to_reset: Reset
26
26
  close: Schließen
27
- config_list: Konfigurieren
28
- config_list_model: "Konfiguriere Spalten für %{model}"
29
27
  contains: Enthält
30
28
  create: Anlegen
31
29
  create_another: "Weitere anlegen"
@@ -24,8 +24,6 @@ en:
24
24
  click_to_edit: "Click to edit"
25
25
  click_to_reset: "Click to reset"
26
26
  close: Close
27
- config_list: Configure
28
- config_list_model: "Configure Columns for %{model}"
29
27
  contains: Contains
30
28
  create: Create
31
29
  create_another: "Create Another %{model}"
@@ -24,8 +24,6 @@ es:
24
24
  click_to_edit: "Pulsa para editar"
25
25
  click_to_reset: "Pulsa para restaurar"
26
26
  close: Cerrar
27
- config_list: Configurar
28
- config_list_model: "Configurar columnas de %{model}"
29
27
  contains: Contiene
30
28
  create: Crear
31
29
  create_another: "Crear Otro %{model}"
@@ -24,8 +24,6 @@ fr:
24
24
  click_to_edit: "Cliquer pour éditer"
25
25
  click_to_reset: "Cliquer pour ré-initialiser"
26
26
  close: Fermer
27
- config_list: Configurer
28
- config_list_model: "Configurer les colonnes pour %{model}"
29
27
  contains: Contient
30
28
  create: Créer
31
29
  create_another: "Créer un autre %{model}"
@@ -24,8 +24,6 @@ hu:
24
24
  click_to_edit: "Kattints a szerkesztéshez"
25
25
  click_to_reset: "Kattints az alapállapothoz"
26
26
  close: Bezárás
27
- config_list: Configure
28
- config_list_model: "Configure Columns for %{model}"
29
27
  contains: Contains
30
28
  create: Létrehozás
31
29
  create_another: "Create Another %{model}"
@@ -24,8 +24,6 @@ ja:
24
24
  click_to_edit: クリックして編集
25
25
  click_to_reset: "Click to reset"
26
26
  close: 閉じる
27
- config_list: Configure
28
- config_list_model: "Configure Columns for %{model}"
29
27
  contains: Contains
30
28
  create: 作成
31
29
  create_another: "Create Another %{model}"
@@ -22,8 +22,6 @@ ru:
22
22
  click_to_edit: "Нажмите для редактирования"
23
23
  click_to_reset: "Нажмите для сброса"
24
24
  close: Закрыть
25
- config_list: "Настройки списка"
26
- config_list_model: "%{model}: настройки списка"
27
25
  contains: Содержит
28
26
  create: Создать
29
27
  create_another: "%{model}: Создать другую запись"
@@ -83,7 +83,7 @@ module ActiveScaffold::Actions
83
83
  @record.send "#{@column.name}=", value
84
84
  @record.id = params[:id]
85
85
  end
86
- set_parent(@record) if @record.id.nil? && params[:parent_controller]
86
+ set_parent(@record) if @record.id.nil? && params[:parent_controller] && @scope
87
87
 
88
88
  after_render_field(@record, @column)
89
89
  end
@@ -17,7 +17,7 @@ module ActiveScaffold::DataStructures
17
17
 
18
18
  # fallback to setting primary key ordering
19
19
  if model.column_names.include?(model.primary_key)
20
- set(model.primary_key, 'ASC')
20
+ set([model.primary_key, 'ASC'])
21
21
  @sorting_by_primary_key = clause
22
22
  end
23
23
  # If an ORDER BY clause is found set default sorting according to it
@@ -299,24 +299,26 @@ module ActiveScaffold
299
299
  html = if select_options.empty?
300
300
  content_tag(:span, as_(:no_options), :class => "#{options[:class]} no-options", :id => options[:id])
301
301
  else
302
- method = column.options[:label_method] || :to_label
303
- active_scaffold_checkbox_list(column, select_options.collect {|r| [r.send(method), r.id]}, associated_options.collect(&:id), options)
302
+ active_scaffold_checkbox_list(column, select_options, associated_options.collect(&:id), options)
304
303
  end
305
304
  html << active_scaffold_refresh_link(column, options, record) if column.options[:refresh_link]
306
305
  html
307
306
  end
307
+
308
+ def active_scaffold_checkbox_option(option, label_method, associated_ids, checkbox_options, li_options = {})
309
+ content_tag(:li, li_options) do
310
+ check_box_tag(checkbox_options[:name], option.id, associated_ids.include?(option.id), checkbox_options) <<
311
+ content_tag(:label, option.send(label_method), :for => checkbox_options[:id])
312
+ end
313
+ end
308
314
 
309
315
  def active_scaffold_checkbox_list(column, select_options, associated_ids, options)
316
+ label_method = column.options[:label_method] || :to_label
310
317
  html = hidden_field_tag("#{options[:name]}[]", '', :id => nil)
311
318
  html << content_tag(:ul, options.merge(:class => "#{options[:class]} checkbox-list#{' draggable-lists' if column.options[:draggable_lists]}")) do
312
319
  content = ''.html_safe
313
320
  select_options.each_with_index do |option, i|
314
- label, id = option
315
- this_id = "#{options[:id]}_#{i}_id"
316
- content << content_tag(:li) do
317
- check_box_tag("#{options[:name]}[]", id, associated_ids.include?(id), :id => this_id) <<
318
- content_tag(:label, h(label), :for => this_id)
319
- end
321
+ content << active_scaffold_checkbox_option(option, label_method, associated_ids, :name => "#{options[:name]}[]", :id => "#{options[:id]}_#{i}_id")
320
322
  end
321
323
  content
322
324
  end
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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: 3.4.4
4
+ version: 3.4.5
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: 2014-09-02 00:00:00.000000000 Z
11
+ date: 2014-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoulda