commenteux 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +20 -10
- data/lib/commenteux/version.rb +1 -1
- data/spec/dummy/log/test.log +83 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c264000912237c5f64aedc38af1bb98e4e623a1
|
4
|
+
data.tar.gz: 12a8edde837c82bc8ddf5ecc8be5cfcc0451af8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
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
|
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
|
|
data/lib/commenteux/version.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
@@ -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
|
[1m[35mComment Load (0.5ms)[0m SELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 1 ORDER BY created_at ASC LIMIT 1
|
1333
1333
|
[1m[36m (0.4ms)[0m [1mROLLBACK[0m
|
1334
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
1335
|
+
[1m[35m (0.2ms)[0m COMMIT
|
1336
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
1337
|
+
[1m[35mSQL (0.3ms)[0m 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
|
+
[1m[36mDummyModel Load (0.3ms)[0m [1mSELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1[0m
|
1342
|
+
[1m[35mComment Load (0.3ms)[0m 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
|
+
[1m[36m (0.4ms)[0m [1mROLLBACK[0m
|
1346
|
+
[1m[35m (0.1ms)[0m BEGIN
|
1347
|
+
[1m[36m (0.1ms)[0m [1mCOMMIT[0m
|
1348
|
+
[1m[35m (0.1ms)[0m BEGIN
|
1349
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO `dummy_models` (`created_at`, `id`, `text`, `updated_at`) VALUES ('2014-03-17 19:33:01', 1, 'blah', '2014-03-17 19:33:01')[0m
|
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
|
+
[1m[35mDummyModel Load (0.3ms)[0m SELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1
|
1354
|
+
[1m[36mComment Load (0.3ms)[0m [1mSELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 1 AND `comments`.`commentable_type` = 'DummyModel' ORDER BY created_at ASC[0m
|
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
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
1358
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
1359
|
+
[1m[35m (0.1ms)[0m COMMIT
|
1360
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
1361
|
+
[1m[35mSQL (0.3ms)[0m 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
|
+
[1m[36mDummyModel Load (0.3ms)[0m [1mSELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1[0m
|
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
|
+
[1m[35mDummyModel Load (0.3ms)[0m SELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1
|
1372
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT 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')[0m
|
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
|
+
[1m[35mDummyModel Load (0.3ms)[0m SELECT `dummy_models`.* FROM `dummy_models` WHERE `dummy_models`.`id` = 1 LIMIT 1
|
1379
|
+
[1m[36mComment Load (0.3ms)[0m [1mSELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 1 AND `comments`.`commentable_type` = 'DummyModel' ORDER BY created_at ASC[0m
|
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
|
+
[1m[35mComment Load (0.5ms)[0m SELECT `comments`.* FROM `comments` WHERE `comments`.`commentable_id` = 1 ORDER BY created_at ASC LIMIT 1
|
1383
|
+
[1m[36m (0.4ms)[0m [1mROLLBACK[0m
|
1384
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT `schema_migrations`.* FROM `schema_migrations`[0m
|
1385
|
+
[1m[35m (0.2ms)[0m BEGIN
|
1386
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
1387
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
1392
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
1397
|
+
[1m[35m (0.1ms)[0m BEGIN
|
1398
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
1399
|
+
[1m[35m (0.1ms)[0m BEGIN
|
1400
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
1401
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
1407
|
+
[1m[35m (0.2ms)[0m 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
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
1412
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
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.
|
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-
|
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
|
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
|
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
|