<% cache("user-profile-comments-#{@user.last_comment_at}-#{@user.id}-#{@comments.size}", expires_in: 2.days) do %>
<% if @comments.present? %> <% if params[:view] == "comments" %>

<% if high_number_of_comments?(@user.comments_count) %> <%= t("views.users.comments.last", count: number_of_comments_to_render) %> <% else %> <%= t("views.users.comments.all", count: @user.comments_count) %> <% end %>

<% else %>

<%= t("views.users.comments.recent") %>

<% end %> <% end %> <% @comments.each do |comment| %> <% if comment.commentable.present? && comment.commentable.published && !comment.deleted %>

<%= comment.commentable.title %>

<%= truncate(strip_tags(comment.processed_html), length: 64).html_safe %>

<% end %> <% end %> <% if params[:view] != "comments" && high_number_of_comments?(@user.comments_count) %>
<%= t("views.users.comments.view_last", count: number_of_comments_to_render) %>
<% elsif params[:view] != "comments" && view_all_comments?(@user.comments_count) %>
<%= t("views.users.comments.view_all", count: @user.comments_count) %>
<% end %>
<% end %>