<%# Root note: the universe %>
-
<%= link_to "My Universes", '#' %>
<% current_user.universes.each do |universe| %>
-
<%= link_to universe.name, universe %>
<% @content_types.each do |content_type| %>
-
<% content_of_this_type = universe.send(content_type.downcase) %>
<%= link_to "#{content_type} (#{content_of_this_type.count})", '#' %>
<% if content_of_this_type.any? %>
<% content_of_this_type.each do |content| %>
-
<%= link_to content.name, content %>
<% fields = [] %>
<% case content_type %>
<% when 'Characters' %>
<% fields = %w(
fathers mothers siblings spouses children best_friends
archenemies birthplaces races spoken_languages
) %>
<% when 'Locations' %>
<% fields = %w(
leaders capital_cities largest_cities notable_cities languages
) %>
<% when 'Items' %>
<% fields = %w(
original_owners past_owners current_owners makers
) %>
<% when 'Creatures' %>
<% fields = %w(habitats related_creatures) %>
<% when 'Races' %>
<% fields = %w(famous_figures) %>
<% when 'Religions' %>
<% fields = %w(notable_figures deities practicing_locations artifacts races) %>
<% when 'Groups' %>
<% fields = %w(
leaders members supergroups subgroups sistergroups allies enemies rivals clients
suppliers locations headquarters offices equipment key_items
) %>
<% when 'Magics' %>
<% fields = %w(deities) %>
<% when 'Languages' %>
<% fields = [] %>
<% when 'Scenes' %>
<% fields = %w(scene_characters scene_locations scene_items) %>
<% end %>
<% fields.each do |field| %>
-
<% content_of_this_relation = content.send(field) %>
<%= link_to "#{field.titleize} (#{content_of_this_relation.count})", '#' %>
<% if content_of_this_relation %>
<% content_of_this_relation.each do |relation| %>
- <%= link_to relation.name, relation %>
<% end %>
<% end %>
<% end %>
<%# TODO: relationships for this content %>
<% end %>
<% end %>
<% end %>
<% end %>