<commit_before><table class="no-borders">

<% @notes.each do |note| %>  
  
  <tr>
    <td class="subheading">

       <% if !note.body.blank? %>
          <%=h note.body %>
       <% else %>
          Note
       <% end %>

    </td>

    <td width="100px">
      <% if @current_user == note.user %>
      <div id="actions"><%= link_to 'Edit', edit_note_path(note) %> |
        <%= link_to 'Remove', note, :confirm => 'Are you sure?', :method => :delete %>
      </div>
      <% end %>
    </td>

  </tr><tr>

    <td>


      <% if note.source %>
        <%= link_to note.source, note.source.location, :class => 'source-link', :target => '_blank' %>
      <% else %>
        No source.
      <% end %>

   </td>

    <td>
      <% if @current_user == note.user %>
      <div id="actions"><%= link_to 'Edit', edit_source_path(note.source) %> |
        <%= link_to 'Remove', note.source, :confirm => 'Are you sure?', :method => :delete %>
      </div>
      <% end %>
    </td>


 </tr>

 <tr>
   <td colspan = "2">
     Attached to:
      <% if note.attachedto.blank? %>
      none
      <% else %>
       <% note.attachedto.each do |goal| %>
       <%= link_to goal.name, goal_path(goal) %>&nbsp;
       <% end %>
     <% end %>
   </td>
 </tr>

  <tr>
    <td colspan="2" class="spacer"></td>
  </tr>
<commit_msg>Adding check to see if note.source exists before creating a link to edit it.<commit_after><table class="no-borders">

<% @notes.each do |note| %>  
  
  <tr>
    <td class="subheading">

       <% if !note.body.blank? %>
          <%=h note.body %>
       <% else %>
          Note
       <% end %>

    </td>

    <td width="100px">
      <% if @current_user == note.user %>
      <div id="actions"><%= link_to 'Edit', edit_note_path(note) %> |
        <%= link_to 'Remove', note, :confirm => 'Are you sure?', :method => :delete %>
      </div>
      <% end %>
    </td>

  </tr><tr>

    <td>


      <% if note.source %>
        <%= link_to note.source, note.source.location, :class => 'source-link', :target => '_blank' %>
      <% else %>
        No source.
      <% end %>

   </td>

    <td>
      <% if @current_user == note.user %>
        <% if note.source %>
        <div id="actions"><%= link_to 'Edit', edit_source_path(note.source) %> |
          <%= link_to 'Remove', note.source, :confirm => 'Are you sure?', :method => :delete %>
        </div>
        <% end %>
    <% end %>
    </td>


 </tr>

 <tr>
   <td colspan = "2">
     Attached to:
      <% if note.attachedto.blank? %>
      none
      <% else %>
       <% note.attachedto.each do |goal| %>
       <%= link_to goal.name, goal_path(goal) %>&nbsp;
       <% end %>
     <% end %>
   </td>
 </tr>

  <tr>
    <td colspan="2" class="spacer"></td>
  </tr>

{'fraction_non_alphanumeric': 0.2101238164603059, 'fraction_numerical': 0.003641660597232338, 'mean_word_length': 1.9348290598290598, 'pattern_counts': {'":': 0, '<': 101, '<?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': '963338', 'n_tokens_mistral': 1080, 'n_tokens_neox': 946, 'n_words': 220}