<commit_before><% content_for :javascript do  %>
  $(".message_link").attr('href', '#');
  $(".message_link").livequery('click', function() {
    $(this).parents(".message_div").find("div.message_content").toggle();
		if ($(this).parents(".message_div").hasClass("highlight")){
		  var route = "/users/<%=params[:user_id]%>/messages/" + $(this).parents(".message_div").attr("id")
		  $.post(route, { _method: "put", authenticity_token: "<%=form_authenticity_token()%>", 'private_message[checked]': "true" },  function(data){eval(data);});
	  }
  }); 
<%end%>

<% content_for :sidebar do  %>
  <%if params[:reply_to] %>
	  <%= render :partial => "reply_private_message", :locals => { :previous_message =>  PrivateMessage.find(params[:reply_to])}%>
	<%else%>
    <%= render :partial => "new_private_message", :locals => { :checked_users =>  Array.new}%>
	<%end%>
<%end%>

<%=link_to_if params[:sent_messages], "Incoming Messages" ,user_messages_path(params[:user_id])  %> | 
<%=link_to_unless params[:sent_messages], "Sent Messages" ,user_messages_path(params[:user_id],:sent_messages => true)  %>
<br/><br/>

<%if @private_messages.blank?%>
  There is not privates messages
<%else%>

	<% for private_message in @private_messages %>
	  <div <%if !params[:sent_messages] && !private_message.checked%>class="message_div highlight"<%else%>class="message_div"<%end%> id="<%=private_message.id%>">
		  <div class="message_header">
		    <%=link_to sanitize(private_message.title), user_message_path(params[:user_id], private_message), :class => "message_link"%>
		    <% if params[:sent_messages] %>
				  Sent to <%= link_logotype(User.find(private_message.receiver_id))%> <%=time_ago_in_words(private_message.created_at)%> ago 
			  <% else%>
			    Received from <%= link_logotype(User.find(private_message.sender_id))%> <%=time_ago_in_words(private_message.created_at)%> ago
			  <% end%>
				<%= link_to image_tag("ui/icons/arrow-rotate-anticlockwise.png", :alt => "reply" ), user_messages_path(params[:user_id], :reply_to => private_message), :title => "reply" unless params[:sent_messages]%>
        <% if params[:sent_messages] %>
          <%= link_to image_tag("ui/icons/cross.png", :alt => "delete" ), user_message_path(params[:user_id],private_message, :private_message => {:deleted_by_sender => true}), :confirm => 'Are you sure?', :method => :delete,:title => "destroy" %>
        <%else%>
          <%= link_to image_tag("ui/icons/cross.png", :alt => "delete" ), user_message_path(params[:user_id],private_message, :private_message => {:deleted_by_receiver => true}), :confirm => 'Are you sure?', :method => :delete,:title => "destroy" %>
        <%end%>
			</div>
			<div class="message_content" style="display:none;">
			 	<p><%= sanitize(private_message.body)%></p>
			</div>
		 	<br/>
		</div> 
	<% end %>
	<%= will_paginate @private_messages %>
<%end%>


<commit_msg>small change in private messages index view<commit_after><% content_for :javascript do  %>
  $(".message_link").attr('href', '#');
  $(".message_link").livequery('click', function() {
    $(this).parents(".message_div").find("div.message_content").toggle();
		if ($(this).parents(".message_div").hasClass("highlight")){
		  var route = "/users/<%=params[:user_id]%>/messages/" + $(this).parents(".message_div").attr("id")
		  $.post(route, { _method: "put", authenticity_token: "<%=form_authenticity_token()%>", 'private_message[checked]': "true" },  function(data){eval(data);});
	  }
  }); 
<%end%>

<% content_for :sidebar do  %>
  <%if params[:reply_to] %>
	  <%= render :partial => "reply_private_message", :locals => { :previous_message =>  PrivateMessage.find(params[:reply_to])}%>
	<%else%>
    <%= render :partial => "new_private_message", :locals => { :checked_users =>  Array.new}%>
	<%end%>
<%end%>

<%=link_to_if params[:sent_messages], "Incoming Messages" ,user_messages_path(params[:user_id])  %> | 
<%=link_to_unless params[:sent_messages], "Sent Messages" ,user_messages_path(params[:user_id],:sent_messages => true)  %>
<br/><br/>

<%if @private_messages.blank?%>
  There are not privates messages
<%else%>

	<% for private_message in @private_messages %>
	  <div <%if !params[:sent_messages] && !private_message.checked%>class="message_div highlight"<%else%>class="message_div"<%end%> id="<%=private_message.id%>">
		  <div class="message_header">
		    <%=link_to sanitize(private_message.title), user_message_path(params[:user_id], private_message), :class => "message_link"%>
		    <% if params[:sent_messages] %>
				  Sent to <%= link_logotype(User.find(private_message.receiver_id))%> <%=time_ago_in_words(private_message.created_at)%> ago 
			  <% else%>
			    Received from <%= link_logotype(User.find(private_message.sender_id))%> <%=time_ago_in_words(private_message.created_at)%> ago
			  <% end%>
				<%= link_to image_tag("ui/icons/arrow-rotate-anticlockwise.png", :alt => "reply" ), user_messages_path(params[:user_id], :reply_to => private_message), :title => "reply" unless params[:sent_messages]%>
        <% if params[:sent_messages] %>
          <%= link_to image_tag("ui/icons/cross.png", :alt => "delete" ), user_message_path(params[:user_id],private_message, :private_message => {:deleted_by_sender => true}), :confirm => 'Are you sure?', :method => :delete,:title => "destroy" %>
        <%else%>
          <%= link_to image_tag("ui/icons/cross.png", :alt => "delete" ), user_message_path(params[:user_id],private_message, :private_message => {:deleted_by_receiver => true}), :confirm => 'Are you sure?', :method => :delete,:title => "destroy" %>
        <%end%>
			</div>
			<div class="message_content" style="display:none;">
			 	<p><%= sanitize(private_message.body)%></p>
			</div>
		 	<br/>
		</div> 
	<% end %>
	<%= will_paginate @private_messages %>
<%end%>



{'fraction_non_alphanumeric': 0.20825418753237782, 'fraction_numerical': 0.0, 'mean_word_length': 5.604332953249715, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 147, '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': '660828', 'n_tokens_mistral': 2159, 'n_tokens_neox': 1953, 'n_words': 312}