<commit_before><div class="navbar-fixed">
  <nav class="navbar nav-extended <%= 'logged-in' if user_signed_in? %>" style="background-color: <%= @navbar_color.presence || '#2196F3' %>">
    <div class="nav-wrapper">
      <ul>
        <li class="left">
          <a class="sidenav-trigger show-on-large left" href="#" data-target="sidenav-left">
            <i class="material-icons">menu</i>
          </a>
        </li>
        <li class="left">
          <%=
            link_to documents_path, class: 'tooltipped', data: {
              position: 'bottom',
              tooltip: 'Back to your documents'
            } do
          %>
            <i class="material-icons white-text">file_copy</i>
          <% end %>
        </li>
        <li class="left">
          <%=
            link_to new_document_path, class: 'tooltipped', data: {
              position: 'bottom',
              tooltip: 'New document'
            },
            target: '_blank' do
          %>
            <i class="material-icons white-text left">note_add</i>
          <% end %>
        </li>

        <ul id="about-this-document-dropdown" class="dropdown-content">
          <li style="padding: 0 20px" class="<%= Document.color %> lighten-5">
            <h5 class="grey-text text-darken-4">
              About this document
            </h5>
            <p>
              Created <%= time_ago_in_words @document.created_at %> ago
            </p>
            <p class="clearfix">
              Last edited <%= time_ago_in_words @document.updated_at %> ago
            </p>
            <p class="clearfix"></p>
          </li>
          <li class="<%= Document.color %> lighten-5">
            <%= link_to @document.user, class: User.color + '-text' do %>
              <i class="material-icons left"><%= User.icon %></i>
              <span class="black-text">Written by</span>
              <%= @document.user.name %>
            <% end %>
          </li>
          <li class="<%= Document.color %> lighten-5">
            <%= link_to '#universe-picker-modal', class: Universe.color + '-text modal-trigger' do %>
              <i class="material-icons left"><%= Universe.icon %></i>
              <span class="black-text">Set in</span>
              <span class="js-content-universe-name">
                <%= @document.universe_id.nil? ? 'No Universe Set' : @document.universe.name %>
              </span>
            <% end %>
          </li>
          <li class="divider"></li>
          <li>
            <%= link_to analysis_document_path(@document) do %>
              <i class="material-icons left orange-text">bar_chart</i>
              Analyze this document
            <% end %>
          </li>
          <li>
            <%=
              link_to '#', class: 'share' do
            %>
              <i class="material-icons purple-text left">share</i>
              Share this document
            <% end %>
          </li>
          <% if current_user.can_delete?(@document) %>
            <li>
              <%= link_to @document,
                method: :delete,
                data: {
                  confirm: "Are you sure? This will permanently delete this entire document!"
                } do
              %>
                <i class="material-icons left red-text">delete</i>
                Delete this document
              <% end %>
            </li>
          <% end %>
        </ul>
        <li class="right">
          <%=
            link_to '#', class: 'tooltipped dropdown-trigger', data: {
              position: 'bottom',
              tooltip: 'About this document',
              target: 'about-this-document-dropdown'
            } do
          %>
            <i class="material-icons white-text left"><%= Document.icon %></i>
            <span class="hide-on-med-and-down">About</span>
          <% end %>
        </li>
        <li class="right">
          <%= link_to analysis_document_path(@document), class: "tooltipped", data: { tooltip: 'Analyze this document', position: 'bottom' } do %>
            <i class="material-icons left">bar_chart</i>
            <span class="hide-on-med-and-down">Analyze</span>
          <% end %>
        </li>
        <li class="left" style="margin-left: 20px">
          <%= yield :navbar_left_content %>
        </li>
        <li class="right">
          <%= yield :navbar_right_content %>
        </li>
      </ul>
    </div>
  </nav>
</div>

