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.
- data/MIT-LICENSE +20 -0
- data/README.md +35 -0
- data/Rakefile +40 -0
- data/app/assets/images/commontator/downvote.png +0 -0
- data/app/assets/images/commontator/downvote_hover.png +0 -0
- data/app/assets/images/commontator/upvote.png +0 -0
- data/app/assets/images/commontator/upvote_hover.png +0 -0
- data/app/assets/stylesheets/commontator/application.css +13 -0
- data/app/assets/stylesheets/commontator/application.css~ +88 -0
- data/app/assets/stylesheets/commontator/comments.css +86 -0
- data/app/assets/stylesheets/commontator/comments.css~ +90 -0
- data/app/assets/stylesheets/commontator/threads.css +13 -0
- data/app/assets/stylesheets/commontator/threads.css~ +13 -0
- data/app/controllers/commontator/application_controller.rb +18 -0
- data/app/controllers/commontator/application_controller.rb~ +16 -0
- data/app/controllers/commontator/comments_controller.rb +143 -0
- data/app/controllers/commontator/comments_controller.rb~ +143 -0
- data/app/controllers/commontator/subscriptions_controller.rb +42 -0
- data/app/controllers/commontator/subscriptions_controller.rb~ +40 -0
- data/app/controllers/commontator/threads_controller.rb +42 -0
- data/app/controllers/commontator/threads_controller.rb~ +43 -0
- data/app/helpers/commontator/application_helper.rb +11 -0
- data/app/helpers/commontator/application_helper.rb~ +11 -0
- data/app/helpers/commontator/comments_helper.rb +47 -0
- data/app/helpers/commontator/comments_helper.rb~ +58 -0
- data/app/helpers/commontator/commontable_helper.rb~ +9 -0
- data/app/helpers/commontator/commontator_helper.rb +8 -0
- data/app/helpers/commontator/commontator_helper.rb~ +8 -0
- data/app/helpers/commontator/subscriptions_helper.rb +8 -0
- data/app/helpers/commontator/subscriptions_helper.rb~ +8 -0
- data/app/helpers/commontator/threads_helper.rb +21 -0
- data/app/helpers/commontator/threads_helper.rb~ +32 -0
- data/app/mailers/commontator/subscription_mailer.rb~ +38 -0
- data/app/mailers/commontator/subscriptions_mailer.rb +51 -0
- data/app/mailers/commontator/subscriptions_mailer.rb~ +51 -0
- data/app/models/commontator/comment.rb +84 -0
- data/app/models/commontator/comment.rb~ +84 -0
- data/app/models/commontator/subscription.rb +21 -0
- data/app/models/commontator/subscription.rb~ +21 -0
- data/app/models/commontator/thread.rb +138 -0
- data/app/models/commontator/thread.rb~ +141 -0
- data/app/views/commontator/comments/_actions.html.erb +32 -0
- data/app/views/commontator/comments/_actions.html.erb~ +33 -0
- data/app/views/commontator/comments/_body.html.erb +7 -0
- data/app/views/commontator/comments/_body.html.erb~ +8 -0
- data/app/views/commontator/comments/_form.html.erb +20 -0
- data/app/views/commontator/comments/_form.html.erb~ +21 -0
- data/app/views/commontator/comments/_show.html.erb +41 -0
- data/app/views/commontator/comments/_show.html.erb~ +45 -0
- data/app/views/commontator/comments/_votes.html.erb +60 -0
- data/app/views/commontator/comments/_votes.html.erb~ +62 -0
- data/app/views/commontator/comments/create.js.erb +15 -0
- data/app/views/commontator/comments/create.js.erb~ +15 -0
- data/app/views/commontator/comments/delete.js.erb +15 -0
- data/app/views/commontator/comments/delete.js.erb~ +15 -0
- data/app/views/commontator/comments/destroy.js.erb~ +1 -0
- data/app/views/commontator/comments/edit.html.erb +6 -0
- data/app/views/commontator/comments/edit.html.erb~ +6 -0
- data/app/views/commontator/comments/edit.js.erb +5 -0
- data/app/views/commontator/comments/edit.js.erb~ +5 -0
- data/app/views/commontator/comments/new.html.erb +8 -0
- data/app/views/commontator/comments/new.html.erb~ +8 -0
- data/app/views/commontator/comments/new.js.erb +12 -0
- data/app/views/commontator/comments/new.js.erb~ +12 -0
- data/app/views/commontator/comments/update.js.erb +7 -0
- data/app/views/commontator/comments/update.js.erb~ +7 -0
- data/app/views/commontator/comments/vote.js.erb +5 -0
- data/app/views/commontator/comments/vote.js.erb~ +5 -0
- data/app/views/commontator/commontator/_thread.html.erb +14 -0
- data/app/views/commontator/commontator/_thread.html.erb~ +15 -0
- data/app/views/commontator/subscriptions/_subscription_link.html.erb +12 -0
- data/app/views/commontator/subscriptions/_subscription_link.html.erb~ +12 -0
- data/app/views/commontator/subscriptions/create.js.erb +5 -0
- data/app/views/commontator/subscriptions/create.js.erb~ +3 -0
- data/app/views/commontator/subscriptions/destroy.js.erb +5 -0
- data/app/views/commontator/subscriptions/destroy.js.erb~ +3 -0
- data/app/views/commontator/subscriptions/index.html.erb +16 -0
- data/app/views/commontator/subscriptions/index.html.erb~ +16 -0
- data/app/views/commontator/subscriptions_mailer/comment_created_email.html.erb +14 -0
- data/app/views/commontator/subscriptions_mailer/comment_created_email.html.erb~ +14 -0
- data/app/views/commontator/threads/_show.html.erb +26 -0
- data/app/views/commontator/threads/_show.html.erb~ +26 -0
- data/app/views/commontator/threads/show.html.erb +3 -0
- data/app/views/commontator/threads/show.js.erb +6 -0
- data/app/views/layouts/commontator/application.html.erb +14 -0
- data/config/initializers/commontator.rb +7 -0
- data/config/routes.rb +24 -0
- data/config/routes.rb~ +22 -0
- data/db/migrate/0_install_commontator.rb +40 -0
- data/db/migrate/0_install_commontator.rb~ +40 -0
- data/lib/commontator.rb +66 -0
- data/lib/commontator.rb~ +66 -0
- data/lib/commontator/acts_as_commontable.rb +39 -0
- data/lib/commontator/acts_as_commontable.rb~ +42 -0
- data/lib/commontator/acts_as_commontator.rb +28 -0
- data/lib/commontator/acts_as_commontator.rb~ +37 -0
- data/lib/commontator/commontable_config.rb +13 -0
- data/lib/commontator/commontator_config.rb +13 -0
- data/lib/commontator/engine.rb +5 -0
- data/lib/commontator/routes.rb~ +37 -0
- data/lib/commontator/version.rb +3 -0
- data/lib/commontator/version.rb~ +3 -0
- data/test/commontator_test.rb +7 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +16 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +204 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/functional/comment_thread_subscriptions_controller_test.rb~ +125 -0
- data/test/functional/comments_controller_test.rb +181 -0
- data/test/functional/comments_controller_test.rb~ +184 -0
- data/test/functional/subscriptions_controller_test.rb +122 -0
- data/test/functional/subscriptions_controller_test.rb~ +122 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/comment_test.rb +35 -0
- data/test/unit/comment_test.rb~ +38 -0
- data/test/unit/comment_thread_subscription_test.rb~ +18 -0
- data/test/unit/comment_thread_test.rb~ +60 -0
- data/test/unit/helpers/comment_thread_subscriptions_helper_test.rb~ +7 -0
- data/test/unit/helpers/comments_helper_test.rb +4 -0
- data/test/unit/helpers/comments_helper_test.rb~ +7 -0
- data/test/unit/helpers/subscriptions_helper_test.rb +4 -0
- data/test/unit/helpers/subscriptions_helper_test.rb~ +4 -0
- data/test/unit/subscription_test.rb +15 -0
- data/test/unit/subscription_test.rb~ +15 -0
- data/test/unit/thread_test.rb +57 -0
- data/test/unit/thread_test.rb~ +57 -0
- metadata +301 -0
|
@@ -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
|
+
|
|
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
|
+
|
|
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(@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,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 %>
|