mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
39 lines
931 B
Plaintext
39 lines
931 B
Plaintext
<%=
|
|
render partial: 'content/contexts/relation', locals: {
|
|
content_type: Flora,
|
|
content: content,
|
|
relation_class: FloraEatenBy,
|
|
relation_class_id: :creature_id,
|
|
relation_text: :eats
|
|
}
|
|
%>
|
|
|
|
<% @references.each do |content_type, relations| %>
|
|
<% next unless relations.any? %>
|
|
<%
|
|
card_title = if relations.count == 1
|
|
if relations.first.first.include? '<plural>'
|
|
relations.first.first
|
|
else
|
|
[
|
|
relations.first.first,
|
|
' ',
|
|
pluralize(relations.count, "#{content_type.to_s.singularize}")
|
|
].join
|
|
end
|
|
else
|
|
[
|
|
'Related to ',
|
|
pluralize(relations.count, "other #{content_type.to_s.singularize}")
|
|
].join
|
|
end
|
|
%>
|
|
<div class="col s12 m6 l4">
|
|
<%= render partial: 'content/cards/content_relation_list', locals: {
|
|
content_type: content_type,
|
|
relations: relations,
|
|
card_title: card_title
|
|
} %>
|
|
</div>
|
|
<% end %>
|