<commit_before><div class="page-header">
  <h1><%= @edition.title %></h1>
  <p class="lead summary"><%= @edition.summary %></p>
  <dl class="clearfix">
    <dt>Type of document:</dt>
    <dd><%= edition_type(@edition) %></dd>
    <dt>Status:</dt>
    <dd><%= @edition.state.capitalize %></dd>
    <dt>Organisations:</dt>
    <dd><%= @edition.organisations.map { |o| o.name }.join(", ") %></dd>
  </dl>
  <% if @edition.non_english_edition? %>
    <p><em>(This document is <%=@edition.primary_language_name %>-only)</em></p>
  <% end %>
</div>

<%= render partial: "rejected_by", locals: { edition: @edition } %>
<%= render partial: 'alerts', locals: {edition: @edition}  %>

<section class="edition-view-edit-buttons">
  <% if @edition.published? %>
    <%= link_to "View on website", public_document_url(@edition), class: 'btn btn-large btn-primary public_version', target: '_blank' %>
  <% else %>
    <%= link_to "Preview on website", preview_document_path(@edition), class: 'btn btn-large btn-primary preview_version', target: '_blank' %>
  <% end %>

  <% if @edition.editable? %>
    <%= edit_edition_button(@edition) %>
  <% elsif @edition.is_latest_edition? and @edition.published? %>
    <%= redraft_edition_button(@edition) %>
  <% end %>
</section><commit_msg>We don't "preview" archived documents<commit_after><div class="page-header">
  <h1><%= @edition.title %></h1>
  <p class="lead summary"><%= @edition.summary %></p>
  <dl class="clearfix">
    <dt>Type of document:</dt>
    <dd><%= edition_type(@edition) %></dd>
    <dt>Status:</dt>
    <dd><%= @edition.state.capitalize %></dd>
    <dt>Organisations:</dt>
    <dd><%= @edition.organisations.map { |o| o.name }.join(", ") %></dd>
  </dl>
  <% if @edition.non_english_edition? %>
    <p><em>(This document is <%=@edition.primary_language_name %>-only)</em></p>
  <% end %>
</div>

<%= render partial: "rejected_by", locals: { edition: @edition } %>
<%= render partial: 'alerts', locals: {edition: @edition}  %>

<section class="edition-view-edit-buttons">
  <% if @edition.published? || @edition.archived? %>
    <%= link_to "View on website", public_document_url(@edition), class: 'btn btn-large btn-primary public_version', target: '_blank' %>
  <% else %>
    <%= link_to "Preview on website", preview_document_path(@edition), class: 'btn btn-large btn-primary preview_version', target: '_blank' %>
  <% end %>

  <% if @edition.editable? %>
    <%= edit_edition_button(@edition) %>
  <% elsif @edition.is_latest_edition? and @edition.published? %>
    <%= redraft_edition_button(@edition) %>
  <% end %>
</section>
{'fraction_non_alphanumeric': 0.2187017001545595, 'fraction_numerical': 0.0015455950540958269, 'mean_word_length': 4.532051282051282, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 95, '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': '4256710', 'n_tokens_mistral': 1005, 'n_tokens_neox': 927, 'n_words': 186}