diff --git a/app/views/documents/edit.html.erb b/app/views/documents/edit.html.erb index 2e991d3e..486170e2 100644 --- a/app/views/documents/edit.html.erb +++ b/app/views/documents/edit.html.erb @@ -44,11 +44,7 @@ Preview as Reader <% end %> - - +
@@ -112,11 +108,16 @@ 0 words
- -
- <%= @document.privacy == 'private' ? 'lock' : 'public' %> + +
+ edit + @@ -162,6 +163,255 @@
<%= render partial: 'javascripts/content_linking' %> + +
+ +
+ + +
+
+ +
+
+
+
+ <%= Document.icon %> +
+

Privacy Settings

+
+ +
+
+ + +
+ +
+ + +
+ +
+ + + + + +
+ info + + + Control who can view this document. More privacy options will be available in the future. + +
+ + <% if @document.universe.present? %> +
+
+
+
+ <%= @document.universe.privacy == 'public' ? 'warning' : 'info' %> +
+
+
+

+ This document is in the universe "<%= @document.universe.name %>" +

+

+ <% if @document.universe.privacy == 'public' %> + Note: This universe is public, so this document will be visible to anyone who can view the universe, regardless of its own privacy setting. + <% else %> + This universe is private, so this document's privacy setting will be respected. + <% end %> + Manage universe privacy +

+
+
+
+ <% end %> + + <%= form_for(@document, remote: true, html: { id: 'document-privacy-form' }) do |f| %> +
+ <%= f.hidden_field :privacy, value: @document.privacy, id: 'document_privacy_field' %> + +
+ +
+ onchange="updateDocumentPrivacy(this)"> + +
+ + +
+ onchange="updateDocumentPrivacy(this)"> + +
+ + + +
+
+ <% end %> +
+ + + <% if @document.universe.present? %> +
+ + + + + +
+ info + + + Documents in a public universe are visible to anyone who can view that universe, regardless of the document's privacy setting. + +
+ + <% if @document.universe.user == current_user %> + <%= form_for(@document.universe, remote: true, html: { id: 'universe-privacy-form' }) do |f| %> +
+
+
+ public +
+
+ <%= @document.universe.name %> +
+
+ + <%= f.hidden_field :privacy, value: @document.universe.privacy, id: 'universe_privacy_field' %> + +
+ +
+ onchange="updateUniversePrivacy(this)"> + +
+ + +
+ onchange="updateUniversePrivacy(this)"> + +
+
+
+ <% end %> + <% else %> +
+
+
+ public +
+
+ <%= @document.universe.name %> +

Currently: <%= @document.universe.privacy || 'private' %>

+

You don't own this universe, so you can't change its privacy settings.

+
+
+
+ <% end %> +
+ <% end %> +
+ + +
+ +
+
+
+
+
short_text Synopsis +
@@ -274,6 +533,36 @@ style: 'min-height: 300px; padding: 12px;' %>
+ + +
+ + + + + +
+ public + + + Select a universe for this document. Documents in a universe can be organized together and share common worldbuilding elements. + +
+ +
+ + <%= f.collection_select :universe_id, + current_user.universes.order(:name), + :id, + :name, + { include_blank: "No universe" }, + { class: "mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-teal-500 focus:border-teal-500 sm:text-sm rounded-md" } + %> +

+ Selecting a universe will make this document part of that universe's worldbuilding. +

+
+
@@ -927,6 +1216,380 @@ }); + + +