Allow supervisors to write a note associated with their projects #8
@ -4,6 +4,7 @@
|
||||
<wicket:panel>
|
||||
<div wicket:id="edit_note_modal"></div>
|
||||
<span wicket:id="shortened_note"></span>
|
||||
<wicket:container wicket:id="full_note"></wicket:container>
|
||||
<a wicket:id="view_note">[view/edit note]</a>
|
||||
</wicket:panel>
|
||||
</body>
|
||||
|
@ -8,6 +8,7 @@ import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulato
|
||||
import org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractExportableColumn;
|
||||
import org.apache.wicket.feedback.FencedFeedbackPanel;
|
||||
import org.apache.wicket.injection.Injector;
|
||||
import org.apache.wicket.markup.html.basic.MultiLineLabel;
|
||||
import org.apache.wicket.markup.html.form.Form;
|
||||
import org.apache.wicket.markup.html.form.TextArea;
|
||||
import org.apache.wicket.markup.html.panel.GenericPanel;
|
||||
@ -69,11 +70,20 @@ public class ProjectNoteColumn extends AbstractExportableColumn<Project, String>
|
||||
setOutputMarkupId(true);
|
||||
modal.onClose(target -> target.add(this));
|
||||
|
||||
IModel<Integer> maxLength = supervisorProjectNoteDisplayModel.map(display -> switch (display) {
|
||||
case FULL -> Integer.MAX_VALUE;
|
||||
case COMPACT -> 100;
|
||||
add(new MaxLengthLabel("shortened_note", getDataModel(model), Model.of(100)) {
|
||||
@Override
|
||||
protected void onConfigure() {
|
||||
super.onConfigure();
|
||||
setVisibilityAllowed(supervisorProjectNoteDisplayModel.getObject() == SupervisorProjectNoteDisplay.COMPACT);
|
||||
}
|
||||
});
|
||||
add(new MultiLineLabel("full_note", getDataModel(model)) {
|
||||
@Override
|
||||
protected void onConfigure() {
|
||||
super.onConfigure();
|
||||
setVisibilityAllowed(supervisorProjectNoteDisplayModel.getObject() == SupervisorProjectNoteDisplay.FULL);
|
||||
}
|
||||
});
|
||||
add(new MaxLengthLabel("shortened_note", getDataModel(model), maxLength));
|
||||
|
||||
AjaxLink<Object> noteLink = new AjaxLink<>("view_note") {
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user