diff --git a/app/models/community.rb b/app/models/community.rb
index 9a18f3510..f1640c8e9 100644
--- a/app/models/community.rb
+++ b/app/models/community.rb
@@ -27,7 +27,11 @@ class Community < ActiveRecord::Base
end
def comments_count
- Comment.where(commentable: topics).count
+ comments.count
+ end
+
+ def comments
+ Comment.where(commentable: topics)
end
def debates_count
diff --git a/app/views/proposals_dashboard/_comment.html.erb b/app/views/proposals_dashboard/_comment.html.erb
new file mode 100644
index 000000000..4bb5bc88e
--- /dev/null
+++ b/app/views/proposals_dashboard/_comment.html.erb
@@ -0,0 +1,10 @@
+
+ <%= comment.body %>
+
+ <%= comment.commentable.title %>
+ -
+ <%= l(comment.updated_at.to_date) %>
+ -
+ <%= comment.author.name %>
+
+
diff --git a/app/views/proposals_dashboard/_topic.html.erb b/app/views/proposals_dashboard/_topic.html.erb
deleted file mode 100644
index becd154c6..000000000
--- a/app/views/proposals_dashboard/_topic.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-
- <%= topic.title %>
-
- <%= l(topic.updated_at.to_date) %>
- -
- <%= topic.author.name %>
-
-
diff --git a/app/views/proposals_dashboard/community.html.erb b/app/views/proposals_dashboard/community.html.erb
index 6a4a1997c..54c15bf0e 100644
--- a/app/views/proposals_dashboard/community.html.erb
+++ b/app/views/proposals_dashboard/community.html.erb
@@ -27,13 +27,13 @@
-<% if proposal.community.topics.any? %>
+<% if proposal.community.comments.any? %>
-
<%= t('.latest_topics') %>
+ <%= t('.latest_comments') %>
- <%= render partial: 'topic', collection: proposal.community.topics %>
+ <%= render partial: 'comment', collection: proposal.community.comments.sort_by_newest.limit(5) %>
<% end %>
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index 8ff50b829..fadb75182 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -560,7 +560,7 @@ en:
participants: Participants
debates: Debates
comments: Comments
- latest_topics: Latest topics
+ latest_comments: Latest messages
dashboard:
polls:
index:
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index 3c2d6fdd9..91a461d55 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -560,7 +560,7 @@ es:
participants: Participantes
debates: Debates
comments: Comentarios
- latest_topics: Últimos debates
+ latest_comments: Últimos mensajes
dashboard:
polls:
index: