Extract component to show a user's public activity
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
<%= render "following", user: @user, follows: @follows if @follows.present? %>
|
||||
<%= render "proposals", proposals: @proposals if @proposals.present? && feature?(:proposals) %>
|
||||
<%= render "debates", debates: @debates if @debates.present? && feature?(:debates) %>
|
||||
<%= render "budget_investments", budge_investments: @budge_investments if @budge_investments.present? && feature?(:budgets) %>
|
||||
<%= render "comments", comments: @comments if @comments.present? %>
|
||||
@@ -22,36 +22,7 @@
|
||||
<% end %>
|
||||
</h2>
|
||||
|
||||
<% if @user.public_activity || @authorized_current_user %>
|
||||
<ul class="menu simple margin-top">
|
||||
<% @valid_filters.each do |filter| %>
|
||||
<% if @activity_counts[filter] > 0 %>
|
||||
<% if @current_filter == filter %>
|
||||
<li class="is-active">
|
||||
<h2><%= t("users.show.filters.#{filter}", count: @activity_counts[filter]) %></h2>
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<%= link_to t("users.show.filters.#{filter}", count: @activity_counts[filter]),
|
||||
current_path_with_query_params(filter: filter, page: 1) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% if @activity_counts.values.inject(&:+) == 0 %>
|
||||
<div class="callout primary">
|
||||
<%= t("users.show.no_activity") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "activity_page" %>
|
||||
<% else %>
|
||||
<div class="callout warning margin">
|
||||
<%= t("users.show.private_activity") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render Users::PublicActivityComponent.new(@user) %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user