commontator 4.8.0 → 4.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +0 -1
- data/README.md +1 -2
- data/app/assets/stylesheets/commontator/application.css +0 -1
- data/app/assets/stylesheets/commontator/comments.css +0 -1
- data/app/assets/stylesheets/commontator/threads.css +4 -9
- data/app/controllers/commontator/application_controller.rb +4 -4
- data/app/controllers/commontator/comments_controller.rb +5 -7
- data/app/controllers/commontator/subscriptions_controller.rb +1 -2
- data/app/controllers/commontator/threads_controller.rb +1 -3
- data/app/helpers/commontator/application_helper.rb +0 -1
- data/app/mailers/commontator/subscriptions_mailer.rb +0 -1
- data/app/models/commontator/comment.rb +0 -1
- data/app/models/commontator/subscription.rb +0 -1
- data/app/models/commontator/thread.rb +0 -1
- data/app/views/commontator/comments/_actions.html.erb +0 -1
- data/app/views/commontator/comments/_body.html.erb +0 -1
- data/app/views/commontator/comments/_form.html.erb +0 -1
- data/app/views/commontator/comments/_list.html.erb +2 -3
- data/app/views/commontator/comments/_show.html.erb +5 -6
- data/app/views/commontator/comments/_votes.html.erb +0 -1
- data/app/views/commontator/comments/cancel.js.erb +11 -4
- data/app/views/commontator/comments/create.js.erb +14 -7
- data/app/views/commontator/comments/delete.js.erb +5 -6
- data/app/views/commontator/comments/edit.js.erb +1 -2
- data/app/views/commontator/comments/new.js.erb +7 -10
- data/app/views/commontator/comments/update.js.erb +1 -2
- data/app/views/commontator/comments/vote.js.erb +2 -3
- data/app/views/commontator/shared/_thread.html.erb +4 -5
- data/app/views/commontator/subscriptions/_link.html.erb +0 -1
- data/app/views/commontator/subscriptions/subscribe.js.erb +2 -3
- data/app/views/commontator/subscriptions_mailer/comment_created.html.erb +0 -1
- data/app/views/commontator/threads/_reply.html.erb +25 -12
- data/app/views/commontator/threads/_show.html.erb +16 -17
- data/app/views/commontator/threads/_show.js.erb +5 -6
- data/app/views/commontator/threads/show.js.erb +5 -6
- data/config/initializers/commontator.rb +12 -1
- data/config/locales/commontator/en.yml +0 -1
- data/config/routes.rb +0 -1
- data/db/migrate/0_install_commontator.rb +26 -22
- data/lib/commontator.rb +1 -1
- data/lib/commontator/acts_as_commontable.rb +0 -1
- data/lib/commontator/acts_as_commontator.rb +0 -1
- data/lib/commontator/commontable_config.rb +0 -1
- data/lib/commontator/commontator_config.rb +0 -1
- data/lib/commontator/controller_includes.rb +9 -0
- data/lib/commontator/engine.rb +0 -1
- data/lib/commontator/link_renderer.rb +0 -1
- data/lib/commontator/security_transgression.rb +0 -1
- data/lib/commontator/shared_helper.rb +3 -3
- data/lib/commontator/version.rb +1 -2
- data/lib/tasks/commontator_tasks.rake +0 -1
- data/spec/app/controllers/commontator/comments_controller_spec.rb +2 -3
- data/spec/app/controllers/commontator/subscriptions_controller_spec.rb +0 -1
- data/spec/app/controllers/commontator/threads_controller_spec.rb +0 -1
- data/spec/app/helpers/commontator/application_helper_spec.rb +0 -1
- data/spec/app/mailers/commontator/subscriptions_mailer_spec.rb +0 -1
- data/spec/app/models/commontator/comment_spec.rb +0 -1
- data/spec/app/models/commontator/subscription_spec.rb +0 -1
- data/spec/app/models/commontator/thread_spec.rb +0 -1
- data/spec/dummy/README.md +0 -1
- data/spec/dummy/Rakefile +0 -1
- data/spec/dummy/app/assets/javascripts/application.js +0 -1
- data/spec/dummy/app/assets/stylesheets/application.css +0 -1
- data/spec/dummy/app/controllers/application_controller.rb +0 -1
- data/spec/dummy/app/controllers/dummy_models_controller.rb +0 -1
- data/spec/dummy/app/helpers/application_helper.rb +0 -1
- data/spec/dummy/app/models/dummy_model.rb +0 -1
- data/spec/dummy/app/models/dummy_user.rb +0 -1
- data/spec/dummy/app/views/dummy_model/show.html.erb +0 -1
- data/spec/dummy/app/views/layouts/application.html.erb +0 -1
- data/spec/dummy/config.ru +0 -1
- data/spec/dummy/config/application.rb +0 -1
- data/spec/dummy/config/boot.rb +0 -1
- data/spec/dummy/config/database.yml +0 -1
- data/spec/dummy/config/environment.rb +0 -1
- data/spec/dummy/config/environments/development.rb +0 -1
- data/spec/dummy/config/environments/production.rb +0 -1
- data/spec/dummy/config/environments/test.rb +0 -1
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -1
- data/spec/dummy/config/initializers/commontator.rb +0 -1
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -1
- data/spec/dummy/config/initializers/inflections.rb +0 -1
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/config/initializers/secret_token.rb +0 -1
- data/spec/dummy/config/initializers/session_store.rb +0 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -1
- data/spec/dummy/config/routes.rb +0 -1
- data/spec/dummy/db/migrate/1_create_dummy_models.rb +0 -1
- data/spec/dummy/db/migrate/2_create_dummy_users.rb +0 -1
- data/spec/dummy/db/migrate/3_acts_as_votable_migration.rb +0 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +6202 -0
- data/spec/dummy/public/404.html +0 -1
- data/spec/dummy/public/422.html +0 -1
- data/spec/dummy/public/500.html +0 -1
- data/spec/dummy/script/rails +0 -1
- data/spec/dummy/tmp/cache/assets/test/sprockets/72b63dddbc5c995f79af8e3c94904fd9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a473b3873e554893372a53d71f5e9879 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a77b1a9223d168112e1705c29220116f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/afa63eb365bdf4f42584b17ac9176b9d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d2244ccef8e05bb993f75715af0344cc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/decb63cac838a5314aa0c22a979f5ac9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f721383d531f067d82b071e14aed7a92 +0 -0
- data/spec/lib/commontator/acts_as_commontable_spec.rb +0 -1
- data/spec/lib/commontator/acts_as_commontator_spec.rb +0 -1
- data/spec/lib/commontator/commontable_config_spec.rb +0 -1
- data/spec/lib/commontator/commontator_config_spec.rb +0 -1
- data/spec/lib/commontator/controller_includes_spec.rb +0 -1
- data/spec/lib/commontator/shared_helper_spec.rb +0 -1
- data/spec/lib/commontator_spec.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2a812300839c474464d971d6b3ac2ef09c1552b
|
4
|
+
data.tar.gz: 1a4f7b752025697ea321f82a10043ff06dd15798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 941be6a20d22ab89fad1c15908972ba0c858789748569540ffa5cb3ca831b6f540b61b023809331a35635c963faa2e1e736487c1360bc53ec72981ff6bb391ba
|
7
|
+
data.tar.gz: a8937a901b8dac241b58c18ad4158a3953821f466cc7f10228ba51cde2affbe98a2062e69d31515bcd950a6981d27fac40a948523b8a783908a3add03bfdf211
|
data/MIT-LICENSE
CHANGED
@@ -18,4 +18,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
20
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
-
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ There are 4 steps you must follow to install commontator:
|
|
18
18
|
Add this line to your application's Gemfile:
|
19
19
|
|
20
20
|
```rb
|
21
|
-
gem 'commontator', '~> 4.
|
21
|
+
gem 'commontator', '~> 4.8.0'
|
22
22
|
```
|
23
23
|
|
24
24
|
And then execute:
|
@@ -220,4 +220,3 @@ $ bundle exec rake
|
|
220
220
|
|
221
221
|
This gem is distributed under the terms of the MIT license.
|
222
222
|
See the MIT-LICENSE file for details.
|
223
|
-
|
@@ -2,6 +2,10 @@
|
|
2
2
|
display: block !important;
|
3
3
|
}
|
4
4
|
|
5
|
+
.thread .hidden {
|
6
|
+
display: none;
|
7
|
+
}
|
8
|
+
|
5
9
|
.thread_actions {
|
6
10
|
float: right;
|
7
11
|
}
|
@@ -15,14 +19,6 @@
|
|
15
19
|
display: block;
|
16
20
|
}
|
17
21
|
|
18
|
-
.thread_new_comment {
|
19
|
-
display: none;
|
20
|
-
}
|
21
|
-
|
22
|
-
.thread_new_comment_link {
|
23
|
-
display: block;
|
24
|
-
}
|
25
|
-
|
26
22
|
/* Modified from:
|
27
23
|
http://www.strangerstudios.com/sandbox/pagination/diggstyle.php */
|
28
24
|
.thread_page_entries_info {
|
@@ -68,4 +64,3 @@ http://www.strangerstudios.com/sandbox/pagination/diggstyle.php */
|
|
68
64
|
|
69
65
|
color: #DDD;
|
70
66
|
}
|
71
|
-
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Commontator
|
2
2
|
class ApplicationController < ActionController::Base
|
3
|
-
before_filter :
|
3
|
+
before_filter :set_user, :ensure_user
|
4
4
|
|
5
5
|
rescue_from SecurityTransgression, :with => lambda { head(:forbidden) }
|
6
6
|
|
@@ -10,7 +10,7 @@ module Commontator
|
|
10
10
|
raise SecurityTransgression unless check
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def set_user
|
14
14
|
@user = Commontator.current_user_proc.call(self)
|
15
15
|
end
|
16
16
|
|
@@ -18,12 +18,12 @@ module Commontator
|
|
18
18
|
security_transgression_unless(@user && @user.is_commontator)
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
21
|
+
def set_thread
|
22
22
|
@thread = params[:thread_id].blank? ? \
|
23
23
|
Commontator::Thread.find(params[:id]) : \
|
24
24
|
Commontator::Thread.find(params[:thread_id])
|
25
25
|
security_transgression_unless @thread.can_be_read_by? @user
|
26
|
+
commontator_set_new_comment(@thread, @user)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
29
|
-
|
@@ -1,14 +1,13 @@
|
|
1
1
|
module Commontator
|
2
2
|
class CommentsController < Commontator::ApplicationController
|
3
|
-
before_filter :
|
4
|
-
before_filter :
|
3
|
+
before_filter :set_thread, :only => [:new, :create]
|
4
|
+
before_filter :set_comment_and_thread, :except => [:new, :create]
|
5
5
|
|
6
6
|
# GET /threads/1/comments/new
|
7
7
|
def new
|
8
8
|
@comment = Comment.new
|
9
9
|
@comment.thread = @thread
|
10
10
|
@comment.creator = @user
|
11
|
-
|
12
11
|
security_transgression_unless @comment.can_be_created_by?(@user)
|
13
12
|
|
14
13
|
@per_page = params[:per_page] || @thread.config.comments_per_page
|
@@ -23,10 +22,9 @@ module Commontator
|
|
23
22
|
# POST /threads/1/comments
|
24
23
|
def create
|
25
24
|
@comment = Comment.new
|
26
|
-
@comment.body = params[:comment].nil? ? nil : params[:comment][:body]
|
27
25
|
@comment.thread = @thread
|
28
26
|
@comment.creator = @user
|
29
|
-
|
27
|
+
@comment.body = params[:comment].nil? ? nil : params[:comment][:body]
|
30
28
|
security_transgression_unless @comment.can_be_created_by?(@user)
|
31
29
|
|
32
30
|
respond_to do |format|
|
@@ -144,10 +142,10 @@ module Commontator
|
|
144
142
|
|
145
143
|
protected
|
146
144
|
|
147
|
-
def
|
145
|
+
def set_comment_and_thread
|
148
146
|
@comment = Comment.find(params[:id])
|
149
147
|
@thread = @comment.thread
|
148
|
+
commontator_set_new_comment(@thread, @user)
|
150
149
|
end
|
151
150
|
end
|
152
151
|
end
|
153
|
-
|
@@ -1,8 +1,7 @@
|
|
1
1
|
module Commontator
|
2
2
|
class ThreadsController < Commontator::ApplicationController
|
3
3
|
skip_before_filter :ensure_user, :only => :show
|
4
|
-
|
5
|
-
before_filter :get_thread
|
4
|
+
before_filter :set_thread
|
6
5
|
|
7
6
|
# GET /threads/1
|
8
7
|
def show
|
@@ -46,4 +45,3 @@ module Commontator
|
|
46
45
|
end
|
47
46
|
end
|
48
47
|
end
|
49
|
-
|
@@ -16,8 +16,8 @@
|
|
16
16
|
</span>
|
17
17
|
<span id="comment_<%= comment.id.to_s %>_actions_span" class="comment_actions">
|
18
18
|
<%= render :partial => 'commontator/comments/actions',
|
19
|
-
:locals => {:comment => comment,
|
20
|
-
|
19
|
+
:locals => { :comment => comment,
|
20
|
+
:user => user } %>
|
21
21
|
</span>
|
22
22
|
</div>
|
23
23
|
<div id="comment_<%= comment.id.to_s %>_middle_div" class="comment_div">
|
@@ -26,12 +26,12 @@
|
|
26
26
|
</span>
|
27
27
|
<span id="comment_<%= comment.id.to_s %>_votes_span" class="comment_votes">
|
28
28
|
<%= render :partial => 'commontator/comments/votes',
|
29
|
-
:locals => {:comment => comment,
|
30
|
-
|
29
|
+
:locals => { :comment => comment,
|
30
|
+
:user => user } %>
|
31
31
|
</span>
|
32
32
|
<div id="comment_<%= comment.id.to_s %>_body_div" class="comment_body">
|
33
33
|
<%= render :partial => 'commontator/comments/body',
|
34
|
-
:locals => {:comment => comment} %>
|
34
|
+
:locals => { :comment => comment } %>
|
35
35
|
</div>
|
36
36
|
</div>
|
37
37
|
<div id="comment_<%= comment.id.to_s %>_bottom_div" class="comment_div">
|
@@ -46,4 +46,3 @@
|
|
46
46
|
</span>
|
47
47
|
</div>
|
48
48
|
</div>
|
49
|
-
|
@@ -1,12 +1,19 @@
|
|
1
1
|
<% unless @comment.try(:id).blank? %>
|
2
2
|
<% @comment.reload %>
|
3
3
|
$("#comment_<%= @comment.id.to_s %>_body_div").html("<%= escape_javascript(
|
4
|
-
render :partial => 'body', :locals => {:comment => @comment}) %>");
|
4
|
+
render :partial => 'body', :locals => { :comment => @comment }) %>");
|
5
5
|
<% end %>
|
6
6
|
|
7
|
-
|
7
|
+
<% unless @new_comment.nil? %>
|
8
|
+
$("#thread_<%= @thread.id %>_new_comment_form_div").html("<%= escape_javascript(
|
9
|
+
render :partial => 'form',
|
10
|
+
:locals => { :comment => @new_comment,
|
11
|
+
:thread => @thread,
|
12
|
+
:per_page => @per_page }) %>");
|
13
|
+
<% else %>
|
14
|
+
$("#thread_<%= @thread.id %>_new_comment_form_div").hide();
|
8
15
|
|
9
|
-
$("#thread_<%= @thread.id %>
|
16
|
+
$("#thread_<%= @thread.id %>_new_comment_link_div").fadeIn();
|
17
|
+
<% end %>
|
10
18
|
|
11
19
|
<%= javascript_proc %>
|
12
|
-
|
@@ -1,14 +1,21 @@
|
|
1
1
|
<%= render :partial => 'commontator/threads/show',
|
2
|
-
:locals => {:thread => @thread,
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
:locals => { :thread => @thread,
|
3
|
+
:user => @user,
|
4
|
+
:page => @thread.new_comment_page(@per_page),
|
5
|
+
:per_page => @per_page } %>
|
6
6
|
|
7
|
-
|
7
|
+
<% unless @new_comment.nil? %>
|
8
|
+
$("#thread_<%= @thread.id %>_new_comment_form_div").html("<%= escape_javascript(
|
9
|
+
render :partial => 'form',
|
10
|
+
:locals => { :comment => @new_comment,
|
11
|
+
:thread => @thread,
|
12
|
+
:per_page => @per_page }) %>");
|
13
|
+
<% else %>
|
14
|
+
$("#thread_<%= @thread.id %>_new_comment_form_div").hide();
|
8
15
|
|
9
|
-
$("#thread_<%= @thread.id %>
|
16
|
+
$("#thread_<%= @thread.id %>_new_comment_link_div").fadeIn();
|
17
|
+
<% end %>
|
10
18
|
|
11
19
|
$("#comment_<%= @comment.id.to_s %>_div").hide().fadeIn()[0].scrollIntoView();
|
12
20
|
|
13
21
|
<%= javascript_proc %>
|
14
|
-
|
@@ -1,18 +1,17 @@
|
|
1
1
|
$("#comment_<%= @comment.id.to_s %>_body_div").html("<%= escape_javascript(
|
2
|
-
render :partial => 'body', :locals => {:comment => @comment}) %>");
|
2
|
+
render :partial => 'body', :locals => { :comment => @comment }) %>");
|
3
3
|
|
4
4
|
$("#comment_<%= @comment.id.to_s %>_updated_timestamp_span").html("<%= escape_javascript(
|
5
5
|
@comment.updated_timestamp) %>");
|
6
6
|
|
7
7
|
$("#comment_<%= @comment.id.to_s %>_actions_span").html("<%= escape_javascript(
|
8
8
|
render :partial => 'actions',
|
9
|
-
:locals => {:comment => @comment,
|
10
|
-
|
9
|
+
:locals => { :comment => @comment,
|
10
|
+
:user => @user }) %>");
|
11
11
|
|
12
12
|
$("#comment_<%= @comment.id %>_votes_span").html("<%= escape_javascript(
|
13
13
|
render :partial => 'votes',
|
14
|
-
:locals => {:comment => @comment,
|
15
|
-
|
14
|
+
:locals => { :comment => @comment,
|
15
|
+
:user => @user }) %>");
|
16
16
|
|
17
17
|
<%= javascript_proc %>
|
18
|
-
|
@@ -1,14 +1,11 @@
|
|
1
|
-
$("#thread_<%= @thread.id %>
|
1
|
+
$("#thread_<%= @thread.id %>_new_comment_form_div").html("<%= escape_javascript(
|
2
2
|
render :partial => 'form',
|
3
|
-
:locals => {
|
4
|
-
|
5
|
-
|
6
|
-
:per_page => @per_page
|
7
|
-
}) %>");
|
8
|
-
|
9
|
-
$("#thread_<%= @thread.id %>_new_comment_div").fadeIn()[0].scrollIntoView();
|
3
|
+
:locals => { :comment => @comment,
|
4
|
+
:thread => @thread,
|
5
|
+
:per_page => @per_page }) %>");
|
10
6
|
|
11
|
-
$("#thread_<%= @thread.id %>
|
7
|
+
$("#thread_<%= @thread.id %>_new_comment_form_div").fadeIn()[0].scrollIntoView();
|
12
8
|
|
13
|
-
<%=
|
9
|
+
$("#thread_<%= @thread.id %>_new_comment_link_div").hide();
|
14
10
|
|
11
|
+
<%= javascript_proc %>
|
@@ -1,8 +1,7 @@
|
|
1
1
|
$("#comment_<%= @comment.id.to_s %>_body_div").html("<%= escape_javascript(
|
2
|
-
render :partial => 'body', :locals => {:comment => @comment}) %>");
|
2
|
+
render :partial => 'body', :locals => { :comment => @comment }) %>");
|
3
3
|
|
4
4
|
$("#comment_<%= @comment.id.to_s %>_updated_timestamp_span").html("<%= escape_javascript(
|
5
5
|
@comment.updated_timestamp) %>");
|
6
6
|
|
7
7
|
<%= javascript_proc %>
|
8
|
-
|
@@ -9,10 +9,10 @@
|
|
9
9
|
<div id="thread_<%= thread.id %>_div" class="thread" style="display: none;">
|
10
10
|
<% if @commontator_thread_show %>
|
11
11
|
<%= render :partial => 'commontator/threads/show',
|
12
|
-
:locals => {:thread => thread,
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
:locals => { :thread => thread,
|
13
|
+
:user => user,
|
14
|
+
:page => @commontator_page,
|
15
|
+
:per_page => @commontator_per_page } %>
|
16
16
|
<% else %>
|
17
17
|
<% subscription = thread.subscription_for(user) %>
|
18
18
|
<%= link_to "#{t 'commontator.thread.actions.show'} (#{(subscription.unread_comments.count.to_s + '/') \
|
@@ -21,4 +21,3 @@
|
|
21
21
|
<% end %>
|
22
22
|
</div>
|
23
23
|
<% end %>
|
24
|
-
|