active_scaffold_vho 3.1.8 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +8 -8
- data/app/assets/javascripts/jquery/active_scaffold.js +4 -12
- data/frontends/default/views/destroy.js.erb +1 -1
- data/frontends/default/views/on_create.js.erb +3 -3
- data/frontends/default/views/on_mark_all.js.erb +3 -3
- data/frontends/default/views/on_update.js.erb +3 -3
- data/lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb +7 -0
- data/lib/active_scaffold/finder.rb +2 -8
- data/lib/active_scaffold/helpers/form_column_helpers.rb +6 -2
- data/lib/active_scaffold/version.rb +2 -2
- metadata +12 -12
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_scaffold_vho (3.1.
|
4
|
+
active_scaffold_vho (3.1.8)
|
5
5
|
kaminari
|
6
6
|
rails (>= 3.1.0)
|
7
7
|
|
@@ -39,9 +39,9 @@ GEM
|
|
39
39
|
builder (3.0.4)
|
40
40
|
erubis (2.7.0)
|
41
41
|
hike (1.2.1)
|
42
|
-
i18n (0.6.
|
42
|
+
i18n (0.6.4)
|
43
43
|
journey (1.0.4)
|
44
|
-
json (1.
|
44
|
+
json (1.8.0)
|
45
45
|
kaminari (0.14.1)
|
46
46
|
actionpack (>= 3.0.0)
|
47
47
|
activesupport (>= 3.0.0)
|
@@ -49,8 +49,8 @@ GEM
|
|
49
49
|
i18n (>= 0.4.0)
|
50
50
|
mime-types (~> 1.16)
|
51
51
|
treetop (~> 1.4.8)
|
52
|
-
mime-types (1.
|
53
|
-
multi_json (1.
|
52
|
+
mime-types (1.25)
|
53
|
+
multi_json (1.7.8)
|
54
54
|
polyglot (0.3.3)
|
55
55
|
rack (1.4.4)
|
56
56
|
rack-cache (1.2)
|
@@ -74,7 +74,7 @@ GEM
|
|
74
74
|
rake (>= 0.8.7)
|
75
75
|
rdoc (~> 3.4)
|
76
76
|
thor (>= 0.14.6, < 2.0)
|
77
|
-
rake (10.0
|
77
|
+
rake (10.1.0)
|
78
78
|
rcov (0.9.9)
|
79
79
|
rdoc (3.12)
|
80
80
|
json (~> 1.4)
|
@@ -84,12 +84,12 @@ GEM
|
|
84
84
|
multi_json (~> 1.0)
|
85
85
|
rack (~> 1.0)
|
86
86
|
tilt (~> 1.1, != 1.3.0)
|
87
|
-
thor (0.
|
87
|
+
thor (0.18.1)
|
88
88
|
tilt (1.3.3)
|
89
89
|
treetop (1.4.12)
|
90
90
|
polyglot
|
91
91
|
polyglot (>= 0.3.1)
|
92
|
-
tzinfo (0.3.
|
92
|
+
tzinfo (0.3.37)
|
93
93
|
|
94
94
|
PLATFORMS
|
95
95
|
ruby
|
@@ -814,21 +814,13 @@ var ActiveScaffold = {
|
|
814
814
|
var mark_checkboxes = $('#' + element.attr('id') + ' > tr.record td.marked-column input[type="checkbox"]');
|
815
815
|
mark_checkboxes.each(function (index) {
|
816
816
|
var item = $(this);
|
817
|
-
|
818
|
-
|
819
|
-
} else {
|
820
|
-
item.removeAttr('checked');
|
821
|
-
}
|
822
|
-
item.attr('value', ('' + !options.checked));
|
817
|
+
item.prop('checked', (options.checked === true));
|
818
|
+
item.prop('value', ('' + !options.checked));
|
823
819
|
});
|
824
820
|
if(options.include_mark_all === true) {
|
825
821
|
var mark_all_checkbox = element.prev('thead').find('th.marked-column_heading span input[type="checkbox"]');
|
826
|
-
|
827
|
-
|
828
|
-
} else {
|
829
|
-
mark_all_checkbox.removeAttr('checked');
|
830
|
-
}
|
831
|
-
mark_all_checkbox.attr('value', ('' + !options.checked));
|
822
|
+
mark_all_checkbox.prop('checked', (options.checked === true));
|
823
|
+
mark_all_checkbox.prop('value', ('' + !options.checked));
|
832
824
|
}
|
833
825
|
},
|
834
826
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
ActiveScaffold.delete_record_row('<%=element_row_id(:controller_id => "as_#{id_from_controller(params[:eid] || params[:parent_sti])}", :action => 'list', :id => params[:id])%>', '<%=url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max, :escape => false))%>');
|
8
8
|
<%messages_id = active_scaffold_messages_id(:controller_id => "as_#{id_from_controller(params[:eid] || params[:parent_sti])}")%>
|
9
9
|
<%elsif render_parent_action == :index%>
|
10
|
-
<%=
|
10
|
+
<%= controller.send(:render_component_into_view, render_parent_options)%>
|
11
11
|
<%end%>
|
12
12
|
<%#page.call 'ActiveScaffold.replace', active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?}%>
|
13
13
|
<%elsif (active_scaffold_config.delete.refresh_list)%>
|
@@ -7,12 +7,12 @@ action_link.update_flash_messages('<%=escape_javascript(render(:partial => 'mess
|
|
7
7
|
<% if render_parent? && controller.respond_to?(:render_component_into_view) %>
|
8
8
|
<% parent_rendered = controller.send(:render_component_into_view, render_parent_options) %>
|
9
9
|
<% if nested_singular_association? %>
|
10
|
-
action_link.close('<%= escape_javascript(parent_rendered)%>');
|
10
|
+
action_link.close('<%= escape_javascript(parent_rendered) %>');
|
11
11
|
<% else %>
|
12
12
|
<% if render_parent_action == :row %>
|
13
|
-
ActiveScaffold.create_record_row(action_link.scaffold(),'<%=
|
13
|
+
ActiveScaffold.create_record_row(action_link.scaffold(),'<%= escape_javascript(parent_rendered) %>', <%= {:insert_at => insert_at}.to_json.html_safe %>);
|
14
14
|
<% elsif render_parent_action == :index %>
|
15
|
-
<%=
|
15
|
+
<%= parent_rendered %>
|
16
16
|
<% end %>
|
17
17
|
action_link.close();
|
18
18
|
<% end %>
|
@@ -2,10 +2,10 @@
|
|
2
2
|
:include_mark_all => true}%>
|
3
3
|
ActiveScaffold.mark_records('<%=active_scaffold_tbody_id%>',<%=options.to_json.html_safe%>);
|
4
4
|
<%if active_scaffold_config.model.marked.length>0 then %>
|
5
|
-
<%if active_scaffold_config.model.marked.length < @
|
6
|
-
ActiveScaffold.replace_html('<%=active_scaffold_messages_id%>','<%="#{active_scaffold_config.model.marked.length.to_s} records marked. Press <a href=\"#{url_for(:action=>"mark_all",:mark_target=>"scope")}\">here</a> to select all #{@
|
5
|
+
<%if active_scaffold_config.model.marked.length < @records.count then%>
|
6
|
+
ActiveScaffold.replace_html('<%=active_scaffold_messages_id%>','<%="#{active_scaffold_config.model.marked.length.to_s} records marked. Press <a href=\"#{url_for(:action=>"mark_all",:mark_target=>"scope")}\">here</a> to select all #{@records.count} records.".html_safe%>');
|
7
7
|
<%else%>
|
8
|
-
ActiveScaffold.replace_html('<%=active_scaffold_messages_id%>','<%="All #{@
|
8
|
+
ActiveScaffold.replace_html('<%=active_scaffold_messages_id%>','<%="All #{@records.count} records marked".html_safe%>');
|
9
9
|
<%end%>
|
10
10
|
<%else%>
|
11
11
|
ActiveScaffold.replace_html('<%=active_scaffold_messages_id%>','');
|
@@ -6,12 +6,12 @@ action_link.update_flash_messages('<%=escape_javascript(render(:partial => 'mess
|
|
6
6
|
<% if render_parent? && controller.respond_to?(:render_component_into_view) %>
|
7
7
|
<% parent_rendered = controller.send(:render_component_into_view, render_parent_options) %>
|
8
8
|
<% if nested_singular_association? %>
|
9
|
-
action_link.close('<%= escape_javascript(parent_rendered)%>');
|
9
|
+
action_link.close('<%= escape_javascript(parent_rendered) %>');
|
10
10
|
<% else %>
|
11
11
|
<% if render_parent_action == :row %>
|
12
|
-
action_link.close('<%= escape_javascript(parent_rendered)%>');
|
12
|
+
action_link.close('<%= escape_javascript(parent_rendered) %>');
|
13
13
|
<% elsif render_parent_action == :index %>
|
14
|
-
<%=
|
14
|
+
<%= parent_rendered %>
|
15
15
|
<% end %>
|
16
16
|
<% end %>
|
17
17
|
<%#page.call 'ActiveScaffold.replace', active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?}%>
|
@@ -1,3 +1,6 @@
|
|
1
|
+
include Sprockets::Helpers::RailsHelper
|
2
|
+
include Sprockets::Helpers::IsolatedHelper
|
3
|
+
|
1
4
|
class File #:nodoc:
|
2
5
|
|
3
6
|
unless File.respond_to?(:binread)
|
@@ -95,6 +98,10 @@ module ActiveScaffold
|
|
95
98
|
Rails.logger.warn "ActiveScaffold: Missing date picker localization for your locale: #{locale}"
|
96
99
|
end
|
97
100
|
|
101
|
+
unless date_picker_options[:buttonImage].nil?
|
102
|
+
date_picker_options[:buttonImage] = asset_path(date_picker_options[:buttonImage])
|
103
|
+
end
|
104
|
+
|
98
105
|
js_format = self.to_datepicker_format(date_options[:formats][:default])
|
99
106
|
date_picker_options[:dateFormat] = js_format unless js_format.nil?
|
100
107
|
date_picker_options
|
@@ -269,7 +269,7 @@ module ActiveScaffold
|
|
269
269
|
klass = klass.where("") if klass.is_a?(Array)
|
270
270
|
|
271
271
|
# create a general-use options array that's compatible with Rails finders
|
272
|
-
finder_options = { :
|
272
|
+
finder_options = { :reorder => options[:sorting].try(:clause),
|
273
273
|
:where => search_conditions,
|
274
274
|
:joins => joins_for_finder,
|
275
275
|
:includes => add_association_to_includes_for_sorting(options[:sorting], full_includes)}
|
@@ -302,14 +302,8 @@ module ActiveScaffold
|
|
302
302
|
end
|
303
303
|
|
304
304
|
def append_to_query(query, options)
|
305
|
-
options.assert_valid_keys :where, :select, :group, :
|
305
|
+
options.assert_valid_keys :where, :select, :group, :reorder, :limit, :offset, :joins, :includes, :lock, :readonly, :from
|
306
306
|
options.reject{|k, v| v.blank?}.inject(query) do |query, (k, v)|
|
307
|
-
# default ordering of model has a higher priority than current queries ordering
|
308
|
-
# fix this by removing existing ordering from arel
|
309
|
-
if k.to_sym == :order
|
310
|
-
query = query.where('1=1') unless query.is_a?(ActiveRecord::Relation)
|
311
|
-
query = query.except(:order)
|
312
|
-
end
|
313
307
|
query.send((k.to_sym), v)
|
314
308
|
end
|
315
309
|
end
|
@@ -257,8 +257,12 @@ module ActiveScaffold
|
|
257
257
|
|
258
258
|
# the naming convention for overriding form fields with partials
|
259
259
|
def override_form_field_partial(column)
|
260
|
-
|
261
|
-
|
260
|
+
begin
|
261
|
+
path = active_scaffold_controller_for(column.active_record_class).controller_path
|
262
|
+
File.join(path, "#{clean_column_name(column.name)}_form_column")
|
263
|
+
rescue ActiveScaffold::ControllerNotFound => e
|
264
|
+
nil
|
265
|
+
end
|
262
266
|
end
|
263
267
|
|
264
268
|
def override_form_field(column)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold_vho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: shoulda
|
16
|
-
requirement: &
|
16
|
+
requirement: &22098540 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *22098540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &22114420 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *22114420
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rcov
|
38
|
-
requirement: &
|
38
|
+
requirement: &22113940 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *22113940
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &22113460 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 3.1.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *22113460
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: kaminari
|
60
|
-
requirement: &
|
60
|
+
requirement: &22113080 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *22113080
|
69
69
|
description: Save time and headaches, and create a more easily maintainable set of
|
70
70
|
pages, with ActiveScaffold. ActiveScaffold handles all your CRUD (create, read,
|
71
71
|
update, delete) user interface needs, leaving you more time to focus on more challenging
|