Added project type title when viewing or editing

When you chose to edit a template you could not see what type the template is.
For example if it was a bachelor or master type template.

Now when you choose to edit a grading template the type will be shown as a heading,
so you can more easily see what type of template you are currently editing.
The heading will read:
`You are editing a <type> grading template.`
The <type> will display the correct type of the grading template you are editing.

Open to change of what exactly the heading will display if anyone has a better idea for it.
This commit is contained in:
Nico Athanassiadis 2024-11-19 07:10:18 +01:00
parent 942418988a
commit 4991719048
4 changed files with 16 additions and 1 deletions

@ -16,6 +16,7 @@ class EditingGradingTemplate implements Serializable {
private LocalDate validFrom;
private List<Criteria> criteria;
private GradeLimits gradeLimits;
private String projectType;
public EditingGradingTemplate() {
this.gradeLimits = new GradeLimits();
@ -41,6 +42,7 @@ class EditingGradingTemplate implements Serializable {
Criteria editingCriteria = new Criteria(criteria);
this.criteria.add(editingCriteria);
}
this.projectType = template.getProjectType().getName();
}
public String getNote() {
@ -81,13 +83,18 @@ class EditingGradingTemplate implements Serializable {
this.criteria.add(new Criteria());
}
public String getProjectType() {
return projectType;
}
@Override
public boolean equals(Object o) {
return o instanceof EditingGradingTemplate that
&& Objects.equals(note, that.note)
&& Objects.equals(validFrom, that.validFrom)
&& Objects.equals(criteria, that.criteria)
&& Objects.equals(gradeLimits, that.gradeLimits);
&& Objects.equals(gradeLimits, that.gradeLimits)
&& Objects.equals(projectType, that.projectType);
}
@Override

@ -9,6 +9,12 @@
</head>
<body>
<wicket:panel>
<div class="mb-3 lead">
<wicket:message key="project_type_name_editing">
<span wicket:id="project_type_name"></span>
</wicket:message>
</div>
<div class="mb-3 line-length-limit">
<label class="form-label" wicket:for="valid_from">
Valid from

@ -30,6 +30,7 @@ class EditingGradingTemplateComponentPanel extends GenericPanel<EditingGradingTe
setOutputMarkupId(true);
add(new Label("project_type_name", editingGradingTemplateModel.map(EditingGradingTemplate::getProjectType)));
TextField<LocalDate> validFromField = new RequiredTextField<>("valid_from",
LambdaModel.of(editingGradingTemplateModel,
EditingGradingTemplate::getValidFrom,

@ -11,3 +11,4 @@ Type.INDIVIDUAL=Individually for each author
minimum.Required=You must set the minimum number of points for each grade
grade.Required=You must set the letter for each grade
flag.nullValid=None
project_type_name_editing=You are editing a ${project_type_name} grading template.