inline_forms 0.8.3 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/app/helpers/form_elements/check_list.rb +1 -1
- data/app/helpers/inline_forms_helper.rb +19 -22
- data/inline_forms.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.4
|
@@ -20,7 +20,7 @@ def check_list_edit(object, attribute)
|
|
20
20
|
out << '<ul>'
|
21
21
|
values.each do | item |
|
22
22
|
out << '<li>'
|
23
|
-
out << check_box_tag( attribute + '[' + item.id.to_s + ']', 1, object.send(attribute.singularize + "_ids").include?(item.id) )
|
23
|
+
out << check_box_tag( attribute.to_s + '[' + item.id.to_s + ']', 1, object.send(attribute.to_s.singularize + "_ids").include?(item.id) )
|
24
24
|
out << '<div class="edit_form_checklist_text">'
|
25
25
|
out << h(item._presentation)
|
26
26
|
out << '</div>'
|
@@ -43,9 +43,8 @@ module InlineFormsHelper
|
|
43
43
|
def inline_forms_new_record(object, attributes=nil)
|
44
44
|
attributes ||= object.inline_forms_attribute_list
|
45
45
|
out = String.new
|
46
|
-
logger.info attributes.inspect
|
47
46
|
attributes.each do | attribute, name, form_element |
|
48
|
-
|
47
|
+
unless form_element.to_sym == :associated #|| form_element.to_sym == :check_list
|
49
48
|
css_class_id = "attribute_#{attribute}_#{object.id}"
|
50
49
|
name_cell = content_tag :td, :valign=>'top' do
|
51
50
|
content_tag :div, :class=> "attribute_name attribute_#{attribute} form_element_#{form_element}" do
|
@@ -62,7 +61,6 @@ module InlineFormsHelper
|
|
62
61
|
out += content_tag :tr, name_cell + value_cell
|
63
62
|
end
|
64
63
|
end
|
65
|
-
logger.info "return"
|
66
64
|
return content_tag :table, raw(out), :cellspacing => 0, :cellpadding => 0
|
67
65
|
end
|
68
66
|
|
@@ -73,8 +71,8 @@ module InlineFormsHelper
|
|
73
71
|
css_class_id = @Klass.to_s.underscore + '_' + object.id.to_s
|
74
72
|
t += content_tag tag, :id => css_class_id do
|
75
73
|
link_to h(object._presentation),
|
76
|
-
|
77
|
-
|
74
|
+
send( @Klass.to_s.underscore + '_path', object, :update => css_class_id),
|
75
|
+
:remote => true
|
78
76
|
end
|
79
77
|
end
|
80
78
|
return raw(t)
|
@@ -83,8 +81,8 @@ module InlineFormsHelper
|
|
83
81
|
# link for new item
|
84
82
|
def inline_forms_new_record_link(text='new', update_span='inline_forms_list')
|
85
83
|
link_to text,
|
86
|
-
|
87
|
-
|
84
|
+
send('new_' + @Klass.to_s.underscore + '_path', :update => update_span),
|
85
|
+
:remote => true
|
88
86
|
end
|
89
87
|
|
90
88
|
private
|
@@ -95,24 +93,24 @@ module InlineFormsHelper
|
|
95
93
|
spaces = attribute_value.length > 40 ? 0 : 40 - attribute_value.length
|
96
94
|
attribute_value << " ".html_safe * spaces
|
97
95
|
link_to attribute_value,
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
96
|
+
send( 'edit_' + @Klass.to_s.underscore + '_path',
|
97
|
+
object,
|
98
|
+
:attribute => attribute.to_s,
|
99
|
+
:form_element => calling_method.sub(/_[a-z]+$/,''),
|
100
|
+
:update => "attribute_#{attribute}_#{object.id}" ),
|
101
|
+
:remote => true
|
104
102
|
end
|
105
103
|
|
106
104
|
# link to inline image edit
|
107
105
|
def link_to_inline_image_edit(object, attribute)
|
108
106
|
text= image_tag object.send(attribute).send('url', :thumb)
|
109
107
|
link_to text,
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
108
|
+
send('edit_' + @Klass.to_s.underscore + '_path',
|
109
|
+
object,
|
110
|
+
:attribute => attribute.to_s,
|
111
|
+
:form_element => calling_method.sub(/_[a-z]+$/,''),
|
112
|
+
:update => "attribute_#{attribute}_#{object.id}" ),
|
113
|
+
:remote => true
|
116
114
|
end
|
117
115
|
|
118
116
|
# get the values for an attribute
|
@@ -131,10 +129,9 @@ module InlineFormsHelper
|
|
131
129
|
values.to_a.each_index do |i|
|
132
130
|
temp << [ i, values.to_a[i] ]
|
133
131
|
end
|
134
|
-
|
132
|
+
values = temp.sort {|a,b| a[1]<=>b[1]}
|
135
133
|
end
|
136
|
-
|
137
|
-
values
|
134
|
+
values
|
138
135
|
end
|
139
136
|
|
140
137
|
end
|
data/inline_forms.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{inline_forms}
|
8
|
-
s.version = "0.8.
|
8
|
+
s.version = "0.8.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ace Suares"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-18}
|
13
13
|
s.description = %q{Inline Forms aims to ease the setup of forms that provide inline editing. The field list can be specified in the model.}
|
14
14
|
s.email = %q{ace@suares.an}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 4
|
10
|
+
version: 0.8.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ace Suares
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-18 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|