the_sortable_tree 1.9.3 → 1.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
- ### TheSortableTree
1
+ ### TheSortableTree
2
2
 
3
3
  Awesome Helper for building sortable nested sets
4
4
 
5
+ [TheSortableTree on RubyGems](http://rubygems.org/gems/the_sortable_tree)
6
+
5
7
  ### Keywords
6
8
 
7
9
  Sortable awesom_nested_set, Drag&Drop GUI for awesom_nested_set, View Helper for nested set, Nested Comments
@@ -111,7 +113,7 @@ end
111
113
 
112
114
  ```
113
115
 
114
- or
116
+ or
115
117
 
116
118
  ``` ruby
117
119
  class PagesController < ApplicationController
@@ -120,7 +122,7 @@ class PagesController < ApplicationController
120
122
  def manage
121
123
  @pages = Page.reversed_nested_set.all
122
124
  end
123
-
125
+
124
126
  # any code here
125
127
  end
126
128
  ```
@@ -142,6 +144,32 @@ end
142
144
  <%= stylesheet_link_tag 'comments_tree', :media => :all %>
143
145
  ```
144
146
 
147
+ ### Or, if you're using Asset Pipeline
148
+
149
+ In JS manifest file (application.js):
150
+
151
+ ``` js
152
+ //= require jquery
153
+ //= require jquery_ujs
154
+ //= require jquery-ui
155
+ //= require jquery.ui.nestedSortable
156
+ //= require sortable/base
157
+ //= require comments/base
158
+ //= require_tree .
159
+ ```
160
+
161
+ In CSS manifest file (application.css):
162
+
163
+ ``` css
164
+ /*
165
+ *= require_self
166
+ *= require_tree .
167
+ *= require tree
168
+ *= require sortable
169
+ *= require comments_tree
170
+ */
171
+
172
+ ```
145
173
 
146
174
  ### Render your tree
147
175
 
@@ -359,6 +387,8 @@ And fix errors :) Ha-Ha-Ha! You can ask me if you will do it.
359
387
 
360
388
  ### Changelog
361
389
 
390
+ 1.9.4 - rm CoffeeScript document scope, ru locale, fix data-confirm
391
+
362
392
  1.9.3 - Jeffery Utter patch for coffee script
363
393
 
364
394
  1.9.2 - View Generators updated
@@ -405,4 +435,4 @@ HAML by default. You can use any Template Engine, but convert partials by yourse
405
435
  ### Acknowledgments
406
436
 
407
437
  * https://github.com/mjsarfatti/nestedSortable
408
- * http://iconza.com
438
+ * http://iconza.com
@@ -1,48 +1,47 @@
1
- $ ->
2
- class @TheSortableTree
3
- max_levels = 3
4
- rebuild_url = '/'
1
+ class @TheSortableTree
2
+ max_levels = 3
3
+ rebuild_url = '/'
5
4
 
6
- init: ->
7
- $('ol.sortable').nestedSortable
8
- disableNesting: 'no-nest'
9
- forcePlaceholderSize: true
10
- handle: 'i.handle'
11
- helper: 'clone'
12
- items: 'li'
13
- maxLevels: @max_levels
14
- opacity: .6
15
- placeholder: 'placeholder'
16
- revert: 250
17
- tabSize: 25
18
- tolerance: 'pointer'
19
- toleranceElement: '> div'
5
+ init: ->
6
+ $('ol.sortable').nestedSortable
7
+ disableNesting: 'no-nest'
8
+ forcePlaceholderSize: true
9
+ handle: 'i.handle'
10
+ helper: 'clone'
11
+ items: 'li'
12
+ maxLevels: @max_levels
13
+ opacity: .6
14
+ placeholder: 'placeholder'
15
+ revert: 250
16
+ tabSize: 25
17
+ tolerance: 'pointer'
18
+ toleranceElement: '> div'
20
19
 
21
- $('ol.sortable').sortable
22
- update: (event, ui) =>
23
- parent_id = ui.item.parent().parent().attr('id')
24
- item_id = ui.item.attr('id')
25
- prev_id = ui.item.prev().attr('id')
26
- next_id = ui.item.next().attr('id')
20
+ $('ol.sortable').sortable
21
+ update: (event, ui) =>
22
+ parent_id = ui.item.parent().parent().attr('id')
23
+ item_id = ui.item.attr('id')
24
+ prev_id = ui.item.prev().attr('id')
25
+ next_id = ui.item.next().attr('id')
27
26
 
