3110 Improve text instructions for final thesis and reflection based on project state
This commit is contained in:
parent
13fef97d0f
commit
e8bd998b93
view/src/main/java/se/su/dsv/scipro/project
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:wicket="http://wicket.apache.org">
|
||||
<html xmlns:wicket="http://wicket.apache.org" xmlns:wicrket="http://wicket.apache.org">
|
||||
<body>
|
||||
<wicket:extend>
|
||||
<wicket:enclosure>
|
||||
@ -47,14 +47,14 @@
|
||||
</div>
|
||||
</wicket:enclosure>
|
||||
|
||||
<wicrket:enclosure>
|
||||
<div class="card mb-3 bg-light">
|
||||
<div class="card-body p-2">
|
||||
<h4>Final thesis and reflection</h4>
|
||||
<p>
|
||||
You will be able to upload the final thesis and your reflection on this page after the final seminar has taken place.
|
||||
</p>
|
||||
<wicket:container wicket:id="final_thesis_and_reflection_instructions"/>
|
||||
</div>
|
||||
</div>
|
||||
</wicrket:enclosure>
|
||||
|
||||
<wicket:enclosure child="externalOrganization">
|
||||
<div class="card mb-3 bg-light">
|
||||
|
@ -21,6 +21,7 @@ import se.su.dsv.scipro.project.ExternalOrganization;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
import se.su.dsv.scipro.project.panels.ExternalResourcesPanel;
|
||||
import se.su.dsv.scipro.project.panels.FinalStepsPanel;
|
||||
import se.su.dsv.scipro.project.panels.FinalThesisReflectionInstructionsPanel;
|
||||
import se.su.dsv.scipro.projectstate.ProjectStatePanel;
|
||||
import se.su.dsv.scipro.session.SciProSession;
|
||||
import se.su.dsv.scipro.survey.SurveyService;
|
||||
@ -95,6 +96,8 @@ public class ProjectDetailsPage extends AbstractProjectDetailsPage implements Me
|
||||
});
|
||||
|
||||
add(new FinalStepsPanel("final_steps", projectModel));
|
||||
|
||||
add(new FinalThesisReflectionInstructionsPanel("final_thesis_and_reflection_instructions", projectModel));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
23
view/src/main/java/se/su/dsv/scipro/project/panels/FinalThesisReflectionInstructionsPanel.html
Normal file
23
view/src/main/java/se/su/dsv/scipro/project/panels/FinalThesisReflectionInstructionsPanel.html
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
|
||||
<body>
|
||||
<wicket:panel>
|
||||
<p wicket:id="nothing_done">
|
||||
You will be able to upload the final thesis and your reflection on this page after the final seminar has taken place.
|
||||
</p>
|
||||
<p wicket:id="final_seminar_done_no_final_thesis_no_reflection">
|
||||
The final seminar has taken place, you need to upload the final thesis and your reflection on this page in order to have your thesis assessed.
|
||||
</p>
|
||||
<p wicket:id="final_seminar_done_final_thesis_done_no_reflection">
|
||||
The final seminar has taken place, you have uploaded your final thesis. You need to upload your reflection on this page in order to have your thesis assessed.
|
||||
</p>
|
||||
<p wicket:id="final_seminar_done_no_final_thesis_done_has_reflection">
|
||||
The final seminar has taken place, your final thesis has been rejected. You need to upload the new version of your final thesis to have your thesis assessed.
|
||||
</p>
|
||||
<p wicket:id="all_done">
|
||||
Your thesis project is completed.
|
||||
</p>
|
||||
</wicket:panel>
|
||||
</body>
|
||||
</html>
|
82
view/src/main/java/se/su/dsv/scipro/project/panels/FinalThesisReflectionInstructionsPanel.java
Normal file
82
view/src/main/java/se/su/dsv/scipro/project/panels/FinalThesisReflectionInstructionsPanel.java
Normal file
@ -0,0 +1,82 @@
|
||||
package se.su.dsv.scipro.project.panels;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.behavior.Behavior;
|
||||
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||
import org.apache.wicket.markup.html.panel.GenericPanel;
|
||||
import org.apache.wicket.model.IModel;
|
||||
import org.apache.wicket.model.LoadableDetachableModel;
|
||||
import se.su.dsv.scipro.finalseminar.FinalSeminarService;
|
||||
import se.su.dsv.scipro.finalthesis.FinalThesisService;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
import se.su.dsv.scipro.project.ProjectStatus;
|
||||
import se.su.dsv.scipro.reflection.ReflectionService;
|
||||
import se.su.dsv.scipro.session.SciProSession;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class FinalThesisReflectionInstructionsPanel extends GenericPanel<Project> {
|
||||
@Inject
|
||||
private ReflectionService reflectionService;
|
||||
@Inject
|
||||
private FinalThesisService finalThesisService;
|
||||
@Inject
|
||||
private FinalSeminarService finalSeminarService;
|
||||
|
||||
public FinalThesisReflectionInstructionsPanel(String id, IModel<Project> projectModel) {
|
||||
super(id, projectModel);
|
||||
|
||||
IModel<Boolean> hasSubmittedReflection = LoadableDetachableModel.of(() ->
|
||||
reflectionService.getSubmittedReflection(projectModel.getObject(), SciProSession.get().getUser()) != null);
|
||||
IModel<Boolean> hasFinalThesis = LoadableDetachableModel.of(() ->
|
||||
!finalThesisService.isUploadAllowed(projectModel.getObject()));
|
||||
IModel<Boolean> hasHadFinalSeminar = LoadableDetachableModel.of(() ->
|
||||
finalSeminarService.hasHadFinalSeminar(projectModel.getObject()));
|
||||
add(new WebMarkupContainer("nothing_done") {
|
||||
@Override
|
||||
protected void onConfigure() {
|
||||
super.onConfigure();
|
||||
setVisible(!hasHadFinalSeminar.getObject() && !hasFinalThesis.getObject() && !hasSubmittedReflection.getObject());
|
||||
}
|
||||
});
|
||||
add(new WebMarkupContainer("final_seminar_done_no_final_thesis_no_reflection") {
|
||||
@Override
|
||||
protected void onConfigure() {
|
||||
super.onConfigure();
|
||||
setVisible(hasHadFinalSeminar.getObject() && !hasFinalThesis.getObject() && !hasSubmittedReflection.getObject());
|
||||
}
|
||||
});
|
||||
add(new WebMarkupContainer("final_seminar_done_final_thesis_done_no_reflection") {
|
||||
@Override
|
||||
protected void onConfigure() {
|
||||
super.onConfigure();
|
||||
setVisible(hasHadFinalSeminar.getObject() && hasFinalThesis.getObject() && !hasSubmittedReflection.getObject());
|
||||
}
|
||||
});
|
||||
add(new WebMarkupContainer("final_seminar_done_no_final_thesis_done_has_reflection") {
|
||||
@Override
|
||||
protected void onConfigure() {
|
||||
super.onConfigure();
|
||||
setVisible(hasHadFinalSeminar.getObject() && !hasFinalThesis.getObject() && hasSubmittedReflection.getObject());
|
||||
}
|
||||
});
|
||||
add(new WebMarkupContainer("all_done") {
|
||||
@Override
|
||||
protected void onConfigure() {
|
||||
super.onConfigure();
|
||||
setVisible(hasHadFinalSeminar.getObject() && hasFinalThesis.getObject() && hasSubmittedReflection.getObject());
|
||||
}
|
||||
});
|
||||
add(new Behavior() {
|
||||
@Override
|
||||
public void onConfigure(Component component) {
|
||||
super.onConfigure(component);
|
||||
component.setVisible(
|
||||
!hasHadFinalSeminar.getObject()
|
||||
|| !hasFinalThesis.getObject()
|
||||
|| !hasSubmittedReflection.getObject()
|
||||
|| projectModel.getObject().getProjectStatus() == ProjectStatus.COMPLETED);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user