commenteux 1.0.2 → 1.0.3

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f978e02678f3fa4c8552fc7d46a13bc20288bb4
4
- data.tar.gz: 16e9abc6ecb416eb6d349809de3a4691919c0525
3
+ metadata.gz: 1c264000912237c5f64aedc38af1bb98e4e623a1
4
+ data.tar.gz: 12a8edde837c82bc8ddf5ecc8be5cfcc0451af8b
5
5
  SHA512:
6
- metadata.gz: eb7810304ac08c14d0d4ab8836f31ea563e19e18565867d9c4adfa2efb127ddeee3dcdbbf7a6c515a13534c9b4f7a287bc658d2b943375e9f013d79703fe82d0
7
- data.tar.gz: bd9771d8e79450f50acfee380a287c498a687cd1b37169b736b1571dd03cdf69015954853fd4106039d77b59500b4ded68abc4b947edd454b08a05eee6b5fb3e
6
+ metadata.gz: e60e3ae6fd53da05d8e5d25284faa33a16a9502fd5959c89952802a6c2e230e847ed4942f0d04190ad838c1063e7e89553cff12505b9a1a986a90a7ef613fafe
7
+ data.tar.gz: d005296bbd86869e5b5857b8b0cfa6b3f4e6d9c0a048a4667f4616787d7cf23587781d8c60d1a2bc678568a10cec24191ac6fd47e0329c181d52dccf03ed5810
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Commenteux
2
2
 
3
- This is a mountable gem that add a presentation layer to act_as_commentable.
3
+ This is a mountable gem that add a presentation layer to acts_as_commentable.
4
4
 
5
5
  Mount this gem into your app to automatically have access to screens that list and create comments on any of your resources.
6
6
  Those screen will be inserted in your current app layout. You can call the routes of the gem with ajax passing a parent
@@ -8,7 +8,7 @@ div where you want the response to ben inserted.
8
8
 
9
9
  Note that the presentation layer is based on bootstrap.
10
10
 
11
- Note that you must have act_as_commentable installed and ready in your desired resource.
11
+ Also note that you must have acts_as_commentable installed and declared in your desired resources.
12
12
 
13
13
  == Installation :
14
14
 
@@ -20,25 +20,36 @@ Add the following line to your Gemfile
20
20
 
21
21
  == Usage
22
22
 
23
- Make your ActiveRecord model act as commentable:
24
-
25
- class Post < ActiveRecord::Base
26
- acts_as_commentable
27
- end
28
-
29
23
  Mount the commenteux gem in your routes:
30
24
 
31
25
  mount Commenteux::Engine => "/"
32
26
 
27
+ The routes that will be available are :
28
+
29
+ GET /commenteux/:resource/:resource_id(.:format) commenteux/notes#index
30
+ GET /commenteux/:resource/:resource_id/new(.:format) commenteux/notes#new
31
+ POST /commenteux/:resource/:resource_id(.:format) commenteux/notes#create
32
+
33
+ where :resource is the name of your model (you can use namespace)
34
+
33
35
  Call url of commenteux screens, for exemple, like that:
34
36
 
35
37
  <%= link_to "<i class='icon-file-text text-blue'></i> Notes".html_safe,
36
38
  "/commenteux/client::contract/#{@contract.id}?parent_div=ajax_target",
37
39
  :id => "notes_tab", :data => {:remote => true} %>
38
40
 
41
+ With a binding like that in your application.js
42
+
43
+ $(document).delegate '#notes_tab', 'ajax:success', (e, data, status, xhr) ->
44
+ console.log(xhr.responseText)
45
+ $('.tab_header').removeClass('active')
46
+ $('#notes_tab_header').addClass('active')
47
+ $('#ajax_target').html(xhr.responseText)
48
+
49
+
39
50
  == Credits
40
51
 
41
- jackdempsey - The creator of act_as_commentable.
52
+ jackdempsey - The creator of acts_as_commentable.
42
53
 
43
54
  == Contributors
44
55
 
@@ -46,7 +57,6 @@ seurdge, rgagnon
46
57
 
47
58
  == More
48
59
 
49
- https://github.com/seurdge/commenteux
50
60
  http://www.groupefungo.ca
51
61
 
52
62
 
@@ -1,3 +1,3 @@
1
1
  module Commenteux
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -1331,3 +1331,86 @@ Processing by Commenteux::NotesController#index as HTML
1331
1331
  Completed 200 OK in 5ms (Views: 1.3ms | ActiveRecord: 0.6ms)
