Sort list of eligible students, and some other bullshit.
This commit is contained in:
		
							parent
							
								
									64f75ea21d
								
							
						
					
					
						commit
						6653047263
					
				|  | @ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.PostMapping; | ||||||
| import org.springframework.web.bind.annotation.RequestParam; | import org.springframework.web.bind.annotation.RequestParam; | ||||||
| 
 | 
 | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
|  | import java.util.List; | ||||||
| import java.util.Optional; | import java.util.Optional; | ||||||
| 
 | 
 | ||||||
| @Controller | @Controller | ||||||
|  | @ -80,9 +81,11 @@ public class StudentTeamEntity { | ||||||
|         Optional<StudentTeam> optionalStudentTeam = this.studentTeamRepository.findById(teamId); |         Optional<StudentTeam> optionalStudentTeam = this.studentTeamRepository.findById(teamId); | ||||||
| 
 | 
 | ||||||
|         if (optionalCourse.isPresent() && optionalStudentTeam.isPresent()) { |         if (optionalCourse.isPresent() && optionalStudentTeam.isPresent()) { | ||||||
|  |             List<Student> eligibleStudents = optionalCourse.get().getStudents(); | ||||||
|  |             eligibleStudents.sort((s1, s2) -> s1.getLastName().compareToIgnoreCase(s2.getLastName())); | ||||||
|             model.addAttribute("course", optionalCourse.get()); |             model.addAttribute("course", optionalCourse.get()); | ||||||
|             model.addAttribute("student_team", optionalStudentTeam.get()); |             model.addAttribute("student_team", optionalStudentTeam.get()); | ||||||
|             model.addAttribute("eligible_students", optionalCourse.get().getStudents()); |             model.addAttribute("eligible_students", eligibleStudents); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         return "courses/entity/student_teams/entity/add_student"; |         return "courses/entity/student_teams/entity/add_student"; | ||||||
|  |  | ||||||
|  | @ -221,7 +221,7 @@ public class GithubManager { | ||||||
|             users.add(this.github.getUser(s.getGithubUsername())); |             users.add(this.github.getUser(s.getGithubUsername())); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         repository.removeCollaborators(users); |         //repository.removeCollaborators(users); | ||||||
| 
 | 
 | ||||||
|         GHTeam taTeam = organization.getTeamByName(studentTeam.getAssignedTeachingAssistantTeam().getGithubTeamName()); |         GHTeam taTeam = organization.getTeamByName(studentTeam.getAssignedTeachingAssistantTeam().getGithubTeamName()); | ||||||
|         taTeam.remove(repository); |         taTeam.remove(repository); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue