inline_forms 1.6.62 → 1.6.63
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.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmE0ZmJlNWEyNjc5ODY0YTdkYjhmNWY1MmFhYjk0OTUzNzhkMjQzYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjViZGMyYTVkNTIwNTc0NGMxNzYxNjM1NTBmZTRhMzlkM2QxM2IwNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTg4YWNlMzhlMDFmNzg2OGIwZDBhMjAwNmY3OThjMzY0MWE2NmZhYTA4ZDg1
|
10
|
+
ZTQyN2RkZGFjNWIxMmUyY2NhMmZkZDM4MjQ2OGZmODY3YzJiOTViOWQyMDIx
|
11
|
+
MDI1YTAwNjZhNjhkZjdlMzk3OWI4N2Y0YWU2MTdjNWQxOWY1YjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjQyMTdkZDE3YWIzNWQ1ODM3NmFjMDE4N2NjNjU1ZDE2Yzc2Yjc2NDE4MjBh
|
14
|
+
M2QyN2QwMjA0M2Y2MjA5NjFjMmFiNmE4ZTYwNDVkMTU3NDY4MTgxYjYwNjUy
|
15
|
+
M2IzMzkyNjA5ZWM0ZTU0MzdhNDhjNDhmODg3N2Q1ZmE1OWQ1M2Y=
|
@@ -113,7 +113,7 @@ class InlineFormsController < ApplicationController
|
|
113
113
|
@update_span = params[:update]
|
114
114
|
attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list
|
115
115
|
attributes.each do | attribute, name, form_element |
|
116
|
-
send("#{form_element.to_s}_update", @object, attribute) unless form_element == :associated || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute))
|
116
|
+
send("#{form_element.to_s}_update", @object, attribute) unless form_element == :tree || form_element == :associated || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute))
|
117
117
|
end
|
118
118
|
@parent_class = params[:parent_class]
|
119
119
|
@parent_id = params[:parent_id]
|
@@ -23,7 +23,7 @@
|
|
23
23
|
:multipart => true, :remote => true, :class => "edit_form" do -%>
|
24
24
|
<% attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list -%>
|
25
25
|
<% attributes.each do | attribute, name, form_element | -%>
|
26
|
-
<% unless form_element.to_sym == :associated || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute)) -%>
|
26
|
+
<% unless form_element.to_sym == :associated || form_element.to_sym == :tree || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute)) -%>
|
27
27
|
<% css_class_id = "attribute_#{attribute}_#{@object.id}" -%>
|
28
28
|
<% if form_element == :header %>
|
29
29
|
<div class="row form_element_header" >
|
@@ -22,40 +22,59 @@
|
|
22
22
|
</div>
|
23
23
|
</div>
|
24
24
|
<% else %>
|
25
|
-
<% if form_element == :
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
<div class="row <%= cycle('odd', 'even') %>">
|
35
|
-
<div id="<%= css_class_id -%>" class='small-11 small-centered column' >
|
36
|
-
<%= render :partial => "inline_forms/list",
|
37
|
-
:locals => { :parent_class => @object.class,
|
38
|
-
:parent_id => @object.id,
|
39
|
-
:attribute => attribute } %>
|
40
|
-
</div>
|
41
|
-
</div>
|
42
|
-
<% else -%>
|
25
|
+
<% if form_element == :tree -%>
|
26
|
+
<div class="row form_element_header associated_auto_header" id="<%= css_class_id -%>_list_auto_header" >
|
27
|
+
<div class='medium-11 large-11 column' >
|
28
|
+
Children
|
29
|
+
</div>
|
30
|
+
<div class='medium-1 large-1 column'>
|
31
|
+
<%= link_to_new_record(@object.class, "new_#{@object.class.to_s.underscore.singularize}_path", css_class_id, @object.class, @object.id) -%>
|
32
|
+
</div>
|
33
|
+
</div>
|
43
34
|
<div class="row <%= cycle('odd', 'even') %>">
|
44
|
-
<div class='
|
45
|
-
|
46
|
-
|
35
|
+
<div id="<%= css_class_id -%>" class='small-11 small-centered column' >
|
36
|
+
<%= render :partial => "inline_forms/tree",
|
37
|
+
:locals => { :parent_class => @object.class,
|
38
|
+
:parent_id => @object.id,
|
39
|
+
:attribute => attribute } %>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<% else -%>
|
43
|
+
<% if form_element == :associated -%>
|
44
|
+
<div class="row form_element_header associated_auto_header" id="<%= css_class_id -%>_list_auto_header" >
|
45
|
+
<div class='medium-11 large-11 column' >
|
46
|
+
<%= @object.class.human_attribute_name(attribute) -%>
|
47
|
+
</div>
|
48
|
+
<div class='medium-1 large-1 column'>
|
49
|
+
<%= link_to_new_record(attribute.to_s.singularize.camelcase.constantize, "new_#{attribute.to_s.underscore.singularize}_path", css_class_id, @object.class, @object.id) -%>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
<div class="row <%= cycle('odd', 'even') %>">
|
53
|
+
<div id="<%= css_class_id -%>" class='small-11 small-centered column' >
|
54
|
+
<%= render :partial => "inline_forms/list",
|
55
|
+
:locals => { :parent_class => @object.class,
|
56
|
+
:parent_id => @object.id,
|
57
|
+
:attribute => attribute } %>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
<% else -%>
|
61
|
+
<div class="row <%= cycle('odd', 'even') %>">
|
62
|
+
<div class='medium-3 large-3 column' >
|
63
|
+
<% if @object.has_validations_for?(attribute) -%>
|
64
|
+
<span data-tooltip class="has-tip tip-top" title="<%= validation_hints_as_list_for(@object, attribute).html_safe -%>">
|
65
|
+
<%= @object.class.human_attribute_name(attribute) -%>
|
66
|
+
</span>
|
67
|
+
<% else %>
|
47
68
|
<%= @object.class.human_attribute_name(attribute) -%>
|
69
|
+
<% end %>
|
70
|
+
</div>
|
71
|
+
<div class='medium-9 large-9 column' >
|
72
|
+
<span id="<%= css_class_id -%>" >
|
73
|
+
<%= send("#{form_element}_show", @object, attribute) -%>
|
48
74
|
</span>
|
49
|
-
|
50
|
-
<%= @object.class.human_attribute_name(attribute) -%>
|
51
|
-
<% end %>
|
75
|
+
</div>
|
52
76
|
</div>
|
53
|
-
|
54
|
-
<span id="<%= css_class_id -%>" >
|
55
|
-
<%= send("#{form_element}_show", @object, attribute) -%>
|
56
|
-
</span>
|
57
|
-
</div>
|
58
|
-
</div>
|
77
|
+
<% end -%>
|
59
78
|
<% end -%>
|
60
79
|
<% end -%>
|
61
80
|
<% end -%>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<% # here we come from _show %>
|
2
|
+
<% update_span = "#{parent_class.to_s.underscore}_#{parent_id}_#{attribute}_list" -%>
|
3
|
+
<% path_to_new='new_' + parent_class.to_s.underscore.singularize + '_path' %>
|
4
|
+
<% model = parent_class %>
|
5
|
+
<% objects = parent_class.find(parent_id).children %>
|
6
|
+
<% objects = parent_class.find(parent_id).children.accessible_by(current_ability) if cancan_enabled? %>
|
7
|
+
<% objects = objects.paginate :page => params[:page], :per_page => @PER_PAGE || 5 %>
|
8
|
+
|
9
|
+
<div class="list_container" id="<%= update_span %>">
|
10
|
+
|
11
|
+
<!-- # list of objects -->
|
12
|
+
<% for object in objects %>
|
13
|
+
<% css_class_id = parent_class.to_s.underscore + '_' + parent_id.to_s + '_' + attribute.to_s.singularize.underscore + "_" + object.id.to_s -%>
|
14
|
+
<% path_to_object = parent_class.to_s.singularize.underscore + "_path" %>
|
15
|
+
<div class="row <%= cycle('odd', 'even') %><%= " top-level" if parent_class.nil? %>" id="<%= css_class_id -%>">
|
16
|
+
<% if cancan_disabled? || ( can? :delete, object ) %>
|
17
|
+
<div class="small-1 column">
|
18
|
+
<%= link_to_destroy(object, css_class_id) -%>
|
19
|
+
</div>
|
20
|
+
<div class="small-11 column">
|
21
|
+
<%= link_to h(object._presentation),
|
22
|
+
send( path_to_object, object, :update => css_class_id),
|
23
|
+
:remote => true -%>
|
24
|
+
</div>
|
25
|
+
<% else %>
|
26
|
+
<div class="small-12 column">
|
27
|
+
<%= link_to h(object._presentation),
|
28
|
+
send( path_to_object, object, :update => css_class_id),
|
29
|
+
:remote => true -%>
|
30
|
+
</div>
|
31
|
+
<% end %>
|
32
|
+
</div>
|
33
|
+
<% end -%>
|
34
|
+
<!-- # pagination -->
|
35
|
+
<% if parent_id.nil? -%>
|
36
|
+
<% pagination = will_paginate objects -%>
|
37
|
+
<% else %>
|
38
|
+
<% pagination = will_paginate objects, :remote => true, :params => {:controller => attribute, :action => :index, :id => nil, :parent_class => parent_class, :parent_id => parent_id, :update => "#{parent_class.to_s.underscore}_#{parent_id}_#{attribute}", :ul_needed => true } -%>
|
39
|
+
<% end %>
|
40
|
+
<% if pagination %>
|
41
|
+
<div class="row <%= cycle('odd', 'even') %>">
|
42
|
+
<div class='small-11 small-centered column'>
|
43
|
+
<%= raw pagination %>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
<% end %>
|
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: 1.6.
|
4
|
+
version: 1.6.63
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ace Suares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rvm
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- lib/app/views/inline_forms/_new.html.erb
|
240
240
|
- lib/app/views/inline_forms/_new_nested.html.erb
|
241
241
|
- lib/app/views/inline_forms/_show.html.erb
|
242
|
+
- lib/app/views/inline_forms/_tree.html.erb
|
242
243
|
- lib/app/views/inline_forms/close.js.erb
|
243
244
|
- lib/app/views/inline_forms/edit.js.erb
|
244
245
|
- lib/app/views/inline_forms/extract_translations.erb
|