1332
1332
  Comment Load (0.5ms) SELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 1 ORDER BY created_at ASC LIMIT 1
1333
1333
   (0.4ms) ROLLBACK
1334
+  (0.1ms) BEGIN
1335
+  (0.2ms) COMMIT
1336
+  (0.1ms) BEGIN
1337
+ SQL (0.3ms) INSERT INTO `dummy_models` (`created_at`, `id`, `text`, `updated_at`) VALUES ('2014-03-17 19:33:01', 1, 'blah', '2014-03-17 19:33:01')
1338
+ Started GET "/commenteux/dummy_model/1" for 127.0.0.1 at 2014-03-17 15:33:01 -0400
1339
+ Processing by Commenteux::NotesController#index as HTML
1340
+ Parameters: {"resource"=>"dummy_model", "resource_id"=>"1"}
1341
+ DummyModel Load (0.3ms) SELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1
1342
+ Comment Load (0.3ms) SELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 1 AND `comments`.`commentable_type` = 'DummyModel' ORDER BY created_at ASC
1343
+ Rendered /Users/seurdge/projects/commenteux/app/views/commenteux/notes/index.html.erb within layouts/application (33.1ms)
1344
+ Completed 200 OK in 77ms (Views: 47.3ms | ActiveRecord: 2.5ms)
1345
+  (0.4ms) ROLLBACK
1346
+  (0.1ms) BEGIN
1347
+  (0.1ms) COMMIT
1348
+  (0.1ms) BEGIN
1349
+ SQL (0.3ms) INSERT INTO `dummy_models` (`created_at`, `id`, `text`, `updated_at`) VALUES ('2014-03-17 19:33:01', 1, 'blah', '2014-03-17 19:33:01')
1350
+ Started GET "/commenteux/dummy_model/1" for 127.0.0.1 at 2014-03-17 15:33:01 -0400
1351
+ Processing by Commenteux::NotesController#index as HTML
1352
+ Parameters: {"resource"=>"dummy_model", "resource_id"=>"1"}
1353
+ DummyModel Load (0.3ms) SELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1
1354
+ Comment Load (0.3ms) SELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 1 AND `comments`.`commentable_type` = 'DummyModel' ORDER BY created_at ASC
1355
+ Rendered /Users/seurdge/projects/commenteux/app/views/commenteux/notes/index.html.erb within layouts/application (0.5ms)
1356
+ Completed 200 OK in 7ms (Views: 1.7ms | ActiveRecord: 0.7ms)
1357
+  (0.4ms) ROLLBACK
1358
+  (0.1ms) BEGIN
1359
+  (0.1ms) COMMIT
1360
+  (0.1ms) BEGIN
1361
+ SQL (0.3ms) INSERT INTO `dummy_models` (`created_at`, `id`, `text`, `updated_at`) VALUES ('2014-03-17 19:33:01', 1, 'blah', '2014-03-17 19:33:01')
1362
+ Started GET "/commenteux/dummy_model/1/new" for 127.0.0.1 at 2014-03-17 15:33:01 -0400
1363
+ Processing by Commenteux::NotesController#new as HTML
1364
+ Parameters: {"resource"=>"dummy_model", "resource_id"=>"1"}
1365
+ DummyModel Load (0.3ms) SELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1
1366
+ Rendered /Users/seurdge/projects/commenteux/app/views/commenteux/notes/new.html.erb within layouts/application (82.4ms)
1367
+ Completed 200 OK in 96ms (Views: 84.8ms | ActiveRecord: 0.7ms)
1368
+ Started POST "/commenteux/dummy_model/1?parent_div=" for 127.0.0.1 at 2014-03-17 15:33:01 -0400
1369
+ Processing by Commenteux::NotesController#create as HTML
1370
+ Parameters: {"utf8"=>"✓", "comments"=>{"title"=>"", "comment"=>"Ceci est un commentaire"}, "parent_div"=>"", "resource"=>"dummy_model", "resource_id"=>"1"}
1371
+ DummyModel Load (0.3ms) SELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1
1372
+ SQL (0.3ms) INSERT INTO `comments` (`comment`, `commentable_id`, `commentable_type`, `created_at`, `updated_at`) VALUES ('Ceci est un commentaire', 1, 'DummyModel', '2014-03-17 19:33:01', '2014-03-17 19:33:01')
1373
+ Redirected to http://www.example.com/commenteux/dummy_model/1?parent_div=
1374
+ Completed 302 Found in 6ms (ActiveRecord: 0.6ms)
1375
+ Started GET "/commenteux/dummy_model/1?parent_div=" for 127.0.0.1 at 2014-03-17 15:33:01 -0400
1376
+ Processing by Commenteux::NotesController#index as HTML
1377
+ Parameters: {"parent_div"=>"", "resource"=>"dummy_model", "resource_id"=>"1"}
1378
+ DummyModel Load (0.3ms) SELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1
1379
+ Comment Load (0.3ms) SELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 1 AND `comments`.`commentable_type` = 'DummyModel' ORDER BY created_at ASC
1380
+ Rendered /Users/seurdge/projects/commenteux/app/views/commenteux/notes/index.html.erb within layouts/application (0.4ms)
1381
+ Completed 200 OK in 4ms (Views: 1.2ms | ActiveRecord: 0.6ms)
1382
+ Comment Load (0.5ms) SELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 1 ORDER BY created_at ASC LIMIT 1
1383
+  (0.4ms) ROLLBACK
1384
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1385
+  (0.2ms) BEGIN
1386
+  (0.2ms) ROLLBACK
1387
+  (0.1ms) BEGIN
1388
+ Processing by Commenteux::NotesController#new as JS
1389
+ Parameters: {"resource"=>"dummy_model", "resource_id"=>"1"}
1390
+ Completed 200 OK in 9ms (Views: 8.2ms | ActiveRecord: 0.0ms)
1391
+  (0.2ms) ROLLBACK
1392
+  (0.1ms) BEGIN
1393
+ Processing by Commenteux::NotesController#new as HTML
1394
+ Parameters: {"resource"=>"dummy_model", "resource_id"=>"1"}
1395
+ Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.0ms)
1396
+  (0.2ms) ROLLBACK
1397
+  (0.1ms) BEGIN
1398
+  (0.2ms) ROLLBACK
1399
+  (0.1ms) BEGIN
1400
+  (0.2ms) ROLLBACK
1401
+  (0.1ms) BEGIN
1402
+ Processing by Commenteux::NotesController#create as HTML
1403
+ Parameters: {"parent_div"=>"parent_div", "comments"=>{"title"=>"Titre", "comment"=>"Commentaire"}, "resource"=>"dummy_model", "resource_id"=>"1"}
1404
+ Redirected to http://test.host/commenteux/dummy_model/1?parent_div=parent_div
1405
+ Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
1406
+  (0.2ms) ROLLBACK
1407
+  (0.2ms) BEGIN
1408
+ Processing by Commenteux::NotesController#index as JS
1409
+ Parameters: {"resource"=>"dummy_model", "resource_id"=>"1"}
1410
+ Completed 200 OK in 8ms (Views: 6.8ms | ActiveRecord: 0.0ms)
1411
+  (0.2ms) ROLLBACK
1412
+  (0.1ms) BEGIN
1413
+ Processing by Commenteux::NotesController#index as HTML
1414
+ Parameters: {"resource"=>"dummy_model", "resource_id"=>"1"}
1415
+ Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms)
1416
+  (0.2ms) ROLLBACK
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commenteux
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Groupe Fungo inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-17 00:00:00.000000000 Z
11
+ date: 2014-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -69,7 +69,7 @@ dependencies:
69
69
  description: |-
70
70
  Mount this gem into your app to automatically have access to screens that list and create comments on any of your resources that use act_as_commentable.
71
71
  Those screen will be inserted in your current app layout. You can call the routes of the gem with ajax passing a parent
72
- div where you want the response to ben inserted.
72
+ div where you want the response to be inserted.
73
73
  email:
74
74
  - ssavoie@fungo.ca
75
75
  executables: []
@@ -193,7 +193,7 @@ rubyforge_project:
193
193
  rubygems_version: 2.2.2
194
194
  signing_key:
195
195
  specification_version: 4
196
- summary: This is a mountable gem that add a presentation layer to act_as_commentable.
196
+ summary: This is a mountable gem that add a presentation layer to acts_as_commentable.
197
197
  test_files:
198
198
  - spec/controllers/commenteux/notes_controller_spec.rb
199
199
  - spec/dummy/app/assets/javascripts/application.js