inline_forms 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/helpers/form_elements/associated.rb +11 -11
- data/app/views/layouts/inline_forms.rhtml +1 -1
- data/inline_forms.gemspec +3 -2
- data/public/stylesheets/inline_forms.css +78 -0
- metadata +5 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
@@ -20,6 +20,17 @@ module InlineFormsHelper
|
|
20
20
|
else
|
21
21
|
# if it's a new record (sub_id == 0) then update the whole <ul> and redraw all list-elements
|
22
22
|
out << "<ul class='associated #{attribute}' id='list_#{attribute}_#{object.id.to_s}'>" if @sub_id.nil?
|
23
|
+
out << '<li class="associated_new">'
|
24
|
+
out << link_to( 'new', send('edit_' + @Klass.to_s.underscore + '_path',
|
25
|
+
object,
|
26
|
+
:field => attribute,
|
27
|
+
:sub_id => 0,
|
28
|
+
:form_element => this_method.sub(/_[a-z]+$/,''),
|
29
|
+
:values => values,
|
30
|
+
:update => "list_#{attribute}_#{object.id.to_s}" ),
|
31
|
+
:method => :get,
|
32
|
+
:remote => true )
|
33
|
+
out << '</li>'
|
23
34
|
if not object.send(attribute.to_s.pluralize).empty?
|
24
35
|
# if there are things to show, show them
|
25
36
|
object.send(attribute.to_s.pluralize).each do |m|
|
@@ -39,17 +50,6 @@ module InlineFormsHelper
|
|
39
50
|
end
|
40
51
|
end
|
41
52
|
# add a 'new' link for creating a new record
|
42
|
-
out << '<li>'
|
43
|
-
out << link_to( 'new', send('edit_' + @Klass.to_s.underscore + '_path',
|
44
|
-
object,
|
45
|
-
:field => attribute,
|
46
|
-
:sub_id => 0,
|
47
|
-
:form_element => this_method.sub(/_[a-z]+$/,''),
|
48
|
-
:values => values,
|
49
|
-
:update => "list_#{attribute}_#{object.id.to_s}" ),
|
50
|
-
:method => :get,
|
51
|
-
:remote => true )
|
52
|
-
out << '</li>'
|
53
53
|
out << '</ul>' if @sub_id.nil?
|
54
54
|
end
|
55
55
|
raw(out)
|
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.6.
|
8
|
+
s.version = "0.6.1"
|
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-02-
|
12
|
+
s.date = %q{2011-02-13}
|
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 = [
|
@@ -51,6 +51,7 @@ Gem::Specification.new do |s|
|
|
51
51
|
"lib/generators/inline_forms/templates/migration.erb",
|
52
52
|
"lib/generators/inline_forms/templates/model.erb",
|
53
53
|
"lib/inline_forms.rb",
|
54
|
+
"public/stylesheets/inline_forms.css",
|
54
55
|
"test/helper.rb",
|
55
56
|
"test/test_inline_forms.rb"
|
56
57
|
]
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/*
|
2
|
+
Document : inline_forms
|
3
|
+
Created on : Feb 13, 2011, 10:00:55 AM
|
4
|
+
Author : ace
|
5
|
+
Description:
|
6
|
+
Purpose of the stylesheet follows.
|
7
|
+
*/
|
8
|
+
|
9
|
+
/*
|
10
|
+
TODO customize this sample style
|
11
|
+
Syntax recommendation http://www.w3.org/TR/REC-CSS2/
|
12
|
+
*/
|
13
|
+
|
14
|
+
root {
|
15
|
+
display: block;
|
16
|
+
}
|
17
|
+
body {
|
18
|
+
color: darkblue;
|
19
|
+
padding: 0;
|
20
|
+
margin: 0;
|
21
|
+
}
|
22
|
+
a { text-decoration: none;
|
23
|
+
background-color: lightgoldenrodyellow;
|
24
|
+
}
|
25
|
+
a:link, a:visited, a:hover,a:active {
|
26
|
+
color: darkblue;
|
27
|
+
}
|
28
|
+
h1 { border: 1px solid blue;
|
29
|
+
color: darkblue;
|
30
|
+
}
|
31
|
+
#inline_form_list {
|
32
|
+
border: 1px solid green;
|
33
|
+
padding: 0;
|
34
|
+
margin: 0;
|
35
|
+
list-style-type: none;
|
36
|
+
background-color: lightgoldenrodyellow;
|
37
|
+
}
|
38
|
+
#inline_form_list li.inline_form_new_item {
|
39
|
+
padding: 0.5em;
|
40
|
+
font-size: 200%;
|
41
|
+
}
|
42
|
+
#inline_form_list li.inline_form_new_item a {
|
43
|
+
}
|
44
|
+
#inline_form_list li {
|
45
|
+
padding: 0 1em 1.5em 1em;
|
46
|
+
}
|
47
|
+
#inline_form_list li table {
|
48
|
+
border: 1px dotted darkcyan;
|
49
|
+
}
|
50
|
+
#inline_form_list li table tr {
|
51
|
+
}
|
52
|
+
#inline_form_list li table tr td {
|
53
|
+
padding: 0.2em 0.5em 0.2em 0.2em;
|
54
|
+
border-bottom: 1px dotted lightgrey;
|
55
|
+
}
|
56
|
+
#inline_form_list div.field_name{
|
57
|
+
font-weight: bold;
|
58
|
+
}
|
59
|
+
#inline_form_list div.field_value{
|
60
|
+
padding-left: 1em;
|
61
|
+
}
|
62
|
+
#inline_form_list div.form_element_text_field { }
|
63
|
+
#inline_form_list div.form_element_associated ul {
|
64
|
+
list-style-type: none;
|
65
|
+
padding: 0;
|
66
|
+
margin: 0;
|
67
|
+
}
|
68
|
+
#inline_form_list div.form_element_associated li {
|
69
|
+
padding: 0em 0.5em 0.2em 0;
|
70
|
+
|
71
|
+
}
|
72
|
+
#inline_form_list div.form_element_associated li a {
|
73
|
+
padding: 0;
|
74
|
+
margin: 0;
|
75
|
+
}
|
76
|
+
|
77
|
+
#inline_form_list div.associated_new {
|
78
|
+
}
|
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: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 1
|
10
|
+
version: 0.6.1
|
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-02-
|
18
|
+
date: 2011-02-13 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/generators/inline_forms/templates/migration.erb
|
123
123
|
- lib/generators/inline_forms/templates/model.erb
|
124
124
|
- lib/inline_forms.rb
|
125
|
+
- public/stylesheets/inline_forms.css
|
125
126
|
- test/helper.rb
|
126
127
|
- test/test_inline_forms.rb
|
127
128
|
has_rdoc: true
|