active_scaffold_vho 3.0.30 → 3.0.31

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,7 @@ $(document).ready(function() {
26
26
  ActiveScaffold.enable_form(as_form);
27
27
  }
28
28
  });
29
- $(document).on('ajax:failure', 'form.as_form', function(event) {
29
+ $(document).on('ajax:error', 'form.as_form', function(event) {
30
30
  var as_div = $(this).closest("div.active-scaffold");
31
31
  if (as_div) {
32
32
  ActiveScaffold.report_500_response(as_div)
@@ -91,7 +91,7 @@ $(document).ready(function() {
91
91
  }
92
92
  return true;
93
93
  });
94
- $(document).on('ajax:failure', 'a.as_action', function(event) {
94
+ $(document).on('ajax:error', 'a.as_action', function(event) {
95
95
  var action_link = ActiveScaffold.ActionLink.get($(this));
96
96
  if (action_link) {
97
97
  ActiveScaffold.report_500_response(action_link.scaffold_id());
@@ -140,7 +140,7 @@ $(document).ready(function() {
140
140
  }
141
141
  return true;
142
142
  });
143
- $(document).on('ajax:failure', 'a.as_cancel', function(event) {
143
+ $(document).on('ajax:error', 'a.as_cancel', function(event) {
144
144
  var action_link = ActiveScaffold.find_action_link($(this));
145
145
  if (action_link) {
146
146
  ActiveScaffold.report_500_response(action_link.scaffold_id());
@@ -154,7 +154,7 @@ $(document).ready(function() {
154
154
  as_sort.closest('th').addClass('loading');
155
155
  return true;
156
156
  });
157
- $(document).on('ajax:failure', 'a.as_sort', function(event) {
157
+ $(document).on('ajax:error', 'a.as_sort', function(event) {
158
158
  var as_scaffold = $(this).closest('.active-scaffold');
159
159
  ActiveScaffold.report_500_response(as_scaffold);
160
160
  return true;
@@ -174,7 +174,7 @@ $(document).ready(function() {
174
174
  loading_indicator.css('visibility','visible');
175
175
  return true;
176
176
  });
177
- $(document).on('ajax:failure', 'div.active-scaffold-footer .pagination a', function(event) {
177
+ $(document).on('ajax:error', 'div.active-scaffold-footer .pagination a', function(event) {
178
178
  var as_scaffold = $(this).closest('.active-scaffold');
179
179
  ActiveScaffold.report_500_response(as_scaffold);
180
180
  return true;
@@ -935,7 +935,9 @@ var ActiveScaffold = {
935
935
  load_embedded_conrollers: function(){
936
936
  $.each($('a.as_link_to_component'), function(index) {
937
937
  var div_element = $(this).closest('div.active-scaffold-component');
938
- div_element.load($(this).attr('href').append_params({embedded: true}));
938
+ div_element.load($(this).attr('href').append_params({embedded: true}), function() {
939
+ ActiveScaffold.trigger_load_events($(this).find('[data-as_load]'));
940
+ });
939
941
  });
940
942
  },
941
943
 
@@ -776,7 +776,7 @@ padding: 6px 0;
776
776
  }
777
777
 
778
778
  .active-scaffold li.form-element dd {
779
- float: left;
779
+ float: none;
780
780
  }
781
781
 
782
782
  .active-scaffold li.form-element dd input[type="checkbox"] {
@@ -1001,9 +1001,9 @@ height: 27px;
1001
1001
  background: url(../../../images/active_scaffold/default/close_touch.png) 0 0 no-repeat;
1002
1002
  }
1003
1003
 
1004
- .as_touch .active-scaffold-pagination a {
1005
- font-size: 20px;
1006
- padding: 3px 10px;
1004
+ .as_touch .active-scaffold-footer .pagination, .as_touch .active-scaffold-footer .pagination a {
1005
+ font-size: 20px;
1006
+ padding: 3px 10px;
1007
1007
  }
1008
1008
 
1009
1009
  .as_touch .active-scaffold-header div.actions a {
@@ -1072,4 +1072,4 @@ padding: 5px 2px 5px 5px;
1072
1072
 
1073
1073
  .as_touch tr.record td {
1074
1074
  padding: 5px 10px;
1075
- }
1075
+ }
@@ -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?
@@ -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',
@@ -137,12 +137,13 @@ module ActiveScaffold
137
137
  def self.split_datetime_format(datetime_format)
138
138
  date_format = datetime_format
139
139
  time_format = nil
140
- time_start_indicators = %w{hh mm tt ss}
140
+ time_start_indicators = %w{HH hh mm tt ss}
141
141
  unless datetime_format.nil?
142
142
  start_indicator = time_start_indicators.detect {|indicator| datetime_format.include?(indicator)}
143
143
  unless start_indicator.nil?
144
144
  pos_time_format = datetime_format.index(start_indicator)
145
145
  date_format = datetime_format.to(pos_time_format - 1)
146
+ date_format.strip!
146
147
  time_format = datetime_format.from(pos_time_format)
147
148
  end
148
149
  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
@@ -5,7 +5,7 @@ module ActiveScaffold
5
5
  module FileColumnHelpers
6
6
  class << self
7
7
  def file_column_fields(klass)
8
- klass.instance_methods.grep(/_just_uploaded\?$/).collect{|m| m[0..-16].to_sym }
8
+ klass.instance_method_names.grep(/_just_uploaded\?$/).collect{|m| m[0..-16].to_sym }
9
9
  end
10
10
 
11
11
  def generate_delete_helpers(klass)
@@ -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")
@@ -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
 
@@ -266,9 +266,11 @@ module ActiveScaffold
266
266
  #TODO not supported by kaminari
267
267
  options[:count_includes] ||= full_includes unless search_conditions.nil?
268
268
 
269
+ #active_scaffold_config.model.skip_total_count = true if options[:pagination] == :infinite
270
+
269
271
  klass = beginning_of_chain
270
272
  klass = klass.where("") if klass.is_a?(Array)
271
-
273
+
272
274
  # create a general-use options array that's compatible with Rails finders
273
275
  finder_options = { :order => options[:sorting].try(:clause),
274
276
  :where => search_conditions,
@@ -140,7 +140,12 @@ module ActiveScaffold
140
140
  if link.type == :member && !options[:authorized]
141
141
  action_link_html(link, nil, {:class => "disabled #{link.action}#{link.html_options[:class].blank? ? '' : (' ' + link.html_options[:class])}"}, record)
142
142
  else
143
- render_action_link(link, url_options, record)
143
+ begin
144
+ render_action_link(link, url_options, record)
145
+ rescue
146
+ Rails.logger.error("render_action_link: exception occured: #{$!} link: #{link.inspect}, url_options: #{url_options.inspect}, options: #{options.inspect}, record: #{record.inspect}")
147
+ action_link_html(link, nil, {:class => "disabled #{link.action}#{link.html_options[:class].blank? ? '' : (' ' + link.html_options[:class])}"}, record)
148
+ end
144
149
  end
145
150
  end
146
151
 
@@ -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)'
@@ -49,6 +50,7 @@ de:
49
50
  _select_: '- Auswählen -'
50
51
  show: 'Anzeigen'
51
52
  show_model: 'Zeige %{model} an'
53
+ 'true': 'Ja'
52
54
  _to_ : ' zu '
53
55
  update: 'Speichern'
54
56
  update_model: 'Editiere %{model}'
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- PATCH = 30
5
+ PATCH = 31
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_vho
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
5
- prerelease:
4
+ hash: 57
5
+ prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 30
10
- version: 3.0.30
9
+ - 31
10
+ version: 3.0.31
11
11
  platform: ruby
12
12
  authors:
13
13
  - Many, see README
@@ -15,7 +15,8 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-01-28 00:00:00 Z
18
+ date: 2014-01-25 00:00:00 +01:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: shoulda
@@ -385,6 +386,7 @@ files:
385
386
  - test/run_all.rb
386
387
  - test/test_helper.rb
387
388
  - uninstall.rb
389
+ has_rdoc: true
388
390
  homepage: http://github.com/vhochstein/active_scaffold
389
391
  licenses:
390
392
  - MIT
@@ -414,7 +416,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
414
416
  requirements: []
415
417
 
416
418
  rubyforge_project:
417
- rubygems_version: 1.8.17
419
+ rubygems_version: 1.3.7
418
420
  signing_key:
419
421
  specification_version: 3
420
422
  summary: Rails 3 Version of activescaffold supporting prototype and jquery