Search in sources :

Example 6 with Department

use of amu.zhcet.data.department.Department in project zhcet-web by zhcet-amu.

the class CourseEditController method addCourse.

@GetMapping("/edit")
public String addCourse(Model model, @PathVariable Course course) {
    ErrorUtils.requireNonNullCourse(course);
    Department department = course.getDepartment();
    model.addAttribute("page_description", "Edit course details and manage other settings");
    model.addAttribute("department", department);
    model.addAttribute("page_title", "Edit Course : " + department.getName() + " Department");
    model.addAttribute("page_subtitle", "Course Management");
    model.addAttribute("page_path", getPath(course));
    model.addAttribute("course_types", CourseType.values());
    if (!model.containsAttribute("course")) {
        model.addAttribute("course", course);
    }
    model.addAttribute("floated", floatedCourseService.isFloated(course));
    return "department/edit_course";
}
Also used : Department(amu.zhcet.data.department.Department)

Aggregations

Department (amu.zhcet.data.department.Department)6 Transactional (javax.transaction.Transactional)2 UpdateException (amu.zhcet.common.error.UpdateException)1 Path (amu.zhcet.common.page.Path)1 PathChain (amu.zhcet.common.page.PathChain)1 DepartmentController (amu.zhcet.core.admin.department.DepartmentController)1 ErrorUtils (amu.zhcet.core.error.ErrorUtils)1 Course (amu.zhcet.data.course.Course)1 CourseService (amu.zhcet.data.course.CourseService)1 FloatedCourse (amu.zhcet.data.course.floated.FloatedCourse)1 FloatedCourseService (amu.zhcet.data.course.floated.FloatedCourseService)1 Student (amu.zhcet.data.user.student.Student)1 Comparator (java.util.Comparator)1 List (java.util.List)1 Stream (java.util.stream.Stream)1 Slf4j (lombok.extern.slf4j.Slf4j)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 Controller (org.springframework.stereotype.Controller)1 Model (org.springframework.ui.Model)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1