<commit_before><div id="analysis" class="pill-pane active">
  <div class="row">
    <% 2.times do |i| %>
      <div class="dashboard-6 <%= i == 0 ? "dashboard-left" : "dashboard-right" %> col-md-6 without-heading">
        <div class="row">
          <div class="col-md-12 button-margin-bottom">
            <a class="btn record-selector dropdown btn-primary glyphicon glyphicon-chevron-down" href="#" data-toggle="dropdown"></a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
              <% @repository.snapshots.last.best_records(@metric).each do |document| %>
                <%= record_selector_entry(@documents[i], document) %>
              <% end %>
            </ul>
            <a class="btn record-selector dropdown btn-default glyphicon glyphicon-search" href="<%= "#search-modal-#{i}" %>" data-toggle="modal"></a>
            <div class="modal fade" id="<%= "search-modal-#{i}" %>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">Record Search</h4>
                  </div>
                  <div class="modal-body">
                    <div class="row">
                      <div class="col-md-12">
                        <input id="<%= "record-search-input-#{i}" %>" class="form-control" type="text" placeholder="Search..."></input>
                      </div>
                    </div>
                    <div class="row">
                      <div id="<%= "record-search-results-#{i}" %>" class="col-md-12" data-document="<%= @documents[i][:id] %>">
                        <!-- The list class is used to make List.js working -->
                        <table data-provides="rowlink" class="table metric record-results">
                          <thead>
                            <tr>
                              <th class="name">Name</th>
                              <th class="score">Score</th>
                            </tr>
                          </thead>
                          <tbody class="list">
                            <tr>
                              <td class="name"></td>
                              <td class="score"></td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </div>
                  </div>
                  <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                  </div>
                </div> <!-- /.modal-content -->
              </div> <!-- /.modal-dialog -->
            </div> <!-- /.modal -->
          </div>
        </div>
        <div class="row">
          <div class="col-md-12">
            <table class="metric record-info table table-bordered">
              <tr>
                <th>ID</th>
                <td><%= @documents[i].record['id'] %></td>
              </tr>
              <tr>
                <th>Name</th>
                <td><%= @documents[i].record['name'] %></td>
              </tr>
            </table>
          </div>
        </div>
        <div class="row">
          <div class="col-md-12">
            <table class="metric table table-bordered table-striped">
              <tbody>
                <% analysis = @documents[i].send(@metric).maybe['analysis'].to_a %>
                <% analysis.each do |item| %>
                  <% item = item.with_indifferent_access %>
                  <tr>
                    <th><%= item['field'].to_s.gsub(/[:,\[\]]/,'').titlecase %></th>
                    <th><%= item['score'] %></th>
                  </tr>
                  <tr>
                    <%= content_tag(:td, Metrics::Metric.value(@documents[i].record, item['field']).join(','), colspan: '2')%>
                  </tr>
                <% end %>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    <% end %>
  </div>
</div>
<div id="statistics" class="pill-pane fade">
  <div class="row">
    <div class="col-md-6 dashboard-6 dashboard-left">
      <h3 class="statistic-heading">Score Distribution</h3>
      <div id="pie-chart"></div>
    </div>
    <div class="col-md-6 dashboard-6 dashboard-right">
      <h3 class="statistic-heading">Group Distribution</h3>
      <div id="bar-chart"></div>
    </div>
  </div>
</div><commit_msg>Update generic view to new design<commit_after><div id="analysis" class="pill-pane active">
  <div class="row">
    <% 2.times do |i| %>
      <% side = ["dashboard-left", "dashboard-right"][i] %>
      <%= content_tag(:div, class: "dashboard-6 #{side} col-md-6 without-heading") do %>
        <h3>Record Selection</h3>
        <h4>Select a metadata record to compare with</h4>
        <%= render partial: 'shared/metadata_record_selector', locals: { i: i } %>
        <h3>Analysis</h3>
        <h4>Inspect the differences</h4>
        <div class="row">
          <div class="col-md-12">
            <table class="metric table table-bordered table-striped">
              <tbody>
                <% analysis = @documents[i].send(@metric.id).maybe['analysis'].to_a %>
                <% analysis.each do |item| %>
                  <% item = item.with_indifferent_access %>
                  <tr>
                    <th><%= item['field'].to_s.gsub(/[:,\[\]]/,'').titlecase %></th>
                    <th><%= item['score'] %></th>
                  </tr>
                  <tr>
                    <%= content_tag(:td, Metrics::Metric.value(@documents[i].record, item['field']), colspan: '2')%>
                  </tr>
                <% end %>
              </tbody>
            </table>
          </div>
        </div>
      <% end %>
    <% end %>
  </div>
</div>
<div id="statistics" class="pill-pane fade">
  <div class="dashboard col-md-12 info alert-info error-page">
    <h3><span class="glyphicon glyphicon-warning-sign"></span> No statistics for this metric</h3>
  </div>
</div>
{'fraction_non_alphanumeric': 0.1816867469879518, 'fraction_numerical': 0.007068273092369478, 'mean_word_length': 1.469654898849663, 'pattern_counts': {'":': 0, '<': 188, '<?xml version=': 0, '>': 188, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5553537', 'n_tokens_mistral': 1874, 'n_tokens_neox': 1738, 'n_words': 345}