In proposal's dashboard, inside community section, the latests topics
has been replaced by latest messages.
This commit is contained in:
Juan Salvador Pérez García
2018-07-18 16:50:51 +02:00
parent ea421980b5
commit 0e8746299d
6 changed files with 20 additions and 14 deletions

View File

@@ -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

View 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>

View File

@@ -1,8 +0,0 @@
<li>
<strong><%= topic.title %></strong>
<p class="help-text">
<%= l(topic.updated_at.to_date) %>
-
<%= topic.author.name %>
</p>
</li>

View File

@@ -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 %>

View File

@@ -560,7 +560,7 @@ en:
participants: Participants
debates: Debates
comments: Comments
latest_topics: Latest topics
latest_comments: Latest messages
dashboard:
polls:
index:

View File

@@ -560,7 +560,7 @@ es:
participants: Participantes
debates: Debates
comments: Comentarios
latest_topics: Últimos debates
latest_comments: Últimos mensajes
dashboard:
polls:
index: