<%# We're using the medium-editor CDN here instead of the rails-medium-editor gem because it broke in the latest version of Chrome, and has been archived for no more changes. Ergo, we gotta move off of it. :) %> <% set_meta_tags title: "Editing: " + @document.title, description: truncate(@document.body) %>
<%= link_to document_path(@document), class: "flex items-center px-3 py-1.5 rounded-md bg-white text-gray-700 hover:bg-gray-100 transition-colors shadow-sm" do %> visibility Preview as Reader <% end %>
<%= link_to queue_analysis_document_path(@document), class: "flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-50" do %> analytics Analyze this document <% end %> history Revision log text_format Plaintext view

delete Delete document
text_fields 0 words
<%= form_for @document do |f| %>
<%= Document.icon %>
<%= f.text_field :title, id: "document_title", class: "flex-1 px-4 py-3 text-lg font-medium focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", placeholder: "Document title" %>
<% end %>
<%= @document.body.try(:html_safe) %>
<%= 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 %>
<%= form_for(@document, remote: true, html: { id: 'document-metadata-form' }) do |f| %>
<%= Document.icon %>

Document Metadata

info Document notes are for your reference only and won't be visible to readers. Use this space for research notes, planning, or any other information you want to keep with your document.
<%= f.text_area :notes_text, class: 'w-full rounded-md border-gray-300 shadow-sm focus:border-teal-500 focus:ring focus:ring-teal-500 focus:ring-opacity-30', placeholder: "Write as little or as much as you'd like!", style: 'min-height: 300px; padding: 12px;' %>
visibility A brief summary of your document's content. This will be displayed in document listings and previews to give readers an idea of what your document is about.
<%= f.text_area :synopsis, class: 'w-full rounded-md border-gray-300 shadow-sm focus:border-teal-500 focus:ring focus:ring-teal-500 focus:ring-opacity-30', placeholder: "Summarize your document in a few sentences...", 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.

save All changes will be saved
<% end %>
people_alt

Document Entities

Link a page to this document

search

Linked pages

<% end %> See document.rb and document_analysis.rb for the relationship between documents and their linked entities via document_analysis. -->
person
Aragorn

Character

expand_more

Quick reference

View full page

Role

Ranger of the North, Heir to the throne of Gondor

Description

A tall, dark-haired man with gray eyes and a stern face that would light up when he smiled.

place
Rivendell

Location

expand_more

Quick reference

View full page

Type

Elven settlement

Description

A hidden valley with elegant elven architecture, surrounded by forests and waterfalls.

people_alt

Document Entities

Link a page to this document

search

Linked pages

person
Aragorn

Character

chevron_right
place
Rivendell

Location

chevron_right
save Saved
<%= link_to queue_analysis_document_path(@document), class: "flex items-center justify-center w-14 h-14 rounded-full bg-gradient-to-r from-blue-500 to-purple-600 text-white shadow-lg hover:from-blue-600 hover:to-purple-700 transition-all transform hover:scale-110 focus:outline-none" do %> analytics <% end %>

Analyze Your Document

Get AI-powered insights about readability, style, and sentiment.