active_scaffold_vho 3.2.10 → 3.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/active_scaffold.js.erb +2 -2
- data/app/assets/javascripts/jquery/tiny_mce_bridge.js +21 -19
- data/frontends/default/views/_form_hidden_attribute.html.erb +1 -1
- data/lib/active_scaffold/config/base.rb +8 -0
- data/lib/active_scaffold/config/delete.rb +1 -5
- data/lib/active_scaffold/config/field_search.rb +1 -5
- data/lib/active_scaffold/config/form.rb +1 -6
- data/lib/active_scaffold/config/search.rb +1 -5
- data/lib/active_scaffold/config/show.rb +1 -4
- data/lib/active_scaffold/helpers/form_column_helpers.rb +30 -19
- data/lib/active_scaffold/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDdiYjFiZTVjMjhhMjZhN2FkNDQxMjc4M2Q3ZDU0ZjkwZjE5YzczNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2FkZWIxMWZmYWYyOTA1MDJlNGVlNTIyODFhZDE3OGIyZmI4ODJhYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTlhMTRkOTZhNjlhYTRjNTM3N2QyZjJlZTViODZhOTAyMDVlOTJhMmNkYjMz
|
10
|
+
MjViNTM3NzFiODdhMjJkNDc3N2EwNmVkZjgwMjFlZTRiODk4NGVhNjc3YWYw
|
11
|
+
NDRjNDg5YjY2ZWNmNDRmYTFmZmY5NjBkN2QyZDA2MmEzYmJhNGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Mzg1MjZlMmVlMjk0MmVlMTM1NjU0YmI1NGU5MGRlYTM4YTdmMGExNGZkN2Fl
|
14
|
+
YzhhNDVkNjM1YTNiNWY0YTkzNmIzMDhjOGQxYzIzYTBhNWFmNDEyYjU4ZDFi
|
15
|
+
MjBlMzQ4NTkwZTgyMmUwNTc1ZDVlMTQyNjk3ZWMyNGQ4NTNiMDk=
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
<% if ActiveScaffold.js_framework == :jquery %>
|
2
|
+
<% require_asset "jquery/date_picker_bridge" %>
|
3
|
+
<% require_asset "jquery/tiny_mce_bridge" %>
|
2
4
|
<% require_asset "jquery/active_scaffold" %>
|
3
5
|
<% require_asset "jquery/jquery.editinplace" %>
|
4
6
|
<% require_asset "jquery/jquery-ui-timepicker-addon.js" %>
|
5
|
-
<% require_asset "jquery/date_picker_bridge" %>
|
6
|
-
<% require_asset "jquery/tiny_mce_bridge" %>
|
7
7
|
<% else %>
|
8
8
|
<% require_asset "prototype/active_scaffold" %>
|
9
9
|
<% require_asset "prototype/dhtml_history" %>
|
@@ -1,22 +1,24 @@
|
|
1
|
-
$(document).
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
$(document).ready(function() {
|
2
|
+
$(document).on('as:form_loaded', 'form.as_form, form.inplace_form', function(event) {
|
3
|
+
var as_form = $(this).closest("form");
|
4
|
+
as_form.find('textarea.as_mceEditor').each(function(index, elem) {
|
5
|
+
tinyMCE.execCommand('mceAddControl', false, $(elem).attr('id'));
|
6
|
+
});
|
7
|
+
return true;
|
8
|
+
});
|
9
|
+
$(document).on('as:form_submit', 'form.as_form, form.inplace_form', function(event) {
|
10
|
+
var as_form = $(this).closest("form");
|
11
|
+
if (as_form.has('textarea.as_mceEditor').length > 0) {
|
12
|
+
tinyMCE.triggerSave();
|
13
|
+
}
|
14
|
+
return true;
|
5
15
|
});
|
6
|
-
return true;
|
7
|
-
});
|
8
|
-
$(document).on('as:form_submit', 'form.as_form, form.inplace_form', function(event) {
|
9
|
-
var as_form = $(this).closest("form");
|
10
|
-
if (as_form.has('textarea.as_mceEditor').length > 0) {
|
11
|
-
tinyMCE.triggerSave();
|
12
|
-
}
|
13
|
-
return true;
|
14
|
-
});
|
15
16
|
|
16
|
-
$(document).on('as:form_unloaded', 'form.as_form, form.inplace_form', function(event) {
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
$(document).on('as:form_unloaded', 'form.as_form, form.inplace_form', function(event) {
|
18
|
+
var as_form = $(this).closest("form");
|
19
|
+
as_form.find('textarea.as_mceEditor').each(function(index, elem) {
|
20
|
+
tinyMCE.execCommand('mceRemoveControl', false, $(elem).attr('id'));
|
21
|
+
});
|
22
|
+
return true;
|
20
23
|
});
|
21
|
-
|
22
|
-
});
|
24
|
+
});
|
@@ -1,2 +1,2 @@
|
|
1
1
|
<% scope ||= nil %>
|
2
|
-
<%=
|
2
|
+
<%= active_scaffold_input_hidden(column, active_scaffold_input_options(column, scope)) %>
|
@@ -3,6 +3,14 @@ module ActiveScaffold::Config
|
|
3
3
|
include ActiveScaffold::Configurable
|
4
4
|
extend ActiveScaffold::Configurable
|
5
5
|
|
6
|
+
def initialize(core_config)
|
7
|
+
@core = core_config
|
8
|
+
@action_group = self.class.action_group.clone if self.class.action_group
|
9
|
+
# start with the ActionLink defined globally
|
10
|
+
@link = self.class.link.clone if self.class.respond_to?(:link) && self.class.link
|
11
|
+
end
|
12
|
+
attr_reader :core
|
13
|
+
|
6
14
|
def self.inherited(subclass)
|
7
15
|
class << subclass
|
8
16
|
# the crud type of the action. possible values are :create, :read, :update, :delete, and nil.
|
@@ -3,11 +3,7 @@ module ActiveScaffold::Config
|
|
3
3
|
self.crud_type = :delete
|
4
4
|
|
5
5
|
def initialize(core_config)
|
6
|
-
|
7
|
-
|
8
|
-
# start with the ActionLink defined globally
|
9
|
-
@link = self.class.link.clone
|
10
|
-
@action_group = self.class.action_group.clone if self.class.action_group
|
6
|
+
super
|
11
7
|
self.refresh_list = self.class.refresh_list
|
12
8
|
end
|
13
9
|
|
@@ -3,14 +3,10 @@ module ActiveScaffold::Config
|
|
3
3
|
self.crud_type = :read
|
4
4
|
|
5
5
|
def initialize(core_config)
|
6
|
-
|
6
|
+
super
|
7
7
|
|
8
8
|
@text_search = self.class.text_search
|
9
9
|
@or_delimiter = self.class.or_delimiter
|
10
|
-
|
11
|
-
# start with the ActionLink defined globally
|
12
|
-
@link = self.class.link.clone
|
13
|
-
@action_group = self.class.action_group.clone if self.class.action_group
|
14
10
|
end
|
15
11
|
|
16
12
|
|
@@ -1,12 +1,7 @@
|
|
1
1
|
module ActiveScaffold::Config
|
2
2
|
class Form < Base
|
3
3
|
def initialize(core_config)
|
4
|
-
|
5
|
-
|
6
|
-
# start with the ActionLink defined globally
|
7
|
-
@link = self.class.link.clone unless self.class.link.nil?
|
8
|
-
@action_group = self.class.action_group.clone if self.class.action_group
|
9
|
-
|
4
|
+
super
|
10
5
|
# no global setting here because multipart should only be set for specific forms
|
11
6
|
@multipart = false
|
12
7
|
end
|
@@ -3,14 +3,10 @@ module ActiveScaffold::Config
|
|
3
3
|
self.crud_type = :read
|
4
4
|
|
5
5
|
def initialize(core_config)
|
6
|
-
|
6
|
+
super
|
7
7
|
|
8
8
|
@text_search = self.class.text_search
|
9
9
|
@live = self.class.live?
|
10
|
-
|
11
|
-
# start with the ActionLink defined globally
|
12
|
-
@link = self.class.link.clone
|
13
|
-
@action_group = self.class.action_group.clone if self.class.action_group
|
14
10
|
end
|
15
11
|
|
16
12
|
|
@@ -3,10 +3,7 @@ module ActiveScaffold::Config
|
|
3
3
|
self.crud_type = :read
|
4
4
|
|
5
5
|
def initialize(core_config)
|
6
|
-
|
7
|
-
# start with the ActionLink defined globally
|
8
|
-
@link = self.class.link.clone
|
9
|
-
@action_group = self.class.action_group.clone if self.class.action_group
|
6
|
+
super
|
10
7
|
end
|
11
8
|
|
12
9
|
# global level configuration
|
@@ -30,25 +30,13 @@ module ActiveScaffold
|
|
30
30
|
# if we get here, it's because the column has a form_ui but not one ActiveScaffold knows about.
|
31
31
|
raise "Unknown form_ui `#{column.form_ui}' for column `#{column.name}'"
|
32
32
|
end
|
33
|
-
elsif column.virtual?
|
34
|
-
active_scaffold_input_virtual(column, options)
|
35
|
-
|
36
33
|
else # regular model attribute column
|
37
34
|
# if we (or someone else) have created a custom render option for the column type, use that
|
38
|
-
if override_input?(column.column.type)
|
35
|
+
if !column.virtual? && override_input?(column.column.type)
|
39
36
|
send(override_input(column.column.type), column, options)
|
40
37
|
# final ultimate fallback: use rails' generic input method
|
41
38
|
else
|
42
|
-
|
43
|
-
text_types = [:text, :string, :integer, :float, :decimal, :date, :time, :datetime]
|
44
|
-
options = active_scaffold_input_text_options(options) if text_types.include?(column.column.type)
|
45
|
-
if column.column.type == :string && options[:maxlength].blank?
|
46
|
-
options[:maxlength] = column.column.limit
|
47
|
-
options[:size] ||= ActionView::Helpers::InstanceTag::DEFAULT_FIELD_OPTIONS["size"]
|
48
|
-
end
|
49
|
-
options[:include_blank] = true if column.column.null and [:date, :datetime, :time].include?(column.column.type)
|
50
|
-
options[:value] = format_number_value(@record.send(column.name), column.options) if column.column.number?
|
51
|
-
text_field(:record, column.name, options.merge(column.options))
|
39
|
+
active_scaffold_input_text_field(column, options)
|
52
40
|
end
|
53
41
|
end
|
54
42
|
end
|
@@ -94,6 +82,34 @@ module ActiveScaffold
|
|
94
82
|
##
|
95
83
|
## Form input methods
|
96
84
|
##
|
85
|
+
def active_scaffold_input_text_field(column, options)
|
86
|
+
if column.column.nil?
|
87
|
+
options = active_scaffold_input_text_options(options)
|
88
|
+
if column.association
|
89
|
+
associated = @record.send(column.association.name)
|
90
|
+
options[:value] = associated.id
|
91
|
+
end
|
92
|
+
else
|
93
|
+
text_types = [:text, :string, :integer, :float, :decimal, :date, :time, :datetime]
|
94
|
+
options = active_scaffold_input_text_options(options) if text_types.include?(column.column.type)
|
95
|
+
if column.column.type == :string && options[:maxlength].blank?
|
96
|
+
options[:maxlength] = column.column.limit
|
97
|
+
options[:size] ||= ActionView::Helpers::InstanceTag::DEFAULT_FIELD_OPTIONS["size"]
|
98
|
+
end
|
99
|
+
options[:include_blank] = true if column.column.null and [:date, :datetime, :time].include?(column.column.type)
|
100
|
+
options[:value] = format_number_value(@record.send(column.name), column.options) if column.column.number?
|
101
|
+
end
|
102
|
+
|
103
|
+
text_field(:record, column.name, options.merge(column.options))
|
104
|
+
end
|
105
|
+
|
106
|
+
def active_scaffold_input_hidden(column, options)
|
107
|
+
if column.association
|
108
|
+
associated = @record.send(column.association.name)
|
109
|
+
options[:value] = associated.id
|
110
|
+
end
|
111
|
+
hidden_field(:record, column.name, options)
|
112
|
+
end
|
97
113
|
|
98
114
|
def active_scaffold_input_singular_association(column, html_options)
|
99
115
|
associated = @record.send(column.association.name)
|
@@ -223,11 +239,6 @@ module ActiveScaffold
|
|
223
239
|
def active_scaffold_input_textarea(column, options)
|
224
240
|
text_area(:record, column.name, options.merge(:cols => column.options[:cols], :rows => column.options[:rows], :size => column.options[:size]))
|
225
241
|
end
|
226
|
-
|
227
|
-
def active_scaffold_input_virtual(column, options)
|
228
|
-
options = active_scaffold_input_text_options(options)
|
229
|
-
text_field :record, column.name, options.merge(column.options)
|
230
|
-
end
|
231
242
|
|
232
243
|
#
|
233
244
|
# Column.type-based inputs
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold_vho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Many, see README
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shoulda
|