<commit_before><table cellspacing="5">
<% review_no = 1%>
<% mappings.each{
     | map | %> 
     <tr><td><%= @assignment.name %> <%= title %> <%= review_no %></td>
     <%if @assignment.team_assignment?%>
       <%if map.type.to_s == "MetareviewResponseMap"%>
          <%review_mapping = ResponseMap.find(map.reviewed_object_id)%>
          <%team = TeamsUser.find_all_by_team_id(review_mapping.reviewee_id)%>
          <%@participant = Participant.find_by_user_id_and_parent_id(team.first.user_id,@assignment.id)%>
       <%else%>
          <%user_id = TeamsUser.find_all_by_team_id(map.reviewee_id).first.user_id %>
          <%@participant = Participant.find_by_user_id_and_parent_id(user_id,@assignment.id)%>
       <%end%>
     <%else%>
       <%if map.type.to_s == "MetareviewResponseMap"%>
          <%review_mapping = ResponseMap.find(map.reviewed_object_id)%>
          <%@participant = AssignmentParticipant.find(review_mapping.reviewee_id)%>    
       <%else%>
          <%@participant = AssignmentParticipant.find_by_id_and_parent_id(map.reviewee_id, @assignment.id)%>
       <%end%>
     <%end%>
     <% if map.response %>            
       <td><%= link_to "View",{:controller => 'response', :action => 'view', :id => map.response.id} %></td>
       <% if @assignment.get_current_stage(@participant.topic_id) != "Complete" %>
         <td><%= link_to "Edit",{:controller => 'response', :action => 'edit', :id => map.response.id} %></td>
       <% end %>

     <% elsif @assignment.get_current_stage(@participant.topic_id) != "Complete" %>
       <%if @assignment.staggered_deadline?%>
           <%if map.type.to_s == "MetareviewResponseMap"%>
               <%if @assignment.get_current_stage(@participant.topic_id) == 'metareview'%>
                   <td>
                     <%= link_to "Begin",{:controller => 'response', :action => 'new', :id => map.id} %>
                   </td>
                   <td>
                     Reserved for review until: <%=h map.potential_response_deadline %>
                   </td>
               <%else%>
                   <td>Begin</td><td> (Work has not yet been submitted)</td>
                   <td>
                     Reserved for review until: <%=h map.potential_response_deadline %>
                   </td>
               <%end%>
           <%else%>
                <%if @assignment.get_current_stage(@participant.topic_id) != 'submission'%>
                   <td><%= link_to "Begin",{:controller => 'response', :action => 'new', :id => map.id} %></td>
                   <% if @assignment.dynamic_reviewer_assignments_enabled %>
                     <td>Reserved for review until: <%=h map.potential_response_deadline %></td>
                     <td><%= link_to "Release Review Reservation",{:controller => 'review_mapping', :action => 'release_reservation', :id => map.id} %></td>
                   <% end %>
                <%else%>
                   <td>Begin</td><td> (Work has not yet been submitted)</td>
                <%end%>
           <%end%>
       <%else%>
         <td><%= link_to "Begin", {:controller => 'response', :action => 'new', :id => map.id} %></td>
         <% if @assignment.dynamic_reviewer_assignments_enabled %>
           <td>Reserved for review until: <%=h map.potential_response_deadline %></td>
           <td><%= link_to "Release Review Reservation",{:controller => 'review_mapping', :action => 'release_reservation', :id => map.id} %></td>
         <% end %>
       <%end%>
  	 <% else %>
  	   <td>Begin</td><td> (Work has not yet been submitted)</td>
     <% end %>       
     </tr>  
     <% review_no += 1 %>
<% } %>
</table><commit_msg>DRY "Reserved for review" message; show "Release Review Reservation" even if work has not started<commit_after><table cellspacing="5">
<% review_no = 1%>
<% mappings.each do | map | %> 
     <tr><td><%= @assignment.name %> <%= title %> <%= review_no %></td>
     <%if @assignment.team_assignment?%>
       <%if map.type.to_s == "MetareviewResponseMap"%>
          <%review_mapping = ResponseMap.find(map.reviewed_object_id)%>
          <%team = TeamsUser.find_all_by_team_id(review_mapping.reviewee_id)%>
          <%@participant = Participant.find_by_user_id_and_parent_id(team.first.user_id,@assignment.id)%>
       <%else%>
          <%user_id = TeamsUser.find_all_by_team_id(map.reviewee_id).first.user_id %>
          <%@participant = Participant.find_by_user_id_and_parent_id(user_id,@assignment.id)%>
       <%end%>
     <%else%>
       <%if map.type.to_s == "MetareviewResponseMap"%>
          <%review_mapping = ResponseMap.find(map.reviewed_object_id)%>
          <%@participant = AssignmentParticipant.find(review_mapping.reviewee_id)%>    
       <%else%>
          <%@participant = AssignmentParticipant.find_by_id_and_parent_id(map.reviewee_id, @assignment.id)%>
       <%end%>
     <%end%>

     <% if map.response %>            
       <td><%= link_to "View",{:controller => 'response', :action => 'view', :id => map.response.id} %></td>
       <% if @assignment.get_current_stage(@participant.topic_id) != "Complete" %>
         <td><%= link_to "Edit",{:controller => 'response', :action => 'edit', :id => map.response.id} %></td>
       <% end %>

     <% elsif @assignment.get_current_stage(@participant.topic_id) != "Complete" %>
       <%if @assignment.staggered_deadline?%>
           <%if map.type.to_s == "MetareviewResponseMap"%>
               <%if @assignment.get_current_stage(@participant.topic_id) == 'metareview'%>
                   <td><%= link_to "Begin",{:controller => 'response', :action => 'new', :id => map.id} %></td>
               <%else%>
                   <td>Begin</td><td> (Work has not yet been submitted)</td>
               <%end%>
           <%else%>
                <%if @assignment.get_current_stage(@participant.topic_id) != 'submission'%>
                   <td><%= link_to "Begin",{:controller => 'response', :action => 'new', :id => map.id} %></td>
                <%else%>
                   <td>Begin</td><td> (Work has not yet been submitted)</td>
                <%end%>
           <%end%>
       <% else # no staggered deadline %>
         <td><%= link_to "Begin", {:controller => 'response', :action => 'new', :id => map.id} %></td>
       <% end %>

       <% if @assignment.dynamic_reviewer_assignments_enabled %>
         <td>Reserved for review until: <%=h map.potential_response_deadline %></td>
         <td><%= link_to "Release Review Reservation",{:controller => 'review_mapping', :action => 'release_reservation', :id => map.id} %></td>
       <% end %>

  	 <% else # Deadline has passed, and the work was not submitted %>
  	   <td>Begin</td><td> (Work has not yet been submitted)</td>
     <% end %>       
     </tr>  
     <% review_no += 1 %>
<% end %>
</table>

{'fraction_non_alphanumeric': 0.17610517191563133, 'fraction_numerical': 0.0008668015024559376, 'mean_word_length': 2.3623118018455562, 'pattern_counts': {'":': 0, '<': 183, '<?xml version=': 0, '>': 222, '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': '907', 'n_tokens_mistral': 2410, 'n_tokens_neox': 2189, 'n_words': 392}