inline_forms 0.9.24 → 0.9.25

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 CHANGED
@@ -1 +1 @@
1
- 0.9.24
1
+ 0.9.25
@@ -64,9 +64,8 @@ class InlineFormsController < ApplicationController
64
64
  @objects = @Klass.order(@Klass.order_by_clause).paginate :page => params[:page], :per_page => @PER_PAGE || 12, :conditions => conditions
65
65
  end
66
66
  respond_to do |format|
67
- # found this here: http://www.ruby-forum.com/topic/211467
68
67
  format.html { render 'inline_forms/_list', :layout => 'inline_forms' } unless @Klass.not_accessible_through_html?
69
- format.js { render(:update) {|page| page.replace_html update_span, :partial => 'inline_forms/list' } }
68
+ format.js { }
70
69
  end
71
70
  end
72
71
 
@@ -83,9 +82,7 @@ class InlineFormsController < ApplicationController
83
82
  @object[@parent_class.foreign_key] = @parent_id
84
83
  end
85
84
  respond_to do |format|
86
- # found this here: http://www.ruby-forum.com/topic/211467
87
- format.js { render(:update) {|page| page.replace_html @update_span, :partial => 'inline_forms/new'}
88
- }
85
+ format.js { }
89
86
  end
90
87
  end
91
88
 
@@ -100,9 +97,7 @@ class InlineFormsController < ApplicationController
100
97
  @sub_id = params[:sub_id]
101
98
  @update_span = params[:update]
102
99
  respond_to do |format|
103
- # found this here: http://www.ruby-forum.com/topic/211467
104
- format.js { render(:update) {|page| page.replace_html @update_span, :partial => 'inline_forms/edit'}
105
- }
100
+ format.js { }
106
101
  end
107
102
  end
108
103
 
@@ -131,9 +126,7 @@ class InlineFormsController < ApplicationController
131
126
  @objects = @Klass.order(@Klass.order_by_clause).paginate :page => params[:page], :per_page => @PER_PAGE || 12, :conditions => conditions
132
127
  end
133
128
  respond_to do |format|
134
- # found this here: http://www.ruby-forum.com/topic/211467
135
- format.js { render(:update) {|page| page.replace_html @update_span, :partial => 'inline_forms/list'}
136
- }
129
+ format.js { render :list }
137
130
  end
138
131
  else
139
132
  flash.now[:error] = "Failed to create #{object.class.to_s.underscore}.".html_safe
@@ -142,8 +135,7 @@ class InlineFormsController < ApplicationController
142
135
  end
143
136
  respond_to do |format|
144
137
  @object = object
145
- format.js { render(:update) {|page| page.replace_html @update_span, :partial => 'inline_forms/new'}
146
- }
138
+ format.js { render :new}
147
139
  end
148
140
  end
149
141
  end
@@ -160,9 +152,7 @@ class InlineFormsController < ApplicationController
160
152
  send("#{@form_element.to_s}_update", @object, @attribute)
161
153
  @object.save
162
154
  respond_to do |format|
163
- # found this here: http://www.ruby-forum.com/topic/211467
164
- format.js { render(:update) {|page| page.replace_html @update_span, :inline => '<%= send("#{@form_element.to_s}_show", @object, @attribute) %>' }
165
- }
155
+ format.js { }
166
156
  end
167
157
  end
168
158
 
@@ -187,30 +177,15 @@ class InlineFormsController < ApplicationController
187
177
  if @attribute.nil?
188
178
  respond_to do |format|
189
179
  @attributes = @object.inline_forms_attribute_list
190
- # found this here: http://www.ruby-forum.com/topic/211467
191
180
  if close
192
- format.js do
193
- render(:update) do |page|
194
- page.replace_html @update_span, :inline => '<%= link_to h(@object._presentation), send(@object.class.to_s.underscore + "_path", @object, :update => @update_span), :remote => true %>'
195
- end
196
- end
181
+ format.js { render :close }
197
182
  else
198
- format.js do
199
- render(:update) do |page|
200
- page.replace_html @update_span, :partial => 'inline_forms/show'
201
- end
202
- end
203
- # format.js { render(:update) {|page| page.replace_html @update_span, :inline => '<%= send( "inline_forms_show_record", @object) %>' } }
183
+ format.js { }
204
184
  end
