<div id="share-modal" class="modal">
  <div class="modal-content">
    <h4>
      <i class="material-icons <%= shared_content.class.color %>-text right"><%= shared_content.class.icon %></i>
      Share <%= shared_content.name %>
    </h4>

    <div class="row">
      <div class="input-field col s12">
        <input type="text" id="share_url" readonly onclick="this.focus();this.select()" value="<%= polymorphic_url(shared_content) %>">
        <label for="share_url">Share URL</label>
      </div>
    </div>

    <% if current_user && shared_content.user == current_user %>

      <div class="row">
        <p class="col s12">To be shareable, content must either be public <strong>or</strong> in a public Universe.</p>
      </div>

      <% if ((shared_content.respond_to? :universe) && shared_content.universe.present?) %>
        <div class="row">
          <%= render partial: 'content/form/privacy_toggle', locals: { content: shared_content.universe } %>
        </div>
      <% end %>

      <% if shared_content.respond_to? :privacy %>
        <div class="row">
          <%= render partial: 'content/form/privacy_toggle', locals: { content: shared_content } %>
        </div>
      <% end %>

      <% if shared_content.is_a?(Universe) %>
        <div class="row">
          <p class="col s12">
            Sharing this universe will allow all pages within it to also be viewed.
            If you'd like to share specific pages, you should share those pages directly instead.
          </p>
        </div>
      <% end %>

      <div class="row">
        <p class="col s12" style='text-align: center'>
          <%= link_to 'https://medium.com/indent-labs/privacy-on-notebook-ai-how-it-works-c23a59faeae2', class: 'btn btn-small blue lighten-1', target: '_new' do %>
            Click here to learn more about sharing pages on Notebook.ai
          <% end %>
        </p>
      </div>

    <% else %>

      <div class="row">
        <p class="col s12">
          This <%= shared_content.class.to_s.downcase %> is being shared on Notebook.ai by <%= link_to shared_content.user.name, shared_content.user %>.
        </p>
      </div>

    <% end %>
  </div>
  <div class="modal-footer">
    <a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">close</a>
  </div>
</div>
