active_scaffold_vho 3.1.6 → 3.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_scaffold_vho (3.1.6)
4
+ active_scaffold_vho (3.1.7)
5
5
  kaminari
6
6
  rails (>= 3.1.0)
7
7
 
@@ -937,7 +937,9 @@ var ActiveScaffold = {
937
937
  load_embedded_conrollers: function(){
938
938
  $.each($('a.as_link_to_component'), function(index) {
939
939
  var div_element = $(this).closest('div.active-scaffold-component');
940
- div_element.load($(this).attr('href').append_params({embedded: true}));
940
+ div_element.load($(this).attr('href').append_params({embedded: true}), function() {
941
+ ActiveScaffold.trigger_load_events($(this).find('[data-as_load]'));
942
+ });
941
943
  });
942
944
  },
943
945
 
@@ -1176,12 +1178,20 @@ ActiveScaffold.ActionLink.Record = ActiveScaffold.ActionLink.Abstract.extend({
1176
1178
 
1177
1179
  if (this.position == 'after') {
1178
1180
  this.target.after(this.wrap_with_adapter_html(content, should_refresh_data));
1179
- ActiveScaffold.trigger_load_events(this.target.next().find('.records').first().find('> [data-as_load]'));
1181
+ if(this.action == 'index') {
1182
+ ActiveScaffold.trigger_load_events(this.target.next().find('.records').first().find('> [data-as_load]'));
1183
+ } else {
1184
+ ActiveScaffold.trigger_load_events(this.target.next().find('[data-as_load]'));
1185
+ }
1180
1186
  this.set_adapter(this.target.next());
1181
1187
  }
1182
1188
  else if (this.position == 'before') {
1183
1189
  this.target.before(this.wrap_with_adapter_html(content, should_refresh_data));
1184
- ActiveScaffold.trigger_load_events(this.target.prev().find('.records').first().find('> [data-as_load]'));
1190
+ if (this.action == 'index') {
1191
+ ActiveScaffold.trigger_load_events(this.target.prev().find('.records').first().find('> [data-as_load]'));
1192
+ } else {
1193
+ ActiveScaffold.trigger_load_events(this.target.prev().find('[data-as_load]'));
1194
+ }
1185
1195
  this.set_adapter(this.target.prev());
1186
1196
  }
1187
1197
  else {
@@ -1224,7 +1234,11 @@ ActiveScaffold.ActionLink.Record = ActiveScaffold.ActionLink.Abstract.extend({
1224
1234
  }
1225
1235
  if (!new_adapter.hasClass('as_adapter')) {
1226
1236
  new_adapter = ActiveScaffold.replace(new_adapter, this.wrap_with_adapter_html(new_adapter.children(':first-child').html(), should_refresh_data), true);
1227
- ActiveScaffold.trigger_load_events(new_adapter.find('.records').first().find('> [data-as_load]'));
1237
+ if (this.action == 'index') {
1238
+ ActiveScaffold.trigger_load_events(new_adapter.find('.records').first().find('> [data-as_load]'));
1239
+ } else {
1240
+ ActiveScaffold.trigger_load_events(new_adapter.find('[data-as_load]'));
1241
+ }
1228
1242
  }
1229
1243
  this.set_adapter(new_adapter);
1230
1244
  this.disable();
@@ -530,9 +530,10 @@ color: #ccc;
530
530
  }
531
531
 
532
532
  .active-scaffold-footer .pagination {
533
- float: right;
533
+ text-align: right;
534
534
  white-space: nowrap;
535
535
  margin-right: 5px;
536
+ font: bold 12px arial, sans-serif;
536
537
  }
537
538
 
538
539
  .blue-theme .active-scaffold-footer .active-scaffold-records {
@@ -543,8 +544,7 @@ margin-left: 5px;
543
544
  text-decoration: none;
544
545
  letter-spacing: 0;
545
546
  padding: 0 2px;
546
- margin: 0 -2px;
547
- font: bold 12px arial, sans-serif;
547
+ margin: 0;
548
548
  }
549
549
 
550
550
  .blue-theme .active-scaffold-footer a,
@@ -777,7 +777,7 @@ padding: 6px 0;
777
777
  }
778
778
 
779
779
  .active-scaffold li.form-element dd {
780
- float: left;
780
+ float: none;
781
781
  }
782
782
 
783
783
  .active-scaffold li.form-element dd input[type="checkbox"] {
@@ -1002,9 +1002,9 @@ height: 27px;
1002
1002
  background: url(<%= asset_data_uri 'close_touch.png' %>) 0 0 no-repeat;
1003
1003
  }
1004
1004
 
1005
- .as_touch .active-scaffold-pagination a {
1006
- font-size: 20px;
1007
- padding: 3px 10px;
1005
+ .as_touch .active-scaffold-footer .pagination, .as_touch .active-scaffold-footer .pagination a {
1006
+ font-size: 20px;
1007
+ padding: 3px 10px;
1008
1008
  }
1009
1009
 
1010
1010
  .as_touch .active-scaffold-header div.actions a {
@@ -5,6 +5,7 @@
5
5
  <% if request.xhr? %>
6
6
  <a href="#" onclick="ActiveScaffold.remove(this.parentNode); return false;" title="<%= as_(:close) %>"><%= as_(:close) %></a>
7
7
  <% end %>
8
+ <% flash[name] = nil %>
8
9
  </div>
9
10
  <% end %>
10
11
  <% end %>
@@ -43,12 +43,16 @@ module ActiveScaffold::Actions
43
43
  end
44
44
 
45
45
  def do_search
46
- unless search_params.nil?
46
+ prepare_search_conditions(search_params)
47
+ end
48
+
49
+ def prepare_search_conditions(params)
50
+ unless params.nil?
47
51
  text_search = active_scaffold_config.field_search.text_search
48
52
  search_conditions = []
49
53
  human_condition_columns = [] if active_scaffold_config.field_search.human_conditions
50
54
  columns = field_search_columns
51
- search_params.each do |key, value|
55
+ params.each do |key, value|
52
56
  next unless columns.include? key
53
57
  search_condition = self.class.condition_for_column(active_scaffold_config.columns[key], value, text_search)
54
58
  unless search_condition.blank?
@@ -83,7 +83,7 @@ module ActiveScaffold::Actions
83
83
 
84
84
  def beginning_of_chain
85
85
  if nested? && nested.association && nested.association.collection?
86
- nested.parent_scope.send(nested.association.name).where("")
86
+ nested.parent_scope.send(nested.association.name)
87
87
  elsif nested? && nested.scope
88
88
  nested.parent_scope.send(nested.scope)
89
89
  else
@@ -3,7 +3,7 @@ ActiveScaffold::Bridges.bridge "CalendarDateSelect" do
3
3
  # check to see if the old bridge was installed. If so, warn them
4
4
  # we can detect this by checking to see if the bridge was installed before calling this code
5
5
 
6
- if ActiveScaffold::Config::Core.instance_methods.include?("initialize_with_calendar_date_select")
6
+ if ActiveScaffold::Config::Core.instance_method_names.include?("initialize_with_calendar_date_select")
7
7
  raise RuntimeError, "We've detected that you have active_scaffold_calendar_date_select_bridge installed. This plugin has been moved to core. Please remove active_scaffold_calendar_date_select_bridge to prevent any conflicts"
8
8
  end
9
9
 
@@ -41,7 +41,7 @@ module ActiveScaffold
41
41
  '%m' => 'mm',
42
42
  '%y' => 'y',
43
43
  '%Y' => 'yy',
44
- '%H' => 'hh', # options ampm => false
44
+ '%H' => 'HH', # options ampm => false
45
45
  '%I' => 'hh', # options ampm => true
46
46
  '%M' => 'mm',
47
47
  '%p' => 'tt',
@@ -168,12 +168,13 @@ module ActiveScaffold
168
168
  def self.split_datetime_format(datetime_format)
169
169
  date_format = datetime_format
170
170
  time_format = nil
171
- time_start_indicators = %w{hh mm tt ss}
171
+ time_start_indicators = %w{HH hh mm tt ss}
172
172
  unless datetime_format.nil?
173
173
  start_indicator = time_start_indicators.detect {|indicator| datetime_format.include?(indicator)}
174
174
  unless start_indicator.nil?
175
175
  pos_time_format = datetime_format.index(start_indicator)
176
176
  date_format = datetime_format.to(pos_time_format - 1)
177
+ date_format.strip!
177
178
  time_format = datetime_format.from(pos_time_format)
178
179
  end
179
180
  end
@@ -1,6 +1,6 @@
1
1
  ActiveScaffold::Bridges.bridge "FileColumn" do
2
2
  install do
3
- if ActiveScaffold::Config::Core.instance_methods.include?("initialize_with_file_column")
3
+ if ActiveScaffold::Config::Core.instance_method_names.include?("initialize_with_file_column")
4
4
  raise RuntimeError, "We've detected that you have active_scaffold_file_column_bridge installed. This plugin has been moved to core. Please remove active_scaffold_file_column_bridge to prevent any conflicts"
5
5
  end
6
6
  require File.join(File.dirname(__FILE__), "lib/as_file_column_bridge")
@@ -24,7 +24,7 @@ module ActiveScaffold::Config
24
24
  }
25
25
  end
26
26
 
27
- alias_method_chain :initialize, :file_column unless self.instance_methods.include?("initialize_without_file_column")
27
+ alias_method_chain :initialize, :file_column unless self.instance_method_names.include?("initialize_without_file_column")
28
28
 
29
29
  def configure_file_column_field(field)
30
30
  # set list_ui first because it gets its default value from form_ui
@@ -1,6 +1,6 @@
1
1
  ActiveScaffold::Bridges.bridge "Paperclip" do
2
2
  install do
3
- if ActiveScaffold::Config::Core.instance_methods.include?("initialize_with_paperclip")
3
+ if ActiveScaffold::Config::Core.instance_method_names.include?("initialize_with_paperclip")
4
4
  raise RuntimeError, "We've detected that you have active_scaffold_paperclip_bridge installed. This plugin has been moved to core. Please remove active_scaffold_paperclip_bridge to prevent any conflicts"
5
5
  end
6
6
  require File.join(File.dirname(__FILE__), "lib/form_ui")
@@ -7,7 +7,7 @@ module ActiveScaffold
7
7
  self.thumbnail_style = :thumbnail
8
8
 
9
9
  def self.generate_delete_helper(klass, field)
10
- klass.class_eval <<-EOF, __FILE__, __LINE__ + 1 unless klass.instance_methods.include?("delete_#{field}=")
10
+ klass.class_eval <<-EOF, __FILE__, __LINE__ + 1 unless klass.instance_method_names.include?("delete_#{field}=")
11
11
  attr_reader :delete_#{field}
12
12
 
13
13
  def delete_#{field}=(value)
@@ -188,7 +188,16 @@ module ActiveScaffold::DataStructures
188
188
  end
189
189
 
190
190
  def stripped_value(value)
191
- stripable? ? value.strip : value
191
+ if stripable?
192
+ begin
193
+ value.strip
194
+ rescue
195
+ Rails.logger.error("stripped_value: column #{self.name} is a db text column, but value is nt a string: #{value.inspect}. Please define column[:#{self.name}].stripable = false in config")
196
+ value
197
+ end
198
+ else
199
+ value
200
+ end
192
201
  end
193
202
 
194
203
  # to set how many associated records a column with plural association must show in list
@@ -266,6 +266,7 @@ module ActiveScaffold
266
266
  options[:count_includes] ||= full_includes unless search_conditions.nil?
267
267
 
268
268
  klass = beginning_of_chain
269
+ klass = klass.where("") if klass.is_a?(Array)
269
270
 
270
271
  # create a general-use options array that's compatible with Rails finders
271
272
  finder_options = { :order => options[:sorting].try(:clause),
@@ -146,7 +146,12 @@ module ActiveScaffold
146
146
  if link.type == :member && !options[:authorized]
147
147
  action_link_html(link, nil, {:class => "disabled #{link.action}#{link.html_options[:class].blank? ? '' : (' ' + link.html_options[:class])}"}, record)
148
148
  else
149
- render_action_link(link, url_options, record)
149
+ begin
150
+ render_action_link(link, url_options, record)
151
+ rescue
152
+ Rails.logger.error("render_action_link: exception occured: #{$!} link: #{link.inspect}, url_options: #{url_options.inspect}, options: #{options.inspect}, record: #{record.inspect}")
153
+ action_link_html(link, nil, {:class => "disabled #{link.action}#{link.html_options[:class].blank? ? '' : (' ' + link.html_options[:class])}"}, record)
154
+ end
150
155
  end
151
156
  end
152
157
 
@@ -22,6 +22,7 @@ de:
22
22
  download: 'Download'
23
23
  edit: 'Bearbeiten'
24
24
  export: 'Exportieren'
25
+ 'false': 'Nein'
25
26
  nested_for_model: '%{nested_model} für %{parent_model}'
26
27
  nested_of_model: '%{nested_model} von %{parent_model}'
27
28
  filtered: '(Gefiltert)'
@@ -50,6 +51,7 @@ de:
50
51
  show: 'Anzeigen'
51
52
  show_model: 'Zeige %{model} an'
52
53
  _to_ : ' zu '
54
+ 'true': 'Ja'
53
55
  update: 'Speichern'
54
56
  update_model: 'Editiere %{model}'
55
57
  updated_model: '%{model} aktualisiert'
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- PATCH = 6
5
+ PATCH = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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.1.6
4
+ version: 3.1.8
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: 2013-01-28 00:00:00.000000000 Z
12
+ date: 2014-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
16
- requirement: &5201540 !ruby/object:Gem::Requirement
16
+ requirement: &19626940 !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: *5201540
24
+ version_requirements: *19626940
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &5165600 !ruby/object:Gem::Requirement
27
+ requirement: &19626440 !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: *5165600
35
+ version_requirements: *19626440
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rcov
38
- requirement: &5157800 !ruby/object:Gem::Requirement
38
+ requirement: &19625940 !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: *5157800
46
+ version_requirements: *19625940
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rails
49
- requirement: &5155320 !ruby/object:Gem::Requirement
49
+ requirement: &19625380 !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: *5155320
57
+ version_requirements: *19625380
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: kaminari
60
- requirement: &5153520 !ruby/object:Gem::Requirement
60
+ requirement: &19625000 !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: *5153520
68
+ version_requirements: *19625000
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
@@ -378,9 +378,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
378
378
  - - ! '>='
379
379
  - !ruby/object:Gem::Version
380
380
  version: '0'
381
- segments:
382
- - 0
383
- hash: -3291551366358840762
384
381
  required_rubygems_version: !ruby/object:Gem::Requirement
385
382
  none: false
386
383
  requirements: