anchor.diff:                 :assignment_id => @student.assignment.id} %>
     <% end %>
   
  -<% if @send_invs && @send_invs.length > 0 %>
  -  <table>
  -    <h2>Sent Invitations</h2>
  -    <tr>
  -      <td><b>To &nbsp</b></td>
  -      <td><b>Reply Status &nbsp</b></td>
  -    </tr>
  -      <% for inv in @send_invs %>
  +    <% if @send_invs && @send_invs.length > 0 %>
  +      <table>
  +        <h2>Sent Invitations</h2>
           <tr>
  -          <td><%= inv.to_user.name %></td>
  -            <% if inv.reply_status == 'A' %>
  -              <td>Accepted</td>
  -            <% elsif inv.reply_status == 'D' %>
  -              <td>Declined</td>
  -            <% else %>
  -              <td>Waiting for reply</td>
  -              <td><%= link_to "Retract", {:controller => 'invitation', :action => 'cancel', :inv_id => inv.id, :student_id => @student.id} %></td>
  -            <% end %>
  -         </tr>
  -      <% end %>
  -  </table>
  -<% end %>
  -
  -<% if @received_invs && @received_invs.length > 0 %>
  - <table>
  -   <h2>Received Invitations</h2>
  -     <tr>
  -       <td><b>From &nbsp</b></td>
  -       <td><b>Team Name &nbsp</b></td>
  -       <td><b>Reply &nbsp</b></td>
  -     </tr>
  -     <% for inv in @received_invs %>
  -       <% if inv.reply_status == 'W' %>
  -         <tr>
  -           <td><%= inv.from_user.name %></td>
  -           <td>
  -             <% teamsusers = TeamsUser.where(['user_id = ?', inv.from_id]) %>
  -               <% for teamsuser in teamsusers %>
  -                 <% current_team = Team.where(['id = ? and parent_id = ?', teamsuser.team_id, @student.assignment.id]).first %>
  -                 <% if current_team != nil %>
  -                   <%= Team.find(current_team.id).name %>
  -                 <% end %>
  -               <% end %>
  -           </td>
  -           <td>
  -             <%if @student.team == nil
  -               @team_id = 0
  -             else
  -               @team_id = @student.team.id
  -              end %>
  -             <%= link_to "Accept",
  -               {:controller => 'invitation', :action => 'accept', :inv_id => inv.id, :student_id => @student.id, :team_id => @team_id},
  -               {:onClick => "javascript: return confirm('Your topic (or place on waiting lists) will be relinquished if you accept the invitation. Do you want to continue?');"}
  -             %>
  -             |
  -             <%= link_to "Decline",
  -               {:controller => 'invitation', :action => 'decline', :inv_id => inv.id, :student_id => @student.id}
  -             %>
  -           </td>
  -         </tr>
  -        <% end %>
  -     <% end %>
  -
  - </table>
  -<% end %>
  +          <td><b>To &nbsp</b></td>
  +          <td><b>Reply Status &nbsp</b></td>
  +        </tr>
  +          <% for inv in @send_invs %>
  +            <tr>
  +              <td><%= inv.to_user.name %></td>
  +                <% if inv.reply_status == 'A' %>
  +                  <td>Accepted</td>
  +                <% elsif inv.reply_status == 'D' %>
  +                  <td>Declined</td>
  +                <% else %>
  +                  <td>Waiting for reply</td>
  +                  <td><%= link_to "Retract", {:controller => 'invitation', :action => 'cancel', :inv_id => inv.id, :student_id => @student.id} %></td>
  +                <% end %>
  +             </tr>
  +          <% end %>
  +      </table>
  +    <% end %>
   
        <% if @student.team == nil %>
          <h2>Name team</h2>
  
positive.code:       <%= link_to 'new', :controller => 'advertise_for_partner', :action => 'new', :team_id=>@student.team.id %>
      <% end %>
  
  
    <%= render :partial => 'join_team_requests/list_sent',
      :locals =>{:teams_user_id=>params[:student_id],
                 :assignment_id => @student.assignment.id
    } %>
  
    <% if @student.team!=nil %>
      <%= render :partial => 'join_team_requests/list_received',
      :locals =>{:team_id=>@student.team.id,
  
negative.code:       </table>
    <% end %>
  <% end %>
  
    <% if @received_invs && @received_invs.length > 0 %>
      <table>
        <h2>Received Invitations</h2>
        <tr>
          <td><b>From &nbsp</b></td>
          <td><b>Team Name &nbsp</b></td>
          <td><b>Reply &nbsp</b></td>
        </tr>
        <% for inv in @received_invs %>
            <% if inv.reply_status == 'W' %>
                <tr>
                  <td><%= inv.from_user.name %></td>
                  <td>
                    <% teamsusers = TeamsUser.where(['user_id = ?', inv.from_id]) %>
                    <% for teamsuser in teamsusers %>
                        <% current_team = Team.where(['id = ? and parent_id = ?', teamsuser.team_id, @student.assignment.id]).first %>
                        <% if current_team != nil %>
                            <%= Team.find(current_team.id).name %>
                        <% end %>
                    <% end %>
                  </td>
                  <td>
                    <%if @student.team == nil
                        @team_id = 0
                      else
                        @team_id = @student.team.id
                      end %>
                    <%= link_to "Accept",
                                {:controller => 'invitation', :action => 'accept', :inv_id => inv.id, :student_id => @student.id, :team_id => @team_id},
                                {:onClick => "javascript: return confirm('Your topic (or place on waiting lists) will be relinquished if you accept the invitation. Do you want to continue?');"}
                    %>
                    |
                    <%= link_to "Decline",
                                {:controller => 'invitation', :action => 'decline', :inv_id => inv.id, :student_id => @student.id}
                    %>
                  </td>
                </tr>
            <% end %>
        <% end %>
  
      </table>
    <% end %>
  
  <%= render :partial => 'join_team_requests/list_sent',
             :locals =>{:teams_user_id=>params[:student_id],
                        :assignment_id => @student.assignment.id
             } %>
  <br>
     <a href="javascript:window.history.back()">Back</a>
  
  