<%# Modals %>
<%= render partial: 'content/share', locals: { shared_content: @document } %>
<div id="universe-picker-modal" class="modal modal-fixed-footer">
  <div class="modal-content">
    <h4>Set document universe</h4>
    <p>
      What universe does this document exist in? You can change this at any time.
    </p>
    <div class="row">
      <%= form_for @document, method: :put, remote: true do |f| %>
        <div class="col s12 m12 l4">
          <p class="grey-text">No universe</p>
          <p>
            <label class="js-autosave-trigger">
              <%= f.radio_button :universe_id, "nil", class: 'with-gap', checked: @document.universe_id.nil? %>
              <span>No universe</span>
            </label>
          </p>
        </div>
        <% if @linked_entities.any? %>
          <div class="col s12 m12 l4">
            <% linked_entity_universes = @linked_entities.map { |de| de.entity.try(:universe) }.uniq.compact %>
            <p class="grey-text"><%= pluralize linked_entity_universes, 'suggested universe' %></p>
            <% linked_entity_universes.each do |universe| %>
              <p>
                <label>
                  <%= f.radio_button :universe_id, universe.id, class: 'with-gap', checked: @document.universe_id == universe.try(:id) %>
                  <span><%= universe.name %></span>
                </label>
              </p>
            <% end %>
          </div>
        <% end %>
        <% if @linkables_cache['Universe'].any? %>
          <div class="col s12 m12 l4">
            <p class="grey-text">All universes</p>
            <%# we can't use linkables_cache here since it can be scoped to @current_universe and therefore only return that universe %>
            <% current_user.universes.each do |universe| %>
              <p>
                <label class="js-autosave-trigger">
                  <%= f.radio_button :universe_id, universe.id, class: 'with-gap', checked: @document.universe_id == universe.id %>
                  <span><%= universe.name %></span>
                </label>
              </p>
            <% end %>
          </div>
        <% end %>
        <div class="col s12">
          <p class="grey-text">
            Changes are saved automatically.
          </p>
        </div>
      <% end %>
    </div>
  </div>
  <div class="modal-footer">
    <a href="#!" class="modal-close waves-effect waves-green btn-flat">Close</a>
  </div>
</div>

