<commit_before><% title "#{@data_object.name}" %>
<h4 id="subtitle"><%= link_to_if current_user.is_admin_of?(current_department),  @data_object.data_type.name, @data_object.data_type %></h4>
<div style="width:25%; float:left">
  <p>
    <strong>Description:</strong>
    <%=h @data_object.description %>
  </p>
  <p>
    <strong>Locations:</strong>
    <%=h @data_object.locations.map{|l| l.short_name}.join(', ') %>
  </p>
  <% if current_user.is_admin_of?(current_department) %>
    <p><%= link_to "Edit data object", edit_data_object_path(@data_object) %><br/>
    <%= link_to "Destroy", @data_object,
    :confirm => 'Are you sure? This will destroy all data entries belonging to this object.',
    :method => :delete %><br/>
  <% end %>
  <%= link_to "View all data objects", data_objects_path %></p>
</div>
<div style="width:75%; float:left">
  <% unless @data_entries.empty? %>

    <%= form_tag data_object_path(@data_object), :method => :get %>
      Viewing
      <%= select_date(@data_entries.last.created_at, :prefix => 'start') %>
      to
      <%= select_date(@data_entries.first.created_at, :prefix => 'end') %>
    <%= submit_tag 'Select Dates' %><br/>


    <p>
      <strong>Data entries for this object:</strong><br/>
      <br/>
      <table>
        <%# this requires some rewriting, since data fields may change over time %>
        <thead>
          <tr>
            <th>Time</th>
            <% @data_fields.each do |df| %>
              <th><%= df.name %></th>
            <% end %>
          </tr>
        </thead>
        <tbody>
          <%= render(:partial => "data_entries/data_entry_row",
                     :collection => @data_entries,
                     :locals => {:data_fields => @data_fields}) %>
        </tbody>
      </table>
      <br>
      <%# TODO: this should be removed or improved, it is commented out for now -ben %>
      <%#= link_to "Add new data entry", new_data_object_data_entry_path(@data_object) %>
    </p>

  <% else %>
    There are no data entries to view.
  <% end %>
</div>

<commit_msg>Worked on making data objects show page more user friendly<commit_after><% title "#{@data_object.name}" %>
<h3 id="subtitle"><%= link_to_if current_user.is_admin_of?(current_department),  @data_object.data_type.name, @data_object.data_type %></h3>
  <p>
    <strong>Description:</strong>
    <%=h @data_object.description %> <br />
    <strong>Locations:</strong>
    <%=h @data_object.locations.map{|l| l.short_name}.join(', ') %>


  <% unless @data_entries.empty? %>

    <%= form_tag data_object_path(@data_object), :method => :get %>
      Viewing
      <%= select_date(@data_entries.last.created_at, :prefix => 'start') %>
      to
      <%= select_date(@data_entries.first.created_at, :prefix => 'end') %>
    <%= submit_tag 'Select Dates' %><br/><br />


    <p>
      <strong>Data entries for this object:</strong>
      <table class = "tablesorter">
        <%# this requires some rewriting, since data fields may change over time %>
        <thead>
          <tr>
            <th>Time</th>
            <% @data_fields.each do |df| %>
              <th><%= df.name %></th>
            <% end %>
          </tr>
        </thead>
        <tbody>
          <%= render(:partial => "data_entries/data_entry_row",
                     :collection => @data_entries,
                     :locals => {:data_fields => @data_fields}) %>
        </tbody>
      </table>
      <br>
    </p>

  <% else %>
    There are no data entries to view.
  <% end %>

  <% if current_user.is_admin_of?(current_department) %>
    <p><%= link_to "Edit", edit_data_object_path(@data_object) %> | 
    <%= link_to "Destroy", @data_object,
    :confirm => 'Are you sure? This will destroy all data entries belonging to this object.',
    :method => :delete %> | 
  <% end %>
  <%= link_to "View all data objects", data_objects_path %></p>


{'fraction_non_alphanumeric': 0.17518059855521156, 'fraction_numerical': 0.0020639834881320948, 'mean_word_length': 2.685361216730038, 'pattern_counts': {'":': 0, '<': 114, '<?xml version=': 0, '>': 132, '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': '6628811', 'n_tokens_mistral': 1364, 'n_tokens_neox': 1257, 'n_words': 288}