28
- @rebuild item_id, parent_id, prev_id, next_id
27
+ @rebuild item_id, parent_id, prev_id, next_id
29
28
 
30
- rebuild: (item_id, parent_id, prev_id, next_id) =>
31
- $.ajax
32
- type: 'POST'
33
- dataType: 'script'
34
- url: @rebuild_url
35
- data:
36
- id: item_id
37
- parent_id: parent_id
38
- prev_id: prev_id
39
- next_id: next_id
29
+ rebuild: (item_id, parent_id, prev_id, next_id) =>
30
+ $.ajax
31
+ type: 'POST'
32
+ dataType: 'script'
33
+ url: @rebuild_url
34
+ data:
35
+ id: item_id
36
+ parent_id: parent_id
37
+ prev_id: prev_id
38
+ next_id: next_id
40
39
 
41
- beforeSend: (xhr) ->
42
- $('.nested_set i.handle').hide()
40
+ beforeSend: (xhr) ->
41
+ $('.nested_set i.handle').hide()
43
42
 
44
- success: (data, status, xhr) ->
45
- $('.nested_set i.handle').show()
43
+ success: (data, status, xhr) ->
44
+ $('.nested_set i.handle').show()
46
45
 
47
- error: (xhr, status, error) ->
48
- alert error
46
+ error: (xhr, status, error) ->
47
+ alert error
@@ -79,19 +79,19 @@
79
79
  margin: 0 0 0 3px;
80
80
  cursor: pointer;
81
81
 
82
- .new{
82
+ &.new{
83
83
  background: transparent url(/assets/iconza/blue/add.png) no-repeat scroll center center;
84
84
  &:hover{ background: transparent url(/assets/iconza/red/add.png) no-repeat scroll center center }
85
85
  }
86
- .edit{
86
+ &.edit{
87
87
  background: transparent url(/assets/iconza/blue/edit.png) no-repeat scroll center center;
88
88
  &:hover{ background: transparent url(/assets/iconza/red/edit.png) no-repeat scroll center center }
89
89
  }
90
- .delete{
90
+ &.delete{
91
91
  background: transparent url(/assets/iconza/blue/delete.png) no-repeat scroll center center;
92
92
  &:hover{ background: transparent url(/assets/iconza/red/delete.png) no-repeat scroll center center }
93
93
  }
94
- .undeleted{ background: transparent url(/assets/iconza/gray/delete.png) no-repeat scroll center center }
94
+ &.undeleted{ background: transparent url(/assets/iconza/gray/delete.png) no-repeat scroll center center }
95
95
  }
96
96
 
97
97
  .placeholder {
@@ -103,4 +103,4 @@
103
103
  color: #8a1f11;
104
104
  }
105
105
  }
106
- }
106
+ }
@@ -2,15 +2,15 @@
2
2
  - edit = link_to '', polymorphic_url(opts[:namespace] + [node], :action => :edit), :title => t('.edit_this'), :class => 'button edit'
3
3
  -# DELETE
4
4
  - if opts[:has_children]
5
- - delete = link_to('', url_for(opts[:namespace] + [node]),
6
- :title => t('.delete'),
7
- :method => :delete,
8
- :confirm => t('.delete_confirm'),
9
- :class => 'button delete')
5
+ - delete = link_to('', url_for(opts[:namespace] + [node]),
6
+ :title => t('.delete'),
7
+ :method => :delete,
8
+ :data => { :confirm => t('.delete_confirm') },
9
+ :class => 'button delete')
10
10
  - else
11
- - delete = link_to('', '#',
12
- :title => t('.cant_be_deleted'),
13
- :onclick => "alert('#{t('.delete_nested_elements')}')",
14
- :class => 'button undeleted')
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
@@ -3,7 +3,7 @@
3
3
  - unless tree.empty?
4
4
  :javascript
