<commit_before>%h1= @discussion.display_title

- if @discussion.proposal
  %div
  - if can? :read, @discussion.proposal
    This discussion has an associated proposal. #{link_to "View Proposal Details here", proposal_path(@discussion.proposal)}.
  - elsif @discussion.proposal.status = "Submitted"
    This discussion has an associated proposal but it has not been approved yet.
- if can? :close, @discussion
  .admin_action
    = link_to "Close this discussion", close_discussion_path(@discussion), method: :put, data: { confirm: "This will prevent future comments and proposals based on this discussion. Continue?" }
%hr

%h3 Comments about this discussion:
= render partial: "start_of_discussion", locals: { discussion: @discussion }

- @discussion.comments.each do |comment|
  = render :partial => "/comments/show", :object => comment
- if can? :create, @comment
  = render :partial => "/comments/form", :object => @comment

-# only show the "create proposal" to admins and the original owner
- if !@discussion.proposal && (current_user.is_committee_admin(@discussion.committee) || @discussion.owner == current_user)
  - if can? :create_proposal, @discussion.committee
    .admin_action
      Is this discussion ready to be made into a proposal?
      = link_to "Create a proposal from this discussion", "#", class: "js--toggle", id: "create_proposal_from_discussion", data: { toggle: ".proposal_new" }<commit_msg>fix partial error when submitting empty comment<commit_after>%h1= @discussion.display_title

- if @discussion.proposal
  %div
  - if can? :read, @discussion.proposal
    This discussion has an associated proposal. #{link_to "View Proposal Details here", proposal_path(@discussion.proposal)}.
  - elsif @discussion.proposal.status = "Submitted"
    This discussion has an associated proposal but it has not been approved yet.
- if can? :close, @discussion
  .admin_action
    = link_to "Close this discussion", close_discussion_path(@discussion), method: :put, data: { confirm: "This will prevent future comments and proposals based on this discussion. Continue?" }
%hr

%h3 Comments about this discussion:
= render partial: "/discussions/start_of_discussion", locals: { discussion: @discussion }

- @discussion.comments.each do |comment|
  = render :partial => "/comments/show", :object => comment
- if can? :create, @comment
  = render :partial => "/comments/form", :object => @comment

-# only show the "create proposal" to admins and the original owner
- if !@discussion.proposal && (current_user.is_committee_admin(@discussion.committee) || @discussion.owner == current_user)
  - if can? :create_proposal, @discussion.committee
    .admin_action
      Is this discussion ready to be made into a proposal?
      = link_to "Create a proposal from this discussion", "#", class: "js--toggle", id: "create_proposal_from_discussion", data: { toggle: ".proposal_new" }
{'fraction_non_alphanumeric': 0.11654526534859522, 'fraction_numerical': 0.001387443635102324, 'mean_word_length': 4.756487025948104, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1867275', 'n_tokens_mistral': 836, 'n_tokens_neox': 795, 'n_words': 280}