active_scaffold 3.4.4 → 3.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +7 -1
- data/app/assets/javascripts/jquery/active_scaffold.js +1 -1
- data/app/views/active_scaffold_overrides/_form_association_footer.html.erb +1 -1
- data/app/views/active_scaffold_overrides/on_action_update.js.erb +1 -1
- data/config/locales/de.yml +0 -2
- data/config/locales/en.yml +0 -2
- data/config/locales/es.yml +0 -2
- data/config/locales/fr.yml +0 -2
- data/config/locales/hu.yml +0 -2
- data/config/locales/ja.yml +0 -2
- data/config/locales/ru.yml +0 -2
- data/lib/active_scaffold/actions/core.rb +1 -1
- data/lib/active_scaffold/data_structures/sorting.rb +1 -1
- data/lib/active_scaffold/helpers/form_column_helpers.rb +10 -8
- data/lib/active_scaffold/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f474117432310ae21c926433541aa5849b9303b
|
4
|
+
data.tar.gz: 1ebb3ec0f64123d0afc586b4015e29a4d634a294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33bfb4cd1023bc82fe3c2974f4725794688b8a96e11033c62081f16dce820e6d31ae09a321949e70605312aa51d87c17a60c373378b9fda71079512803e418f3
|
7
|
+
data.tar.gz: 1f351e2a0d0e5b49cfb952c6763fb0ecd826cc91788ddd8c4cb7c6999a2e02ccdee0f7e1867c730ce09f27029de4e9655a39b3da13d4812d363d14cdb24c322a
|
data/CHANGELOG
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
= 3.4.
|
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
|
-
|
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=> "
|
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('<%=
|
14
|
+
ActiveScaffold.find_action_link('<%= element_form_id(:action => action_name) %>').close();
|
15
15
|
<% end %>
|
16
16
|
<%= render :partial => 'refresh_list' %>
|
17
17
|
<% end %>
|
data/config/locales/de.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
@@ -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}"
|
data/config/locales/fr.yml
CHANGED
@@ -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}"
|
data/config/locales/hu.yml
CHANGED
@@ -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}"
|
data/config/locales/ja.yml
CHANGED
data/config/locales/ru.yml
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
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
|
+
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-
|
11
|
+
date: 2014-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shoulda
|