Page-specific sharing
- <%=
+ <%=
+ # Big oof here.
+ content_obj = if shared_content.is_a?(Document)
+ {
+ id: shared_content.id,
+ name: shared_content.title,
+ page_type: 'Document',
+ privacy: shared_content.privacy
+ }
+ else
+ shared_content.attributes.slice('id', 'name', 'page_type', 'privacy')
+ end
+
react_component("PrivacyToggle", {
- content: shared_content.attributes.slice('id', 'name', 'page_type', 'privacy'),
+ content: content_obj,
content_icon: shared_content.class.icon,
content_color: shared_content.class.color,
submit_path: polymorphic_path(shared_content),
diff --git a/app/views/content/display/_contributors.html.erb b/app/views/content/display/_contributors.html.erb
index d3da8deb..3f74be6e 100644
--- a/app/views/content/display/_contributors.html.erb
+++ b/app/views/content/display/_contributors.html.erb
@@ -1,9 +1,13 @@
<%# Usage: render partial: 'content/display/contributors', locals: { content: content } %>
-<% if content.contributors.any? %>
+<%
+ raw_model = content.is_a?(Universe) ? content : content.raw_model
+%>
+
+<% if raw_model.contributors.any? %>
- <% content.contributors.each do |contributor| %>
+ <% raw_model.contributors.each do |contributor| %>
<% next if contributor.user.nil? && (current_user != content.user) %>
-
person
@@ -27,6 +31,6 @@
<% end %>
- <%= render partial: 'content/form/contributors/leave', locals: { content: content } %>
+ <%= render partial: 'content/form/contributors/leave', locals: { content: raw_model } %>
<% end %>
\ No newline at end of file