commontator 0.1.46

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.
Files changed (156) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +35 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/images/commontator/downvote.png +0 -0
  5. data/app/assets/images/commontator/downvote_hover.png +0 -0
  6. data/app/assets/images/commontator/upvote.png +0 -0
  7. data/app/assets/images/commontator/upvote_hover.png +0 -0
  8. data/app/assets/stylesheets/commontator/application.css +13 -0
  9. data/app/assets/stylesheets/commontator/application.css~ +88 -0
  10. data/app/assets/stylesheets/commontator/comments.css +86 -0
  11. data/app/assets/stylesheets/commontator/comments.css~ +90 -0
  12. data/app/assets/stylesheets/commontator/threads.css +13 -0
  13. data/app/assets/stylesheets/commontator/threads.css~ +13 -0
  14. data/app/controllers/commontator/application_controller.rb +18 -0
  15. data/app/controllers/commontator/application_controller.rb~ +16 -0
  16. data/app/controllers/commontator/comments_controller.rb +143 -0
  17. data/app/controllers/commontator/comments_controller.rb~ +143 -0
  18. data/app/controllers/commontator/subscriptions_controller.rb +42 -0
  19. data/app/controllers/commontator/subscriptions_controller.rb~ +40 -0
  20. data/app/controllers/commontator/threads_controller.rb +42 -0
  21. data/app/controllers/commontator/threads_controller.rb~ +43 -0
  22. data/app/helpers/commontator/application_helper.rb +11 -0
  23. data/app/helpers/commontator/application_helper.rb~ +11 -0
  24. data/app/helpers/commontator/comments_helper.rb +47 -0
  25. data/app/helpers/commontator/comments_helper.rb~ +58 -0
  26. data/app/helpers/commontator/commontable_helper.rb~ +9 -0
  27. data/app/helpers/commontator/commontator_helper.rb +8 -0
  28. data/app/helpers/commontator/commontator_helper.rb~ +8 -0
  29. data/app/helpers/commontator/subscriptions_helper.rb +8 -0
  30. data/app/helpers/commontator/subscriptions_helper.rb~ +8 -0
  31. data/app/helpers/commontator/threads_helper.rb +21 -0
  32. data/app/helpers/commontator/threads_helper.rb~ +32 -0
  33. data/app/mailers/commontator/subscription_mailer.rb~ +38 -0
  34. data/app/mailers/commontator/subscriptions_mailer.rb +51 -0
  35. data/app/mailers/commontator/subscriptions_mailer.rb~ +51 -0
  36. data/app/models/commontator/comment.rb +84 -0
  37. data/app/models/commontator/comment.rb~ +84 -0
  38. data/app/models/commontator/subscription.rb +21 -0
  39. data/app/models/commontator/subscription.rb~ +21 -0
  40. data/app/models/commontator/thread.rb +138 -0
  41. data/app/models/commontator/thread.rb~ +141 -0
  42. data/app/views/commontator/comments/_actions.html.erb +32 -0
  43. data/app/views/commontator/comments/_actions.html.erb~ +33 -0
  44. data/app/views/commontator/comments/_body.html.erb +7 -0
  45. data/app/views/commontator/comments/_body.html.erb~ +8 -0
  46. data/app/views/commontator/comments/_form.html.erb +20 -0
  47. data/app/views/commontator/comments/_form.html.erb~ +21 -0
  48. data/app/views/commontator/comments/_show.html.erb +41 -0
  49. data/app/views/commontator/comments/_show.html.erb~ +45 -0
  50. data/app/views/commontator/comments/_votes.html.erb +60 -0
  51. data/app/views/commontator/comments/_votes.html.erb~ +62 -0
  52. data/app/views/commontator/comments/create.js.erb +15 -0
  53. data/app/views/commontator/comments/create.js.erb~ +15 -0
  54. data/app/views/commontator/comments/delete.js.erb +15 -0
  55. data/app/views/commontator/comments/delete.js.erb~ +15 -0
  56. data/app/views/commontator/comments/destroy.js.erb~ +1 -0
  57. data/app/views/commontator/comments/edit.html.erb +6 -0
  58. data/app/views/commontator/comments/edit.html.erb~ +6 -0
  59. data/app/views/commontator/comments/edit.js.erb +5 -0
  60. data/app/views/commontator/comments/edit.js.erb~ +5 -0
  61. data/app/views/commontator/comments/new.html.erb +8 -0
  62. data/app/views/commontator/comments/new.html.erb~ +8 -0
  63. data/app/views/commontator/comments/new.js.erb +12 -0
  64. data/app/views/commontator/comments/new.js.erb~ +12 -0
  65. data/app/views/commontator/comments/update.js.erb +7 -0
  66. data/app/views/commontator/comments/update.js.erb~ +7 -0
  67. data/app/views/commontator/comments/vote.js.erb +5 -0
  68. data/app/views/commontator/comments/vote.js.erb~ +5 -0
  69. data/app/views/commontator/commontator/_thread.html.erb +14 -0
  70. data/app/views/commontator/commontator/_thread.html.erb~ +15 -0
  71. data/app/views/commontator/subscriptions/_subscription_link.html.erb +12 -0
  72. data/app/views/commontator/subscriptions/_subscription_link.html.erb~ +12 -0
  73. data/app/views/commontator/subscriptions/create.js.erb +5 -0
  74. data/app/views/commontator/subscriptions/create.js.erb~ +3 -0
  75. data/app/views/commontator/subscriptions/destroy.js.erb +5 -0
  76. data/app/views/commontator/subscriptions/destroy.js.erb~ +3 -0
  77. data/app/views/commontator/subscriptions/index.html.erb +16 -0
  78. data/app/views/commontator/subscriptions/index.html.erb~ +16 -0
  79. data/app/views/commontator/subscriptions_mailer/comment_created_email.html.erb +14 -0
  80. data/app/views/commontator/subscriptions_mailer/comment_created_email.html.erb~ +14 -0
  81. data/app/views/commontator/threads/_show.html.erb +26 -0
  82. data/app/views/commontator/threads/_show.html.erb~ +26 -0
  83. data/app/views/commontator/threads/show.html.erb +3 -0
  84. data/app/views/commontator/threads/show.js.erb +6 -0
  85. data/app/views/layouts/commontator/application.html.erb +14 -0
  86. data/config/initializers/commontator.rb +7 -0
  87. data/config/routes.rb +24 -0
  88. data/config/routes.rb~ +22 -0
  89. data/db/migrate/0_install_commontator.rb +40 -0
  90. data/db/migrate/0_install_commontator.rb~ +40 -0
  91. data/lib/commontator.rb +66 -0
  92. data/lib/commontator.rb~ +66 -0
  93. data/lib/commontator/acts_as_commontable.rb +39 -0
  94. data/lib/commontator/acts_as_commontable.rb~ +42 -0
  95. data/lib/commontator/acts_as_commontator.rb +28 -0
  96. data/lib/commontator/acts_as_commontator.rb~ +37 -0
  97. data/lib/commontator/commontable_config.rb +13 -0
  98. data/lib/commontator/commontator_config.rb +13 -0
  99. data/lib/commontator/engine.rb +5 -0
  100. data/lib/commontator/routes.rb~ +37 -0
  101. data/lib/commontator/version.rb +3 -0
  102. data/lib/commontator/version.rb~ +3 -0
  103. data/test/commontator_test.rb +7 -0
  104. data/test/dummy/README.rdoc +261 -0
  105. data/test/dummy/Rakefile +7 -0
  106. data/test/dummy/app/assets/javascripts/application.js +15 -0
  107. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  108. data/test/dummy/app/controllers/application_controller.rb +3 -0
  109. data/test/dummy/app/helpers/application_helper.rb +2 -0
  110. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  111. data/test/dummy/config.ru +4 -0
  112. data/test/dummy/config/application.rb +59 -0
  113. data/test/dummy/config/boot.rb +10 -0
  114. data/test/dummy/config/database.yml +25 -0
  115. data/test/dummy/config/environment.rb +5 -0
  116. data/test/dummy/config/environments/development.rb +37 -0
  117. data/test/dummy/config/environments/production.rb +67 -0
  118. data/test/dummy/config/environments/test.rb +37 -0
  119. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  120. data/test/dummy/config/initializers/inflections.rb +15 -0
  121. data/test/dummy/config/initializers/mime_types.rb +5 -0
  122. data/test/dummy/config/initializers/secret_token.rb +7 -0
  123. data/test/dummy/config/initializers/session_store.rb +8 -0
  124. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  125. data/test/dummy/config/locales/en.yml +5 -0
  126. data/test/dummy/config/routes.rb +4 -0
  127. data/test/dummy/db/development.sqlite3 +0 -0
  128. data/test/dummy/db/schema.rb +16 -0
  129. data/test/dummy/db/test.sqlite3 +0 -0
  130. data/test/dummy/log/development.log +204 -0
  131. data/test/dummy/public/404.html +26 -0
  132. data/test/dummy/public/422.html +26 -0
  133. data/test/dummy/public/500.html +25 -0
  134. data/test/dummy/public/favicon.ico +0 -0
  135. data/test/dummy/script/rails +6 -0
  136. data/test/functional/comment_thread_subscriptions_controller_test.rb~ +125 -0
  137. data/test/functional/comments_controller_test.rb +181 -0
  138. data/test/functional/comments_controller_test.rb~ +184 -0
  139. data/test/functional/subscriptions_controller_test.rb +122 -0
  140. data/test/functional/subscriptions_controller_test.rb~ +122 -0
  141. data/test/integration/navigation_test.rb +10 -0
  142. data/test/test_helper.rb +15 -0
  143. data/test/unit/comment_test.rb +35 -0
  144. data/test/unit/comment_test.rb~ +38 -0
  145. data/test/unit/comment_thread_subscription_test.rb~ +18 -0
  146. data/test/unit/comment_thread_test.rb~ +60 -0
  147. data/test/unit/helpers/comment_thread_subscriptions_helper_test.rb~ +7 -0
  148. data/test/unit/helpers/comments_helper_test.rb +4 -0
  149. data/test/unit/helpers/comments_helper_test.rb~ +7 -0
  150. data/test/unit/helpers/subscriptions_helper_test.rb +4 -0
  151. data/test/unit/helpers/subscriptions_helper_test.rb~ +4 -0
  152. data/test/unit/subscription_test.rb +15 -0
  153. data/test/unit/subscription_test.rb~ +15 -0
  154. data/test/unit/thread_test.rb +57 -0
  155. data/test/unit/thread_test.rb~ +57 -0
  156. metadata +301 -0
