mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
<% if @question.present? && @question[:question].present? %>
|
|
<div class="row">
|
|
<div class="col s12">
|
|
<%= render partial: 'cards/serendipitous/content_question', locals: { question: @question, content: @content } %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%
|
|
s_width = 12
|
|
m_width = 6
|
|
l_width = 6
|
|
%>
|
|
|
|
<div class="row">
|
|
<% @content_types.reverse.each do |content_type| %>
|
|
<%
|
|
pluralized_content_name = content_type.downcase.pluralize
|
|
|
|
if @universe_scope.present? && content_type != 'Universe'
|
|
content_list = @universe_scope.send(pluralized_content_name)
|
|
else
|
|
content_list = current_user.send(pluralized_content_name) + current_user.send("contributable_#{pluralized_content_name}")
|
|
|
|
unless content_type == 'Universe'
|
|
content_list.concat(content_type.constantize.where(universe_id: current_user.universes.pluck(:id)))
|
|
end
|
|
end
|
|
|
|
content_list.uniq!
|
|
%>
|
|
|
|
<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: content_type.downcase, content_list: content_list } %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|