Add empty interests list message.
This commit is contained in:
@@ -41,4 +41,20 @@ module UsersHelper
|
||||
current_user && current_user.administrator?
|
||||
end
|
||||
|
||||
def interests_title_text(user)
|
||||
if current_user == user
|
||||
t('account.show.public_interests_my_title_list')
|
||||
else
|
||||
t('account.show.public_interests_user_title_list')
|
||||
end
|
||||
end
|
||||
|
||||
def empty_interests_message_text(user)
|
||||
if current_user == user
|
||||
t('account.show.public_interests_my_empty_list')
|
||||
else
|
||||
t('account.show.public_interests_user_empty_list')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
24
app/views/users/_interests.html.erb
Normal file
24
app/views/users/_interests.html.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<div id="public_interests" class="public-interests">
|
||||
<h4><%= interests_title_text(user) %></h4>
|
||||
|
||||
<% if user.interests.any? %>
|
||||
|
||||
<% user.interests.in_groups_of(10, false) do |interests_group| %>
|
||||
<div class="small-4 column end">
|
||||
<ul class="no-bullet">
|
||||
<% interests_group.each do |interest| %>
|
||||
<li> <small><%= interest %></small> </li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
|
||||
<div class="callout primary">
|
||||
<%= empty_interests_message_text(user) %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
@@ -46,20 +46,7 @@
|
||||
<p><%= t('users.show.private_activity') %></p>
|
||||
<% end %>
|
||||
|
||||
<% if valid_interests_access? %>
|
||||
<div id="public_interests" class="public-interests">
|
||||
<h4><%= t('account.show.public_interests_title_list') %></h4>
|
||||
<% @user.interests.in_groups_of(10, false) do |interests_group| %>
|
||||
<div class="small-4 column end">
|
||||
<ul class="no-bullet">
|
||||
<% interests_group.each do |interest| %>
|
||||
<li> <small><%= interest %></small> </li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render 'interests', user: @user if valid_interests_access? %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user