@@ -0,0 +1,7 @@
1
+ <% # Clients of this partial must provide the following variable:
2
+ # comment
3
+ %>
4
+
5
+ <%= simple_format comment.is_deleted? ? \
6
+ comment.thread.config.comment_name.capitalize + \
7
+ ' deleted by ' + deleter_name(comment) : comment.body %>
@@ -0,0 +1,8 @@
1
+ <% # Clients of this partial must provide the following variable:
2
+ # comment
3
+ %>
4
+
5
+ <%= simple_format comment.is_deleted? ? \
6
+ comment.thread.config.comment_name.capitalize + \
7
+ ' deleted by ' + deleter_name(comment) : comment.body,
8
+ {:id => "comment_#{comment.id}_body_pre", :class => 'comment_body'} %>
@@ -0,0 +1,20 @@
1
+ <% # Clients of this partial must provide the following variables:
2
+ # comment
3
+ #
4
+ # Additionally, they can override the following variable:
5
+ thread ||= nil
6
+ no_remote ||= false
7
+ %>
8
+
9
+ <%= form_for([thread, comment],
10
+ :remote => !no_remote) do |f| %>
11
+
12
+ <p>
13
+ <%= f.text_area :body, :rows => '7' %>
14
+ </p>
15
+
16
+ <p>
17
+ <%= f.submit %>
18
+ </p>
19
+
20
+ <% end %>
@@ -0,0 +1,21 @@
1
+ <% # Clients of this partial must provide the following variables:
2
+ # comment
3
+ #
4
+ # Additionally, they can override the following variable:
5
+ thread ||= nil
6
+ no_remote ||= false
7
+ %>
8
+
9
+ <%= form_for([thread, comment],
10
+ :id => 'new_comment_form',
11
+ :remote => !no_remote) do |f| %>
12
+
13
+ <p>
14
+ <%= f.text_area :body, :rows => '7' %>
15
+ </p>
16
+
17
+ <p>
18
+ <%= f.submit %>
19
+ </p>
20
+
21
+ <% end %>
@@ -0,0 +1,41 @@
1
+ <% # Clients of this partial must supply the following variables:
2
+ # comment
3
+ %>
4
+
5
+ <div id="comment_<%= comment.id.to_s %>_div" class="comment" style="clear:both">
6
+ <span id="comment_<%= comment.id.to_s %>_commontator_span" class="comment_commontator">
7
+ <% if commontator.commontator_config.commontator_name_clickable %>
8
+ <%= link_to commontator_name(comment), main_app.polymorphic_path(comment.commontator) %>
9
+ <% else %>
10
+ <%= commontator_name(comment) %>
11
+ <% end %>
12
+ &nbsp;&nbsp;
13
+ <span id="comment_<%= comment.id.to_s %>_timestamp_span" class="comment_timestamp">
14
+ <%= comment_timestamp(comment) %>
15
+ </span>
16
+ </span>
17
+
18
+ <span id="comment_<%= comment.id.to_s %>_actions_span" class="comment_actions">
19
+ <%= render :partial => 'commontator/comments/actions',
20
+ :locals => { :comment => comment } %>
21
+ </span>
22
+
23
+ <br clear="all"/>
24
+
25
+ <span id="comment_<%= comment.id.to_s %>_profile_picture_span" class="comment_profile_picture">
26
+ <%= gravatar_image comment %>
27
+ </span>
28
+
29
+ <span id="comment_<%= comment.id.to_s %>_votes_span" class="comment_votes">
30
+ <%= render :partial => 'commontator/comments/votes',
31
+ :locals => {:comment => comment} %>
32
+ </span>
33
+
34
+ <div id="comment_<%= comment.id.to_s %>_body_div" class="comment_body">
35
+ <%= render :partial => 'commontator/comments/body',
36
+ :locals => {:comment => comment} %>
37
+ </div>
38
+
39
+ </div>
40
+
41
+ <br clear="all"/>
@@ -0,0 +1,45 @@
1
+ <% # Clients of this partial must supply the following variables:
2
+ # comment
3
+ %>
4
+
5
+ <% enable_votes = comment.can_be_voted_on? %>
6
+
7
+ <div id="comment_<%= comment.id.to_s %>_div" class="comment" style="clear:both">
8
+ <span id="comment_<%= comment.id.to_s %>_commontator_span" class="comment_commontator">
9
+ <% if commontator.commontator_config.commontator_name_clickable %>
10
+ <%= link_to commontator_name(comment), main_app.polymorphic_path(comment.commontator) %>
11
+ <% else %>
12
+ <%= commontator_name(comment) %>
13
+ <% end %>
14
+ &nbsp;&nbsp;
15
+ <span id="comment_<%= comment.id.to_s %>_timestamp_span" class="comment_timestamp">
16
+ <%= comment_timestamp(comment) %>
17
+ </span>
18
+ </span>
19
+
20
+ <span id="comment_<%= comment.id.to_s %>_actions_span" class="comment_actions">
21
+ <%= render :partial => 'commontator/comments/actions',
22
+ :locals => { :comment => comment } %>
23
+ </span>
24
+
25
+ <br clear="all"/>
26
+
27
+ <span id="comment_<%= comment.id.to_s %>_profile_picture_span" class="comment_profile_picture">
28
+ <%= gravatar_image comment %>
29
+ </span>
30
+
31
+ <% if enable_votes %>
32
+ <span id="comment_<%= comment.id.to_s %>_votes_span" class="comment_votes">
33
+ <%= render :partial => 'commontator/comments/votes',
34
+ :locals => {:comment => comment} %>
35
+ </span>
36
+ <% end %>
37
+
38
+ <div id="comment_<%= comment.id.to_s %>_body_div" class="comment_body">
39
+ <%= render :partial => 'commontator/comments/body',
40
+ :locals => {:comment => comment} %>
41
+ </div>
42
+
43
+ </div>
44
+
45
+ <br clear="all"/>
@@ -0,0 +1,60 @@
1
+ <% # Clients of this partial must provide the following variable:
2
+ # comment
3
+ %>
4
+
5
+ <% if comment.can_be_voted_on? %>
6
+ <% can_vote = comment.can_be_voted_on_by?(@commontator) %>
7
+ <% vote = comment.votes.find_by_voter_id_and_voter_type(@commontator.id, @commontator.class.name) %>
8
+
9
+ <span id="comment_<%= comment.id %>_upvote_span" class="comment_upvote">
10
+ <% if can_vote && (vote.blank? || !vote.vote_flag) %>
11
+ <%= form_tag upvote_comment_path(comment),
12
+ :method => :put,
13
+ :remote => true do %>
14
+ <%= image_submit_tag "commontator/upvote.png",
15
+ :onmouseover => "this.src='/assets/commontator/upvote_hover.png'",
16
+ :onmouseout => "this.src='/assets/commontator/upvote.png'" %>
17
+ <% end %>
18
+ <% elsif can_vote %>
19
+ <%= form_tag unvote_comment_path(comment),
20
+ :method => :put,
21
+ :remote => true do %>
22
+ <%= image_submit_tag "commontator/upvote_hover.png",
23
+ :onmouseover => "this.src='/assets/commontator/upvote.png'",
24
+ :onmouseout => "this.src='/assets/commontator/upvote_hover.png'" %>
25
+ <% end %>
26
+ <% else %>
27
+ <%= image_tag "commontator/upvote_hover.png" %>
28
+ <% end %>
29
+ <span id="comment_<%= comment.id %>_upvote_count_span" class="comment_upvote_count">
30
+ <%= comment.upvotes.size %>
31
+ </span>
32
+ </span>
33
+
34
+ <br/>
35
+
36
+ <span id="comment_<%= comment.id %>_downvote_span" class="comment_downvote">
37
+ <% if can_vote && (vote.blank? || vote.vote_flag) %>
38
+ <%= form_tag downvote_comment_path(comment),
39
+ :method => :put,
40
+ :remote => true do %>
41
+ <%= image_submit_tag "commontator/downvote.png",
42
+ :onmouseover => "this.src='/assets/commontator/downvote_hover.png'",
43
+ :onmouseout => "this.src='/assets/commontator/downvote.png'" %>
44
+ <% end %>
45
+ <% elsif can_vote %>
46
+ <%= form_tag unvote_comment_path(comment),
47
+ :method => :put,
48
+ :remote => true do %>
49
+ <%= image_submit_tag "commontator/downvote_hover.png",
50
+ :onmouseover => "this.src='/assets/commontator/downvote.png'",
51
+ :onmouseout => "this.src='/assets/commontator/downvote_hover.png'" %>
52
+ <% end %>
53
+ <% else %>
54
+ <%= image_tag "commontator/downvote_hover.png" %>
55
+ <% end %>
56
+ <span id="comment_<%= comment.id %>_downvote_count_span" class="comment_downvote_count">
57
+ <%= comment.downvotes.size %>
58
+ </span>
59
+ </span>
60
+ <% end %>
@@ -0,0 +1,62 @@
1
+ <% # Clients of this partial must provide the following variable:
2
+ # comment
3
+ %>
4
+
5
+ <% enable_votes = comment.can_be_voted_on? %>
6
+
7
+ <% if comment.can_be_voted_on? %>
8
+ <% can_vote = comment.can_be_voted_on_by?(@commontator) %>
9
+ <% vote = comment.votes.find_by_voter_id_and_voter_type(@commontator.id, @commontator.class.name) %>
10
+
11
+ <span id="comment_<%= comment.id %>_upvote_span" class="comment_upvote">
12
+ <% if can_vote && (vote.blank? || !vote.vote_flag) %>
13
+ <%= form_tag upvote_comment_path(comment),
14
+ :method => :put,
15
+ :remote => true do %>
16
+ <%= image_submit_tag "commontator/upvote.png",
17
+ :onmouseover => "this.src='/assets/commontator/upvote_hover.png'",
18
+ :onmouseout => "this.src='/assets/commontator/upvote.png'" %>
19
+ <% end %>
20
+ <% elsif can_vote %>
21
+ <%= form_tag unvote_comment_path(comment),
22
+ :method => :put,
23
+ :remote => true do %>
24
+ <%= image_submit_tag "commontator/upvote_hover.png",
25
+ :onmouseover => "this.src='/assets/commontator/upvote.png'",
26
+ :onmouseout => "this.src='/assets/commontator/upvote_hover.png'" %>
27
+ <% end %>
28
+ <% else %>
29
+ <%= image_tag "commontator/upvote_hover.png" %>
30
+ <% end %>
31
+ <span id="comment_<%= comment.id %>_upvote_count_span" class="comment_upvote_count">
32
+ <%= comment.upvotes.size %>
33
+ </span>
34
+ </span>
35
+
36
+ <br/>
37
+
38
+ <span id="comment_<%= comment.id %>_downvote_span" class="comment_downvote">
39
+ <% if can_vote && (vote.blank? || vote.vote_flag) %>
40
+ <%= form_tag downvote_comment_path(comment),
41
+ :method => :put,
42
+ :remote => true do %>
43
+ <%= image_submit_tag "commontator/downvote.png",
44
+ :onmouseover => "this.src='/assets/commontator/downvote_hover.png'",
45
+ :onmouseout => "this.src='/assets/commontator/downvote.png'" %>
46
+ <% end %>
47
+ <% elsif can_vote %>
48
+ <%= form_tag unvote_comment_path(comment),
49
+ :method => :put,
50
+ :remote => true do %>
51
+ <%= image_submit_tag "commontator/downvote_hover.png",
52
+ :onmouseover => "this.src='/assets/commontator/downvote.png'",
53
+ :onmouseout => "this.src='/assets/commontator/downvote_hover.png'" %>
54
+ <% end %>
55
+ <% else %>
56
+ <%= image_tag "commontator/downvote_hover.png" %>
57
+ <% end %>
58
+ <span id="comment_<%= comment.id %>_downvote_count_span" class="comment_downvote_count">
59
+ <%= comment.downvotes.size %>
60
+ </span>
61
+ </span>
62
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <% @thread.comments.each do |comment| %>
2
+ $("#comment_<%= comment.id.to_s %>_actions_span").html("<%= escape_javascript(
3
+ render :partial => 'actions',
4
+ :locals => {:comment => comment}) %>");
5
+ <% end %>
6
+
7
+ $("#thread_<%= @thread.id %>_comment_list_div").append("<%= escape_javascript(
8
+ render :partial => 'show',
9
+ :locals => {:comment => @comment}) %>");
10
+
11
+ $("#thread_<%= @thread.id %>_new_comment_div").hide();
12
+
13
+ $("#thread_<%= @thread.id %>_new_comment_link_span").show();
14
+
15
+ <%= javascript_callback %>
@@ -0,0 +1,15 @@
1
+ <% @thread.comments.each do |comment|
2
+ $("#comment_<%= comment.id.to_s %>_actions_span").html("<%= escape_javascript(
3
+ render :partial => 'actions',
4
+ :locals => {:comment => comment}) %>");
5
+ <% end %>
6
+
7
+ $("#thread_<%= @thread.id %>_comment_list_div").append("<%= escape_javascript(
8
+ render :partial => 'show',
9
+ :locals => {:comment => @comment}) %>");
10
+
11
+ $("#thread_<%= @thread.id %>_new_comment_div").hide();
12
+
13
+ $("#thread_<%= @thread.id %>_new_comment_link_span").show();
14
+
15
+ <%= javascript_callback %>
@@ -0,0 +1,15 @@
1
+ $("#comment_<%= @comment.id.to_s %>_body_div").html("<%= escape_javascript(
2
+ render :partial => 'body', :locals => {:comment => @comment}) %>");
3
+
4
+ $("#comment_<%= @comment.id.to_s %>_timestamp_span").html("<%= escape_javascript(
5
+ comment_timestamp(@comment)) %>");
6
+
7
+ $("#comment_<%= @comment.id.to_s %>_actions_span").html("<%= escape_javascript(
8
+ render :partial => 'actions',
9
+ :locals => {:comment => @comment}) %>");
10
+
11
+ $("#comment_<%= @comment.id %>_votes_span").html("<%= escape_javascript(
12
+ render :partial => 'votes',
13
+ :locals => {:comment => @comment}) %>");
14
+
15
+ <%= javascript_callback %>
@@ -0,0 +1,15 @@
1
+ $("#comment_<%= @comment.id.to_s %>_body_div").html("<%= escape_javascript(
2
+ render :partial => 'body', :locals => {:comment => @comment}) %>");
3
+
4
+ $("#comment_<%= @comment.id.to_s %>_timestamp_span").html("<%= escape_javascript(
5
+ comment_timestamp(@comment)) %>");
6
+
7
+ $("#comment_<%= @comment.id.to_s %>_actions_span").html("<%= escape_javascript(
8
+ render :partial => 'actions',
9
+ :locals => {:comment => comment}) %>");
10
+
11
+ $("#comment_<%= @comment.id %>_votes_span").html("<%= escape_javascript(
12
+ render :partial => 'votes',
13
+ :locals => {:comment => @comment}) %>");
14
+
15
+ <%= javascript_callback %>
@@ -0,0 +1 @@
1
+ $("#comment_<%= @comment.id.to_s %>_div").remove();
@@ -0,0 +1,6 @@
1
+ <%= heading("Editing " +\
2
+ @thread.config.comment_name + " #" + @comment.id.to_s) %>
3
+
4
+ <%= render :partial => 'form', :locals => {:comment => @comment} %>
5
+
6
+ <%= link_to 'Back to thread', @thread %>
@@ -0,0 +1,6 @@
1
+ <%= heading(@comment_commontable_thread.config.comment_update_verb_present.capitalize + " " +\
2
+ @comment_commontable_thread.config.comment_name + " #" + @comment.id.to_s) %>
3
+
4
+ <%= render :partial => 'form', :locals => {:comment => @comment} %>
5
+
6
+ <%= link_to 'Back to comment_commontable_thread', @comment_commontable_thread %>
@@ -0,0 +1,5 @@
1
+ $("#comment_<%= @comment.id.to_s %>_body_div").html("<%= escape_javascript(
2
+ render :partial => 'form',
3
+ :locals => {:comment => @comment}) %>");
4
+
5
+ <%= javascript_callback %>
@@ -0,0 +1,5 @@
1
+ $("#comment_<%= @comment.id.to_s %>_div").html("<%= escape_javascript(
2
+ render :partial => 'form',
3
+ :locals => {:comment => @comment}) %>");
4
+
5
+ <%= javascript_callback %>
@@ -0,0 +1,8 @@
1
+ <%= heading(@thread.config.comment_create_verb_present.capitalize + " " +\
2
+ @thread.config.comment_name + " for " + commontable_name(@thread)) %>
3
+
4
+ <%= render :partial => 'form', :locals => {:thread => @thread,
5
+ :comment => @comment,
6
+ :no_remote => true} %>
7
+
8
+ <%= link_to 'Back to thread', @thread %>
@@ -0,0 +1,8 @@
1
+ <%= heading(@comment_commontable_thread.config.comment_create_verb_present.capitalize + " " +\
2
+ @comment_commontable_thread.config.comment_name + " for " + commontable_name(@comment_commontable_thread)) %>
3
+
4
+ <%= render :partial => 'form', :locals => {:comment_commontable_thread => @comment_commontable_thread,
5
+ :comment => @comment,
6
+ :no_remote => true} %>
7
+
8
+ <%= link_to 'Back to CommentCommontableThread', @comment_commontable_thread %>
@@ -0,0 +1,12 @@
1
+ $("#thread_<%= @thread.id %>_new_comment_div").html("<%= escape_javascript(
2
+ render :partial => 'form',
3
+ :locals => {
4
+ :comment => @comment,
5
+ :thread => @thread
6
+ }) %>");
7
+
8
+ $("#thread_<%= @thread.id %>_new_comment_div").show();
9
+
10
+ $("#thread_<%= @thread.id %>_new_comment_link_span").hide();
11
+
12
+ <%= javascript_callback %>
@@ -0,0 +1,12 @@
1
+ $("#thread_<%= @thread.id %>_new_comment_div").html("<%= escape_javascript(
2
+ render :partial => 'form',
3
+ :locals => {
4
+ :comment => @comment,
5
+ :thread => @thread
6
+ }) %>");
7
+
8
+ $("#thread_<%= @thread.id %>_new_comment_div").hide();
9
+
10
+ $("#thread_<%= @thread.id %>_new_comment_link_span").hide();
11
+
12
+ <%= javascript_callback %>
@@ -0,0 +1,7 @@
1
+ $("#comment_<%= @comment.id.to_s %>_body_div").html("<%= escape_javascript(
2
+ render :partial => 'body', :locals => {:comment => @comment}) %>");
3
+
4
+ $("#comment_<%= @comment.id.to_s %>_timestamp_span").html("<%= escape_javascript(
5
+ comment_timestamp(@comment)) %>");
6
+
7
+ <%= javascript_callback %>
@@ -0,0 +1,7 @@
1
+ $("#comment_<%= @comment.id.to_s %>_body_span").html("<%= escape_javascript(
2
+ render :partial => 'body', :locals => {:comment => @comment}) %>");
3
+
4
+ $("#comment_<%= @comment.id.to_s %>_timestamp_span").html("<%= escape_javascript(
5
+ comment_timestamp(@comment)) %>");
6
+
7
+ <%= javascript_callback %>