<%= content_for :javascript do %>
  $(document).ready(function () {
    var universe_picker_form = $('#universe-picker-modal').find('form');<commit_msg>thought I already did this<commit_after><div class="navbar-fixed">
  <nav class="navbar nav-extended <%= 'logged-in' if user_signed_in? %>" style="background-color: <%= @navbar_color.presence || '#2196F3' %>">
    <div class="nav-wrapper">
      <ul>
        <li class="left">
          <a class="sidenav-trigger show-on-large left" href="#" data-target="sidenav-left">
            <i class="material-icons">menu</i>
          </a>
        </li>
        <li class="left">
          <%=
            link_to documents_path, class: 'tooltipped', data: {
              position: 'bottom',
              tooltip: 'Back to your documents'
            } do
          %>
            <i class="material-icons white-text">file_copy</i>
          <% end %>
        </li>
        <li class="left">
          <%=
            link_to new_document_path, class: 'tooltipped', data: {
              position: 'bottom',
              tooltip: 'New document'
            },
            target: '_blank' do
          %>
            <i class="material-icons white-text left">note_add</i>
          <% end %>
        </li>

        <ul id="about-this-document-dropdown" class="dropdown-content">
          <li style="padding: 0 20px" class="<%= Document.color %> lighten-5">
            <h5 class="grey-text text-darken-4">
              About this document
            </h5>
            <p>
              Created <%= time_ago_in_words @document.created_at %> ago
            </p>
            <p class="clearfix">
              Last edited <%= time_ago_in_words @document.updated_at %> ago
            </p>
            <p class="clearfix"></p>
          </li>
          <li class="<%= Document.color %> lighten-5">
            <%= link_to @document.user, class: User.color + '-text' do %>
              <i class="material-icons left"><%= User.icon %></i>
              <span class="black-text">Written by</span>
              <%= @document.user.name %>
            <% end %>
          </li>
          <li class="<%= Document.color %> lighten-5">
            <%= link_to '#universe-picker-modal', class: Universe.color + '-text modal-trigger' do %>
              <i class="material-icons left"><%= Universe.icon %></i>
              <span class="black-text">Set in</span>
              <span class="js-content-universe-name">
                <%= @document.universe_id.nil? ? 'No Universe Set' : @document.universe.name %>
              </span>
            <% end %>
          </li>
          <li class="divider"></li>
          <li>
            <%= link_to analysis_document_path(@document) do %>
              <i class="material-icons left orange-text">bar_chart</i>
              Analyze this document
            <% end %>
          </li>
          <li>
            <%=
              link_to '#', class: 'share' do
            %>
              <i class="material-icons purple-text left">share</i>
              Share this document
            <% end %>
          </li>
          <% if current_user.can_delete?(@document) %>
            <li>
              <%= link_to @document,
                method: :delete,
                data: {
                  confirm: "Are you sure? This will permanently delete this entire document!"
                } do
              %>
                <i class="material-icons left red-text">delete</i>
                Delete this document
              <% end %>
            </li>
          <% end %>
        </ul>
        <li class="right">
          <%=
            link_to '#', class: 'tooltipped dropdown-trigger', data: {
              position: 'bottom',
              tooltip: 'About this document',
              target: 'about-this-document-dropdown'
            } do
          %>
            <i class="material-icons white-text left"><%= Document.icon %></i>
            <span class="hide-on-med-and-down">About</span>
          <% end %>
        </li>
        <li class="right">
          <%= link_to analysis_document_path(@document), class: "tooltipped", data: { tooltip: 'Analyze this document', position: 'bottom' } do %>
            <i class="material-icons left">bar_chart</i>
            <span class="hide-on-med-and-down">Analyze</span>
          <% end %>
        </li>
        <li class="left" style="margin-left: 20px">
          <%= yield :navbar_left_content %>
        </li>
        <li class="right">
          <%= yield :navbar_right_content %>
        </li>
      </ul>
    </div>
  </nav>
</div>

<%# Modals %>
<%= render partial: 'content/share', locals: { shared_content: @document } %>
<div id="universe-picker-modal" class="modal modal-fixed-footer">
  <div class="modal-content">
    <h4>Set document universe</h4>
    <p>
      What universe does this document exist in? You can change this at any time.
    </p>
    <div class="row">
      <%= form_for @document, method: :put, remote: true do |f| %>
        <div class="col s12 m12 l4">
          <p class="grey-text">No universe</p>
          <p>
            <label class="js-autosave-trigger">
              <%= f.radio_button :universe_id, "nil", class: 'with-gap', checked: @document.universe_id.nil? %>
              <span>No universe</span>
            </label>
          </p>
        </div>
        <% if @linked_entities.any? %>
          <div class="col s12 m12 l4">
            <% linked_entity_universes = @linked_entities.map { |de| de.entity.try(:universe) }.uniq.compact %>
            <p class="grey-text"><%= pluralize linked_entity_universes, 'suggested universe' %></p>
            <% linked_entity_universes.each do |universe| %>
              <p>
                <label>
                  <%= f.radio_button :universe_id, universe.id, class: 'with-gap', checked: @document.universe_id == universe.try(:id) %>
                  <span><%= universe.name %></span>
                </label>
              </p>
            <% end %>
          </div>
        <% end %>
        <% if @linkables_cache.fetch('Universe', []).any? %>
          <div class="col s12 m12 l4">
            <p class="grey-text">All universes</p>
            <%# we can't use linkables_cache here since it can be scoped to @current_universe and therefore only return that universe %>
            <% current_user.universes.each do |universe| %>
              <p>
                <label class="js-autosave-trigger">
                  <%= f.radio_button :universe_id, universe.id, class: 'with-gap', checked: @document.universe_id == universe.id %>
                  <span><%= universe.name %></span>
                </label>
              </p>
            <% end %>
          </div>
        <% end %>
        <div class="col s12">
          <p class="grey-text">
            Changes are saved automatically.
          </p>
        </div>
      <% end %>
    </div>
  </div>
  <div class="modal-footer">
    <a href="#!" class="modal-close waves-effect waves-green btn-flat">Close</a>
  </div>
</div>

<%= content_for :javascript do %>
  $(document).ready(function () {
    var universe_picker_form = $('#universe-picker-modal').find('form');
{'fraction_non_alphanumeric': 0.15928698752228165, 'fraction_numerical': 0.004991087344028521, 'mean_word_length': 1.676206830757489, 'pattern_counts': {'":': 0, '<': 365, '<?xml version=': 0, '>': 365, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1550090', 'n_tokens_mistral': 4350, 'n_tokens_neox': 4042, 'n_words': 924}