<commit_before><h3><%= @project.title %></h3> <p><%= @project.status %></p>
<div class="project_description"><p><%= @project.description %></p></div>
  <% if @project.admin == current_user %>
    <% if @project.status == "planning" %>
      <%= button_to "Mark as in progress", {controller: "user_projects", action: "in_progress", user_id: current_user.id, project_id: @project.id}, method: :post %>
    <% end %>
    <% if @project.status == "in_progress" %>
      <%= button_to "Mark as completed", {controller: "user_projects", action: "close_project", user_id: current_user.id, project_id: @project.id}, method: :post %>
    <% end %>
  <% end %>
  <% unless current_user.projects.include?(@project) %>
    <%= button_to "Volunteer for this project", {controller: "user_projects", action: "apply_for_project", user_id: current_user.id, project_id: @project.id}, method: :post %>
  <% end %>

<div class="project_team">
  <h4>Team</h4>
  <ul>
  <div class="admin_profile">
    <strong><li><%= @project.admin.name %></li></strong>
  </div>
  <% if @project.current_collaborators %>
    <% @project.current_collaborators.each do |user| %>
        <div class="team_member_profile">
          <li>
            <strong><%= user.name %></strong>
            <% unless user.rated?(@project) %>
              <ul>
                <% user.skills.each do |skill| %>
                  <li>
                  <%= skill.name %><%= button_to "Endorse!", {controller: "user_projects", action: "update", user_id: user.id, project_id: @project.id, skill_id: skill.id}, method: :post %>
                </li>
                <% end %>
              </ul>
            <% end %>
          </li>
        </div>
    <% end %>
  <% end %>
  </ul>
</div>

<div class="prospective_collaborators">
  <% if @project.admin_id == current_user.id || @project.current_collaborators.include?(current_user) %>
    <% unless @project.prospective_collaborators.empty? || @project.status == "completed" %>
    <div class="want_to_join">
      <h4>These people want to join your team</h4>
      <% @project.prospective_collaborators.each do |user| %>
        <div class="prospective_collaborator">
          <%= user.name %>
          <div class="skill_set">
            <% user.skills.each do |skill| %>
              <div class="skill"><%= skill.name %></div>
            <% end %>
          </div>
          <% if @project.admin_id == current_user.id %>
            <%= button_to "Approve collaboration", {controller: "user_projects", action: "approve_collaboration", user_id: user.id, project_id: @project.id}, method: :post %>
            <%= button_to "Deny collaboration", {controller: "user_projects", action: "deny_collaboration", user_id: user.id, project_id: @project.id}, method: :post %>
          <% end %>
        </div>
        </div>
      <% end  %>
    </div>
    <% end %>
    <div class="suggested_collaborators">
      <% if User.matching_project_skills(@project).reject{|u|u == current_user}.length > 0 %>
      <h4>These people have skills your project is looking for:</h4>
      <% User.matching_project_skills(@project).reject{|u|u == current_user}.each do |user| %>
        <div class="prospective_collaborator">
          <p><%= user.name %><br/>
            Relevant skills:<br/>
            <% user.skills.select{|skill|@project.skills.include?(skill)}.each do |skill| %>
              <div class="skill_tab"><%= skill.name %></div>
            <% end %>
          </p>
          <%= button_to "Invite to project", {controller: "user_projects", action: "invite", user_id: user.id, project_id: @project.id}, method: :post %>
        </div>
      <% end %>
    </div>
    <% end %>
  <% end %>
</div>

<div class="chat_window">
  <ul id="chat">
    <%= render @messages %>
  </ul>

  <%= form_for Message.new, :remote => true do |f| %>
    <%= f.hidden_field :user_id, value: current_user.id %>
    <%= f.hidden_field :project_id, value: @project.id %>
    <%= f.text_field :text %>
    <%= f.submit "Send" %>
  <% end %>
</div>

<%= javascript_include_tag "http://localhost:9292/faye/client.js" %>
<script>
  $(function(){
    var faye = new Faye.Client('http://localhost:9292/faye')
    faye.subscribe('/messages/'+<%= @project.id %>,function(data){
      eval(data)
    });

  });
