<commit_before>

<!-- Edit your profile -->
<% @profile = profile_or_current_subject.profile %>
<% if can?(:update, @profile) %>
<div class="edit_icon">
  <%= link_to(raw("<i class='icon-edit '></i>")+ t('profile.profile'), '#', :id => "edit_icon_link") %> 
</div>
<% end %>


<!--BTN ADD-->

<% if !profile_subject_is_current? %>
    <section class="contact">
      <div class="add">
        <%= contact_button(profile_subject) %>
      </div>
    </section>
<!-- <button>
  <%#= contact_to(profile_subject) %>
</button> -->
<% end %>


<!--BTN MESSAGE-->

<% if !profile_subject_is_current? && user_signed_in?%>
<button href="#new_messages_profile" id="mesage-profile" role="button" class="btn" data-toggle="modal" data-remote="false">
  <%= link_to new_message_path(receiver: profile_subject.slug) do %>
    <i class="icon-envelope-alt"></i>
    <%= t 'mailboxer.send' %>
  <% end %>
</button>
<% end %>

<button href="#" id="showMore" class="btn" status="showMore" class="ui-state-default ui-corner-all"><%=t('excursion.actions.show_more')%></button>



<!-- Button to trigger modal --> 
<!-- Modal -->
<div id="new_messages_profile" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

  <div class="modal-header">
    <h4><%=t('message.new')%></h4>
  </div>
  <div class="modal-body">
    <section id="new_message_profile">
      <%= render :partial => 'messages/new', :locals => {:@recipient => Actor.find_by_slug(profile_subject.slug)} %>
    </section>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <input type="button" class="btn btn-primary" value="<%=t('mailboxer.send')%>"/>
  </div>
</div>


<script>
$(function() {
  $("#showMore").click(function(){
    $(".newClass").switchClass( "newClass", "anotherNewClass", 1000 );
    $(".anotherNewClass").switchClass( "anotherNewClass", "newClass", 1000 );
    if($("#showMore").attr("status")=== "showMore"){
      $("#showMore").html('<%=t("excursion.actions.show_fewer")%>');
      $("#showMore").attr("status", "showFewer");
    }
    else{
      $("#showMore").html('<%=t("excursion.actions.show_more")%>');
      $("#showMore").attr("status", "showMore");
    }
    return false;
  });

  $(function() {
      var sendMessage = $("input[name='send_message']");
      var send = $("input[type='button'][value='<%=t('mailboxer.send')%>']");
      $(sendMessage).addClass("hidden");
      $(send).click(function(event) {
        $(sendMessage).click();
      });
      var SSMInitiated = false;
      $('#new_messages_profile').on('shown', function () {
        if(!SSMInitiated){
           SocialStream.Message.new_();
           SSMInitiated = true;
        }
      })
    });
});
</script><commit_msg>Patch to fix send msg error on user profile<commit_after>

<!-- Edit your profile -->
<% @profile = profile_or_current_subject.profile %>
<% if can?(:update, @profile) %>
<div class="edit_icon">
  <%= link_to(raw("<i class='icon-edit '></i>")+ t('profile.profile'), '#', :id => "edit_icon_link") %> 
</div>
<% end %>


<!--BTN ADD-->

<% if !profile_subject_is_current? %>
    <section class="contact">
      <div class="add">
        <%= contact_button(profile_subject) %>
      </div>
    </section>
<!-- <button>
  <%#= contact_to(profile_subject) %>
</button> -->
<% end %>


<!--BTN MESSAGE-->

<% if !profile_subject_is_current? && user_signed_in?%>
<button href="#new_messages_profile" id="mesage-profile" role="button" class="btn" data-toggle="modal" data-remote="false">
  <%= link_to new_message_path(receiver: profile_subject.slug) do %>
    <i class="icon-envelope-alt"></i>
    <%= t 'mailboxer.send' %>
  <% end %>
</button>
<% end %>

<button href="#" id="showMore" class="btn" status="showMore" class="ui-state-default ui-corner-all"><%=t('excursion.actions.show_more')%></button>



<!-- Button to trigger modal --> 
<!-- Modal -->
<div id="new_messages_profile" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

  <div class="modal-header">
    <h4><%=t('message.new')%></h4>
  </div>
  <div class="modal-body">
    <section id="new_message_profile">
      <%= render :partial => 'messages/new', :locals => {:@recipient => Actor.find_by_slug(profile_subject.slug)} %>
    </section>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <input type="button" class="btn btn-primary" value="<%=t('mailboxer.send')%>"/>
  </div>
</div>


<script>
$(function() {
  $("#showMore").click(function(){
    $(".newClass").switchClass( "newClass", "anotherNewClass", 1000 );
    $(".anotherNewClass").switchClass( "anotherNewClass", "newClass", 1000 );
    if($("#showMore").attr("status")=== "showMore"){
      $("#showMore").html('<%=t("excursion.actions.show_fewer")%>');
      $("#showMore").attr("status", "showFewer");
    }
    else{
      $("#showMore").html('<%=t("excursion.actions.show_more")%>');
      $("#showMore").attr("status", "showMore");
    }
    return false;
  });

  $(function() {
      var sendMessage = $("input[name='send_message']");
      var send = $("input[type='button'][value='<%=t('mailboxer.send')%>']");
      $(sendMessage).addClass("hidden");
      $(send).click(function(event) {
        $(sendMessage).click();
      });
      var SSMInitiated = false;
      $('#new_messages_profile').on('shown', function () {
        if(!SSMInitiated){
           SocialStream.Message.new_();
           SSMInitiated = true;
        }
      })
       $('#new_messages_profile').on('hidden', function () {
        $("#mesage-profile").removeAttr("href");
        $("#mesage-profile").removeAttr("data-toggle");
        $("#mesage-profile").removeAttr("data-remote");
      })
    });
});
</script>
{'fraction_non_alphanumeric': 0.2373780592161561, 'fraction_numerical': 0.0037651891151805577, 'mean_word_length': 3.9736170212765956, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 129, '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': '6524950', 'n_tokens_mistral': 2058, 'n_tokens_neox': 1961, 'n_words': 310}