5
5
  $(function() {
6
- sortable = new document.TheSortableTree;
6
+ sortable = new TheSortableTree;
7
7
  sortable.max_levels = #{opts[:max_levels]};
8
8
  sortable.rebuild_url = "#{url_for(:controller => opts[:klass].pluralize, :action => :rebuild)}";
9
9
  sortable.init()
@@ -1,10 +1,31 @@
1
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: Сперва удалите все дочерние элементы
2
+ sortable:
3
+ base:
4
+ new:
5
+ create: Добавить элемент
6
+ controls:
7
+ edit_this: Редактировать элемент
8
+ delete: Удалить элемент
9
+ delete_confirm: Удалить элемент безвозвратно?
10
+ cant_be_deleted: Не может быть удалено. Есть дочерние элементы
11
+ delete_nested_elements: Сперва удалите все дочерние элементы
12
+
13
+ comments:
14
+ base:
15
+ new_comment_form:
16
+ title: Тема сообщения
17
+ conatacts: Ваши контакты
18
+ content: Ваш комментарий
19
+ for: Для
20
+ skip: '[Отмена]'
21
+ submit: Оставить комментарий
22
+ comment:
23
+ reply: '[Ответить]'
24
+ new:
25
+ create: Добавить элемент
26
+ controls:
27
+ edit_this: Редактировать элемент
28
+ delete: Удалить элемент
29
+ delete_confirm: Удалить элемент безвозвратно?
30
+ cant_be_deleted: Не может быть удалено. Есть дочерние элементы
31
+ delete_nested_elements: Сперва удалите все дочерние элементы
@@ -1,3 +1,3 @@
1
1
  module TheSortableTree
2
- VERSION = "1.9.3"
2
+ VERSION = "1.9.4"
3
3
  end
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.9.3
4
+ version: 1.9.4
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-05-24 00:00:00.000000000 Z
12
+ date: 2012-06-17 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &8578180 !ruby/object:Gem::Requirement
16
+ requirement: &69384430 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *8578180
24
+ version_requirements: *69384430
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sqlite3
27
- requirement: &8577760 !ruby/object:Gem::Requirement
27
+ requirement: &69384220 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *8577760
35
+ version_requirements: *69384220
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &8577300 !ruby/object:Gem::Requirement
38
+ requirement: &69374790 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *8577300
46
+ version_requirements: *69374790
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec-rails
49
- requirement: &8576880 !ruby/object:Gem::Requirement
49
+ requirement: &69374570 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *8576880
57
+ version_requirements: *69374570
58
58
  description: Sortable awesom_nested_set, Drag&Drop GUI for awesom_nested_set, View
59
59
  Helper for nested set, Nested Comments
60
60
  email:
@@ -65,93 +65,93 @@ extra_rdoc_files:
65
65
  - README.md
66
66
  files:
67
67
  - app/controllers/the_sortable_tree_controller.rb
68
- - app/assets/javascripts/comments/base.js.coffee
69
- - app/assets/javascripts/sortable/base.js.coffee
70
- - app/assets/javascripts/jquery.ui.nestedSortable.js
71
- - app/assets/images/iconza/blue/downloads_folder.png
72
- - app/assets/images/iconza/blue/edit.png
73
- - app/assets/images/iconza/blue/move.png
74
- - app/assets/images/iconza/blue/up.png
75
- - app/assets/images/iconza/blue/add.png
76
- - app/assets/images/iconza/blue/down.png
77
- - app/assets/images/iconza/blue/delete.png
78
68
  - app/assets/images/iconza/red/edit.png
79
- - app/assets/images/iconza/red/up.png
80
- - app/assets/images/iconza/red/add.png
81
- - app/assets/images/iconza/red/newspaper.png
82
69
  - app/assets/images/iconza/red/down.png
83
70
  - app/assets/images/iconza/red/zoom.png
84
71
  - app/assets/images/iconza/red/trash.png
72
+ - app/assets/images/iconza/red/newspaper.png
85
73
  - app/assets/images/iconza/red/delete.png
86
- - app/assets/images/iconza/gray/push_pin.png
74
+ - app/assets/images/iconza/red/up.png
75
+ - app/assets/images/iconza/red/add.png
76
+ - app/assets/images/iconza/gray/mail.png
87
77
  - app/assets/images/iconza/gray/edit.png
88
- - app/assets/images/iconza/gray/lock.png
89
- - app/assets/images/iconza/gray/up.png
90
- - app/assets/images/iconza/gray/add.png
91
78
  - app/assets/images/iconza/gray/down.png
92
79
  - app/assets/images/iconza/gray/delete.png
93
- - app/assets/images/iconza/gray/mail.png
94
- - app/assets/stylesheets/comments_tree.css.scss
80
+ - app/assets/images/iconza/gray/push_pin.png
81
+ - app/assets/images/iconza/gray/up.png
82
+ - app/assets/images/iconza/gray/add.png
83
+ - app/assets/images/iconza/gray/lock.png
84
+ - app/assets/images/iconza/blue/edit.png
85
+ - app/assets/images/iconza/blue/down.png
86
+ - app/assets/images/iconza/blue/downloads_folder.png
87
+ - app/assets/images/iconza/blue/move.png
88
+ - app/assets/images/iconza/blue/delete.png
89
+ - app/assets/images/iconza/blue/up.png
90
+ - app/assets/images/iconza/blue/add.png
95
91
  - app/assets/stylesheets/tree.css.scss
92
+ - app/assets/stylesheets/comments_tree.css.scss
96
93
  - app/assets/stylesheets/sortable.css.scss
97
- - app/helpers/the_sortable_tree_helper.rb
98
- - app/views/comments/base/_new_comment_form.html.haml
94
+ - app/assets/javascripts/comments/base.js.coffee
95
+ - app/assets/javascripts/sortable/base.js.coffee
96
+ - app/assets/javascripts/jquery.ui.nestedSortable.js
99
97
  - app/views/comments/base/_children.html.haml
100
98
  - app/views/comments/base/_node.html.haml
101
- - app/views/comments/base/_comment.html.haml
102
99
  - app/views/comments/base/_tree.html.haml
103
- - app/views/sortable/base/_new.html.haml
100
+ - app/views/comments/base/_comment.html.haml
101
+ - app/views/comments/base/_new_comment_form.html.haml
104
102
  - app/views/sortable/base/_children.html.haml
105
103
  - app/views/sortable/base/_node.html.haml
106
104
  - app/views/sortable/base/_link.html.haml
107
- - app/views/sortable/base/_controls.html.haml
108
105
  - app/views/sortable/base/_tree.html.haml
106
+ - app/views/sortable/base/_new.html.haml
107
+ - app/views/sortable/base/_controls.html.haml
109
108
  - app/views/tree/base/_children.html.haml
110
109
  - app/views/tree/base/_node.html.haml
111
110
  - app/views/tree/base/_link.html.haml
112
111
  - app/views/tree/base/_tree.html.haml
113
- - config/locales/en.yml
112
+ - app/helpers/the_sortable_tree_helper.rb
114
113
  - config/locales/ru.yml
114
+ - config/locales/en.yml
115
115
  - lib/the_sortable_tree/version.rb
116
116
  - lib/the_sortable_tree/engine.rb
117
- - lib/generators/the_sortable_tree/views_generator.rb
118
117
  - lib/tasks/the_sortable_tree.rake
118
+ - lib/generators/the_sortable_tree/views_generator.rb
119
119
  - lib/the_sortable_tree.rb
120
120
  - MIT-LICENSE
121
121
  - Rakefile
122
122
  - README.md
123
- - spec/spec_helper.rb
124
123
  - spec/controlllers/controller_mixin_spec.rb
125
- - spec/dummy/public/404.html
126
- - spec/dummy/public/422.html
127
- - spec/dummy/public/500.html
128
- - spec/dummy/public/favicon.ico
124
+ - spec/spec_helper.rb
125
+ - spec/dummy/README.rdoc
129
126
  - spec/dummy/Rakefile
130
- - spec/dummy/db/test.sqlite3
131
- - spec/dummy/log/test.log
132
- - spec/dummy/script/rails
133
- - spec/dummy/app/controllers/tests_controller.rb
134
- - spec/dummy/app/controllers/application_controller.rb
135
- - spec/dummy/app/assets/javascripts/application.js
136
- - spec/dummy/app/assets/stylesheets/application.css
137
- - spec/dummy/app/views/layouts/application.html.erb
138
127
  - spec/dummy/config.ru
139
- - spec/dummy/config/routes.rb
128
+ - spec/dummy/config/boot.rb
140
129
  - spec/dummy/config/application.rb
141
- - spec/dummy/config/environments/development.rb
142
- - spec/dummy/config/environments/test.rb
143
- - spec/dummy/config/environments/production.rb
144
- - spec/dummy/config/database.yml
145
130
  - spec/dummy/config/environment.rb
146
- - spec/dummy/config/boot.rb
147
131
  - spec/dummy/config/locales/en.yml
148
- - spec/dummy/config/initializers/mime_types.rb
149
132
  - spec/dummy/config/initializers/session_store.rb
150
- - spec/dummy/config/initializers/wrap_parameters.rb
151
133
  - spec/dummy/config/initializers/backtrace_silencers.rb
152
- - spec/dummy/config/initializers/inflections.rb
134
+ - spec/dummy/config/initializers/mime_types.rb
135
+ - spec/dummy/config/initializers/wrap_parameters.rb
153
136
  - spec/dummy/config/initializers/secret_token.rb
154
- - spec/dummy/README.rdoc
137
+ - spec/dummy/config/initializers/inflections.rb
138
+ - spec/dummy/config/routes.rb
139
+ - spec/dummy/config/environments/development.rb
140
+ - spec/dummy/config/environments/test.rb
141
+ - spec/dummy/config/environments/production.rb
142
+ - spec/dummy/config/database.yml
143
+ - spec/dummy/public/500.html
144
+ - spec/dummy/public/404.html
145
+ - spec/dummy/public/422.html
146
+ - spec/dummy/public/favicon.ico
147
+ - spec/dummy/db/test.sqlite3
148
+ - spec/dummy/log/test.log
149
+ - spec/dummy/app/controllers/application_controller.rb
150
+ - spec/dummy/app/controllers/tests_controller.rb
151
+ - spec/dummy/app/assets/stylesheets/application.css
152
+ - spec/dummy/app/assets/javascripts/application.js
153
+ - spec/dummy/app/views/layouts/application.html.erb
154
+ - spec/dummy/script/rails
155
155
  homepage: https://github.com/the-teacher/the_sortable_tree
156
156
  licenses: []
157
157
  post_install_message:
@@ -178,35 +178,35 @@ specification_version: 3
178
178
  summary: Sortable awesom_nested_set, Drag&Drop GUI for awesom_nested_set, View Helper
179
179
  for nested set, Nested Comments
180
180
  test_files:
181
- - spec/spec_helper.rb
182
181
  - spec/controlllers/controller_mixin_spec.rb
183
- - spec/dummy/public/404.html
184
- - spec/dummy/public/422.html
185
- - spec/dummy/public/500.html
186
- - spec/dummy/public/favicon.ico
182
+ - spec/spec_helper.rb
183
+ - spec/dummy/README.rdoc
187
184
  - spec/dummy/Rakefile
188
- - spec/dummy/db/test.sqlite3
189
- - spec/dummy/log/test.log
190
- - spec/dummy/script/rails
191
- - spec/dummy/app/controllers/tests_controller.rb
192
- - spec/dummy/app/controllers/application_controller.rb
193
- - spec/dummy/app/assets/javascripts/application.js
194
- - spec/dummy/app/assets/stylesheets/application.css
195
- - spec/dummy/app/views/layouts/application.html.erb
196
185
  - spec/dummy/config.ru
197
- - spec/dummy/config/routes.rb
186
+ - spec/dummy/config/boot.rb
198
187
  - spec/dummy/config/application.rb
199
- - spec/dummy/config/environments/development.rb
200
- - spec/dummy/config/environments/test.rb
201
- - spec/dummy/config/environments/production.rb
202
- - spec/dummy/config/database.yml
203
188
  - spec/dummy/config/environment.rb
204
- - spec/dummy/config/boot.rb
205
189
  - spec/dummy/config/locales/en.yml
206
- - spec/dummy/config/initializers/mime_types.rb
207
190
  - spec/dummy/config/initializers/session_store.rb
208
- - spec/dummy/config/initializers/wrap_parameters.rb
209
191
  - spec/dummy/config/initializers/backtrace_silencers.rb
210
- - spec/dummy/config/initializers/inflections.rb
192
+ - spec/dummy/config/initializers/mime_types.rb
193
+ - spec/dummy/config/initializers/wrap_parameters.rb
211
194
  - spec/dummy/config/initializers/secret_token.rb
212
- - spec/dummy/README.rdoc
195
+ - spec/dummy/config/initializers/inflections.rb
196
+ - spec/dummy/config/routes.rb
197
+ - spec/dummy/config/environments/development.rb
198
+ - spec/dummy/config/environments/test.rb
199
+ - spec/dummy/config/environments/production.rb
200
+ - spec/dummy/config/database.yml
201
+ - spec/dummy/public/500.html
202
+ - spec/dummy/public/404.html
203
+ - spec/dummy/public/422.html
204
+ - spec/dummy/public/favicon.ico
205
+ - spec/dummy/db/test.sqlite3
206
+ - spec/dummy/log/test.log
207
+ - spec/dummy/app/controllers/application_controller.rb
208
+ - spec/dummy/app/controllers/tests_controller.rb
209
+ - spec/dummy/app/assets/stylesheets/application.css
210
+ - spec/dummy/app/assets/javascripts/application.js
211
+ - spec/dummy/app/views/layouts/application.html.erb
212
+ - spec/dummy/script/rails