diff --git a/app/controllers/notificationcomments_controller.rb b/app/controllers/notificationcomments_controller.rb
index 78272aae1..e0c5adf72 100644
--- a/app/controllers/notificationcomments_controller.rb
+++ b/app/controllers/notificationcomments_controller.rb
@@ -6,7 +6,7 @@ class NotificationcommentsController < ApplicationController
before_filter :authorize
def create
- raise Unauthorized unless @contestnotifications.commentable?
+ raise Unauthorized unless @contestnotifications.notificationcommentable?
@notificaioncomment = Notificaioncomment.new
@notificaioncomment.safe_attributes = params[:notificaioncomment]
diff --git a/app/models/contestnotification.rb b/app/models/contestnotification.rb
index a055d3000..cba9dfa0c 100644
--- a/app/models/contestnotification.rb
+++ b/app/models/contestnotification.rb
@@ -36,8 +36,8 @@ class Contestnotification < ActiveRecord::Base
end
# Returns true if the news can be commented by user
- def commentable?(user=User.current)
- user.allowed_to?(:comment_contestnotifications, contest)
+ def notificationcommentable?(user=User.current)
+ user.allowed_to?(:notificationcomment_contestnotifications, contest)
end
def recipients
diff --git a/app/views/contestnotifications/_news.html.erb b/app/views/contestnotifications/_news.html.erb
index 1621c5813..301a193d8 100644
--- a/app/views/contestnotifications/_news.html.erb
+++ b/app/views/contestnotifications/_news.html.erb
@@ -20,7 +20,7 @@
<%= contestnotifications.created_at %> |
<%= link_to l(:label_project_newother),contest_contestnotification_path(contestnotifications)%>
- <%= "(#{l(:label_x_comments, :count => contestnotifications.comments_count)})" if contestnotifications.comments_count > 0 %>
+ <%= "(#{l(:label_x_comments, :count => contestnotifications.notificationcomments_count)})" if contestnotifications.notificationcomments_count > 0 %>
|
diff --git a/app/views/contestnotifications/index.html.erb b/app/views/contestnotifications/index.html.erb
index c9ce1622d..93d4aaf1f 100644
--- a/app/views/contestnotifications/index.html.erb
+++ b/app/views/contestnotifications/index.html.erb
@@ -48,7 +48,7 @@
<%= l :label_update_time %>
<%= format_time(contestnotifications.created_at) %> |
- <%= link_to l(:label_project_newother), contest_contestnotification_path(@contest, contestnotifications) %><%= "(#{l(:label_x_comments, :count => contestnotifications.comments.count)})" if(contestnotifications.comments.count >= 0)%> |
+ <%= link_to l(:label_project_newother), contest_contestnotification_path(@contest, contestnotifications) %><%= "(#{l(:label_x_comments, :count => contestnotifications.notificationcomments.count)})" if(contestnotifications.notificationcomments.count >= 0)%> |
diff --git a/app/views/contestnotifications/show.html.erb b/app/views/contestnotifications/show.html.erb
index 517f60bca..a9ba5f513 100644
--- a/app/views/contestnotifications/show.html.erb
+++ b/app/views/contestnotifications/show.html.erb
@@ -60,7 +60,7 @@
<% end %>
-
- <% if @contestnotifications.commentable? %> + <% if @contestnotifications.notificationcommentable? %>
- <%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %> + <%= toggle_link l(:label_comment_add), "add_notificationcomment_form", :focus => "comment_comments" %>
- <%= form_tag({:controller => 'comments', :action => 'create', :id => @contestnotifications}, :id => "add_comment_form", :style => "display:none;") do %> + <%= form_tag({:controller => 'notificationcomments', :action => 'create', :id => @contestnotifications}, :id => "add_notificationcomment_form", :style => "display:none;") do %>@@ -92,33 +92,33 @@
<%= l(:label_comment_plural) %>
- <% comments = @comments.reverse %> - <% comments.each do |comment| %> - <% next if comment.new_record? %> +<%= l(:label_comment_plural) %>
+ <% notificationcomments = @notificationcomments.reverse %> + <% notificationcomments.each do |notificationcomment| %> + <% next if notificationcomment.new_record? %>- <%= textilizable(comment.comments) %> + <%= textilizable(notificationcomment.notificationcomments) %>