<commit_before><%= form_for [:admin, classification] do |classification_form| %>
  <%= classification_form.errors %>

  <fieldset>
    <%= classification_form.text_field :name %>
    <%= classification_form.text_area :description %>
  </fieldset>

  <%= render partial: 'related_topics', locals: {classification_form: classification_form} %>
  <%= render partial: 'logo', locals: {classification_form: classification_form} %>

  <%= render partial: 'social_media', locals: {classification_form: classification_form} %>

  <fieldset id="policy_order" class="named sortable">
    <legend>Policy ordering</legend>
    <%= classification_form.fields_for :classification_memberships, classification.classification_memberships.for_type(Policy).published do |classification_membership_form| %>
      <% policy = classification_membership_form.object.policy %>
      <div id="<%= dom_id(policy) %>" class="well">
        <%= classification_membership_form.text_field :ordering, label_text: link_to(policy.title, admin_edition_path(policy)), class: "ordering" %>
        <p>
          <%= [pluralize(Publication.published.related_to(policy).count, "publication"),
               pluralize(NewsArticle.published.related_to(policy).count, "news article")].to_sentence %>
        </p>
      </div>
    <% end %>
  </fieldset>

  <div class="row-fluid">
    <fieldset id="organisations" class="named span4">
      <legend>Organisations</legend>

      <div id="organisation_sortable">
        <%= classification_form.fields_for :organisation_classifications, classification.organisation_classifications.where(lead: false) do |organisation_form| %>
          <% organisation = organisation_form.object.organisation %>
          <div id="<%= dom_id(organisation) %>" class="well">
            <%= organisation_form.text_field :lead_ordering, label_text: link_to(organisation.name, admin_organisation_path(organisation)), class: "ordering" %>
            <%= organisation_form.text_field :lead, label_text: "#{organisation.name} is lead?", class: "lead" %>
          </div>
        <% end %>
      </div>
    </fieldset>

    <fieldset id="lead_organisation_order" class="named span4">
      <legend>Lead organisations</legend>

      <div id="lead_organisation_sortable">
        <%= classification_form.fields_for :organisation_classifications, classification.lead_organisation_classifications do |lead_organisation_form| %>
          <% lead_organisation = lead_organisation_form.object.organisation %>
          <div id="<%= dom_id(lead_organisation) %>" class="well">
            <%= lead_organisation_form.text_field :lead_ordering, label_text: link_to(lead_organisation.name, admin_organisation_path(lead_organisation)), class: "ordering" %>
            <%= lead_organisation_form.text_field :lead, label_text: "#{lead_organisation.name} is lead?", class: "lead" %>
          </div>
        <% end %>
      </div>
    </fieldset>
  </div>
  <%= classification_form.save_or_cancel cancel: admin_topics_path %>
<% end %><commit_msg>Fix url on the cancel button on Topic & TopicalEvent forms<commit_after><%= form_for [:admin, classification] do |classification_form| %>
  <%= classification_form.errors %>

  <fieldset>
    <%= classification_form.text_field :name %>
    <%= classification_form.text_area :description %>
  </fieldset>

  <%= render partial: 'related_topics', locals: {classification_form: classification_form} %>
  <%= render partial: 'logo', locals: {classification_form: classification_form} %>

  <%= render partial: 'social_media', locals: {classification_form: classification_form} %>

  <fieldset id="policy_order" class="named sortable">
    <legend>Policy ordering</legend>
    <%= classification_form.fields_for :classification_memberships, classification.classification_memberships.for_type(Policy).published do |classification_membership_form| %>
      <% policy = classification_membership_form.object.policy %>
      <div id="<%= dom_id(policy) %>" class="well">
        <%= classification_membership_form.text_field :ordering, label_text: link_to(policy.title, admin_edition_path(policy)), class: "ordering" %>
        <p>
          <%= [pluralize(Publication.published.related_to(policy).count, "publication"),
               pluralize(NewsArticle.published.related_to(policy).count, "news article")].to_sentence %>
        </p>
      </div>
    <% end %>
  </fieldset>

  <div class="row-fluid">
    <fieldset id="organisations" class="named span4">
      <legend>Organisations</legend>

      <div id="organisation_sortable">
        <%= classification_form.fields_for :organisation_classifications, classification.organisation_classifications.where(lead: false) do |organisation_form| %>
          <% organisation = organisation_form.object.organisation %>
          <div id="<%= dom_id(organisation) %>" class="well">
            <%= organisation_form.text_field :lead_ordering, label_text: link_to(organisation.name, admin_organisation_path(organisation)), class: "ordering" %>
            <%= organisation_form.text_field :lead, label_text: "#{organisation.name} is lead?", class: "lead" %>
          </div>
        <% end %>
      </div>
    </fieldset>

    <fieldset id="lead_organisation_order" class="named span4">
      <legend>Lead organisations</legend>

      <div id="lead_organisation_sortable">
        <%= classification_form.fields_for :organisation_classifications, classification.lead_organisation_classifications do |lead_organisation_form| %>
          <% lead_organisation = lead_organisation_form.object.organisation %>
          <div id="<%= dom_id(lead_organisation) %>" class="well">
            <%= lead_organisation_form.text_field :lead_ordering, label_text: link_to(lead_organisation.name, admin_organisation_path(lead_organisation)), class: "ordering" %>
            <%= lead_organisation_form.text_field :lead, label_text: "#{lead_organisation.name} is lead?", class: "lead" %>
          </div>
        <% end %>
      </div>
    </fieldset>
  </div>
  <%= classification_form.save_or_cancel cancel: [:admin, model_class] %>
<% end %>
{'fraction_non_alphanumeric': 0.139057626005582, 'fraction_numerical': 0.0006567066163191594, 'mean_word_length': 4.381625441696113, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 113, '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': '2881682', 'n_tokens_mistral': 1945, 'n_tokens_neox': 1743, 'n_words': 306}