active_scaffold 3.1.10 → 3.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,7 +72,8 @@ $(document).ready(function() {
72
72
 
73
73
  if (action_link) {
74
74
  var cancel_url = as_cancel.attr('href');
75
- if (typeof(cancel_url) == 'undefined' || cancel_url.length == 0) {
75
+ var refresh_data = as_cancel.attr('data-refresh');
76
+ if (refresh_data !== 'true' || !cancel_url) {
76
77
  action_link.close();
77
78
  return false;
78
79
  }
@@ -0,0 +1,7 @@
1
+ var action_link_close = ActiveScaffold.ActionLink.Abstract.prototype.close;
2
+ ActiveScaffold.ActionLink.Abstract.prototype.close = function() {
3
+ $(this.adapter).find('textarea.mceEditor').each(function(index, elem) {
4
+ tinyMCE.execCommand('mceRemoveControl', false, $(elem).attr('id'));
5
+ });
6
+ action_link_close.apply(this);
7
+ };
@@ -0,0 +1,7 @@
1
+ var action_link_close = ActiveScaffold.ActionLink.Abstract.prototype.close;
2
+ ActiveScaffold.ActionLink.Abstract.prototype.close = function() {
3
+ this.adapter.select('textarea.mceEditor').each(function(elem) {
4
+ tinyMCE.execCommand('mceRemoveControl', false, elem.id);
5
+ });
6
+ action_link_close.apply(this);
7
+ };
@@ -1,7 +1,7 @@
1
1
  de:
2
2
  time:
3
3
  formats:
4
- picker: "%a, %d %b %Y %H:%M:%S"
4
+ picker: "%d.%m.%Y %H:%M"
5
5
  active_scaffold:
6
6
  add: 'Hinzufügen'
7
7
  add_existing: 'Existierenden Eintrag hinzufügen'
@@ -65,7 +65,7 @@ de:
65
65
  between: 'Zwischen'
66
66
  contains: 'Enthält'
67
67
  begins_with: 'Beginnt'
68
- ends_with: 'Ended'
68
+ ends_with: 'Endet'
69
69
  today: 'Heute'
70
70
  yesterday: 'Gestern'
71
71
  tomorrow: 'Morgen'
@@ -36,7 +36,7 @@ module ActiveScaffold::Actions
36
36
  params.delete(:embedded)
37
37
  render(:partial => 'list_with_header')
38
38
  else
39
- render :action => 'list.js'
39
+ render :action => 'refresh_list.js'
40
40
  end
41
41
  end
42
42
  def list_respond_to_xml
@@ -17,8 +17,6 @@ module ActiveScaffold::Actions
17
17
 
18
18
  def list
19
19
  do_list
20
- do_new if active_scaffold_config.list.always_show_create
21
- @record ||= new_model if active_scaffold_config.list.always_show_search
22
20
  @nested_auto_open = active_scaffold_config.list.nested_auto_open
23
21
  respond_to_action(:list)
24
22
  end
@@ -85,6 +85,7 @@ module ActiveScaffold
85
85
  record = find_or_create_for_params(attributes, column, parent_record)
86
86
  if record
87
87
  record_columns = active_scaffold_config_for(column.association.klass).subform.columns
88
+ record_columns.constraint_columns = [column.association.reverse]
88
89
  update_record_from_params(record, record_columns, attributes)
89
90
  record.unsaved = true
90
91
  end
@@ -85,6 +85,8 @@ module ActiveScaffold
85
85
  record = find_or_create_for_params(attributes, column, parent_record)
86
86
  if record
87
87
  record_columns = active_scaffold_config_for(column.association.klass).subform.columns
88
+ record_columns.constraint_columns = [column.association.reverse]
89
+ debugger
88
90
  update_record_from_params(record, record_columns, attributes)
89
91
  record.unsaved = true
90
92
  end
@@ -101,7 +103,6 @@ module ActiveScaffold
101
103
  end
102
104
 
103
105
  def column_value_from_param_simple_value(parent_record, column, value)
104
- debugger if column.name == :working_days
105
106
  if column.singular_association?
106
107
  # it's a single id
107
108
  column.association.klass.find(value) if value and not value.empty?
@@ -2,4 +2,16 @@ class ActiveScaffold::Bridges::TinyMce < ActiveScaffold::DataStructures::Bridge
2
2
  def self.install
3
3
  require File.join(File.dirname(__FILE__), "tiny_mce/helpers.rb")
4
4
  end
5
+
6
+ def self.install?
7
+ Object.const_defined? "TinyMCE"
8
+ end
9
+
10
+ def self.javascripts
11
+ if ActiveScaffold.js_framework == :jquery
12
+ ['tinymce-jquery', 'jquery/tiny_mce_bridge']
13
+ else
14
+ ['tinymce', 'prototype/tiny_mce_bridge']
15
+ end
16
+ end
5
17
  end
@@ -4,34 +4,6 @@ class ActiveScaffold::Bridges::TinyMce
4
4
  base.class_eval do
5
5
  include FormColumnHelpers
6
6
  include SearchColumnHelpers
7
- include ViewHelpers
8
- end
9
- end
10
-
11
- module ViewHelpers
12
- def active_scaffold_includes(*args)
13
- if ActiveScaffold.js_framework == :jquery
14
- tiny_mce_js = javascript_tag(%|
15
- var action_link_close = ActiveScaffold.ActionLink.Abstract.prototype.close;
16
- ActiveScaffold.ActionLink.Abstract.prototype.close = function() {
17
- $(this.adapter).find('textarea.mceEditor').each(function(index, elem) {
18
- tinyMCE.execCommand('mceRemoveControl', false, $(elem).attr('id'));
19
- });
20
- action_link_close.apply(this);
21
- };
22
- |) if using_tiny_mce?
23
- else
24
- tiny_mce_js = javascript_tag(%|
25
- var action_link_close = ActiveScaffold.ActionLink.Abstract.prototype.close;
26
- ActiveScaffold.ActionLink.Abstract.prototype.close = function() {
27
- this.adapter.select('textarea.mceEditor').each(function(elem) {
28
- tinyMCE.execCommand('mceRemoveControl', false, elem.id);
29
- });
30
- action_link_close.apply(this);
31
- };
32
- |) if using_tiny_mce?
33
- end
34
- super(*args) + (include_tiny_mce_if_needed || '') + (tiny_mce_js || '')
35
7
  end
36
8
  end
37
9
 
@@ -48,13 +20,13 @@ ActiveScaffold.ActionLink.Abstract.prototype.close = function() {
48
20
  html.join "\n"
49
21
  end
50
22
 
51
- def onsubmit
23
+ def onsubmit_with_tiny_mce
52
24
  if ActiveScaffold.js_framework == :jquery
53
- submit_js = 'tinyMCE.triggerSave();$(\'textarea.mceEditor\').each(function(index, elem) { tinyMCE.execCommand(\'mceRemoveControl\', false, $(elem).attr(\'id\')); });' if using_tiny_mce?
25
+ submit_js = 'tinyMCE.triggerSave();$(\'textarea.mceEditor\').each(function(index, elem) { tinyMCE.execCommand(\'mceRemoveControl\', false, $(elem).attr(\'id\')); });'
54
26
  else
55
- submit_js = 'tinyMCE.triggerSave();this.select(\'textarea.mceEditor\').each(function(elem) { tinyMCE.execCommand(\'mceRemoveControl\', false, elem.id); });' if using_tiny_mce?
27
+ submit_js = 'tinyMCE.triggerSave();this.select(\'textarea.mceEditor\').each(function(elem) { tinyMCE.execCommand(\'mceRemoveControl\', false, elem.id); });'
56
28
  end
57
- [super, submit_js].compact.join ';'
29
+ [onsubmit_without_tiny_mce, submit_js].compact.join ';'
58
30
  end
59
31
  end
60
32
 
@@ -8,7 +8,7 @@ module ActionController #:nodoc:
8
8
  opts = args.blank? ? Hash.new : args.first
9
9
  render :partial => params[:adapter][1..-1],
10
10
  :locals => {:payload => render_to_string(opts.merge(:layout => false), &block).html_safe},
11
- :use_full_path => true, :layout => false
11
+ :use_full_path => true, :layout => false, :content_type => :html
12
12
  @rendering_adapter = nil # recursion control
13
13
  else
14
14
  render_without_active_scaffold(*args, &block)
@@ -1,5 +1,6 @@
1
1
  module ActionView
2
2
  class LookupContext
3
+ attr_accessor :uses_active_scaffold
3
4
  module ViewPaths
4
5
  def find_all_templates(name, partial = false, locals = {})
5
6
  prefixes.collect do |prefix|
@@ -11,6 +12,17 @@ module ActionView
11
12
  end.flatten!
12
13
  end
13
14
  end
15
+
16
+ # Overload formats= to expand ["*/*"] values and automatically
17
+ # add :html as fallback to :js.
18
+ def formats=(values)
19
+ debugger
20
+ if values == [:js] && uses_active_scaffold
21
+ _set_detail(:formats, values) if values != @details[:formats]
22
+ else
23
+ super(values)
24
+ end
25
+ end
14
26
  end
15
27
  end
16
28
 
@@ -49,7 +61,7 @@ module ActionView::Helpers #:nodoc:
49
61
  last_view[:templates] = lookup_context.find_all_templates(last_view[:view], last_view[:partial], options[:locals].keys)
50
62
  last_view[:templates].shift
51
63
  end
52
- options[:file] = last_view[:templates].shift
64
+ options[:template] = last_view[:templates].shift
53
65
  view_stack << last_view
54
66
  result = render_without_active_scaffold options
55
67
  view_stack.pop
@@ -96,7 +96,7 @@ module ActiveScaffold
96
96
  elsif value[:from].blank?
97
97
  nil
98
98
  elsif ActiveScaffold::Finder::StringComparators.values.include?(value[:opt])
99
- ["#{column.search_sql} LIKE ?", value[:opt].sub('?', value[:from])]
99
+ ["#{column.search_sql} #{ActiveScaffold::Finder.like_operator} ?", value[:opt].sub('?', value[:from])]
100
100
  elsif value[:opt] == 'BETWEEN'
101
101
  ["#{column.search_sql} BETWEEN ? AND ?", value[:from], value[:to]]
102
102
  elsif ActiveScaffold::Finder::NumericComparators.include?(value[:opt])
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- PATCH = 10
5
+ PATCH = 11
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
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
- - 10
10
- version: 3.1.10
9
+ - 11
10
+ version: 3.1.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Many, see README
@@ -15,10 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-21 00:00:00 Z
18
+ date: 2011-12-12 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
22
22
  none: false
23
23
  requirements:
24
24
  - - ">="
@@ -27,12 +27,12 @@ dependencies:
27
27
  segments:
28
28
  - 0
29
29
  version: "0"
30
+ requirement: *id001
31
+ prerelease: false
30
32
  type: :development
31
33
  name: shoulda
32
- version_requirements: *id001
33
- prerelease: false
34
34
  - !ruby/object:Gem::Dependency
35
- requirement: &id002 !ruby/object:Gem::Requirement
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
36
36
  none: false
37
37
  requirements:
38
38
  - - ~>
@@ -43,12 +43,12 @@ dependencies:
43
43
  - 0
44
44
  - 0
45
45
  version: 1.0.0
46
+ requirement: *id002
47
+ prerelease: false
46
48
  type: :development
47
49
  name: bundler
48
- version_requirements: *id002
49
- prerelease: false
50
50
  - !ruby/object:Gem::Dependency
51
- requirement: &id003 !ruby/object:Gem::Requirement
51
+ version_requirements: &id003 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ">="
@@ -57,12 +57,12 @@ dependencies:
57
57
  segments:
58
58
  - 0
59
59
  version: "0"
60
+ requirement: *id003
61
+ prerelease: false
60
62
  type: :development
61
63
  name: rcov
62
- version_requirements: *id003
63
- prerelease: false
64
64
  - !ruby/object:Gem::Dependency
65
- requirement: &id004 !ruby/object:Gem::Requirement
65
+ version_requirements: &id004 !ruby/object:Gem::Requirement
66
66
  none: false
67
67
  requirements:
68
68
  - - ~>
@@ -73,10 +73,10 @@ dependencies:
73
73
  - 1
74
74
  - 0
75
75
  version: 3.1.0
76
+ requirement: *id004
77
+ prerelease: false
76
78
  type: :runtime
77
79
  name: rails
78
- version_requirements: *id004
79
- prerelease: false
80
80
  description: Save time and headaches, and create a more easily maintainable set of pages, with ActiveScaffold. ActiveScaffold handles all your CRUD (create, read, update, delete) user interface needs, leaving you more time to focus on more challenging (and interesting!) problems.
81
81
  email: activescaffold@googlegroups.com
82
82
  executables: []
@@ -103,11 +103,13 @@ files:
103
103
  - app/assets/javascripts/jquery/draggable_lists.js
104
104
  - app/assets/javascripts/jquery/jquery.editinplace.js
105
105
  - app/assets/javascripts/jquery/active_scaffold.js~
106
+ - app/assets/javascripts/jquery/tiny_mce_bridge.js
106
107
  - app/assets/javascripts/jquery/draggable_lists.js~
107
108
  - app/assets/javascripts/prototype/active_scaffold.js
108
109
  - app/assets/javascripts/prototype/dhtml_history.js
109
110
  - app/assets/javascripts/prototype/form_enhancements.js
110
111
  - app/assets/javascripts/prototype/rico_corner.js
112
+ - app/assets/javascripts/prototype/tiny_mce_bridge.js
111
113
  - app/assets/javascripts/prototype/active_scaffold.js~
112
114
  - app/assets/javascripts/active_scaffold.js.erb~
113
115
  - app/assets/stylesheets/active_scaffold-ie.css
@@ -148,7 +150,6 @@ files:
148
150
  - frontends/default/views/_search.html.erb
149
151
  - frontends/default/views/_show.html.erb
150
152
  - frontends/default/views/list.html.erb
151
- - frontends/default/views/list.js.erb
152
153
  - frontends/default/views/_show_columns.html.erb
153
154
  - frontends/default/views/_update_actions.html.erb
154
155
  - frontends/default/views/_update_form.html.erb
@@ -174,11 +175,11 @@ files:
174
175
  - frontends/default/views/_horizontal_subform_footer.html.erb
175
176
  - frontends/default/views/edit_associated.js.erb
176
177
  - frontends/default/views/form_messages.js.erb
177
- - frontends/default/views/mark.js.rjs
178
178
  - frontends/default/views/on_action_update.js.erb
179
179
  - frontends/default/views/on_create.js.erb
180
180
  - frontends/default/views/on_mark_all.js.erb
181
181
  - frontends/default/views/on_update.js.erb
182
+ - frontends/default/views/refresh_list.js.erb
182
183
  - frontends/default/views/render_field.js.erb
183
184
  - frontends/default/views/update_column.js.erb
184
185
  - frontends/default/views/_base_form.html.erb~
@@ -1,6 +0,0 @@
1
- if params[:id]
2
- # FIXME: It isn't right when there are filtered records by a search
3
- page << "$('#{active_scaffold_id}').down('.mark_record').checked = #{@mark ? true : false};"
4
- else
5
- page << "$$('##{active_scaffold_tbody_id} > tr > td > .mark_record').each(function(checkbox) { checkbox.checked = #{@mark ? true : false};});"
6
- end