use of amu.zhcet.data.course.registration.CourseRegistration in project zhcet-web by zhcet-amu.
the class FloatedCourseEditController method courseDetail.
@GetMapping("/{course}")
public String courseDetail(Model model, @PathVariable Course course, WebRequest webRequest) {
FloatedCourse floatedCourse = floatedCourseService.getFloatedCourse(course).orElseThrow(FloatedCourseNotFoundException::new);
if (!model.containsAttribute("success"))
webRequest.removeAttribute("confirmRegistration", RequestAttributes.SCOPE_SESSION);
model.addAttribute("page_title", course.getCode() + " - " + course.getTitle());
model.addAttribute("page_subtitle", "Course management for " + course.getCode());
model.addAttribute("page_description", "Register Students for the Floated course");
List<CourseRegistration> courseRegistrations = floatedCourse.getCourseRegistrations();
List<String> emails = FloatedCourseService.getEmailsFromCourseRegistrations(courseRegistrations.stream()).collect(Collectors.toList());
SortUtils.sortCourseAttendance(courseRegistrations);
model.addAttribute("courseRegistrations", courseRegistrations);
model.addAttribute("floatedCourse", floatedCourse);
model.addAttribute("email_list", emails);
return "dean/floated_course";
}
use of amu.zhcet.data.course.registration.CourseRegistration in project zhcet-web by zhcet-amu.
the class FloatedCourseController method courseDetail.
@GetMapping
public String courseDetail(Model model, @PathVariable Course course, WebRequest webRequest) {
FloatedCourse floatedCourse = floatedCourseService.getFloatedCourse(course).orElseThrow(FloatedCourseNotFoundException::new);
if (!model.containsAttribute("success"))
webRequest.removeAttribute("confirmRegistration", RequestAttributes.SCOPE_SESSION);
model.addAttribute("page_title", course.getCode() + " - " + course.getTitle());
model.addAttribute("page_subtitle", "Course management for " + course.getCode());
model.addAttribute("page_description", "Register Students and add Faculty In-Charge for the course");
model.addAttribute("page_path", getPath(course));
List<CourseRegistration> courseRegistrations = floatedCourse.getCourseRegistrations();
List<String> emails = FloatedCourseService.getEmailsFromCourseRegistrations(courseRegistrations.stream()).collect(Collectors.toList());
SortUtils.sortCourseAttendance(courseRegistrations);
model.addAttribute("courseRegistrations", courseRegistrations);
model.addAttribute("floatedCourse", floatedCourse);
model.addAttribute("sections", FloatedCourseService.getSections(floatedCourse));
model.addAttribute("email_list", emails);
return "department/floated_course";
}
use of amu.zhcet.data.course.registration.CourseRegistration in project zhcet-web by zhcet-amu.
the class CourseRegistrationUploadAdapter method fromRegistrationUpload.
private CourseRegistration fromRegistrationUpload(RegistrationUpload upload) {
Student student = studentService.getByFacultyNumber(upload.getFacultyNo()).orElseGet(() -> Student.builder().facultyNumber(upload.getFacultyNo()).build());
CourseRegistration courseRegistration = new CourseRegistration();
courseRegistration.setMode(upload.getMode());
courseRegistration.setStudent(student);
return courseRegistration;
}
Aggregations