inline_forms 3.0.19 → 3.0.20
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjRlYjBkYmYyMjRhMmIzYjI0YzQyZWRhN2JiNjFmNmIwNjJlOGVlNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWRiYzBjOTc4MTA3NzMwMjM1ZWQ2YjZjZGJmODE4Nzk1OWI0OTkyMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDc3ZjNhMzZkNzk4ZTk4NWQ4ODY4YjIwMWU3MDQ5Y2Y2ZTUyYjRhYjVjNGI1
|
10
|
+
MDMyOWYxYTA4YTZjYzRjN2FlODg1M2E3ZDQwYmY5NDk3NGY5NzUwNDZiMWEx
|
11
|
+
ZWI1MGM3MzNiNDg2ODEyYWU4MWNjODE2YTg1M2I0MjY0MTJhNzM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWVkOWFlNjljNzlmYTg1OWM1OGYyYTYzZWI3MzQ2ZmQ5ODFkOWM2MTMxOTgy
|
14
|
+
MTc4N2RjNWVmZmYyN2U5YWY5MGNlNWYzMTViMjY1MTRmNmVmZTc3NWQyYjM2
|
15
|
+
MzNjNjlkYjYyODc0NWU5ZjM5YTk5MTFjNGU5MWEwYWJmYTVjYWQ=
|
@@ -50,7 +50,6 @@ class InlineFormsController < ApplicationController
|
|
50
50
|
@parent_class = params[:parent_class]
|
51
51
|
@parent_id = params[:parent_id]
|
52
52
|
@ul_needed = params[:ul_needed]
|
53
|
-
@PER_PAGE = 5 unless @parent_class.nil?
|
54
53
|
# if the parent_class is not nill, we are in associated list and we don't search there.
|
55
54
|
# also, make sure the Model that you want to do a search on has a :name attribute. TODO
|
56
55
|
conditions = nil
|
@@ -66,7 +65,6 @@ class InlineFormsController < ApplicationController
|
|
66
65
|
@objects = @objects.order(@Klass.table_name + "." + @Klass.order_by_clause) if @Klass.respond_to?(:order_by_clause) && ! @Klass.order_by_clause.nil?
|
67
66
|
@objects = @objects.paginate(
|
68
67
|
:page => params[:page],
|
69
|
-
:per_page => @PER_PAGE || 12,
|
70
68
|
:conditions => conditions )
|
71
69
|
respond_to do |format|
|
72
70
|
format.html { render 'inline_forms/_list', :layout => 'inline_forms' } unless @Klass.not_accessible_through_html?
|
@@ -117,7 +115,6 @@ class InlineFormsController < ApplicationController
|
|
117
115
|
end
|
118
116
|
@parent_class = params[:parent_class]
|
119
117
|
@parent_id = params[:parent_id]
|
120
|
-
@PER_PAGE = 5 unless @parent_class.nil?
|
121
118
|
# for the logic behind the :conditions see the #index method.
|
122
119
|
conditions = nil
|
123
120
|
if @parent_class.nil? || @Klass.reflect_on_association(@parent_class.underscore.to_sym).nil?
|
@@ -132,7 +129,7 @@ class InlineFormsController < ApplicationController
|
|
132
129
|
@objects = @Klass
|
133
130
|
@objects = @Klass.accessible_by(current_ability) if cancan_enabled?
|
134
131
|
@objects = @objects.order(@Klass.table_name + "." + @Klass.order_by_clause) if @Klass.respond_to?(:order_by_clause) && ! @Klass.order_by_clause.nil?
|
135
|
-
@objects = @objects.paginate :page => params[:page], :
|
132
|
+
@objects = @objects.paginate :page => params[:page], :conditions => conditions
|
136
133
|
@object = nil
|
137
134
|
respond_to do |format|
|
138
135
|
format.js { render :list}
|
@@ -37,7 +37,7 @@
|
|
37
37
|
<% objects = parent_class.find(parent_id).send(attribute) %>
|
38
38
|
<% objects = parent_class.find(parent_id).send(attribute).accessible_by(current_ability) if cancan_enabled? %>
|
39
39
|
<% objects = objects.order(attribute.to_s.singularize.camelcase.constantize.order_by_clause) if attribute.to_s.singularize.camelcase.constantize.respond_to?(:order_by_clause) && ! attribute.to_s.singularize.camelcase.constantize.order_by_clause.nil? %>
|
40
|
-
<% objects = objects.paginate :page => params[:page], :
|
40
|
+
<% objects = objects.paginate :page => params[:page], :conditions => conditions %>
|
41
41
|
<% end %>
|
42
42
|
<% end %>
|
43
43
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<% model = parent_class %>
|
5
5
|
<% objects = parent_class.find(parent_id).children %>
|
6
6
|
<% objects = parent_class.find(parent_id).children.accessible_by(current_ability) if cancan_enabled? %>
|
7
|
-
<% objects = objects.paginate :page => params[:page]
|
7
|
+
<% objects = objects.paginate :page => params[:page] %>
|
8
8
|
|
9
9
|
<div class="list_container" id="<%= update_span %>">
|
10
10
|
|
data/lib/inline_forms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ace Suares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rvm
|
@@ -208,7 +208,6 @@ files:
|
|
208
208
|
- lib/app/helpers/form_elements/month_year_picker.rb
|
209
209
|
- lib/app/helpers/form_elements/move.rb
|
210
210
|
- lib/app/helpers/form_elements/pdf_link.rb
|
211
|
-
- lib/app/helpers/form_elements/photo_list.rb
|
212
211
|
- lib/app/helpers/form_elements/plain_text_area.rb
|
213
212
|
- lib/app/helpers/form_elements/question_list.rb
|
214
213
|
- lib/app/helpers/form_elements/radio_button.rb
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
# not needed here, since this is only used in the views InlineForms::SPECIAL_COLUMN_TYPES[:info]=:string
|
3
|
-
|
4
|
-
# this will NOT stay in inline_forms, it belongs in an app.
|
5
|
-
|
6
|
-
def chicas_photo_list_show(object, attribute)
|
7
|
-
# the attribute should be like members_photos
|
8
|
-
# then it will look for object.members.photos
|
9
|
-
# I know it's crappy.
|
10
|
-
members, photos = attribute.to_s.split('_')
|
11
|
-
thumbnail_list = {}
|
12
|
-
object.send(members).each do |member|
|
13
|
-
member.send(photos).each do |photo|
|
14
|
-
thumbnail_list[photo.rating] ||= []
|
15
|
-
thumbnail_list[photo.rating] << photo.image.url(:thumb)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
out = ''
|
19
|
-
out = "<div class='row #{cycle('odd', 'even')}'>no photos</div>" if thumbnail_list.empty?
|
20
|
-
unless thumbnail_list.empty?
|
21
|
-
out << "<div class='row #{cycle('odd', 'even')}'>"
|
22
|
-
thumbnail_list.sort.reverse.each do |rating, thumbnails|
|
23
|
-
thumbnails.each do |thumbnail|
|
24
|
-
out << image_tag(thumbnail)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
out << '</div>'
|
28
|
-
end
|
29
|
-
out.html_safe
|
30
|
-
end
|