inline_forms 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.2
1
+ 0.9.3
@@ -29,17 +29,22 @@ class InlineFormsController < ApplicationController
29
29
  # The link to 'new' allows you to create a new record.
30
30
  #
31
31
  def index
32
- @objects = @Klass.paginate :page => params[:page], :order => 'created_at DESC'
33
32
  update_span = params[:update]
33
+ @parent_class = params[:parent_class]
34
+ if @parent_class.nil?
35
+ @objects = @Klass.paginate :page => params[:page], :order => 'created_at DESC'
36
+ else
37
+ @parent_id = params[:parent_id]
38
+ @objects = @Klass.paginate :page => params[:page], :order => 'created_at DESC', :conditions => [ "#{@parent_class.foreign_key} = ?", @parent_id ]
39
+ end
40
+
34
41
  respond_to do |format|
35
42
  # found this here: http://www.ruby-forum.com/topic/211467
36
- format.html { render 'inline_forms/index', :layout => 'inline_forms' } unless @Klass.not_accessible_through_html?
37
- format.js { render(:update) {|page| page.replace_html update_span, :partial => 'inline_forms/index' } }
43
+ format.html { render 'inline_forms/_list', :layout => 'inline_forms' } unless @Klass.not_accessible_through_html?
44
+ format.js { render(:update) {|page| page.replace_html update_span, :partial => 'inline_forms/list' } }
38
45
  end
39
46
  end
40
47
 
41
-
42
-
43
48
  # :new prepares a new object, updates the entire list of objects and replaces it with a new
44
49
  # empty form. After pressing OK or Cancel, the list of objects is retrieved in the same way as :index
45
50
  #
@@ -47,6 +52,11 @@ class InlineFormsController < ApplicationController
47
52
  def new
48
53
  @object = @Klass.new
49
54
  @update_span = params[:update]
55
+ @parent_class = params[:parent_class]
56
+ unless @parent_class.nil?
57
+ @parent_id = params[:parent_id]
58
+ @object[@parent_class.foreign_key] = @parent_id
59
+ end
50
60
  respond_to do |format|
51
61
  # found this here: http://www.ruby-forum.com/topic/211467
