Add participants to community
This commit is contained in:
@@ -313,6 +313,11 @@ class User < ActiveRecord::Base
|
|||||||
follows.map{|follow| follow.followable.tags.map(&:name)}.flatten.compact.uniq
|
follows.map{|follow| follow.followable.tags.map(&:name)}.flatten.compact.uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.community_participants(community)
|
||||||
|
topics_ids = community.topics.pluck(:id)
|
||||||
|
User.joins(:comments).where("comments.commentable_id IN (?) and comments.commentable_type = 'Topic'", topics_ids)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def clean_document_number
|
def clean_document_number
|
||||||
|
|||||||
@@ -20,3 +20,10 @@
|
|||||||
<%= link_to t("topic.new"), new_community_topic_path(@community.id), class: 'button expanded' %>
|
<%= link_to t("topic.new"), new_community_topic_path(@community.id), class: 'button expanded' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="">
|
||||||
|
Participantes
|
||||||
|
<% User.community_participants(@community).each do |participant| %>
|
||||||
|
<%= link_to participant.name, user_path(participant)%>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ Comunidad: <%= @community.proposal.title %>
|
|||||||
|
|
||||||
<div class="tabs-content" data-tabs-content="proposals-tabs" role="tablist">
|
<div class="tabs-content" data-tabs-content="proposals-tabs" role="tablist">
|
||||||
<%= render "topics/filter_subnav" %>
|
<%= render "topics/filter_subnav" %>
|
||||||
<%#= render "proposals/notifications" %>
|
|
||||||
|
|
||||||
<div class="tabs-panel is-active" id="tab-comments">
|
<div class="tabs-panel is-active" id="tab-comments">
|
||||||
<%= render "topics/comments" %>
|
<%= render "topics/comments" %>
|
||||||
|
|||||||
Reference in New Issue
Block a user