205
185
  end
206
186
  else
207
187
  respond_to do |format|
208
- # found this here: http://www.ruby-forum.com/topic/211467
209
- format.js do
210
- render(:update) do |page|
211
- page.replace_html @update_span, :inline => '<%= send("#{@form_element}_show", @object, @attribute) %>'
212
- end
213
- end
188
+ format.js { render :show_element }
214
189
  end
215
190
  end
216
191
  end
@@ -5,21 +5,20 @@ def text_area_show(object, attribute)
5
5
  link_to_inline_edit object,
6
6
  attribute,
7
7
  '<div class="ckeditor_area">'.html_safe +
8
- ckeditor_textarea(
9
- object.class,
10
- attribute,
11
- :value => object[attribute],
12
- :id => "textarea_#{object.class.name.underscore}_#{object.id}_#{attribute.to_s}",
13
- :width => '100%',
14
- :ckeditor_options => {
15
- :height => '200px',
16
- :toolbar => "None",
17
- :readOnly => "true",
18
- :resize_enabled => "false",
19
- :toolbarCanCollapse => "false"
20
- }
8
+ cktext_area_tag(
9
+ attribute,
10
+ object[attribute],
11
+ :input_html => { :id => "textarea_#{object.class.name.underscore}_#{object.id}_#{attribute.to_s}",
12
+ :width => '100%' },
13
+ :height => '200px',
14
+ :toolbar => "None",
15
+ :readOnly => "true",
16
+ :resize_enabled => "false",
17
+ :toolbarCanCollapse => "false"
21
18
  ) +
22
- '<img class="glass_plate" src="images/glass_plate.gif" />'.html_safe +
19
+ image_tag( 'glass_plate.gif',
20
+ :class => "glass_plate",
21
+ :title => '' ) +
23
22
  '</div>'.html_safe
24
23
  else
25
24
  link_to_inline_edit object, attribute, object[attribute]
@@ -28,14 +27,12 @@ end
28
27
 
29
28
  def text_area_edit(object, attribute)
30
29
  if defined? Ckeditor
31
- ckeditor_textarea(
32
- object.class,
30
+ cktext_area_tag(
33
31
  attribute,
34
- :value => object[attribute],
35
- :id => "textarea_#{object.class.name.underscore}_#{object.id}_#{attribute.to_s}",
36
- :width => '100%',
37
- :height => '200px',
38
- :name => attribute
32
+ object[attribute],
33
+ :input_html => { :id => "textarea_#{object.class.name.underscore}_#{object.id}_#{attribute.to_s}",
34
+ :width => '100%'},
35
+ :height => '200px'
39
36
  )
40
37
  else
41
38
  text_area_tag attribute, object[attribute], :class => 'attribute_text_area'
@@ -11,8 +11,9 @@ module InlineFormsHelper
11
11
 
12
12
  # close link
13
13
  def close_link( object, update_span )
14
- link_to image_tag( 'css/close.png',
15
- :class => "close_icon" ),
14
+ link_to image_tag( 'close.png',
15
+ :class => "close_icon",
16
+ :title => 'close' ),
16
17
  send( object.class.to_s.underscore + '_path',
17
18
  object,
18
19
  :update => update_span,
@@ -1,4 +1,4 @@
1
- <% form_tag send(@object.class.to_s.underscore + '_path', :update => @update_span ,
1
+ <%= form_tag send(@object.class.to_s.underscore + '_path', :update => @update_span ,
2
2
  :attribute => @attribute,
3
3
  :form_element => @form_element,
4
4
  :sub_id => @sub_id ),
@@ -5,7 +5,7 @@
5
5
  <script type="text/javascript">
6
6
  $(function() { $("#flash").delay(1000).fadeTo('slow', 0.33); } );
7
7
  </script>
8
- <% form_tag send(@Klass.to_s.underscore.pluralize + '_path', :update => @update_span,
8
+ <%= form_tag send(@Klass.to_s.underscore.pluralize + '_path', :update => @update_span,
9
9
  :parent_class => @parent_class,
10
10
  :parent_id => @parent_id ),
11
11
  :multipart => true, :remote => true, :class => "edit_form" do -%>
@@ -0,0 +1 @@
1
+ $('#<%= @update_span %>').html('<%= escape_javascript(link_to h(@object._presentation), send(@object.class.to_s.underscore + "_path", @object, :update => @update_span), :remote => true)%>')
@@ -0,0 +1 @@
1
+ $('#<%= @update_span %>').html('<%= escape_javascript(render(:partial => 'inline_forms/edit' ))%>')
@@ -0,0 +1 @@
1
+ $('#<%= @update_span %>').html('<%= escape_javascript(render(:partial => 'inline_forms/list' ))%>')
@@ -0,0 +1 @@
1
+ $('#<%= @update_span %>').html('<%= escape_javascript(render(:partial => 'inline_forms/new' ))%>')
@@ -0,0 +1 @@
1
+ $('#<%= @update_span %>').html('<%= escape_javascript(render(:partial => 'inline_forms/show' ))%>')
@@ -0,0 +1 @@
1
+ $('#<%= @update_span %>').html('<%= escape_javascript(send("#{@form_element}_show", @object, @attribute))%>')
@@ -0,0 +1 @@
1
+ $('#<%= @update_span %>').html('<%= escape_javascript(send("#{@form_element.to_s}_show", @object, @attribute))%>')
@@ -4,8 +4,8 @@
4
4
  <head>
5
5
  <title><%= h(yield(:title) || "xyxyxyx") %></title>
6
6
  <%= csrf_meta_tag %>
7
- <%= stylesheet_link_tag 'inline_forms', 'jquery-ui-sunny' %>
8
- <%= javascript_include_tag :defaults, 'jquery.form', 'jquery.remotipart', :ckeditor %>
7
+ <%= stylesheet_link_tag 'inline_forms' %>
8
+ <%= javascript_include_tag 'application' %>
9
9
  <%= yield(:head) %>
10
10
  <script>
11
11
  $.datepicker.setDefaults({
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.9.24"
8
+ s.version = "0.9.25"
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-09-27}
12
+ s.date = %q{2011-10-03}
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 = [
@@ -49,7 +49,14 @@ Gem::Specification.new do |s|
49
49
  "app/views/inline_forms/_list.html.erb",
50
50
  "app/views/inline_forms/_new.html.erb",
51
51
  "app/views/inline_forms/_show.html.erb",
52
- "app/views/layouts/inline_forms.rhtml",
52
+ "app/views/inline_forms/close.js.erb",
53
+ "app/views/inline_forms/edit.js.erb",
54
+ "app/views/inline_forms/list.js.erb",
55
+ "app/views/inline_forms/new.js.erb",
56
+ "app/views/inline_forms/show.js.erb",
57
+ "app/views/inline_forms/show_element.js.erb",
58
+ "app/views/inline_forms/update.js.erb",
59
+ "app/views/layouts/inline_forms.html.erb",
53
60
  "inline_forms.gemspec",
54
61
  "lib/generators/inline_forms/USAGE",
55
62
  "lib/generators/inline_forms/inline_forms_generator.rb",
@@ -64,6 +71,7 @@ Gem::Specification.new do |s|
64
71
  "lib/otherstuff/diffie",
65
72
  "lib/otherstuff/mk-ice-ts",
66
73
  "lib/otherstuff/mk-new-app",
74
+ "lib/otherstuff/mk31-app",
67
75
  "lib/otherstuff/mkrole",
68
76
  "lib/otherstuff/roles_users.sql",
69
77
  "public/images/css/close.png",
@@ -72,10 +72,7 @@ module InlineForms
72
72
 
73
73
  source_root File.expand_path('../templates', __FILE__)
74
74
 
75
- def copy_stylesheet
76
- copy_file File.expand_path('../../../../public/stylesheets', __FILE__) + "/inline_forms.css", "public/stylesheets/inline_forms.css" unless File.exists?('public/stylesheets/inline_forms.css')
77
- end
78
-
75
+
79
76
  # using flags.
80
77
  def set_some_flags
81
78
  @flag_not_accessible_through_html = true
@@ -1,19 +1,13 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rails', '3.0.7'
3
+ gem 'rails', "~> 3.1.0"
4
4
 
5
- # http://stackoverflow.com/questions/5287121/undefined-method-task-using-rake-0-9-0-beta-4
6
- gem 'rake' , '0.8.7'
5
+ gem 'rake'
7
6
 
8
- # Bundle edge Rails instead:
9
- # gem 'rails', :git => 'git://github.com/rails/rails.git'
10
-
11
- gem 'mysql2', '~> 0.2.7'
7
+ gem 'jquery-rails'
12
8
 
13
- # Use unicorn as the web server
14
- # gem 'unicorn'
9
+ gem 'mysql2'
15
10
 
16
- # Deploy with Capistrano
17
11
  gem 'capistrano'
18
12
 
19
13
  gem 'devise'
@@ -28,31 +22,7 @@ gem 'will_paginate', :git => 'git://github.com/acesuares/will_paginate.git', :br
28
22
 
29
23
  gem 'tabs_on_rails'
30
24
 
31
- gem 'jrails'
32
-
33
- gem 'jquery-rails'
34
-
35
- gem 'remotipart', :git => 'git://github.com/JangoSteve/remotipart.git', :branch => 'latest-and-greatest'
36
-
37
- gem "ckeditor", "~> 3.5.4"
38
- #gem 'ckeditor', :git => 'git://github.com/galetahub/rails-ckeditor.git', :branch => 'rails3'
39
- #gem 'ckeditor', :git => 'git://github.com/acesuares/rails-ckeditor.git', :branch => 'rails3'
40
-
41
- #gem 'calendar_date_select' # not rails 3 compatible
42
-
43
- # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
44
- # gem 'ruby-debug'
45
- # gem 'ruby-debug19'
25
+ gem 'ckeditor', :git => 'git://github.com/acesuares/ckeditor.git', :branch => 'master'
46
26
 
47
- # Bundle the extra gems:
48
- # gem 'bj'
49
- # gem 'nokogiri'
50
- # gem 'sqlite3-ruby', :require => 'sqlite3'
51
- # gem 'aws-s3', :require => 'aws/s3'
27
+ gem 'carrierwave'
52
28
 
53
- # Bundle gems for the local environment. Make sure to
54
- # put test-only gems in this group so their generators
55
- # and rake tasks are available in development mode:
56
- # group :development, :test do
57
- # gem 'webrat'
58
- # end
@@ -0,0 +1,15 @@
1
+ #/bin/bash
2
+ APPNAME=$1
3
+ echo "working directory is now `pwd`"
4
+ rails new $APPNAME
5
+ cat database.yml | sed "s/APPNAME/$APPNAME/g" > $APPNAME/config/database.yml
6
+ cp -v Gemfile $APPNAME
7
+ cd $APPNAME
8
+ echo "working directory is now `pwd`"
9
+ bundle install
10
+ echo devise:install
11
+ rails g devise:install
12
+ echo devise User
13
+ rails g devise User
14
+ echo ckeditor:install
15
+ rails g ckeditor:install
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: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 24
10
- version: 0.9.24
9
+ - 25
10
+ version: 0.9.25
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-09-27 00:00:00 -04:00
18
+ date: 2011-10-03 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -148,7 +148,14 @@ files:
148
148
  - app/views/inline_forms/_list.html.erb
149
149
  - app/views/inline_forms/_new.html.erb
150
150
  - app/views/inline_forms/_show.html.erb
151
- - app/views/layouts/inline_forms.rhtml
151
+ - app/views/inline_forms/close.js.erb
152
+ - app/views/inline_forms/edit.js.erb
153
+ - app/views/inline_forms/list.js.erb
154
+ - app/views/inline_forms/new.js.erb
155
+ - app/views/inline_forms/show.js.erb
156
+ - app/views/inline_forms/show_element.js.erb
157
+ - app/views/inline_forms/update.js.erb
158
+ - app/views/layouts/inline_forms.html.erb
152
159
  - inline_forms.gemspec
153
160
  - lib/generators/inline_forms/USAGE
154
161
  - lib/generators/inline_forms/inline_forms_generator.rb
@@ -163,6 +170,7 @@ files:
163
170
  - lib/otherstuff/diffie
164
171
  - lib/otherstuff/mk-ice-ts
165
172
  - lib/otherstuff/mk-new-app
173
+ - lib/otherstuff/mk31-app
166
174
  - lib/otherstuff/mkrole
167
175
  - lib/otherstuff/roles_users.sql
168
176
  - public/images/css/close.png