<commit_before>  <span class="live-notifications">
    <div class="col-sm-3">
      <%# binding.pry %>
      <% if user == current_user || user.accepted_friends.include?(current_user) %>
        <h3>Friends</h3>
        <% if user.accepted_friends.count > 0 %>
          <ul class='list-group' id="accepted-friends">
          <% user.accepted_friends.each do |friend| %>
            <p style="font-size: 20px; padding: 0;"><%= image_tag friend.image || 'placeholder-avatar.png', size: '50x50' %> <%= link_to friend.name, user_path(friend) %></p>
          <% end %>
          </ul>
        <% end %>
      <% end %>
      <h3>Favorites</h3>
      <% if user.favorited_lacquers.count > 0 %>
        <ul class="list-group fave">
        <% user.favorited_lacquers.each do |favorite| %>
          <li class="fave" style="font-size: 20px;">
            <%= link_to favorite.name, lacquer_path(favorite) %>
          </li>
        <% end %>
        </ul>
      <% end %>
    </div>
    <% if user == current_user %>
    <div class="col-sm-5">
      <!-- FRIENDSHIPS YOU NEED TO TAKE ACTION ON -->
      <% if user.friendships_for_your_approval.count > 0 %>
        <h3>Friendships Awaiting Your Approval</h3>
        <ul class="list-group">
          <% user.friendships_for_your_approval.each do |friendship| %>
            <% friend = User.find(friendship.user_id) %>
            <p class="list-group-item" style='padding: 0;'>
              <%= image_tag friend.image || 'placeholder-avatar.png', size: '30x30' %>
              <%= link_to friend.name, user_path(friend) %> 
              <%= link_to "Accept", friendship_path(friendship, :state => 'accepted'), {:method => "PATCH", :class => "btn btn-success btn-xs pull-right", :style => "margin:3px 3px 0 0;"} %> <%= link_to "Reject", friendship_path(friendship, :state => 'rejected'), {:method => "PATCH", :class =>"btn btn-danger btn-xs pull-right", :style => "margin:3px 3px 0 0;"} %>
            </p>
          <% end %>
        </ul>
      <% end %>
      <!-- END OF FRIENDSHIPS YOU NEED TO TAKE ACTION ON -->

      <!-- FRIENDSHIPS YOU'VE REQUESTED NOT YET APPROVED -->
      <% if user.requested_friends_awaiting_approval.count > 0 %>
        <h3>Your Pending Friend Requests</h3>
        <ul class="list-group">
          <% user.requested_friends_awaiting_approval.each do |friend| %>
            <% friendship = Friendship.where(user_id: user.id, friend_id: friend.id).first %>
            <p class="list-group-item" style='padding: 0;'>
            <%= image_tag friend.image || 'placeholder-avatar.png', size: '30x30' %>
            <%= link_to friend.name, user_path(friend) %>
            <%= link_to 'cancel', friendship_path(friendship), method: 'DELETE', class: "btn btn-default btn-xs pull-right", style:"margin:3px 3px 0 0;", data: { confirm: "Are you sure you want to cancel this friend request?" } %>
            </p>
          <% end %>
        </ul>
      <% end %>
      <!-- END OF FRIENDSHIPS YOU'VE REQUESTED NOT YET APPROVED -->

      <!-- RECTED FRIENDSHIPS YOU'VE REQUESTED -->
      <% if user.rejected_friend_requests.count > 0 %>
        <h3>Sorry, these friend requests were not approved.</h3>
        <ul class="list-group">
          <% user.rejected_friend_requests.each do |friendship| %>
            <% friend = User.find(friendship.friend_id) %>
            <p class="list-group-item" style='padding: 0;'>
            <%= image_tag friend.image || 'placeholder-avatar.png', size: '30x30' %>
            <%= link_to friend.name, user_path(friend) %>
            <%= link_to "conclude this request", friendship_path(friendship, :state => 'concluded'), {:method => "PATCH", class: "btn btn-default btn-xs pull-right", style:"margin:3px 3px 0 0;"} %>
            </p>
          <% end %>
        </ul>
      <% end %>
      <!-- END OF RECTED FRIENDSHIPS YOU'VE REQUESTED -->

      <!-- TRANSACTIONS YOU OWN -->
      <% if user.owned_transactions.count > 0 %>

        <!-- TRANSACTIONS AWAITING YOUR APPROVAL -->
        <% if user.transactions_for_your_approval.count > 0 %>
          <h3>Transactions Awaiting Your Approval</h3>
          <ul>
          <% user.transactions_for_your_approval.each do |transaction| %>
            <% friend = User.find(transaction.requester_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'><%= link_to friend.name, user_path(friend) %> has asked to borrow <%= lacquer.name %>.</br> <%= link_to "Accept Request", transaction_path(transaction, :state => 'accepted'), {:method => "PATCH", :class =>"btn btn-success btn-xs"} %> <%= link_to "Reject Request", transaction_path(transaction, :state => 'rejected'), {:method => "PATCH", :class =>"btn btn-danger btn-xs"} %></li>
          <% end %>
          </ul>
        <% end %>
        <!-- END OF TRANSACTIONS AWAITING YOUR APPROVAL -->

        <!-- TRANSACTIONS YOU'VE ACCEPTED BUT NOT GIVEN OUT YET -->
        <% if user.transactions_you_accepted.count > 0 %>
          <h3>Transactions You Accepted</h3>
          <ul>
          <% user.transactions_you_accepted.each do |transaction| %>
            <% friend = User.find(transaction.requester_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'>
              You've agreed to loan <%= lacquer.name %> out to <%= link_to friend.name, user_path(friend) %>.<br> <%= link_to "I gave #{lacquer.name} to #{friend.name}", transaction_path(transaction, :state => 'active', :date_became_active => Date.today), {:method => "PATCH", :class =>"btn btn-info btn-xs"} %>
            </li>
            <%= form_for transaction do |f| %>
              <%= f.label :due_date, "Add or Update Due Date" %>
              <%= f.date_field :due_date %>
              <%= f.submit :class =>"btn btn-info btn-xs" %>
            <% end %> 
          <% end %>
          </ul>
        <% end %>
        <!-- END OF TRANSACTIONS YOU'VE ACCEPTED BUT NOT GIVEN OUT YET -->

        <!-- CURRENTLY LOANED OUT -->
        <% if user.active_owned_transactions.count > 0 %>
          <h3>Lacquers Currenly on Loan</h3>
          <ul>
          <% user.active_owned_transactions.each do |transaction| %>
            <% friend = User.find(transaction.requester_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'>
              Your <%= lacquer.name %> is currently loaned out to <%= link_to friend.name, user_path(friend) %>.<br> <%= link_to "#{friend.name} gave #{lacquer.name} back", transaction_path(transaction, :state => 'completed'), {:method => "PATCH", :class =>"btn btn-info btn-xs"} %>
            </li>
            <%= form_for transaction do |f| %>
              <%= f.label :due_date, "Add or Update Due Date" %>
              <%= f.date_field :due_date %>
              <%= f.submit :class =>"btn btn-info btn-xs" %>
            <% end %> 
          <% end %>
          </ul>
        <% end %>
        <!-- END OF CURRENTLY LOANED OUT -->
      <% end %>
      <!-- END OF TRANSACTIONS YOU OWN -->

      <!-- TRANSACTIONS YOU'VE REQUESTED -->
      <% if user.requested_transactions.count > 0 %>
      
        <!-- CURRENTLY LOANED OUT TO YOU -->
        <% if user.active_requested_transactions.count > 0 %>
          <h3>Lacquers Currently Loaned Out to You</h3>
          <ul>
            <% user.active_requested_transactions.each do |transaction| %>
              <% friend = User.find(transaction.owner_id) %>
              <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
              <li style='padding-top: 15px;'>
                <%= link_to friend.name, user_path(friend) %> gave you <%= lacquer.name %> on <%= transaction.date_became_active.strftime("%m/%d/%Y") %>.
                <% if transaction.due_date %>
                  <% if transaction.overdue? %>
                    <div class="alert alert-danger" role="alert" style="padding: 2px;">
                    You're <%= pluralize(transaction.days_overdue, 'day') %> overdue to return this lacquer. Don't mess with karma - give it back!
                    </div>
                  <% elsif transaction.due_today? %>
                  <div class="alert alert-dismissable alert-warning" style="padding: 2px;">
              
                    Remember to give this lacquer back <strong>today</strong>!
                  </div>
                  <% elsif transaction.due_tomorrow? %>
                  <div class="alert alert-dismissable alert-success" style="padding: 2px;">
                    Remember to give this lacquer back <strong>tomorrow</strong>!
                  </div>
                  <% else %>
                    The return date for this loan is <%= transaction.due_date.strftime("%m/%d/%Y") %>.
                  <% end %>
                <% end %>
              </li>
            <% end %>
          </ul>
        <% end %>
        <!-- END OF CURRENTLY LOANED OUT TO YOU -->

        <!-- LOANS REQUESTED ACCEPTED NOT ACTIVE YET -->
        <% if user.accepted_requested_transactions.count > 0 %>
          <h3>Accepted Loan Requests</h3>
          <ul>
          <% user.accepted_requested_transactions.each do |transaction| %>
            <% friend = User.find(transaction.owner_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'><%= link_to friend.name, user_path(friend) %> has agreed to loan you <%= lacquer.name %>.</li>
          <% end %>
          </ul>
        <% end %>
        <!-- END LOANS REQUESTED ACCEPTED NOT ACTIVE YET -->

        <!-- LOANS REQUESTED PENDING -->
        <% if user.pending_requested_transactions.count > 0 %>
          <h3>Pending Loan Requests</h3>
          <ul>
          <% user.pending_requested_transactions.each do |transaction| %>
            <% friend = User.find(transaction.owner_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'>You've asked <%= link_to friend.name, user_path(friend) %> to loan you <%= lacquer.name %></li>
          <% end %>
          </ul>
        <% end %>
        <!-- END LOANS REQUESTED PENDING -->

        <!-- LOAN REQUESTS REJECTED -->
        <% if user.rejected_requested_transactions.count > 0 %>
          <h3>Pending Loan Requests</h3>
          <ul>
          <% user.rejected_requested_transactions.each do |transaction| %>
            <% friend = User.find(transaction.owner_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'>It seems <%= link_to friend.name, user_path(friend) %> isn't able to loan you <%= lacquer.name %> at this time.</li>
            <%= link_to "conclude this request", transaction_path(transaction, :state => 'completed'), {:method => "PATCH", :class =>"btn btn-warning btn-xs"} %>
          <% end %>
          </ul>
        <% end %>
        <!-- END LOAN REQUESTS REJECTED -->

      <% end %>
      <!-- END OF TRANSACTIONS YOU'VE REQUESTED -->
    
    </div>
    <% end %>
  </span>
<commit_msg>more tweaks<commit_after>  <span class="live-notifications">
    <div class="col-sm-3">
      <%# binding.pry %>
      <% if user == current_user || user.accepted_friends.include?(current_user) %>
        <h3>Friends</h3>
        <% if user.accepted_friends.count > 0 %>
          <ul class='list-group' id="accepted-friends">
          <% user.accepted_friends.each do |friend| %>
            <p style="font-size: 20px; padding: 0;"><%= image_tag friend.image || 'placeholder-avatar.png', size: '50x50' %> <%= link_to friend.name, user_path(friend) %></p>
          <% end %>
          </ul>
        <% end %>
      <% end %>
      <h3>Favorites</h3>
      <% if user.favorited_lacquers.count > 0 %>
        <ul class="list-group fave">
        <% user.favorited_lacquers.each do |favorite| %>
          <li class="fave" style="font-size: 20px;">
            <%= link_to favorite.name, lacquer_path(favorite) %>
          </li>
        <% end %>
        </ul>
      <% end %>
    </div>
    <% if user == current_user %>
    <div class="col-sm-5">
      <!-- FRIENDSHIPS YOU NEED TO TAKE ACTION ON -->
      <% if user.friendships_for_your_approval.count > 0 %>
        <h3>Friendships Awaiting Your Approval</h3>
        <ul class="list-group">
          <% user.friendships_for_your_approval.each do |friendship| %>
            <% friend = User.find(friendship.user_id) %>
            <p class="list-group-item" style='padding: 0;'>
              <%= image_tag friend.image || 'placeholder-avatar.png', size: '30x30' %>
              <%= link_to friend.name, user_path(friend) %> 
              <%= link_to "Accept", friendship_path(friendship, :state => 'accepted'), {:method => "PATCH", :class => "btn btn-success btn-xs pull-right", :style => "margin:3px 3px 0 0;"} %> <%= link_to "Reject", friendship_path(friendship, :state => 'rejected'), {:method => "PATCH", :class =>"btn btn-danger btn-xs pull-right", :style => "margin:3px 3px 0 0;"} %>
            </p>
          <% end %>
        </ul>
      <% end %>
      <!-- END OF FRIENDSHIPS YOU NEED TO TAKE ACTION ON -->

      <!-- FRIENDSHIPS YOU'VE REQUESTED NOT YET APPROVED -->
      <% if user.requested_friends_awaiting_approval.count > 0 %>
        <h3>Your Pending Friend Requests</h3>
        <ul class="list-group">
          <% user.requested_friends_awaiting_approval.each do |friend| %>
            <% friendship = Friendship.where(user_id: user.id, friend_id: friend.id).first %>
            <p class="list-group-item" style='padding: 0;'>
            <%= image_tag friend.image || 'placeholder-avatar.png', size: '30x30' %>
            <%= link_to friend.name, user_path(friend) %>
            <%= link_to 'cancel', friendship_path(friendship), method: 'DELETE', class: "btn btn-default btn-xs pull-right", style:"margin:3px 3px 0 0;", data: { confirm: "Are you sure you want to cancel this friend request?" } %>
            </p>
          <% end %>
        </ul>
      <% end %>
      <!-- END OF FRIENDSHIPS YOU'VE REQUESTED NOT YET APPROVED -->

      <!-- RECTED FRIENDSHIPS YOU'VE REQUESTED -->
      <% if user.rejected_friend_requests.count > 0 %>
        <h3>Sorry, these friend requests were not approved.</h3>
        <ul class="list-group">
          <% user.rejected_friend_requests.each do |friendship| %>
            <% friend = User.find(friendship.friend_id) %>
            <p class="list-group-item" style='padding: 0;'>
            <%= image_tag friend.image || 'placeholder-avatar.png', size: '30x30' %>
            <%= link_to friend.name, user_path(friend) %>
            <%= link_to "conclude this request", friendship_path(friendship, :state => 'concluded'), {:method => "PATCH", class: "btn btn-default btn-xs pull-right", style:"margin:3px 3px 0 0;"} %>
            </p>
          <% end %>
        </ul>
      <% end %>
      <!-- END OF RECTED FRIENDSHIPS YOU'VE REQUESTED -->

      <!-- TRANSACTIONS YOU OWN -->
      <% if user.owned_transactions.count > 0 %>

        <!-- TRANSACTIONS AWAITING YOUR APPROVAL -->
        <% if user.transactions_for_your_approval.count > 0 %>
          <h3>Transactions Awaiting Your Approval</h3>
          <ul>
          <% user.transactions_for_your_approval.each do |transaction| %>
            <% friend = User.find(transaction.requester_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'><%= link_to friend.name, user_path(friend) %> has asked to borrow <%= lacquer.name %>.</br> <%= link_to "Accept Request", transaction_path(transaction, :state => 'accepted'), {:method => "PATCH", :class =>"btn btn-success btn-xs"} %> <%= link_to "Reject Request", transaction_path(transaction, :state => 'rejected'), {:method => "PATCH", :class =>"btn btn-danger btn-xs"} %></li>
          <% end %>
          </ul>
        <% end %>
        <!-- END OF TRANSACTIONS AWAITING YOUR APPROVAL -->

        <!-- TRANSACTIONS YOU'VE ACCEPTED BUT NOT GIVEN OUT YET -->
        <% if user.transactions_you_accepted.count > 0 %>
          <h3>Transactions You Accepted</h3>
          <ul>
          <% user.transactions_you_accepted.each do |transaction| %>
            <% friend = User.find(transaction.requester_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'>
              You've agreed to loan <%= lacquer.name %> out to <%= link_to friend.name, user_path(friend) %>.<br> <%= link_to "I gave #{lacquer.name} to #{friend.name}", transaction_path(transaction, :state => 'active', :date_became_active => Date.today), {:method => "PATCH", :class =>"btn btn-info btn-xs"} %>
            </li>
            <%= form_for transaction do |f| %>
              <%= f.label :due_date, "Add or Update Due Date" %>
              <%= f.date_field :due_date %>
              <%= f.submit :class =>"btn btn-info btn-xs" %>
            <% end %> 
          <% end %>
          </ul>
        <% end %>
        <!-- END OF TRANSACTIONS YOU'VE ACCEPTED BUT NOT GIVEN OUT YET -->

        <!-- CURRENTLY LOANED OUT -->
        <% if user.active_owned_transactions.count > 0 %>
          <h3>Lacquers Currenly on Loan</h3>
          <ul>
          <% user.active_owned_transactions.each do |transaction| %>
            <% friend = User.find(transaction.requester_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'>
              Your <%= lacquer.name %> is currently loaned out to <%= link_to friend.name, user_path(friend) %>.<br> <%= link_to "#{friend.name} gave #{lacquer.name} back", transaction_path(transaction, :state => 'completed'), {:method => "PATCH", :class =>"btn btn-info btn-xs"} %>
            </li>
            <%= form_for transaction do |f| %>
              <%= f.label :due_date, "Add or Update Due Date" %>
              <%= f.date_field :due_date %>
              <%= f.submit :class =>"btn btn-info btn-xs" %>
            <% end %> 
          <% end %>
          </ul>
        <% end %>
        <!-- END OF CURRENTLY LOANED OUT -->
      <% end %>
      <!-- END OF TRANSACTIONS YOU OWN -->

      <!-- TRANSACTIONS YOU'VE REQUESTED -->
      <% if user.requested_transactions.count > 0 %>
      
        <!-- CURRENTLY LOANED OUT TO YOU -->
        <% if user.active_requested_transactions.count > 0 %>
          <h3>Lacquers Currently Loaned Out to You</h3>
          <ul>
            <% user.active_requested_transactions.each do |transaction| %>
              <% friend = User.find(transaction.owner_id) %>
              <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
              <li style='padding-top: 15px;'>
                <%= link_to friend.name, user_path(friend) %> gave you <%= lacquer.name %> on <%= transaction.date_became_active.strftime("%m/%d/%Y") %>.
                <% if transaction.due_date %>
                  <% if transaction.overdue? %>
                    <div class="alert alert-danger" role="alert" style="padding: 2px;">
                    You're <%= pluralize(transaction.days_overdue, 'day') %> overdue to return this lacquer. Don't mess with karma - give it back!
                    </div>
                  <% elsif transaction.due_today? %>
                  <div class="alert alert-dismissable alert-warning" style="padding: 2px;">
              
                    Remember to give this lacquer back <strong>today</strong>!
                  </div>
                  <% elsif transaction.due_tomorrow? %>
                  <div class="alert alert-dismissable alert-success" style="padding: 2px;">
                    Remember to give this lacquer back <strong>tomorrow</strong>!
                  </div>
                  <% else %>
                    The return date for this loan is <%= transaction.due_date.strftime("%m/%d/%Y") %>.
                  <% end %>
                <% end %>
              </li>
            <% end %>
          </ul>
        <% end %>
        <!-- END OF CURRENTLY LOANED OUT TO YOU -->

        <!-- LOANS REQUESTED ACCEPTED NOT ACTIVE YET -->
        <% if user.accepted_requested_transactions.count > 0 %>
          <h3>Accepted Loan Requests</h3>
          <ul>
          <% user.accepted_requested_transactions.each do |transaction| %>
            <% friend = User.find(transaction.owner_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'><%= link_to friend.name, user_path(friend) %> has agreed to loan you <%= lacquer.name %>.</li>
          <% end %>
          </ul>
        <% end %>
        <!-- END LOANS REQUESTED ACCEPTED NOT ACTIVE YET -->

        <!-- LOANS REQUESTED PENDING -->
        <% if user.pending_requested_transactions.count > 0 %>
          <h3>Pending Loan Requests</h3>
          <ul class="list-group">
          <% user.pending_requested_transactions.each do |transaction| %>
            <% friend = User.find(transaction.owner_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <p class="list-group-item" style='padding:0 0 0 5px ;'>You've asked <%= link_to friend.name, user_path(friend) %> to loan you <%= link_to lacquer.name, lacquer_path(lacquer) %></p>
          <% end %>
          </ul>
        <% end %>
        <!-- END LOANS REQUESTED PENDING -->

        <!-- LOAN REQUESTS REJECTED -->
        <% if user.rejected_requested_transactions.count > 0 %>
          <h3>Pending Loan Requests</h3>
          <ul>
          <% user.rejected_requested_transactions.each do |transaction| %>
            <% friend = User.find(transaction.owner_id) %>
            <% lacquer = Lacquer.find(transaction.user_lacquer.lacquer_id) %>
            <li style='padding-top: 15px;'>It seems <%= link_to friend.name, user_path(friend) %> isn't able to loan you <%= lacquer.name %> at this time.</li>
            <%= link_to "conclude this request", transaction_path(transaction, :state => 'completed'), {:method => "PATCH", :class =>"btn btn-warning btn-xs"} %>
          <% end %>
          </ul>
        <% end %>
        <!-- END LOAN REQUESTS REJECTED -->

      <% end %>
      <!-- END OF TRANSACTIONS YOU'VE REQUESTED -->
    
    </div>
    <% end %>
  </span>

{'fraction_non_alphanumeric': 0.15973118518848192, 'fraction_numerical': 0.008723129645289065, 'mean_word_length': 2.131707317073171, 'pattern_counts': {'":': 0, '<': 485, '<?xml version=': 0, '>': 569, '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': '7477066', 'n_tokens_mistral': 7621, 'n_tokens_neox': 6740, 'n_words': 1560}