<commit_before><%= render 'editions/header_with_navigation', edition: @edition, guide: @guide %>

<div class="row">
  <pre class="col-md-8">
    <%= @edition.body %>
  </pre>
</div>

<div class="row">
  <p>
    <%= link_to "Preview", guide_preview_url(@guide), class: 'btn btn-primary' %>
  </p>

  <% if @guide.latest_edition.present? && @guide.latest_edition.approved? %>
    <%= form_for :publication, url: guide_publications_path(guide_id: @guide.id) do |f| %>
      <%= f.submit "Publish Guide", class: 'btn btn-success', name: :publish %>
    <% end %>
  <% end %>

  <% if @guide.can_request_review? %>
    <%= form_for :review_request, url: edition_review_requests_path(edition_id: @guide.latest_edition.id) do |f| %>
      <%= f.submit "Send for review", class: 'btn btn-primary' %>
    <% end %>
  <% end %>

  <% if @guide.can_mark_as_approved? %>
    <%= form_for Approval.new do |f| %>
      <fieldset class='meta'>
        <legend>Approve</legend>
        <%= f.hidden_field :edition_id, value: @guide.latest_edition.id %>
        <%= f.submit "Mark as Approved", class: 'btn btn-primary' %>
      </fieldset>
    <% end %>
  <% end %>
</div>

<p class="row">
  <%= render 'editions/comments', edition: @edition, comments: @comments %>
</p><commit_msg>Display all fields that can change on the edition show page<commit_after><%= render 'editions/header_with_navigation', edition: @edition, guide: @guide %>

<div class="row">
  <div class="col-md-8">
    <pre><%= @edition.body %></pre>
  </div>

  <div class="col-md-4">
    <div class="panel panel-default">
      <div class="panel-heading">Description</div>
      <div class="panel-body">
        <%= @edition.description %>
      </div>
    </div>

    <div class="panel panel-default">
      <div class="panel-heading">Meta</div>

      <ul class="list-group">
        <li class="list-group-item">
          <label>Published by:</label>
          <%= link_to @edition.publisher_title, @edition.publisher_href %>
        </li>
        <% if @edition.related_discussion_href.present? %>
          <li class="list-group-item">
            <label>Related Discussion:</label>
            <%= link_to @edition.related_discussion_title, @edition.related_discussion_href %>
          </li>
          <li class="list-group-item">
            <label>Related Discussion URL:</label>
            <%= link_to @edition.related_discussion_href, @edition.related_discussion_href %>
          </li>
        <% end %>
      </ul>
    </div>

    <div class="panel panel-default">
      <div class="panel-heading">
        <%= @edition.update_type.titleize %> update
      </div>
      <% if @edition.change_note.present? %>
        <div class="panel-body">
          <%= @edition.change_note %>
        </div>
      <% end %>
      <div class="panel-body">
        <label>Updated at:</label>
        <%= @edition.updated_at %>
      </div>
    </div>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <p>
      <%= link_to "Preview", guide_preview_url(@guide), class: 'btn btn-primary' %>
    </p>

    <% if @guide.latest_edition.present? && @guide.latest_edition.approved? %>
      <%= form_for :publication, url: guide_publications_path(guide_id: @guide.id) do |f| %>
        <%= f.submit "Publish Guide", class: 'btn btn-success', name: :publish %>
      <% end %>
    <% end %>

    <% if @guide.can_request_review? %>
      <%= form_for :review_request, url: edition_review_requests_path(edition_id: @guide.latest_edition.id) do |f| %>
        <%= f.submit "Send for review", class: 'btn btn-primary' %>
      <% end %>
    <% end %>

    <% if @guide.can_mark_as_approved? %>
      <%= form_for Approval.new do |f| %>
        <fieldset class='meta'>
          <legend>Approve</legend>
          <%= f.hidden_field :edition_id, value: @guide.latest_edition.id %>
          <%= f.submit "Mark as Approved", class: 'btn btn-primary' %>
        </fieldset>
      <% end %>
    <% end %>
  </div>
</div>

<p class="row">
  <%= render 'editions/comments', edition: @edition, comments: @comments %>
</p>
{'fraction_non_alphanumeric': 0.1853035143769968, 'fraction_numerical': 0.001228803145736053, 'mean_word_length': 2.836003770028275, 'pattern_counts': {'":': 0, '<': 122, '<?xml version=': 0, '>': 122, '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': '6118910', 'n_tokens_mistral': 1515, 'n_tokens_neox': 1364, 'n_words': 276}