Fixes #232
In proposal's dashboard, inside community section, the latests topics has been replaced by latest messages.
This commit is contained in:
@@ -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
|
||||
|
||||
10
app/views/proposals_dashboard/_comment.html.erb
Normal file
10
app/views/proposals_dashboard/_comment.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<li>
|
||||
<%= comment.body %>
|
||||
<p class="help-text">
|
||||
<%= comment.commentable.title %>
|
||||
-
|
||||
<%= l(comment.updated_at.to_date) %>
|
||||
-
|
||||
<%= comment.author.name %>
|
||||
</p>
|
||||
</li>
|
||||
@@ -1,8 +0,0 @@
|
||||
<li>
|
||||
<strong><%= topic.title %></strong>
|
||||
<p class="help-text">
|
||||
<%= l(topic.updated_at.to_date) %>
|
||||
-
|
||||
<%= topic.author.name %>
|
||||
</p>
|
||||
</li>
|
||||
@@ -27,13 +27,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if proposal.community.topics.any? %>
|
||||
<% if proposal.community.comments.any? %>
|
||||
<div class="action-title">
|
||||
<h5><%= t('.latest_topics') %></h5>
|
||||
<h5><%= t('.latest_comments') %></h5>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<%= render partial: 'topic', collection: proposal.community.topics %>
|
||||
<%= render partial: 'comment', collection: proposal.community.comments.sort_by_newest.limit(5) %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
@@ -560,7 +560,7 @@ en:
|
||||
participants: Participants
|
||||
debates: Debates
|
||||
comments: Comments
|
||||
latest_topics: Latest topics
|
||||
latest_comments: Latest messages
|
||||
dashboard:
|
||||
polls:
|
||||
index:
|
||||
|
||||
@@ -560,7 +560,7 @@ es:
|
||||
participants: Participantes
|
||||
debates: Debates
|
||||
comments: Comentarios
|
||||
latest_topics: Últimos debates
|
||||
latest_comments: Últimos mensajes
|
||||
dashboard:
|
||||
polls:
|
||||
index:
|
||||
|
||||
Reference in New Issue
Block a user