</script>
<commit_msg>updates view logic<commit_after><h3><%= @project.title %></h3> <p><%= @project.status %></p>
<div class="project_description"><p><%= @project.description %></p></div>
  <% if @project.admin == current_user %>
    <% if @project.status == "planning" %>
      <%= button_to "Mark as in progress", {controller: "user_projects", action: "in_progress", user_id: current_user.id, project_id: @project.id}, method: :post %>
    <% end %>
    <% if @project.status == "in_progress" %>
      <%= button_to "Mark as completed", {controller: "user_projects", action: "close_project", user_id: current_user.id, project_id: @project.id}, method: :post %>
    <% end %>
  <% end %>
  <% unless current_user.projects.include?(@project) %>
    <%= button_to "Volunteer for this project", {controller: "user_projects", action: "apply_for_project", user_id: current_user.id, project_id: @project.id}, method: :post %>
  <% end %>

<div class="project_team">
  <h4>Team</h4>
  <ul>
  <div class="admin_profile">
    <strong><li><%= @project.admin.name %></li></strong>
  </div>
  <% if @project.current_collaborators %>
    <% @project.current_collaborators.each do |user| %>
        <div class="team_member_profile">
          <li>
            <strong><%= user.name %></strong>
            <% unless user.rated?(@project) || user.id == current_user.id %><!-- don't rate yourself -->
              <ul>
                <% user.skills.each do |skill| %>
                  <li>
                    <%= skill.name %>
                    <%= button_to "Endorse!", {controller: "user_projects", action: "update", user_id: user.id, project_id: @project.id, skill_id: skill.id}, method: :post %>
                  </li>
                <% end %>
              </ul>
            <% end %>
          </li>
        </div>
    <% end %>
  <% end %>
  </ul>
</div>

<div class="prospective_collaborators">
  <% if current_user.is_admin_for?(@project) || @project.current_collaborators.include?(current_user) %>
    <% unless @project.prospective_collaborators.empty? %>
    <div class="want_to_join">
      <h4>These people want to join your team</h4>
      <% @project.prospective_collaborators.each do |user| %>
        <div class="prospective_collaborator">
          <%= user.name %>
          <div class="skill_set">
            <% user.skills.each do |skill| %>
              <div class="skill"><%= skill.name %></div>
            <% end %>
          </div>
          <% if current_user.is_admin_for?(@project) %>
            <%= button_to "Approve collaboration", {controller: "user_projects", action: "approve_collaboration", user_id: user.id, project_id: @project.id}, method: :post %>
            <%= button_to "Deny collaboration", {controller: "user_projects", action: "deny_collaboration", user_id: user.id, project_id: @project.id}, method: :post %>
          <% end %>
        </div>
        </div>
      <% end  %>
    </div>
    <% end %>
    <div class="suggested_collaborators">
      <% if User.matching_project_skills(@project).reject{|u|u == current_user}.length > 0 %>
      <h4>These people have skills your project is looking for:</h4>
      <% User.matching_project_skills(@project).reject{|u|u == current_user}.each do |user| %>
        <div class="prospective_collaborator">
          <p><%= user.name %><br/>
            Relevant skills:<br/>
            <% user.skills.select{|skill|@project.skills.include?(skill)}.each do |skill| %>
              <div class="skill_tab"><%= skill.name %></div>
            <% end %>
          </p>
          <%= button_to "Invite to project", {controller: "user_projects", action: "invite", user_id: user.id, project_id: @project.id}, method: :post %>
        </div>
      <% end %>
    </div>
    <% end %>
  <% end %>
</div>

<div class="chat_window">
  <ul id="chat">
    <%= render @messages %>
  </ul>

  <%= form_for Message.new, :remote => true do |f| %>
    <%= f.hidden_field :user_id, value: current_user.id %>
    <%= f.hidden_field :project_id, value: @project.id %>
    <%= f.text_field :text %>
    <%= f.submit "Send" %>
  <% end %>
</div>

<%= javascript_include_tag "http://localhost:9292/faye/client.js" %>
<script>
  $(function(){
    var faye = new Faye.Client('http://localhost:9292/faye')
    faye.subscribe('/messages/'+<%= @project.id %>,function(data){
      eval(data)
    });

  });
</script>

{'fraction_non_alphanumeric': 0.1902010630922117, 'fraction_numerical': 0.00392881904321701, 'mean_word_length': 2.7910643889618925, 'pattern_counts': {'":': 0, '<': 242, '<?xml version=': 0, '>': 246, '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': '2624690', 'n_tokens_mistral': 3051, 'n_tokens_neox': 2817, 'n_words': 579}