<% tabs = %w( universes characters locations items creatures races religions magics languages groups scenes ) tab_content_list = {} tabs.each do |tab| tab_content_list[tab] = @user.send(tab).is_public.sort_by { |c| c.name.downcase } end %>
<%= image_tag @user.image_url(500).html_safe, class: 'activator' %>
<%= @user.name %>
Profile Pictureclose

Profile pictures are powered by <%= link_to 'Gravatar', 'https://gravatar.com/', target: "_blank" %>, using the email you provided in your <%= link_to 'account settings', edit_user_registration_path %>.

For the prettiest profile, please use an avatar at least 250 pixels wide.

I'm creating universes on Notebook! I'm currently sharing the following public content:
<% tabs.each do |tab| %>

<%= tab_content_list[tab].length %>

<%= tab.singularize.pluralize(tab_content_list[tab].length) %>
<% end %>
<% if @user.public_content_count > 0 %>
<%= pie_chart({ universes: @user.universes.is_public.count, characters: @user.characters.is_public.count, locations: @user.locations.is_public.count, items: @user.items.is_public.count }, colors: [Universe.color, Character.color, Location.color, "yellow"], ) %>
<% end %>
    <% tabs.each do |tab| %> <% tab_class = tab.singularize.titleize.constantize %>
  • <%= link_to "\##{tab}", class: "#{tab_class.color}-text" do %> <%= tab_class.icon %> <%= tab_content_list[tab].length %> <% end %>
  • <% end %>
<% tabs.each do |tab| %> <% if tab_content_list[tab].any? %>
<%= render partial: 'content/list/list', locals: { content_list: tab_content_list[tab], title: '', clean: true } %>
<% elsif tab_content_list[tab].empty? %> <% tab_class = tab.singularize.titleize.constantize %>
<%= tab_class.icon %>

It looks like <%= @user.name %> isn't sharing any public <%= tab %> yet.

<% end %> <% end %>
<% # Default to showing the first tab with content in it (left-first) tabs.each do |tab| if tab_content_list[tab].any? %> <% break # Only do this for the first tab with content we see end end %>