<commit_before><% content_for :head do %>
  <%= javascript_include_tag "collections/collection_model" %>
  <%= javascript_include_tag "collections/collection_show" %>
<% end %>

<div class="custcontainer" data-collection="<%= @collection.id %>">
  <u><h1><%= @collection.name %></h1></u>
  <% if current_user && current_user.id == @collection.user_id %>
    <div class="custbtn-container">
      <%= button_to "Add a Book", new_collection_book_path(@collection.id), method: "get", class: "btn btn-block" %>
    </div>
  <% end %><br>

  <div class="custlist" id="collection-books-show">
  </div><br><br>

  <div class="comment-list" id="user-comments">
    <% if current_user %>
      <%= render "comment_form" %>
    <% else %>
      <h5><%= link_to "Please log in to leave a comment.", new_user_session_path %></h5>
    <% end %><br>

    <u><strong><h4>Comments</h4></strong></u><br>

    <% if @collection.comments.empty? %>
      <h5>Be the first to comment!</h5>
    <% else %>
      <% @collection.comments.each do |comment| %>
        <p><%= comment.content %></p>
        Posted by: <%= comment.user.username %>

        <% if current_user && comment.user_id == current_user.id %>
          (<%= link_to "edit", {controller: "comments", action: "edit", id: comment.id}, method: "get" %>, <%= link_to "delete", {controller: "comments", action: "destroy", id: comment.id}, method: "delete" %>)
        <% end %><br><br>
      <% end %>
    <% end %>
  </div>
</div>

<div class="custbtn-container">
  <% if current_user && current_user.id == @collection.user_id %>
    <%= button_to "Edit Collection", edit_collection_path(@collection.id, @collection), method: "get", class: "btn btn-block" %>
    <%= button_to "Delete Collection", {controller: "collections", action: "destroy", id: @collection.id}, method: "delete", class: "btn btn-block" %>
  <% end %>
  <% if current_user.nil? %>
    <%= button_to "Back", collections_path, method: "get", class: "btn btn-block" %>
  <% else %>
    <%= button_to "Back", user_collections_path(current_user.id), method: "get", class: "btn btn-block" %>
  <% end %>
</div>
<commit_msg>Add comment id to link created by rails helper<commit_after><% content_for :head do %>
  <%= javascript_include_tag "collections/collection_model" %>
  <%= javascript_include_tag "collections/collection_show" %>
<% end %>

<div class="custcontainer" data-collection="<%= @collection.id %>">
  <u><h1><%= @collection.name %></h1></u>
  <% if current_user && current_user.id == @collection.user_id %>
    <div class="custbtn-container">
      <%= button_to "Add a Book", new_collection_book_path(@collection.id), method: "get", class: "btn btn-block" %>
    </div>
  <% end %><br>

  <div class="custlist" id="collection-books-show">
  </div><br><br>

  <div class="comment-list" id="user-comments">
    <% if current_user %>
      <%= render "comment_form" %>
    <% else %>
      <h5><%= link_to "Please log in to leave a comment.", new_user_session_path %></h5>
    <% end %><br>

    <u><strong><h4>Comments</h4></strong></u><br>

    <% if @collection.comments.empty? %>
      <h5>Be the first to comment!</h5>
    <% else %>
      <% @collection.comments.each do |comment| %>
      <div id="comment-<%= comment.id %>">
        <p><%= comment.content %></p>
        Posted by: <%= comment.user.username %>

        <% if current_user && comment.user_id == current_user.id %>
          (<%= link_to "edit", {controller: "comments", action: "edit", id: comment.id}, method: "get" %>, <%= link_to "delete", {controller: "comments", action: "destroy", id: comment.id}, class: "delete-comments", id: "comment-" + comment.id.to_s, method: "delete" %>)
        <% end %>
        <br><br>
      </div>
      <% end %>
    <% end %>
  </div>
</div>

<div class="custbtn-container">
  <% if current_user && current_user.id == @collection.user_id %>
    <%= button_to "Edit Collection", edit_collection_path(@collection.id, @collection), method: "get", class: "btn btn-block" %>
    <%= button_to "Delete Collection", {controller: "collections", action: "destroy", id: @collection.id}, method: "delete", class: "btn btn-block" %>
  <% end %>
  <% if current_user.nil? %>
    <%= button_to "Back", collections_path, method: "get", class: "btn btn-block" %>
  <% else %>
    <%= button_to "Back", user_collections_path(current_user.id), method: "get", class: "btn btn-block" %>
  <% end %>
</div>

{'fraction_non_alphanumeric': 0.20742753623188406, 'fraction_numerical': 0.0036231884057971015, 'mean_word_length': 3.7803030303030303, 'pattern_counts': {'":': 0, '<': 140, '<?xml version=': 0, '>': 140, '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': '109817', 'n_tokens_mistral': 1613, 'n_tokens_neox': 1463, 'n_words': 337}