<commit_before><h1 class='fine_print heading'>FinePrint Contracts</h1>

<% @contracts.group_by(&:name).each do |name, contracts| %>

  <ul class='fine_print'>
    <li><%= name %></li>
    
      <ul class='fine_print'>
        <% contracts.each do |contract| %>
          <li><%= link_to contract.title, contract %> 
            (<%= contract.version.nil? ? 'draft' : 'v.#{contract.version}' %>)
            <% if contract.can_be_updated? %>
              [<%= link_to 'Edit', edit_contract_path(contract), :class => 'fine_print link' %>]
            <% else %>
              [<%= link_to 'New version', new_version_contract_path(contract), :class => 'fine_print link' %>]
            <% end %>
            <% if contract.can_be_published? %>
              [<%= link_to 'Publish', publish_contract_path(contract), :method => :put, :data => {:confirm => 'Are you sure you want to publish this contract?'} %>]
            <% else %>
              <% if contract.can_be_unpublished? %>
                [<%= link_to 'Unpublish', unpublish_contract_path(contract), :method => :put, :data => {:confirm => 'Are you sure you want to unpublish this contract?'} %>]
              <% end %>
            <% end %>
            <% if contract.can_be_destroyed? %>
              [<%= link_to 'Delete', contract, :method => :delete, :data => {:confirm => 'Are you sure you wish to delete this contract?'}, :class => 'fine_print link' %>]
            <% end %>
          </li>
        <% end %>
      </ul>
    
  </ul>

<% end %>

<br />

<%= link_to 'New Contract', new_contract_path, :class => 'fine_print link' %> |
<%= link_to 'Overview', root_path, :class => 'fine_print link' %><commit_msg>string interpolation in single quotes<commit_after><h1 class='fine_print heading'>FinePrint Contracts</h1>

<% @contracts.group_by(&:name).each do |name, contracts| %>

  <ul class='fine_print'>
    <li><%= name %></li>
    
      <ul class='fine_print'>
        <% contracts.each do |contract| %>
          <li><%= link_to contract.title, contract %> 
            (<%= contract.version.nil? ? 'draft' : 'v.' + contract.version.to_s %>)
            <% if contract.can_be_updated? %>
              [<%= link_to 'Edit', edit_contract_path(contract), :class => 'fine_print link' %>]
            <% else %>
              [<%= link_to 'New version', new_version_contract_path(contract), :class => 'fine_print link' %>]
            <% end %>
            <% if contract.can_be_published? %>
              [<%= link_to 'Publish', publish_contract_path(contract), :method => :put, :data => {:confirm => 'Are you sure you want to publish this contract?'} %>]
            <% else %>
              <% if contract.can_be_unpublished? %>
                [<%= link_to 'Unpublish', unpublish_contract_path(contract), :method => :put, :data => {:confirm => 'Are you sure you want to unpublish this contract?'} %>]
              <% end %>
            <% end %>
            <% if contract.can_be_destroyed? %>
              [<%= link_to 'Delete', contract, :method => :delete, :data => {:confirm => 'Are you sure you wish to delete this contract?'}, :class => 'fine_print link' %>]
            <% end %>
          </li>
        <% end %>
      </ul>
    
  </ul>

<% end %>

<br />

<%= link_to 'New Contract', new_contract_path, :class => 'fine_print link' %> |
<%= link_to 'Overview', root_path, :class => 'fine_print link' %>
{'fraction_non_alphanumeric': 0.18028917084685747, 'fraction_numerical': 0.0011802891708468574, 'mean_word_length': 2.4876543209876543, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 101, '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': '3128648', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1014, 'n_words': 249}