52
62
  format.js { render(:update) {|page| page.replace_html @update_span, :partial => 'inline_forms/new'}
@@ -78,19 +88,26 @@ class InlineFormsController < ApplicationController
78
88
  def create
79
89
  object = @Klass.new
80
90
  @update_span = params[:update]
91
+ # update each field of the record
81
92
  attributes = object.inline_forms_attribute_list
82
93
  attributes.each do | name, attribute, form_element |
83
94
  send("#{form_element.to_s}_update", object, attribute) unless form_element == :associated
84
95
  end
85
96
  if object.save
86
- flash[:success] = "Successfully created #{object.class.to_s.downcase}."
97
+ flash.now[:success] = "Successfully created #{object.class.to_s.downcase}."
98
+ else
99
+ flash.now[:error] = "Failed to create #{object.class.to_s.downcase}."
100
+ end
101
+ @parent_class = params[:parent_class]
102
+ if @parent_class.nil?
103
+ @objects = @Klass.paginate :page => params[:page], :order => 'created_at DESC'
87
104
  else
88
- flash[:error] = "Failed to create #{object.class.to_s.downcase}."
105
+ @parent_id = params[:parent_id]
106
+ @objects = @Klass.paginate :page => params[:page], :order => 'created_at DESC', :conditions => [ "#{@parent_class.foreign_key} = ?", @parent_id ]
89
107
  end
90
- @objects = @Klass.paginate :page => params[:page], :order => 'created_at DESC'
91
108
  respond_to do |format|
92
109
  # found this here: http://www.ruby-forum.com/topic/211467
93
- format.js { render(:update) {|page| page.replace_html @update_span, :partial => 'inline_forms/index'}
110
+ format.js { render(:update) {|page| page.replace_html @update_span, :partial => 'inline_forms/list'}
94
111
  }
95
112
  end
96
113
  end
@@ -104,10 +121,8 @@ class InlineFormsController < ApplicationController
104
121
  @form_element = params[:form_element]
105
122
  @sub_id = params[:sub_id]
106
123
  @update_span = params[:update]
107
- logger.info @form_element.to_s
108
124
  send("#{@form_element.to_s}_update", @object, @attribute)
109
125
  @object.save
110
- logger.info "after"
111
126
  respond_to do |format|
112
127
  # found this here: http://www.ruby-forum.com/topic/211467
113
128
  format.js { render(:update) {|page| page.replace_html @update_span, :inline => '<%= send("#{@form_element.to_s}_show", @object, @attribute) %>' }
@@ -138,16 +153,28 @@ class InlineFormsController < ApplicationController
138
153
  @attributes = @object.inline_forms_attribute_list
139
154
  # found this here: http://www.ruby-forum.com/topic/211467
140
155
  if close
141
- format.js { render(:update) {|page| page.replace_html @update_span, :inline => '<%= link_to h(@object._presentation), send(@object.class.to_s.underscore + "_path", @object, :update => @update_span), :remote => true %>' } }
156
+ format.js do
157
+ render(:update) do |page|
158
+ page.replace_html @update_span, :inline => '<%= link_to h(@object._presentation), send(@object.class.to_s.underscore + "_path", @object, :update => @update_span), :remote => true %>'
159
+ end
160
+ end
142
161
  else
143
- format.js { render(:update) {|page| page.replace_html @update_span, :inline => '<%= send( "inline_forms_show_record", @object) %>' } }
162
+ format.js do
163
+ render(:update) do |page|
164
+ page.replace_html @update_span, :partial => 'inline_forms/show'
165
+ end
166
+ end
167
+ # format.js { render(:update) {|page| page.replace_html @update_span, :inline => '<%= send( "inline_forms_show_record", @object) %>' } }
144
168
  end
145
169
  end
146
170
  else
147
171
  respond_to do |format|
148
172
  # found this here: http://www.ruby-forum.com/topic/211467
149
- format.js { render(:update) {|page| page.replace_html @update_span, :inline => '<%= send("#{@form_element}_show", @object, @attribute) %>' }
150
- }
173
+ format.js do
174
+ render(:update) do |page|
175
+ page.replace_html @update_span, :inline => '<%= send("#{@form_element}_show", @object, @attribute) %>'
176
+ end
177
+ end
151
178
  end
152
179
  end
153
180
  end
@@ -8,111 +8,6 @@ module InlineFormsHelper
8
8
  require form_element
9
9
  end
10
10
 
11
- # default inline forms attribute list, for models that don't have an inline_attribute_attribute_list defined.
12
- INLINE_FORMS_DEFAULT_ATTRIBUTE_LIST = { :name => [ 'name', :text ] }
13
-
14
- # show a record by iterating through its attribute list
15
- def inline_forms_show_record(object, attributes=nil)
16
- out = String.new
17
- name_cell = content_tag :th, :valign=>'top' do
18
- content_tag :div, :class=> "object_presentation" do
19
- h(object._presentation)
20
- end
21
- end
22
- value_cell = content_tag :th, :valign=>'top' do
23
- content_tag :div, :class=> "close_link" do
24
- close_link(object)
25
- end
26
- end
27
- out += content_tag :tr, name_cell + value_cell
28
- out << "\n"
29
- attributes ||= object.inline_forms_attribute_list
30
- attributes.each do | attribute, name, form_element |
31
- css_class_id = "#{object.class.to_s.underscore}_#{object.id}_#{attribute}"
32
- name_cell = content_tag :td, :valign=>'top' do
33
- content_tag :div, :class=> "attribute_name attribute_#{attribute} form_element_#{form_element}" do
34
- h(name)
35
- end
36
- end
37
- value_cell = content_tag :td, :valign=>'top' do
38
- content_tag :div, :class=> "attribute_value attribute_#{attribute} form_element_#{form_element}" do
39
- content_tag :span, :id => css_class_id do
40
- if form_element == :associated
41
- inline_forms_list(object.send(attribute.to_s.pluralize), attribute )
42
- else
43
- send("#{form_element}_show", object, attribute)
44
- end
45
- end
46
- end
47
- end
48
- out += content_tag :tr, name_cell + value_cell
49
- out += "\n"
50
- end
51
- # end
52
- return content_tag :table, raw(out), :cellspacing => 0, :cellpadding => 0
53
- end
54
-
55
- # show the form for a new record
56
- #
57
- # associated records are NOT shown!
58
- #
59
- def inline_forms_new_record(object, attributes=nil)
60
- out = String.new
61
- out += content_tag :tr do
62
- content_tag :th, :colspan => 2, :valign=>'top' do
63
- content_tag :div, :class=> "object_presentation" do
64
- "New #{object.class.to_s}"
65
- end
66
- end
67
- end
68
- out << "\n"
69
- attributes ||= object.inline_forms_attribute_list
70
- attributes.each do | attribute, name, form_element |
71
- unless form_element.to_sym == :associated
72
- css_class_id = "attribute_#{attribute}_#{object.id}"
73
- name_cell = content_tag :td, :valign=>'top' do
74
- content_tag :div, :class=> "attribute_name attribute_#{attribute} form_element_#{form_element}" do
75
- h(name)
76
- end
77
- end
78
- value_cell = content_tag :td, :valign=>'top' do
79
- content_tag :div, :class=> "attribute_value attribute_#{attribute} form_element_#{form_element}" do
80
- content_tag :span, :id => css_class_id do
81
- send("#{form_element}_edit", object, attribute)
82
- end
83
- end
84
- end
85
- out += content_tag :tr, name_cell + value_cell
86
- end
87
- end
88
- return content_tag :table, raw(out), :cellspacing => 0, :cellpadding => 0
89
- end
90
-
91
- # display a list of objects
92
- def inline_forms_list(objects, attribute )
93
- t = String.new
94
- # link to new
95
- update_span = attribute.to_s.underscore + '_list'
96
- t += content_tag :li, :class => "new_record_link_li" do
97
- link_to "New",
98
- send('new_' + attribute.to_s.singularize.underscore + '_path', :update => update_span),
99
- :remote => true
100
- end
101
- # list of objects
102
- objects.each do |object|
103
- css_class_id = object.class.to_s.underscore + '_' + object.id.to_s
104
- t += content_tag :li, :id => css_class_id, :class => cycle("odd", "even") do
105
- link_to h(object._presentation),
106
- send( object.class.to_s.underscore + '_path', object, :update => css_class_id),
107
- :remote => true
108
- end
109
- end
110
- t = content_tag :ul, :id => update_span, :class => "inline_forms_list" do
111
- t.html_safe
112
- end
113
- return t
114
- end
115
-
116
11
  private
117
12
 
118
13
  # close icon
@@ -0,0 +1,70 @@
1
+ <% flash.each do |key, value| %>
2
+ <div id="flash" class="flash <%= key %>"><%= value %></div>
3
+ <% end %>
4
+
5
+ <!-- purpose: list objects. we come here from #index and from #new.
6
+ If we come here for the 'first' time, we dont' have parents; its just a list of objects.
7
+ But if we come here because we are called from the show partial, then we have to deal wits some parent object.
8
+ Unfortaunatlly, the way :locals work, these are local variables, like object, but if we come from a controller,
9
+ they are @object. We need this magic here to rewrite all the @variables to variables. Ugh. -->
10
+
11
+ <% ul_needed = true %>
12
+ <% if not defined?(parent_class) %>
13
+ <% # we didn't come here via _show.html.erb %>
14
+ <% if @parent_class.nil? %>
15
+ <% # the controller didn't give us a parent_class, this means we are here for the 'first' time %>
16
+ <% # we have to rely on the @Klass set in the controller %>
17
+ <% update_span = @Klass.to_s.pluralize.downcase + '_list' %>
18
+ <% human_readable_class = @Klass.to_s.humanize.downcase %>
19
+ <% path_to_new = "new_#{@Klass.to_s.singularize.underscore}_path" %>
20
+ <% parent_class = nil %>
21
+ <% parent_id = nil %>
22
+ <% objects = @objects %>
23
+ <% else %>
24
+ <% # the controller gave us an @parent_class, so ... %>
25
+ <% attribute = @Klass.to_s.underscore.pluralize %>
26
+ <% update_span = "#{@parent_class.to_s.underscore}_#{@parent_id}_#{attribute}_list" -%>
27
+ <% human_readable_class= attribute.to_s.singularize.humanize.downcase %>
28
+ <% path_to_new='new_' + attribute.to_s.underscore.singularize + '_path' %>
29
+ <% parent_class=@parent_class %>
30
+ <% parent_id=@parent_id %>
31
+ <% objects = @objects %>
32
+ <% ul_needed = false %>
33
+ <% end %>
34
+ <% else %>
35
+ <% # here we come from _show %>
36
+ <% update_span = "#{parent_class.to_s.underscore}_#{parent_id}_#{attribute}_list" -%>
37
+ <% human_readable_class = attribute.to_s.singularize.humanize.downcase %>
38
+ <% path_to_new='new_' + attribute.to_s.singularize + '_path' %>
39
+ <% objects = parent_class.find(parent_id).send(attribute) %>
40
+ <% end %>
41
+
42
+ <% if ul_needed %>
43
+ <ul id="<%= update_span -%>" class="inline_forms_list">
44
+ <% end %>
45
+ <!-- # link to new -->
46
+ <li class="new_record_link">
47
+ <%= link_to "Add a new #{human_readable_class}",
48
+ send(path_to_new, :update => update_span,
49
+ :parent_class => parent_class,
50
+ :parent_id => parent_id ),
51
+ :remote => true -%>
52
+ </li>
53
+ <!-- # list of objects -->
54
+ <% for object in objects %>
55
+ <% if parent_class.nil? %>
56
+ <% css_class_id = object.class.to_s.underscore + '_' + object.id.to_s -%>
57
+ <% path_to_object = object.class.to_s.underscore + '_path' %>
58
+ <% else %>
59
+ <% css_class_id = parent_class.to_s.underscore + '_' + parent_id.to_s + '_' + attribute.to_s.singularize.underscore + "_" + object.id.to_s -%>
60
+ <% path_to_object = attribute.to_s.singularize.underscore + "_path" %>
61
+ <% end %>
62
+ <li id="<%= css_class_id -%>" class="<%= cycle('odd', 'even') -%>" >
63
+ <%= link_to h(object._presentation),
64
+ send( path_to_object, object, :update => css_class_id),
65
+ :remote => true -%>
66
+ </li>
67
+ <% end -%>
68
+ <% if ul_needed %>
69
+ </ul>
70
+ <% end %>
@@ -1,12 +1,47 @@
1
- <% form_tag send(@Klass.to_s.underscore.pluralize + '_path', :update => @update_span || 'inline_forms_list' ),
1
+ <li>
2
+ <% form_tag send(@Klass.to_s.underscore.pluralize + '_path', :update => @update_span,
3
+ :parent_class => @parent_class,
4
+ :parent_id => @parent_id ),
2
5
  :multipart => true, :remote => true, :class => "edit_form" do -%>
3
6
  <div class="edit_form_field">
4
- <%= inline_forms_new_record @object %>
7
+ <table cellspacing="0" cellpadding="0">
8
+ <tr>
9
+ <th colspan="2" valign="top">
10
+ <div class="object_presentation" >
11
+ Add a new <%= @object.class.to_s.singularize.downcase -%>
12
+ </div>
13
+ </th>
14
+ </tr>
15
+ <% attributes ||= @object.inline_forms_attribute_list -%>
16
+ <% attributes.each do | attribute, name, form_element | -%>
17
+ <% unless form_element.to_sym == :associated -%>
18
+ <% css_class_id = "attribute_#{attribute}_#{@object.id}" -%>
19
+ <tr>
20
+ <td valign="top">
21
+ <div class='<%= "attribute_name attribute_#{attribute} form_element_#{form_element}" -%>' >
22
+ <%= h(name) -%>
23
+ </div>
24
+ </td>
25
+ <td valign="top">
26
+ <div class='<%= "attribute_value attribute_#{attribute} form_element_#{form_element}" -%>' >
27
+ <span id="<%= css_class_id -%>" >
28
+ <%= send("#{form_element}_edit", @object, attribute) -%>
29
+ </span>
30
+ </div>
31
+ </td>
32
+ </tr>
33
+ <% end -%>
34
+ <% end -%>
35
+ </table>
5
36
  </div>
6
- <%= link_to( send(@Klass.to_s.underscore.pluralize + '_path',:update => @update_span || 'inline_forms_list'), :remote => true,
37
+ <%= link_to( send(@Klass.to_s.underscore.pluralize + '_path', :update => @update_span,
38
+ :parent_class => @parent_class,
39
+ :parent_id => @parent_id ),
40
+ :remote => true,
7
41
  :class => "edit_form_cancel" ) do %>
8
42
  <input type="button" name="cancel" value="cancel" />
9
- <% end %>
43
+ <% end %>
10
44
  <%= submit_tag "ok", :class => "edit_form_submit"-%>
11
45
  <div style="clear: both;"></div>
12
- <% end -%>
46
+ <% end %>
47
+ </li>
@@ -0,0 +1,39 @@
1
+ <table cellspacing="0" cellpadding="0">
2
+ <tr>
3
+ <th valign="top">
4
+ <div class="object_presentation" >
5
+ <%= h(@object._presentation) -%>
6
+ </div>
7
+ </th>
8
+ <th valign="top">
9
+ <div class="close_link" >
10
+ <%= close_link(@object) -%>
11
+ </div>
12
+ </th>
13
+ </tr>
14
+ <% attributes ||= @object.inline_forms_attribute_list -%>
15
+ <% attributes.each do | attribute, name, form_element | -%>
16
+ <% css_class_id = "#{@object.class.to_s.underscore}_#{@object.id}_#{attribute}" -%>
17
+ <tr>
18
+ <td valign="top">
19
+ <div class='<%= "attribute_name attribute_#{attribute} form_element_#{form_element}" -%>' >
20
+ <%= h(name) -%>
21
+ </div>
22
+ </td>
23
+ <td valign="top">
24
+ <div class='<%= "attribute_value attribute_#{attribute} form_element_#{form_element}" -%>' >
25
+ <span id="<%= css_class_id -%>" >
26
+ <% if form_element == :associated -%>
27
+ <%= render :partial => "inline_forms/list",
28
+ :locals => { :parent_class => @object.class,
29
+ :parent_id => @object.id,
30
+ :attribute => attribute } %>
31
+ <% else -%>
32
+ <%= send("#{form_element}_show", @object, attribute) -%>
33
+ <% end -%>
34
+ </span>
35
+ </div>
36
+ </td>
37
+ </tr>
38
+ <% end -%>
39
+ </table>
@@ -9,12 +9,8 @@
9
9
  <%= yield(:head) %>
10
10
  </head>
11
11
  <body>
12
- <%= render "inline_forms/header" %>
13
- <%= render "/inline_forms_tabs" %>
14
- <div id="main">
15
- <ul id="inline_forms_list">
12
+ <%= render "inline_forms/header" %>
13
+ <%= render "/inline_forms_tabs" %>
16
14
  <%= yield %>
17
- </ul>
18
- </div>
19
15
  </body>
20
16
  </html>
data/inline_forms.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{inline_forms}
8
- s.version = "0.9.2"
8
+ s.version = "0.9.3"
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"]
@@ -42,9 +42,9 @@ Gem::Specification.new do |s|
42
42
  "app/models/geo_code_curacao.rb",
43
43
  "app/views/inline_forms/_edit.html.erb",
44
44
  "app/views/inline_forms/_header.html.erb",
45
- "app/views/inline_forms/_index.html.erb",
45
+ "app/views/inline_forms/_list.html.erb",
46
46
  "app/views/inline_forms/_new.html.erb",
47
- "app/views/inline_forms/index.html.erb",
47
+ "app/views/inline_forms/_show.html.erb",
48
48
  "app/views/layouts/inline_forms.rhtml",
49
49
  "inline_forms.gemspec",
50
50
  "lib/generators/inline_forms/USAGE",
@@ -10,7 +10,9 @@
10
10
  TODO customize this sample style
11
11
  Syntax recommendation http://www.w3.org/TR/REC-CSS2/
12
12
  */
13
-
13
+ #flash {
14
+ border: 4px solid white;
15
+ }
14
16
  root {
15
17
  display: block;
16
18
  }
@@ -21,64 +23,69 @@ body {
21
23
  padding: 0;
22
24
  margin: 0;
23
25
  font-family: sans-serif;
26
+ font-size: 12pt;
24
27
  }
25
28
 
26
29
  a {
27
30
  text-decoration: none;
28
31
  }
29
- #inline_forms_list {
30
- padding: 0;
31
- margin: 0;
32
- list-style-type: none;
33
- font-size: 0.7em;
34
- font-weight: normal;
35
- }
36
32
 
37
33
  .inline_forms_list {
34
+ font-size: 100%;
35
+ font-weight: normal;
38
36
  padding: 0.7em;
39
- margin: 0;
37
+ margin: 0.4em 1em 0.4em 1em;
40
38
  list-style-type: none;
41
39
  -moz-border-radius: 10px;
42
40
  -webkit-border-radius: 10px;
43
41
  -webkit-box-shadow: 0 1px 3px rgba(0,0,0, .4);
44
42
  -moz-box-shadow: 0 1px 3px rgba(0,0,0, .4);
43
+ background-color: #F9EBAE;
45
44
  }
46
45
 
47
- #inline_forms_list li.inline_forms_new_record_link {
48
- padding: 0.5em;
46
+
47
+ .inline_forms_list .new_record_link {
48
+ font-size: 110%;
49
+ padding: 0.3em;
50
+ border: solid #999999 1px;
51
+ text-decoration: none;
52
+ text-align: center;
53
+ color:black;
54
+ background-color: #EBEAE9;
55
+ background-image: -moz-linear-gradient(100% 100% 90deg, #cccccc,#EBEAE9);
56
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#cccccc), to(#EBEAE9));
57
+ -moz-border-radius: 5px;
58
+ -webkit-border-radius: 5px;
59
+ -webkit-box-shadow: 0 2px 3px rgba(0,0,0, .4);
60
+ -moz-box-shadow: 0 2px 3px rgba(0,0,0, .4);
61
+ margin-bottom: 0.5em;
62
+ width: 14em;
49
63
  }
50
64
 
51
- #inline_forms_list li a {
65
+ .inline_forms_list li a {
52
66
  color: #385B7B;
53
67
  }
54
68
 
55
- #inline_forms_list li {
56
- -moz-border-radius: 10px;
57
- -webkit-border-radius: 10px;
58
- -webkit-box-shadow: 0 1px 1px rgba(0,0,0, .1);
59
- -moz-box-shadow: 0 1px 1px rgba(0,0,0, .1);
69
+ .inline_forms_list li {
60
70
  padding: 0.5em;
61
71
  margin-bottom: 0.3em;
62
72
  }
63
73
 
64
- #inline_forms_list li.even {
74
+ .inline_forms_list li.odd {
65
75
  background-color: #FFE58C;
66
76
  }
67
77
 
68
- #inline_forms_list li.odd {
78
+ .inline_forms_list li.even {
69
79
  background-color: #FFEDB0;
70
80
  }
71
81
 
72
- #inline_forms_list li table {
82
+ .inline_forms_list li table {
73
83
  border: 1px solid #EFCA4B;
74
- -moz-border-radius: 5px;
75
- -webkit-border-radius: 5px;
76
84
  margin: 0;
77
85
  padding: 0;
78
- width: 100%;
79
86
  }
80
87
 
81
- #inline_forms_list table tr th {
88
+ .inline_forms_list table tr th {
82
89
  padding: 0.2em 0.5em 0.2em 0.2em;
83
90
  border-bottom: 1px dotted lightgrey;
84
91
  font-weight: bold;
@@ -86,43 +93,38 @@ a {
86
93
  background-color: #EFCA4B;
87
94
  }
88
95
 
89
- #inline_forms_list li table tr td {
96
+ .inline_forms_list li table tr td {
90
97
  padding: 0.2em 0.5em 0.2em 0.2em;
91
- border-bottom: 1px dotted lightgrey;
92
98
  font-weight: normal;
93
99
  background-color: #F9EBAE;
94
100
  }
95
- /*#inline_forms_list div.attribute_name{
96
- font-weight: bold;
97
- }
98
- */
99
- #inline_forms_list div.attribute_value a{
100
- color: #385B7B;
101
- }
102
- /*
103
- #inline_forms_list div.form_element_text_attribute { }
104
- #inline_forms_list div.form_element_associated ul {
105
- list-style-type: none;
106
- padding: 0;
107
- margin: 0;
108
- }
109
- #inline_forms_list div.form_element_associated li {
110
- padding: 0em 0.5em 0.2em 0;
111
101
 
112
- }
113
- #inline_forms_list div.form_element_associated li a {
114
- padding: 0;
115
- margin: 0;
102
+ .inline_forms_list div.attribute_value {
103
+ margin-left: 1em;
116
104
  }
117
105
 
118
- #inline_forms_list div.associated_new {
106
+ .inline_forms_list div.attribute_value a{
107
+ color: #385B7B;
119
108
  }
120
- */
121
109
  .attribute_text_area {
122
- width: 80em;
110
+ width: 600px;
123
111
  height: 4em;
112
+ padding: 0.2em;
113
+ background-color: #FFE58C;
114
+ border: 1px solid #eee;
115
+ -moz-border-radius: 5px;
116
+ -webkit-border-radius: 5px;
124
117
  }
125
118
 
119
+ .input_text_field {
120
+ width: 600px;
121
+ height: 1.5em;
122
+ padding: 0.2em;
123
+ background-color: #FFE58C;
124
+ border: 1px solid #eee;
125
+ -moz-border-radius: 5px;
126
+ -webkit-border-radius: 5px;
127
+ }
126
128
 
127
129
  .edit_form_checklist ul {
128
130
  list-style-type: none;
@@ -146,7 +148,7 @@ ul.checklist li {
146
148
  }
147
149
 
148
150
 
149
- #inline_forms_list .edit_form_checklist ul li {
151
+ .inline_forms_list .edit_form_checklist ul li {
150
152
  margin: 0;
151
153
  padding: 0 0 0.3em 0;
152
154
  }
@@ -164,7 +166,6 @@ ul.checklist li {
164
166
  #Header {
165
167
  background-color: #B94C32;
166
168
  color: #FFFFFF;
167
- font-size: x-large;
168
169
  font-weight: bold;
169
170
  -moz-border-radius: 5px;
170
171
  -webkit-border-radius: 5px;
@@ -177,8 +178,6 @@ ul.checklist li {
177
178
 
178
179
  #tabs {
179
180
  background-color: #F9EBAE;
180
- font-size: x-large;
181
- font-weight: bold;
182
181
  -moz-border-radius: 5px;
183
182
  -webkit-border-radius: 5px;
184
183
  -webkit-box-shadow: 0 1px 3px rgba(0,0,0, .4);
@@ -187,15 +186,15 @@ ul.checklist li {
187
186
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F9EBAE), to(#F9EBAE));
188
187
  padding: 0.4em;
189
188
  margin: 0 1em 0.4em 1em;
190
- /* border: 1px solid white;*/
191
189
  }
192
190
 
193
191
  #tabs li {
192
+ font-size: 130%;
193
+ font-weight: bold;
194
194
  display: inline-block;
195
195
  background-color: #EFE06C;
196
196
  padding: 0.2em 0.3em;
197
197
  border: 1px solid #385b7b;
198
- font-size: smaller;
199
198
  -moz-border-radius: 5px;
200
199
  -webkit-border-radius: 5px;
201
200
  -webkit-box-shadow: 0 1px 3px rgba(0,0,0, .4);
@@ -221,19 +220,6 @@ ul.checklist li {
221
220
  border: 2px solid #385b7b;
222
221
  }
223
222
 
224
- #main {
225
- background-color: #F9EBAE;
226
- font-size: x-large;
227
- font-weight: bold;
228
- -moz-border-radius: 5px;
229
- -webkit-border-radius: 5px;
230
- -webkit-box-shadow: 0 1px 3px rgba(0,0,0, .4);
231
- -moz-box-shadow: 0 1px 3px rgba(0,0,0, .4);
232
- padding: 0.4em;
233
- margin: 0 1em 0.4em 1em;
234
- /* border: 1px solid white;*/
235
- }
236
-
237
223
  .close_icon {
238
224
  border: 0;
239
225
  margin: 1px;
@@ -248,27 +234,26 @@ ul.checklist li {
248
234
  -moz-box-shadow: 0 1px 3px rgba(0,0,0, .4);
249
235
  background-image: -moz-linear-gradient(100% 100% 90deg, #EFCA4B, #F9EBAE );
250
236
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#EFCA4B), to(#F9EBAE));
251
- padding: 0.7em; }
237
+ padding: 0.7em;
238
+ margin: 0 1em 0.4em 1em;
239
+ }
240
+
252
241
  .pagination a, .pagination span, .pagination em {
242
+ font-size: 70%;
253
243
  padding-left:8px;
254
244
  padding-right:8px;
255
245
  padding-top:5px;
256
246
  padding-bottom: 5px;
257
247
  border: solid #999999 1px;
258
248
  text-decoration: none;
259
-
260
249
  color:black;
261
250
  background-color: #EBEAE9;
262
-
263
251
  background-image: -moz-linear-gradient(100% 100% 90deg, #cccccc,#EBEAE9);
264
252
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#cccccc), to(#EBEAE9));
265
-
266
253
  -moz-border-radius: 5px;
267
254
  -webkit-border-radius: 5px;
268
255
  -webkit-box-shadow: 0 2px 3px rgba(0,0,0, .4);
269
256
  -moz-box-shadow: 0 2px 3px rgba(0,0,0, .4);
270
-
271
-
272
257
  }
273
258
 
274
259
  .pagination a:hover {
@@ -277,210 +262,43 @@ ul.checklist li {
277
262
  background-image: -moz-linear-gradient(100% 100% 90deg, #F9EBAE,#EFCA4B);
278
263
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#EFCA4B), to(#F9EBAE));
279
264
  }
265
+
280
266
  .pagination em {
281
267
  background-color: #eeeeee;
282
268
  color: black;
283
-
284
269
  background-image: -moz-linear-gradient(100% 100% 90deg, #eeeeee, #ffffff);
285
270
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ffffff), to(#eeeeee));
286
271
  }
287
272
 
288
-
289
273
  .pagination span.disabled {
290
274
  color: #AAA; }
291
275
 
292
-
293
- dt label {
294
- margin-left: 18px;
295
- }
296
- dd {
297
- margin-bottom: 10px;
298
- }
299
- input[type='text'] {
300
- font-size: 1.2em;
301
- width: 80%;
302
- }
303
- select {
304
- font-size: 1.1em;
305
- width: 80%;
306
- }
307
- #HeaderUserMenu {
308
- font-size: 10px;
309
- float:right;
310
- }
311
- #HeaderUserMenu a {
312
- text-decoration: none;
313
- color: #333333;
314
- }
315
-
316
- #MainMenu ul {
317
- padding:0;
318
- margin:0;
319
- }
320
- #MainMenu li {
321
- display: inline;
322
- list-style: none;
323
- padding-right: 10px;
324
- margin: 0;
325
- }
326
- #MainMenu a {
276
+ #paginate_info {
327
277
  color: #ffffff;
328
- text-decoration: none;
329
- padding: 5px;
330
- border-bottom: none;
331
- }
332
- #MainMenu a:hover {
333
- color: white;
334
- background-image: -moz-linear-gradient(100% 100% 90deg, #385b7b,#48739c);
335
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#48739c), to(#385b7b));
336
- -moz-border-radius: 5px;
337
- -webkit-border-radius: 5px;
338
- -webkit-transform: scale(1.1);
339
- -moz-transform: scale(1.1);
340
- -webkit-box-shadow: 0 2px 5px rgba(0,0,0, .5);
341
- -moz-box-shadow: 0 2px 5px rgba(0,0,0, .5);
342
- }
343
- .Section {
344
- background-color: #ffffff;
345
- -moz-border-radius: 5px;
346
- -webkit-border-radius: 5px;
347
- -webkit-box-shadow: 0 1px 3px rgba(0,0,0, .4);
348
- -moz-box-shadow: 0 1px 3px rgba(0,0,0, .4);
349
- border: 1px solid #cccccc;
350
- padding: 5px;
351
- margin-top: 10px;
352
- margin-bottom: 10px;
353
- }
354
- .SectionHeading {
355
- background-color: #eeeeee;
356
- font-size: 16px;
357
278
  font-weight: bold;
358
279
  -moz-border-radius: 5px;
359
280
  -webkit-border-radius: 5px;
360
- -webkit-box-shadow: 0 1px 3px rgba(0,0,0, .4);
361
- -moz-box-shadow: 0 1px 3px rgba(0,0,0, .4);
362
- border-bottom: 1px solid #cccccc;
363
- background-image: -moz-linear-gradient(100% 100% 90deg, #eeeeee, #ffffff);
364
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ffffff), to(#eeeeee));
365
- padding: 10px;
366
- }
367
- .SectionHeadingMenu {
368
- font-size: 12px;
369
- float:right;
370
- }
371
- .SectionHeadingMenu a {
372
- text-decoration: none;
373
- border: none;
374
- padding: 5px;
375
- color: #333333;
376
- }
377
- .SectionHeadingMenu a:hover {
378
- color: white;
379
- background-color: #385b7b;
380
- background-image: -moz-linear-gradient(100% 100% 90deg, #385b7b,#48739c);
381
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#48739c), to(#385b7b));
382
- -moz-border-radius: 5px;
383
- -webkit-border-radius: 5px;
384
- -webkit-box-shadow: 0 1px 3px rgba(0,0,0, .4);
385
- -moz-box-shadow: 0 1px 3px rgba(0,0,0, .4);
386
- }
387
-
388
- .SectionContent {
389
- margin-top: 10px;
390
- margin-bottom: 10px;
391
- }
392
- .SectionContent p {
393
- padding-left: 5px;
394
- padding-right: 5px;
395
- }
396
-
397
- .DataTable {
398
- padding-top: 10px;
399
- padding-bottom: 15px;
400
- border-collapse: collapse;
401
-
402
- }
403
- .DataTable th {
404
- background-color: #dddddd;
405
- color: #333333 !important;
406
- border-top: solid 1px #cccccc;
407
- border-bottom: solid 1px #cccccc;
408
- }
409
-
410
- .DataTable td {
411
- border-bottom: solid 1px #eeeeee;
412
-
413
- }
414
- .DataTable tr:hover {
415
- color:#ffffff;
416
- background-color: #385b7b;
417
- background-image: -moz-linear-gradient(100% 100% 90deg, #385b7b,#48739c);
418
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#48739c), to(#385b7b));
419
- -webkit-box-shadow: 0 1px 3px rgba(0,0,0, .4);
420
- -moz-box-shadow: 0 1px 3px rgba(0,0,0, .4);
421
- }
422
-
423
- .DataTable tr:hover a {
424
- color: #ffffff;
425
- border-bottom: solid 1px #ffffff;
426
- }
427
- .PaginationWidget {
428
- text-align:center;
429
- }
430
- .PaginationWidget ul {
431
-
432
- }
433
- .PaginationWidget ul li {
434
- display: inline;
435
- list-style: none;
436
- padding-right: 5px;
437
- margin: 0;
438
- }
439
- .PaginationWidget ul li img {
440
- margin-bottom: -2px;
441
- }
442
- .PaginationWidget ul li a {
443
- padding-left:8px;
444
- padding-right:8px;
445
- padding-top:5px;
446
- padding-bottom: 5px;
447
- border: solid #999999 1px;
448
- text-decoration: none;
449
-
450
- color:black;
451
- background-color: #cccccc;
452
-
453
- background-image: -moz-linear-gradient(100% 100% 90deg, #999999,#cccccc);
454
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#cccccc), to(#999999));
455
-
456
- -moz-border-radius: 5px;
457
- -webkit-border-radius: 5px;
458
- -webkit-box-shadow: 0 2px 3px rgba(0,0,0, .4);
459
- -moz-box-shadow: 0 2px 3px rgba(0,0,0, .4);
281
+ -webkit-box-shadow: 0 1px 1px rgba(0,0,0, .1);
282
+ -moz-box-shadow: 0 1px 1px rgba(0,0,0, .1);
283
+ background-color: #EFCA4B;
284
+ padding: 0.7em;
285
+ margin: 0 1em 0.4em 1em;
460
286
 
461
287
  }
462
-
463
- .ErrorMessage {
288
+ .error {
464
289
  color: #ffffff;
465
- font-size: 14px;
466
290
  font-weight: bold;
467
- -moz-border-radius: 5px;
468
- -webkit-border-radius: 5px;
469
- -webkit-box-shadow: 0 1px 3px rgba(0,0,0, .4);
470
- -moz-box-shadow: 0 1px 3px rgba(0,0,0, .4);
471
- border-bottom: 1px solid #cccccc;
291
+ -moz-border-radius: 10px;
292
+ -webkit-border-radius: 10px;
293
+ -webkit-box-shadow: 0 1px 1px rgba(0,0,0, .1);
294
+ -moz-box-shadow: 0 1px 1px rgba(0,0,0, .1);
472
295
  background-color: #a70f0f;
473
296
  background-image: -moz-linear-gradient(100% 100% 90deg, #a70f0f, #c01313);
474
297
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#c01313), to(#a70f0f));
475
- padding: 10px;
476
- margin-top: 5px;
477
- margin-bottom: 5px;
478
- margin-left: 10px;
479
- margin-right: 10px
298
+ padding: 0.7em;
480
299
  }
481
- .SuccessMessage {
300
+ .success {
482
301
  color: #ffffff;
483
- font-size: 14px;
484
302
  font-weight: bold;
485
303
  -moz-border-radius: 5px;
486
304
  -webkit-border-radius: 5px;
@@ -490,18 +308,6 @@ select {
490
308
  background-color: #4f8d0d;
491
309
  background-image: -moz-linear-gradient(100% 100% 90deg, #4f8d0d, #5ba210);
492
310
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#5ba210), to(#4f8d0d));
493
- padding: 10px;
494
- margin-top: 5px;
495
- margin-bottom: 5px;
496
- margin-left: 10px;
497
- margin-right: 10px;
498
-
499
- }
500
- #Footer {
501
- font-size: 10px;
502
- padding-top: 5px;
503
- border-top: solid 1px #dddddd;
504
- }
505
- #CopyrightStatement {
506
- text-align: right;
311
+ padding: 0.7em;
312
+ margin-bottom: 0.5em;
507
313
  }
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: 63
4
+ hash: 61
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 2
10
- version: 0.9.2
9
+ - 3
10
+ version: 0.9.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ace Suares
@@ -113,9 +113,9 @@ files:
113
113
  - app/models/geo_code_curacao.rb
114
114
  - app/views/inline_forms/_edit.html.erb
115
115
  - app/views/inline_forms/_header.html.erb
116
- - app/views/inline_forms/_index.html.erb
116
+ - app/views/inline_forms/_list.html.erb
117
117
  - app/views/inline_forms/_new.html.erb
118
- - app/views/inline_forms/index.html.erb
118
+ - app/views/inline_forms/_show.html.erb
119
119
  - app/views/layouts/inline_forms.rhtml
120
120
  - inline_forms.gemspec
121
121
  - lib/generators/inline_forms/USAGE
@@ -1,6 +0,0 @@
1
- <% flash.each do |key, value| %>
2
- <div id="flash" class="flash <%= key %>"><%= value %></div>
3
- <% end %>
4
- <%= inline_forms_list(@objects, @Klass.to_s.pluralize) %>
5
- <%= will_paginate @objects %>
6
- <div id="paginate_info"><%= page_entries_info @objects %></div>
@@ -1,7 +0,0 @@
1
- <% flash.each do |key, value| %>
2
- <div id="flash" class="flash <%= key %>"><%= value %></div>
3
- <% end %>
4
-
5
- <%= inline_forms_list(@objects, @Klass.to_s.pluralize) %>
6
- <%= will_paginate @objects %>
7
- <div id="paginate_info"><%= page_entries_info @objects %></div>