1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 public class CourseAdminWithoutVersionConfigurer extends CourseProposalConfigurer{
22
23
24
25
26
27
28
29 @Override
30 public void configure(final CourseProposalController layout) {
31 type = "course";
32 state = DtoConstants.STATE_APPROVED;
33 nextState = DtoConstants.STATE_ACTIVE;
34
35 groupName = LUUIConstants.COURSE_GROUP_NAME;
36
37 layout.addView(generateCourseAdminView((CourseAdminWithoutVersionController)layout));
38 }
39
40
41
42
43
44
45 protected View generateCourseAdminView(final CourseAdminWithoutVersionController layout) {
46 VerticalSectionView view =
47 new VerticalSectionView(CourseSections.COURSE_INFO, getLabel(LUUIConstants.INFORMATION_LABEL_KEY), COURSE_PROPOSAL_MODEL, false);
48 view.addStyleName(LUUIConstants.STYLE_SECTION);
49
50
51 Section courseSection = generateCourseInfoSection(initSection(LUUIConstants.INFORMATION_LABEL_KEY));
52 Section governanceSection = generateGovernanceSection(initSection(LUUIConstants.GOVERNANCE_LABEL_KEY));
53 Section logisticsSection = generateCourseLogisticsSection(initSection(LUUIConstants.LOGISTICS_LABEL_KEY));
54 Section loSection = initSection(LUUIConstants.LEARNING_OBJECTIVES_LABEL_KEY);
55 loSection.addSection(generateLearningObjectivesNestedSection());
56 Section activeDatesSection = generateActiveDatesSection(initSection(LUUIConstants.ACTIVE_DATES_LABEL_KEY));
57 Section financialSection = generateFinancialsSection(initSection(LUUIConstants.FINANCIALS_LABEL_KEY));
58
59
60 view.addSection(courseSection);
61 view.addSection(governanceSection);
62 view.addSection(logisticsSection);
63 view.addSection(loSection);
64 view.addSection(activeDatesSection);
65 view.addSection(financialSection);
66
67
68 String sections = getLabel(LUUIConstants.COURSE_SECTIONS);
69 layout.addMenu(sections);
70 layout.addMenuItemSection(sections, getLabel(LUUIConstants.INFORMATION_LABEL_KEY), LUUIConstants.INFORMATION_LABEL_KEY, courseSection);
71 layout.addMenuItemSection(sections, getLabel(LUUIConstants.GOVERNANCE_LABEL_KEY), LUUIConstants.GOVERNANCE_LABEL_KEY, governanceSection);
72 layout.addMenuItemSection(sections, getLabel(LUUIConstants.LOGISTICS_LABEL_KEY), LUUIConstants.LOGISTICS_LABEL_KEY, logisticsSection);
73 layout.addMenuItemSection(sections, getLabel(LUUIConstants.LEARNING_OBJECTIVE_LABEL_KEY), LUUIConstants.LEARNING_OBJECTIVE_LABEL_KEY, loSection);
74 layout.addMenuItemSection(sections, getLabel(LUUIConstants.ACTIVE_DATES_LABEL_KEY), LUUIConstants.ACTIVE_DATES_LABEL_KEY, activeDatesSection);
75 layout.addMenuItemSection(sections, getLabel(LUUIConstants.FINANCIALS_LABEL_KEY), LUUIConstants.FINANCIALS_LABEL_KEY, financialSection);
76
77
78 layout.addButtonForView(CourseSections.COURSE_INFO, layout.getSaveButton());
79 layout.addButtonForView(CourseSections.COURSE_INFO, layout.getActivateButton());
80 layout.addButtonForView(CourseSections.COURSE_INFO, layout.getCancelButton());
81 layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getSaveButton());
82 layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getActivateButton());
83 layout.addTopButtonForView(CourseSections.COURSE_INFO, layout.getCancelButton());
84
85 return view;
86 }
87
88 protected Section initSection(String labelKey){
89 return initSection(SectionTitle.generateH2Title(getLabel(labelKey)), NO_DIVIDER);
90 }
91
92
93
94
95
96
97 @Override
98 public Section generateCourseInfoSection(Section section) {
99 addField(section, COURSE + "/" + COURSE_TITLE, generateMessageInfo(LUUIConstants.COURSE_TITLE_LABEL_KEY));
100 addField(section, COURSE + "/" + TRANSCRIPT_TITLE, generateMessageInfo(LUUIConstants.SHORT_TITLE_LABEL_KEY));
101 section.addSection(generateCourseNumberSection());
102 FieldDescriptor instructorsFd = addField(section, COURSE + "/" + INSTRUCTORS, generateMessageInfo(LUUIConstants.INSTRUCTORS_LABEL_KEY));
103 instructorsFd.setWidgetBinding(new KeyListModelWigetBinding("personId"));
104
105 section.addSection(generateDescriptionRationaleSection());
106
107 return section;
108 }
109
110
111
112
113
114
115 @Override
116 protected VerticalSection generateDescriptionRationaleSection() {
117 SectionTitle title = getH4Title(LUUIConstants.PROPOSAL_TITLE_SECTION_LABEL_KEY);
118 VerticalSection description = initSection(title, !WITH_DIVIDER);
119 title.setStyleName("cluProposalTitleSection");
120 addField(description, COURSE + "/" + DESCRIPTION + "/" + RichTextInfoConstants.PLAIN, generateMessageInfo(LUUIConstants.DESCRIPTION_LABEL_KEY));
121 return description;
122 }
123
124
125 }