the_sortable_tree 1.2.0 → 1.4.6
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/README.md +65 -14
- data/app/assets/stylesheets/the_sortable_tree.css +3 -3
- data/app/assets/stylesheets/the_sortable_tree_min.css +16 -0
- data/app/helpers/the_sortable_tree_helper.rb +33 -84
- data/app/views/the_sortable_tree/_children.html.haml +1 -0
- data/app/views/the_sortable_tree/_controls.html.haml +10 -10
- data/app/views/the_sortable_tree/_js_init_sortable_tree.html.haml +3 -3
- data/app/views/the_sortable_tree/_js_on_update_tree.html.haml +1 -1
- data/app/views/the_sortable_tree/_js_rebuild_ajax.html.haml +8 -16
- data/app/views/the_sortable_tree/_link.html.haml +7 -10
- data/app/views/the_sortable_tree/_new.html.haml +3 -3
- data/app/views/the_sortable_tree/_node.html.haml +3 -0
- data/app/views/the_sortable_tree/_tree.html.haml +6 -6
- data/app/views/the_sortable_tree_min/_children.html.haml +1 -0
- data/app/views/the_sortable_tree_min/_link.html.haml +1 -0
- data/app/views/the_sortable_tree_min/_node.html.haml +3 -0
- data/app/views/the_sortable_tree_min/_tree.html.haml +2 -0
- data/config/locales/en.yml +10 -0
- data/config/locales/ru.yml +10 -0
- data/lib/generators/the_sortable_tree/views_generator.rb +7 -3
- data/lib/the_sortable_tree/version.rb +1 -1
- metadata +13 -6
- data/app/views/the_sortable_tree/_item.html.haml +0 -3
- data/app/views/the_sortable_tree/_nested_set.html.haml +0 -1
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
### TheSortableTree
|
2
2
|
|
3
|
+
**Dev status: GEM is FINISHED! **
|
4
|
+
|
3
5
|
Engine Based GUI for awesome_nested_set gem. Rails 3+
|
4
6
|
|
5
7
|

