active_scaffold 3.1.17 → 3.1.18
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/{add.gif → active_scaffold/add.gif} +0 -0
- data/app/assets/images/{arrow_down.gif → active_scaffold/arrow_down.gif} +0 -0
- data/app/assets/images/{arrow_up.gif → active_scaffold/arrow_up.gif} +0 -0
- data/app/assets/images/{close.gif → active_scaffold/close.gif} +0 -0
- data/app/assets/images/{close_touch.png → active_scaffold/close_touch.png} +0 -0
- data/app/assets/images/{config.png → active_scaffold/config.png} +0 -0
- data/app/assets/images/{cross.png → active_scaffold/cross.png} +0 -0
- data/app/assets/images/{gears.png → active_scaffold/gears.png} +0 -0
- data/app/assets/images/{indicator-small.gif → active_scaffold/indicator-small.gif} +0 -0
- data/app/assets/images/{indicator.gif → active_scaffold/indicator.gif} +0 -0
- data/app/assets/images/{magnifier.png → active_scaffold/magnifier.png} +0 -0
- data/app/assets/javascripts/jquery/active_scaffold.js +125 -125
- data/app/assets/javascripts/jquery/date_picker_bridge.js.erb +5 -5
- data/app/assets/javascripts/jquery/draggable_lists.js +9 -9
- data/app/assets/javascripts/jquery/tiny_mce_bridge.js +2 -2
- data/app/assets/stylesheets/active_scaffold.css.erb +166 -147
- data/app/assets/stylesheets/active_scaffold.css.erb~ +182 -147
- data/app/assets/stylesheets/blue-theme.css +74 -0
- data/app/assets/stylesheets/blue-theme.css~ +1150 -0
- data/frontends/default/views/_search.html.erb +3 -3
- data/lib/active_scaffold/actions/nested.rb +2 -2
- data/lib/active_scaffold/actions/nested.rb~ +3 -3
- data/lib/active_scaffold/data_structures/nested_info.rb +6 -2
- data/lib/active_scaffold/data_structures/nested_info.rb~ +7 -3
- data/lib/active_scaffold/helpers/search_column_helpers.rb +3 -1
- data/lib/active_scaffold/helpers/view_helpers.rb +1 -1
- data/lib/active_scaffold/version.rb +1 -1
- data/lib/active_scaffold.rb +2 -1
- data/lib/active_scaffold.rb~ +14 -4
- metadata +21 -19
@@ -25,9 +25,9 @@ options['data-loading'] = true unless live_search
|
|
25
25
|
$(element).next().click();
|
26
26
|
});
|
27
27
|
<% elsif live_search && ActiveScaffold.js_framework == :jquery %>
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
jQuery(<%= "##{search_input_id}".to_json.html_safe %>).next().hide();
|
29
|
+
jQuery(<%= "##{search_input_id}".to_json.html_safe %>).delayedObserver(0.5, function() {
|
30
|
+
jQuery(<%= "##{search_input_id}".to_json.html_safe %>).parent().trigger("submit");});
|
31
31
|
<% end -%>
|
32
32
|
ActiveScaffold.focus_first_element_of_form('<%= element_form_id(:action => 'search') %>');
|
33
33
|
//]]>
|
@@ -5,8 +5,8 @@ module ActiveScaffold::Actions
|
|
5
5
|
def self.included(base)
|
6
6
|
super
|
7
7
|
base.module_eval do
|
8
|
-
before_filter :register_constraints_with_action_columns
|
9
|
-
|
8
|
+
#before_filter :register_constraints_with_action_columns
|
9
|
+
prepend_before_filter :set_nested
|
10
10
|
before_filter :configure_nested
|
11
11
|
include ActiveScaffold::Actions::Nested::ChildMethods if active_scaffold_config.model.reflect_on_all_associations.any? {|a| a.macro == :has_and_belongs_to_many}
|
12
12
|
end
|
@@ -5,9 +5,10 @@ module ActiveScaffold::Actions
|
|
5
5
|
def self.included(base)
|
6
6
|
super
|
7
7
|
base.module_eval do
|
8
|
-
before_filter :register_constraints_with_action_columns
|
9
|
-
|
8
|
+
#before_filter :register_constraints_with_action_columns
|
9
|
+
prepend_before_filter :set_nested
|
10
10
|
before_filter :configure_nested
|
11
|
+
debugger
|
11
12
|
include ActiveScaffold::Actions::Nested::ChildMethods if active_scaffold_config.model.reflect_on_all_associations.any? {|a| a.macro == :has_and_belongs_to_many}
|
12
13
|
end
|
13
14
|
base.before_filter :include_habtm_actions
|
@@ -31,7 +32,6 @@ module ActiveScaffold::Actions
|
|
31
32
|
active_scaffold_constraints[:id] = params[:id] if @nested.belongs_to?
|
32
33
|
register_constraints_with_action_columns(@nested.constrained_fields, active_scaffold_config.list.hide_nested_column ? [] : [:list])
|
33
34
|
end
|
34
|
-
#params.delete_if {|key, value| [:parent_scaffold, :association, :named_scope, :assoc_id].include? key.to_sym}
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -117,8 +117,12 @@ module ActiveScaffold::DataStructures
|
|
117
117
|
end
|
118
118
|
if association.foreign_key == current.foreign_key
|
119
119
|
# show columns for has_many and has_one child associationes
|
120
|
-
constrained_fields << current.name.to_sym if current.belongs_to?
|
121
|
-
|
120
|
+
constrained_fields << current.name.to_sym if current.belongs_to?
|
121
|
+
if association.options[:as] and current.options[:polymorphic]
|
122
|
+
@child_association = current if association.options[:as].to_sym == current.name
|
123
|
+
else
|
124
|
+
@child_association = current if current.klass == @parent_model
|
125
|
+
end
|
122
126
|
end
|
123
127
|
end
|
124
128
|
end
|
@@ -109,17 +109,21 @@ module ActiveScaffold::DataStructures
|
|
109
109
|
|
110
110
|
def iterate_model_associations(model)
|
111
111
|
@constrained_fields = []
|
112
|
-
debugger
|
113
112
|
@constrained_fields << association.foreign_key.to_sym unless association.belongs_to?
|
114
113
|
model.reflect_on_all_associations.each do |current|
|
114
|
+
debugger
|
115
115
|
if !current.belongs_to? && association.foreign_key == current.association_foreign_key
|
116
116
|
constrained_fields << current.name.to_sym
|
117
117
|
@child_association = current if current.klass == @parent_model
|
118
118
|
end
|
119
119
|
if association.foreign_key == current.foreign_key
|
120
120
|
# show columns for has_many and has_one child associationes
|
121
|
-
constrained_fields << current.name.to_sym if current.belongs_to?
|
122
|
-
|
121
|
+
constrained_fields << current.name.to_sym if current.belongs_to?
|
122
|
+
if association.options[:as] and current.options[:polymorphic]
|
123
|
+
@child_association = current if association.options[:as].to_sym == current.name
|
124
|
+
else
|
125
|
+
@child_association = current if current.klass == @parent_model
|
126
|
+
end
|
123
127
|
end
|
124
128
|
end
|
125
129
|
end
|
@@ -63,7 +63,9 @@ module ActiveScaffold
|
|
63
63
|
if column.association
|
64
64
|
select_options = options_for_association(column.association, false)
|
65
65
|
else
|
66
|
-
select_options =
|
66
|
+
select_options = column.options[:options].collect do |text, value|
|
67
|
+
active_scaffold_translated_option(column, text, value)
|
68
|
+
end
|
67
69
|
end
|
68
70
|
return as_(:no_options) if select_options.empty?
|
69
71
|
|
@@ -86,7 +86,7 @@ module ActiveScaffold
|
|
86
86
|
|
87
87
|
# a general-use loading indicator (the "stuff is happening, please wait" feedback)
|
88
88
|
def loading_indicator_tag(options)
|
89
|
-
image_tag "indicator.gif", :style => "visibility:hidden;", :id => loading_indicator_id(options), :alt => "loading indicator", :class => "loading-indicator"
|
89
|
+
image_tag "active_scaffold/indicator.gif", :style => "visibility:hidden;", :id => loading_indicator_id(options), :alt => "loading indicator", :class => "loading-indicator"
|
90
90
|
end
|
91
91
|
|
92
92
|
# Creates a javascript-based link that toggles the visibility of some element on the page.
|
data/lib/active_scaffold.rb
CHANGED
@@ -84,7 +84,8 @@ module ActiveScaffold
|
|
84
84
|
self.class.active_scaffold_config_for(klass)
|
85
85
|
end
|
86
86
|
|
87
|
-
def active_scaffold_session_storage(id =
|
87
|
+
def active_scaffold_session_storage(id = nil)
|
88
|
+
id ||= params[:eid] || "#{params[:controller]}#{"_#{nested.parent_id}" if nested?}"
|
88
89
|
session_index = "as:#{id}"
|
89
90
|
session[session_index] ||= {}
|
90
91
|
session[session_index]
|
data/lib/active_scaffold.rb~
CHANGED
@@ -13,6 +13,7 @@ require 'active_scaffold/responds_to_parent'
|
|
13
13
|
|
14
14
|
require 'active_scaffold/version'
|
15
15
|
require 'active_scaffold/engine' unless defined? ACTIVE_SCAFFOLD_PLUGIN
|
16
|
+
require 'json' # for js_config
|
16
17
|
|
17
18
|
module ActiveScaffold
|
18
19
|
autoload :AttributeParams, 'active_scaffold/attribute_params'
|
@@ -83,10 +84,12 @@ module ActiveScaffold
|
|
83
84
|
self.class.active_scaffold_config_for(klass)
|
84
85
|
end
|
85
86
|
|
86
|
-
def active_scaffold_session_storage(id =
|
87
|
+
def active_scaffold_session_storage(id = nil)
|
88
|
+
debugger
|
89
|
+
id ||= params[:eid] || "#{params[:controller]}#{"_#{nested.parent_id}" if nested?}"
|
87
90
|
session_index = "as:#{id}"
|
88
|
-
|
89
|
-
|
91
|
+
session[session_index] ||= {}
|
92
|
+
session[session_index]
|
90
93
|
end
|
91
94
|
|
92
95
|
# at some point we need to pass the session and params into config. we'll just take care of that before any particular action occurs by passing those hashes off to the UserSettings class of each action.
|
@@ -95,7 +98,6 @@ module ActiveScaffold
|
|
95
98
|
active_scaffold_config.actions.each do |action_name|
|
96
99
|
conf_instance = active_scaffold_config.send(action_name) rescue next
|
97
100
|
next if conf_instance.class::UserSettings == ActiveScaffold::Config::Base::UserSettings # if it hasn't been extended, skip it
|
98
|
-
debugger
|
99
101
|
active_scaffold_session_storage[action_name] ||= {}
|
100
102
|
conf_instance.user = conf_instance.class::UserSettings.new(conf_instance, active_scaffold_session_storage[action_name], params)
|
101
103
|
end
|
@@ -132,6 +134,14 @@ module ActiveScaffold
|
|
132
134
|
end
|
133
135
|
end
|
134
136
|
|
137
|
+
def self.js_config=(config)
|
138
|
+
@@js_config = config
|
139
|
+
end
|
140
|
+
|
141
|
+
def self.js_config
|
142
|
+
@@js_config ||= {:scroll_on_close => true}
|
143
|
+
end
|
144
|
+
|
135
145
|
# exclude bridges you do not need
|
136
146
|
# name of bridge subdir should be used to exclude it
|
137
147
|
# eg
|
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:
|
4
|
+
hash: 39
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 18
|
10
|
+
version: 3.1.18
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Many, see README
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-27 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -65,14 +65,14 @@ dependencies:
|
|
65
65
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
66
66
|
none: false
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
hash:
|
70
|
+
hash: 5
|
71
71
|
segments:
|
72
72
|
- 3
|
73
73
|
- 1
|
74
|
-
-
|
75
|
-
version: 3.1.
|
74
|
+
- 3
|
75
|
+
version: 3.1.3
|
76
76
|
requirement: *id004
|
77
77
|
prerelease: false
|
78
78
|
type: :runtime
|
@@ -86,17 +86,17 @@ extensions: []
|
|
86
86
|
extra_rdoc_files:
|
87
87
|
- README
|
88
88
|
files:
|
89
|
-
- app/assets/images/add.gif
|
90
|
-
- app/assets/images/arrow_down.gif
|
91
|
-
- app/assets/images/arrow_up.gif
|
92
|
-
- app/assets/images/close.gif
|
93
|
-
- app/assets/images/close_touch.png
|
94
|
-
- app/assets/images/config.png
|
95
|
-
- app/assets/images/cross.png
|
96
|
-
- app/assets/images/gears.png
|
97
|
-
- app/assets/images/indicator-small.gif
|
98
|
-
- app/assets/images/indicator.gif
|
99
|
-
- app/assets/images/magnifier.png
|
89
|
+
- app/assets/images/active_scaffold/add.gif
|
90
|
+
- app/assets/images/active_scaffold/arrow_down.gif
|
91
|
+
- app/assets/images/active_scaffold/arrow_up.gif
|
92
|
+
- app/assets/images/active_scaffold/close.gif
|
93
|
+
- app/assets/images/active_scaffold/close_touch.png
|
94
|
+
- app/assets/images/active_scaffold/config.png
|
95
|
+
- app/assets/images/active_scaffold/cross.png
|
96
|
+
- app/assets/images/active_scaffold/gears.png
|
97
|
+
- app/assets/images/active_scaffold/indicator-small.gif
|
98
|
+
- app/assets/images/active_scaffold/indicator.gif
|
99
|
+
- app/assets/images/active_scaffold/magnifier.png
|
100
100
|
- app/assets/javascripts/active_scaffold.js.erb
|
101
101
|
- app/assets/javascripts/jquery/active_scaffold.js
|
102
102
|
- app/assets/javascripts/jquery/date_picker_bridge.js.erb
|
@@ -114,7 +114,9 @@ files:
|
|
114
114
|
- app/assets/javascripts/active_scaffold.js.erb~
|
115
115
|
- app/assets/stylesheets/active_scaffold-ie.css
|
116
116
|
- app/assets/stylesheets/active_scaffold.css.erb
|
117
|
+
- app/assets/stylesheets/blue-theme.css
|
117
118
|
- app/assets/stylesheets/active_scaffold.css.erb~
|
119
|
+
- app/assets/stylesheets/blue-theme.css~
|
118
120
|
- config/locales/de.yml
|
119
121
|
- config/locales/en.yml
|
120
122
|
- config/locales/es.yml
|