<% if user_signed_in? && !@user.blocked_by?(current_user || User.new) %>
<% if @user.followed_by?(current_user) %>
<%= form_for(current_user.user_followings.find_by(followed_user_id: @user.id), method: :delete) do |f| %>
<%= f.hidden_field :followed_user_id, value: @user.id %>
<%= link_to '#', onclick: "$('.edit_user_following').first().submit()", class: 'collection-item blue-text' do %>
Unfollow this user
how_to_reg
<% end %>
<% end %>
<% else %>
<%= form_for UserFollowing.new, method: :post do |f| %>
<%= f.hidden_field :followed_user_id, value: @user.id %>
<%= link_to '#', onclick: "$('#new_user_following').first().submit()", class: 'collection-item blue-text' do %>
Follow this user
<%= User.icon %>
<% end %>
<% end %>
<% end %>
<% end %>
<%= link_to Thredded::UrlsHelper.send_private_message_path(current_user: current_user, to: @user), class: 'collection-item blue-text' do %>
Send a message
forum
<% end %>
<% if user_signed_in? %>
<% if @user.blocked_by?(current_user) %>
<%= form_for(current_user.user_blockings.find_by(blocked_user_id: @user.id), method: :delete) do |f| %>
<%= f.hidden_field :blocked_user_id, value: @user.id %>
<%= link_to '#', onclick: "$('.edit_user_blocking').first().submit()", class: 'collection-item blue-text' do %>
Unblock this user
cancel
<% end %>
<% end %>
<% else %>
<%= form_for UserBlocking.new, method: :post do |f| %>
<%= f.hidden_field :blocked_user_id, value: @user.id %>
<%= link_to '#', onclick: "$('#new_user_blocking').submit()", class: 'collection-item blue-text' do %>
Block this user
close
<% end %>
<% end %>
<% end %>
<% end %>