notebook/app/views/main/dashboard.html.erb
2017-02-28 16:56:27 +00:00

40 lines
1.3 KiB
Plaintext

<% if @question.present? && @question[:question].present? %>
<div class="row">
<div class="col m9 s12">
<%= render partial: 'cards/serendipitous/content_question', locals: { question: @question, content: @content } %>
</div>
<div class="col m3 s12">
<%= render 'cards/user/recent_activity' %>
</div>
</div>
<% end %>
<% if current_user.content_count.zero? && false %>
<div class="row">
<div class="col s12">
<!-- Get started onboarding -->
</div>
</div>
<% end %>
<%
s_width = 12
m_width = 6
l_width = 3
if current_user.content_count > 0
# If we're losing 2 columns to the sidebar (if any content exists), only show 2 content types per row
l_width = 6
end
%>
<div class="row">
<% [:universe, :character, :location, :item, :creature, :race, :religion, :group, :magic, :language, :scene].each do |type| %>
<% content_list = current_user.send(type.to_s.pluralize) %>
<% next if !current_user.can_create?(type.to_s.capitalize.constantize) && content_list.empty? %>
<div class="dashboard-row col <%= "s#{s_width} m#{m_width} l#{l_width}" %>">
<%= render partial: 'content/cards/in_universe_content_list', locals: { content_type: type, content_list: content_list } %>
</div>
<% end %>
</div>