|
@@ -8,6 +10,14 @@ Engine Based GUI for awesome_nested_set gem. Rails 3+
|
|
8
10
|
|
9
11
|
**sortable_tree** uses partials for rendering, that's why it is **so easy to customize**!
|
10
12
|
|
13
|
+
### Is it fast?
|
14
|
+
|
15
|
+
Hmmmm...
|
16
|
+
Development env, 584 elements, 3 levels deep - rendered by 50 sec.
|
17
|
+
I think it is good result.
|
18
|
+
|
19
|
+
Do you can makes it fester? Welcome!
|
20
|
+
|
11
21
|
### Install
|
12
22
|
|
13
23
|
gem 'the_sortable_tree'
|
@@ -26,7 +36,6 @@ bundle
|
|
26
36
|
|
27
37
|
``` ruby
|
28
38
|
class Page < ActiveRecord::Base
|
29
|
-
# SCOPES FOR SORTABLE NESTED SET
|
30
39
|
include TheSortableTree::Scopes
|
31
40
|
# any code here
|
32
41
|
end
|
@@ -102,10 +111,45 @@ end
|
|
102
111
|
- content_for :js do
|
103
112
|
= javascript_include_tag 'jquery.ui.nestedSortable'
|
104
113
|
|
105
|
-
= sortable_tree @pages, :
|
114
|
+
= sortable_tree @pages, :new_url => new_page_path, :max_levels => 4
|
115
|
+
```
|
116
|
+
|
117
|
+
or (without administrator controls and drag&drop)
|
118
|
+
|
119
|
+
``` ruby
|
120
|
+
- content_for :css do
|
121
|
+
= stylesheet_link_tag 'the_sortable_tree_min', :media => :screen
|
122
|
+
|
123
|
+
= sortable_tree @pages, :new_url => new_page_path, :path => 'the_sortable_tree_min'
|
124
|
+
```
|
125
|
+
|
126
|
+
### Customize tree for User (min version)
|
127
|
+
|
128
|
+
**Use sortable_tree as view helper for simple rendering of nested_set tree**
|
129
|
+
|
130
|
+
``` ruby
|
131
|
+
rails g the_sortable_tree:views pages min
|
132
|
+
```
|
133
|
+
|
134
|
+
It's will generate minimal set of view partials for **sortable_tree** helper
|
135
|
+
|
136
|
+
``` ruby
|
137
|
+
create app/views/pages/the_sortable_tree_min
|
138
|
+
create app/views/pages/the_sortable_tree_min/_children.html.haml
|
139
|
+
create app/views/pages/the_sortable_tree_min/_node.html.haml
|
140
|
+
create app/views/pages/the_sortable_tree_min/_link.html.haml
|
141
|
+
create app/views/pages/the_sortable_tree_min/_tree.html.haml
|
142
|
+
```
|
143
|
+
|
144
|
+
Just use it or Customize and use it!
|
145
|
+
|
146
|
+
``` ruby
|
147
|
+
- content_for :css do
|
148
|
+
= stylesheet_link_tag 'the_sortable_tree_min', :media => :screen
|
149
|
+
= sortable_tree @pages, :new_url => new_page_path, :path => 'pages/the_sortable_tree_min'
|
106
150
|
```
|
107
151
|
|
108
|
-
### Customize
|
152
|
+
### Customize tree for Administrator (full version)
|
109
153
|
|
110
154
|
``` ruby
|
111
155
|
rails g the_sortable_tree:views pages
|
@@ -116,27 +160,40 @@ It's will generate view partials for **sortable_tree** helper
|
|
116
160
|
``` ruby
|
117
161
|
create app/views/pages/the_sortable_tree
|
118
162
|
create app/views/pages/the_sortable_tree/_controls.html.haml
|
119
|
-
create app/views/pages/the_sortable_tree/
|
163
|
+
create app/views/pages/the_sortable_tree/_node.html.haml
|
120
164
|
create app/views/pages/the_sortable_tree/_js_init_sortable_tree.html.haml
|
121
165
|
create app/views/pages/the_sortable_tree/_js_on_update_tree.html.haml
|
122
166
|
create app/views/pages/the_sortable_tree/_js_rebuild_ajax.html.haml
|
123
167
|
create app/views/pages/the_sortable_tree/_link.html.haml
|
124
|
-
create app/views/pages/the_sortable_tree/
|
168
|
+
create app/views/pages/the_sortable_tree/_children.html.haml
|
125
169
|
create app/views/pages/the_sortable_tree/_new.html.haml
|
126
170
|
create app/views/pages/the_sortable_tree/_tree.html.haml
|
127
171
|
```
|
128
172
|
|
173
|
+
Customize and use it!
|
174
|
+
|
175
|
+
``` ruby
|
176
|
+
- content_for :css do
|
177
|
+
= stylesheet_link_tag 'the_sortable_tree', :media => :screen
|
178
|
+
- content_for :js do
|
179
|
+
= javascript_include_tag 'jquery.ui.nestedSortable'
|
180
|
+
|
181
|
+
= sortable_tree @pages, :new_url => new_page_path, :path => 'pages/the_sortable_tree', :max_levels => 2
|
182
|
+
```
|
183
|
+
|
184
|
+
### Partials
|
185
|
+
|
129
186
|
**_tree** - root container for nested set elements
|
130
187
|
|
131
|
-
**
|
188
|
+
**_node** - element of tree (link to current node and nested set of children)
|
132
189
|
|
133
190
|
**_link** - decoration of link to current element of tree
|
134
191
|
|
135
|
-
**
|
192
|
+
**_children** - decoration of children
|
136
193
|
|
137
194
|
**_new** - create new element link
|
138
195
|
|
139
|
-
**_controls** - control elements for current
|
196
|
+
**_controls** - control elements for current node
|
140
197
|
|
141
198
|
|
142
199
|
**_js_init_sortable_tree** - JS for sortable tree
|
@@ -145,12 +202,6 @@ create app/views/pages/the_sortable_tree/_tree.html.haml
|
|
145
202
|
|
146
203
|
**_js_rebuild_ajax**- JS for sortable tree
|
147
204
|
|
148
|
-
Customize and use it!
|
149
|
-
|
150
|
-
``` ruby
|
151
|
-
= sortable_tree @pages, :klass => :page, :rebuild_url => rebuild_pages_path, :path => 'pages/the_sortable_tree'
|
152
|
-
```
|
153
|
-
|
154
205
|
### Acknowledgments
|
155
206
|
|
156
207
|
* https://github.com/mjsarfatti/nestedSortable
|
@@ -54,14 +54,14 @@
|
|
54
54
|
margin:0 0 0 3px;
|
55
55
|
cursor:pointer;
|
56
56
|
}
|
57
|
-
.
|
57
|
+
.nested_set_new_image{
|
58
58
|
vertical-align:middle;
|
59
59
|
border:none;
|
60
60
|
}
|
61
|
-
.
|
61
|
+
.nested_set_new{
|
62
62
|
margin:25px 0;
|
63
63
|
}
|
64
|
-
.
|
64
|
+
.nested_set_new a{
|
65
65
|
font-size:14pt;
|
66
66
|
}
|
67
67
|
.nested_set .handle{
|
@@ -0,0 +1,16 @@
|
|
1
|
+
ol.nested_set_min li{
|
2
|
+
font-size: 1.4em;
|
3
|
+
line-height: 130%;
|
4
|
+
margin-bottom: 5px;
|
5
|
+
font-weight: bold;
|
6
|
+
}
|
7
|
+
ol.nested_set_min ol{
|
8
|
+
border-left: 1px dashed #AAA;
|
9
|
+
padding-left: 10px;
|
10
|
+
margin-left: 15px;
|
11
|
+
margin-top: 5px;
|
12
|
+
}
|
13
|
+
ol.nested_set_min ol li{ font-weight: normal; }
|
14
|
+
|
15
|
+
.nested_set_min a:hover { color: #003A89 !important; }
|
16
|
+
.nested_set_min a:visited { color: #809dc4; }
|
@@ -1,107 +1,56 @@
|
|
1
1
|
module TheSortableTreeHelper
|
2
2
|
# Publicated by MIT
|
3
3
|
# Nested Set View Helper
|
4
|
-
# Ilya Zykin, zykin-ilya@ya.ru, Russia, Ivanovo 2009-
|
4
|
+
# Ilya Zykin, zykin-ilya@ya.ru, Russia, Ivanovo 2009-2012
|
5
5
|
# github.com/the-teacher
|
6
6
|
#-------------------------------------------------------------------------------------------------------
|
7
|
-
|
8
|
-
# = sortable_tree(@pages)
|
9
|
-
# = sortable_tree @products, :klass => :product, :path => 'products/the_sortable_tree', :rebuild_url => rebuild_products_path
|
10
7
|
|
11
|
-
|
12
|
-
|
13
|
-
render :partial => "#{opts[:path]}/new", :locals => { :opts => opts }
|
14
|
-
end
|
8
|
+
# = sortable_tree @pages, :new_url => new_page_url, :max_levels => 5
|
9
|
+
# = sortable_tree @products, :new_url => new_product_url, :path => 'products/the_sortable_tree'
|
15
10
|
|
16
|
-
def
|
17
|
-
|
18
|
-
|
19
|
-
:first => false, # first element flag
|
20
|
-
:last => false, # last element flag
|
21
|
-
:has_childs => false # has childs?
|
22
|
-
}.merge!(options)
|
23
|
-
render :partial => "#{opts[:path]}/controls", :locals => { :node => node, :opts => opts }
|
11
|
+
def define_class_of_elements_of tree
|
12
|
+
return nil if tree.empty?
|
13
|
+
tree.first.class.to_s.downcase
|
24
14
|
end
|
25
15
|
|
26
|
-
def sortable_tree(tree,
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
16
|
+
def sortable_tree(tree, opts= {})
|
17
|
+
opts.merge!({
|
18
|
+
:path => opts[:path] || :the_sortable_tree,
|
19
|
+
:klass => define_class_of_elements_of(tree),
|
20
|
+
:title => opts[:title] || :title,
|
21
|
+
:max_levels => opts[:max_levels] || 3
|
22
|
+
})
|
23
|
+
render :partial => "#{opts[:path]}/tree", :locals => { :tree => sortable_tree_builder(tree, opts), :opts => opts }
|
32
24
|
end
|
33
25
|
|
34
|
-
def
|
35
|
-
result= ''
|
36
|
-
opts= {
|
26
|
+
def sortable_tree_builder(tree, options= {})
|
27
|
+
result = ''
|
28
|
+
opts = {
|
29
|
+
:id => :id, # node id field
|
37
30
|
:node => nil, # node
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:id_field => 'id', # id field name, id by default
|
41
|
-
:first => false, # first element flag
|
42
|
-
:last => false, # last element flag
|
43
|
-
:level => 0, # recursion level
|
44
|
-
:clean => true # delete element from tree after rendering. ~25% time economy when rendering tree once on a page
|
31
|
+
:root => false, # is it root node?
|
32
|
+
:level => 0 # recursion level
|
45
33
|
}.merge!(options)
|
46
34
|
|
47
|
-
node = opts[:node]
|
48
35
|
root = opts[:root]
|
49
|
-
|
50
|
-
# must be string
|
51
|
-
opts[:id_field] = opts[:id_field].to_s
|
36
|
+
node = opts[:node]
|
52
37
|
|
53
38
|
unless node
|
54
|
-
roots= tree.select{|elem| elem.parent_id.nil?}
|
55
|
-
# find ids of first and last root node
|
56
|
-
roots_first_id= roots.empty? ? nil : roots.first.id
|
57
|
-
roots_last_id= roots.empty? ? nil : roots.last.id
|
58
|
-
|
59
|
-
# render roots
|
39
|
+
roots = tree.select{|elem| elem.parent_id.nil?}
|
60
40
|
roots.each do |root|
|
61
|
-
|
62
|
-
|
63
|
-
_opts = opts.merge({:node => root, :root => true, :level => opts[:level].next, :first => is_first, :last => is_last})
|
64
|
-
result<< sortable_tree_bilder(tree, _opts)
|
41
|
+
_opts = opts.merge({:node => root, :root => true, :level => opts[:level].next})
|
42
|
+
result << sortable_tree_builder(tree, _opts)
|
65
43
|
end
|
66
44
|
else
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
opts.merge!({:has_childs => childs.blank?})
|
74
|
-
|
75
|
-
# admin controls
|
76
|
-
if opts[:admin]
|
77
|
-
c = ans_controls(node, opts)
|
78
|
-
controls= content_tag(:span, c, :class => :controls)
|
45
|
+
children_res = ''
|
46
|
+
children = tree.select{|elem| elem.parent_id == node.id}
|
47
|
+
opts.merge!({:has_children => children.blank?})
|
48
|
+
children.each do |elem|
|
49
|
+
_opts = opts.merge({:node => elem, :root => false, :level => opts[:level].next})
|
50
|
+
children_res << sortable_tree_builder(tree, _opts)
|
79
51
|
end
|
80
|
-
|
81
|
-
# find id of first and last node
|
82
|
-
childs_first_id= childs.empty? ? nil : childs.first.id
|
83
|
-
childs_last_id= childs.empty? ? nil : childs.last.id
|
84
|
-
|
85
|
-
# render childs
|
86
|
-
childs.each do |elem|
|
87
|
-
is_first= (elem.id==childs_first_id)
|
88
|
-
is_last= (elem.id==childs_last_id)
|
89
|
-
_opts = opts.merge({:node => elem, :root => false, :level => opts[:level].next, :first => is_first, :last => is_last})
|
90
|
-
childs_res << sortable_tree_bilder(tree, _opts)
|
91
|
-
end
|
92
|
-
|
93
|
-
# build views
|
94
|
-
childs_res= childs_res.blank? ? '' : render(:partial => "#{opts[:path]}/nested_set", :locals => {:opts => opts, :parent => node, :childs => childs_res})
|
95
|
-
link= render(:partial => "#{opts[:path]}/link", :locals => {:opts => opts, :node => node, :root => root, :controls => controls})
|
96
|
-
res= render(:partial => "#{opts[:path]}/item", :locals => {:opts => opts, :node => node, :link => link, :childs => childs_res})
|
97
|
-
|
98
|
-
# delete current node from tree if you want
|
99
|
-
# recursively moving by tree is 25%+ faster on 500 elems
|
100
|
-
# remove from Array, not from DB! ;) ?! Array#pull?!
|
101
|
-
# tree.delete(node) if opts[:clean]
|
102
|
-
|
103
|
-
result << res
|
52
|
+
result << render(:partial => "#{opts[:path]}/node", :locals => {:opts => opts, :root => root, :node => node, :children => children_res})
|
104
53
|
end
|
105
54
|
raw result
|
106
|
-
end#
|
107
|
-
end# module
|
55
|
+
end# sortable_tree_builder
|
56
|
+
end# module
|
@@ -0,0 +1 @@
|
|
1
|
+
= content_tag :ol, raw(children)
|
@@ -1,16 +1,16 @@
|
|
1
1
|
-# EDIT
|
2
|
-
- edit= link_to
|
2
|
+
- edit = link_to '', polymorphic_url(node, :action => :edit), :title => t('.edit_this'), :class => 'button edit'
|
3
3
|
-# DELETE
|
4
|
-
- if opts[:
|
5
|
-
- delete=
|
6
|
-
:title => t(
|
4
|
+
- if opts[:has_children]
|
5
|
+
- delete = link_to('', url_for(node),
|
6
|
+
:title => t('.delete'),
|
7
7
|
:method => :delete,
|
8
|
-
:confirm => t(
|
9
|
-
:class =>
|
8
|
+
:confirm => t('.delete_confirm'),
|
9
|
+
:class => 'button delete')
|
10
10
|
- else
|
11
|
-
- delete= link_to(
|
12
|
-
:title => t(
|
13
|
-
:onclick =>
|
14
|
-
:class =>
|
11
|
+
- delete = link_to('', '#',
|
12
|
+
:title => t('.cant_be_deleted'),
|
13
|
+
:onclick => "alert('#{t('.delete_nested_elements')}')",
|
14
|
+
:class => 'button undeleted')
|
15
15
|
-# OUTPUT
|
16
16
|
= edit + delete
|
@@ -1,12 +1,12 @@
|
|
1
1
|
:javascript
|
2
|
-
$(
|
2
|
+
$(function(){
|
3
3
|
$('ol.sortable').nestedSortable({
|
4
4
|
disableNesting: 'no-nest',
|
5
5
|
forcePlaceholderSize: true,
|
6
|
-
handle: '
|
6
|
+
handle: 'i.handle',
|
7
7
|
helper: 'clone',
|
8
8
|
items: 'li',
|
9
|
-
maxLevels:
|
9
|
+
maxLevels: #{opts[:max_levels]},
|
10
10
|
opacity: .6,
|
11
11
|
placeholder: 'placeholder',
|
12
12
|
revert: 250,
|
@@ -1,21 +1,13 @@
|
|
1
1
|
:javascript
|
2
2
|
function sortable_tree(item_id, parent_id, prev_id, next_id){
|
3
3
|
jQuery.ajax({
|
4
|
-
type:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
//$('##{opts[:klass]}_nested_set .handle').hide();
|
13
|
-
},
|
14
|
-
success: function(data, status, xhr){
|
15
|
-
//$('##{opts[:klass]}_nested_set .handle').show();
|
16
|
-
},
|
17
|
-
error: function(xhr, status, error){
|
18
|
-
alert(error);
|
19
|
-
}
|
4
|
+
type: 'POST',
|
5
|
+
dataType: 'script',
|
6
|
+
url: '#{url_for(:controller => opts[:klass].pluralize, :action => :rebuild)}',
|
7
|
+
data: { id: item_id, parent_id: parent_id, prev_id: prev_id, next_id: next_id },
|
8
|
+
|
9
|
+
beforeSend: function(xhr){ $('.nested_set i.handle').hide() },
|
10
|
+
success: function(data, status, xhr){ $('.nested_set i.handle').show() },
|
11
|
+
error: function(xhr, status, error){ alert(error) }
|
20
12
|
});
|
21
13
|
}
|
@@ -1,10 +1,7 @@
|
|
1
|
-
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
%div{:class => "link #{"root" if root}"}
|
9
|
-
= link_to(node.title, polymorphic_path(node), :title => node.title)
|
10
|
-
|
1
|
+
- title = node.send opts[:title]
|
2
|
+
- handle = content_tag :i, '', :class => :handle
|
3
|
+
- link = link_to(title, url_for(node), :title => title)
|
4
|
+
- controls = render(:partial => "#{opts[:path]}/controls", :locals => { :node => node, :opts => opts })
|
5
|
+
- controls = content_tag(:b, controls, :class => :controls)
|
6
|
+
- element = handle + controls + link
|
7
|
+
%div{ :class => "link#{' root' if root}" }= element
|
@@ -1,3 +1,3 @@
|
|
1
|
-
- image=
|
2
|
-
- link=
|
3
|
-
.
|
1
|
+
- image = image_tag('iconza/blue/add.png', :class => :nested_set_new_image) + ' '
|
2
|
+
- link = link_to(image + t('.create'), opts[:new_url])
|
3
|
+
.nested_set_new= link
|
@@ -0,0 +1,3 @@
|
|
1
|
+
%li{ :id => "#{node.send(opts[:id])}_#{opts[:klass]}" }
|
2
|
+
= raw render(:partial => "#{opts[:path]}/link", :locals => {:opts => opts, :root => root, :node => node})
|
3
|
+
= render(:partial => "#{opts[:path]}/children", :locals => {:opts => opts, :parent => node, :children => children}) unless children.blank?
|
@@ -1,6 +1,6 @@
|
|
1
|
-
= render :partial => "#{opts[:path]}/
|
2
|
-
|
3
|
-
= render :partial => "#{opts[:path]}/
|
4
|
-
|
5
|
-
=
|
6
|
-
|
1
|
+
= render :partial => "#{opts[:path]}/new", :locals => { :opts => opts }
|
2
|
+
- unless tree.empty?
|
3
|
+
= render :partial => "#{opts[:path]}/js_init_sortable_tree", :locals => { :opts => opts }
|
4
|
+
= render :partial => "#{opts[:path]}/js_on_update_tree"
|
5
|
+
= render :partial => "#{opts[:path]}/js_rebuild_ajax", :locals => { :opts => opts }
|
6
|
+
%ol.ui-sortable.sortable.nested_set{ :id => "#{opts[:klass]}_nested_set" }= raw tree
|
@@ -0,0 +1 @@
|
|
1
|
+
= content_tag :ol, raw(children)
|
@@ -0,0 +1 @@
|
|
1
|
+
= link_to node.send(opts[:title]), url_for(node), :title => node.send(opts[:title])
|
@@ -0,0 +1,10 @@
|
|
1
|
+
en:
|
2
|
+
the_sortable_tree:
|
3
|
+
new:
|
4
|
+
create: Add element
|
5
|
+
controls:
|
6
|
+
edit_this: Edit element
|
7
|
+
delete: Delete element
|
8
|
+
delete_confirm: Do you want to delete element?
|
9
|
+
cant_be_deleted: Cant be deleted. Has nested elements
|
10
|
+
delete_nested_elements: Delete all nested elements
|
@@ -0,0 +1,10 @@
|
|
1
|
+
ru:
|
2
|
+
the_sortable_tree:
|
3
|
+
new:
|
4
|
+
create: Добавить элемент
|
5
|
+
controls:
|
6
|
+
edit_this: Редактировать элемент
|
7
|
+
delete: Удалить элемент
|
8
|
+
delete_confirm: Удалить элемент безвозвратно?
|
9
|
+
cant_be_deleted: Не может быть удалено. Есть дочерние элементы
|
10
|
+
delete_nested_elements: Сперва удалите все дочерние элементы
|
@@ -5,15 +5,19 @@ module TheSortableTree
|
|
5
5
|
|
6
6
|
def self.banner
|
7
7
|
<<-BANNER.chomp
|
8
|
-
rails g the_sortable_tree:views MODEL
|
8
|
+
rails g the_sortable_tree:views MODEL [min]
|
9
9
|
Copies files for rendering sortable nested set
|
10
10
|
BANNER
|
11
11
|
end
|
12
12
|
|
13
13
|
def copy_sortable_tree_files
|
14
|
-
|
14
|
+
if ARGV[1] == 'min'
|
15
|
+
directory "the_sortable_tree_min", "app/views/#{folder}/the_sortable_tree_min"
|
16
|
+
else
|
17
|
+
directory "the_sortable_tree", "app/views/#{folder}/the_sortable_tree"
|
18
|
+
end
|
15
19
|
end
|
16
|
-
|
20
|
+
|
17
21
|
private
|
18
22
|
|
19
23
|
def folder
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_sortable_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-16 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml
|
16
|
-
requirement: &
|
16
|
+
requirement: &84551760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *84551760
|
25
25
|
description: Drug&Drop GUI for awesome_nested_set gem. Sortable tree view helper
|
26
26
|
email:
|
27
27
|
- zykin-ilya@ya.ru
|
@@ -58,17 +58,24 @@ files:
|
|
58
58
|
- app/assets/images/iconza/red/zoom.png
|
59
59
|
- app/assets/javascripts/jquery.ui.nestedSortable.js
|
60
60
|
- app/assets/stylesheets/the_sortable_tree.css
|
61
|
+
- app/assets/stylesheets/the_sortable_tree_min.css
|
61
62
|
- app/controllers/the_sortable_tree_controller.rb
|
62
63
|
- app/helpers/the_sortable_tree_helper.rb
|
64
|
+
- app/views/the_sortable_tree/_children.html.haml
|
63
65
|
- app/views/the_sortable_tree/_controls.html.haml
|
64
|
-
- app/views/the_sortable_tree/_item.html.haml
|
65
66
|
- app/views/the_sortable_tree/_js_init_sortable_tree.html.haml
|
66
67
|
- app/views/the_sortable_tree/_js_on_update_tree.html.haml
|
67
68
|
- app/views/the_sortable_tree/_js_rebuild_ajax.html.haml
|
68
69
|
- app/views/the_sortable_tree/_link.html.haml
|
69
|
-
- app/views/the_sortable_tree/_nested_set.html.haml
|
70
70
|
- app/views/the_sortable_tree/_new.html.haml
|
71
|
+
- app/views/the_sortable_tree/_node.html.haml
|
71
72
|
- app/views/the_sortable_tree/_tree.html.haml
|
73
|
+
- app/views/the_sortable_tree_min/_children.html.haml
|
74
|
+
- app/views/the_sortable_tree_min/_link.html.haml
|
75
|
+
- app/views/the_sortable_tree_min/_node.html.haml
|
76
|
+
- app/views/the_sortable_tree_min/_tree.html.haml
|
77
|
+
- config/locales/en.yml
|
78
|
+
- config/locales/ru.yml
|
72
79
|
- lib/generators/the_sortable_tree/views_generator.rb
|
73
80
|
- lib/the_sortable_tree.rb
|
74
81
|
- lib/the_sortable_tree/engine.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
= content_tag(:ol, raw(childs), :id=>"#{parent.id}_page_childs")
|