Allow supervisors to write a note associated with their projects #8
@ -5,7 +5,7 @@
|
||||
<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>
|
||||
<a wicket:id="view_note"><wicket:message key="note.view.edit"/></a>
|
||||
</wicket:panel>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,2 @@
|
||||
note.modal.title=View/edit note for ${title}
|
||||
note.view.edit=View/edit note
|
@ -16,6 +16,7 @@ import org.apache.wicket.markup.repeater.Item;
|
||||
import org.apache.wicket.model.IModel;
|
||||
import org.apache.wicket.model.LoadableDetachableModel;
|
||||
import org.apache.wicket.model.Model;
|
||||
import org.apache.wicket.model.StringResourceModel;
|
||||
import se.su.dsv.scipro.components.LargeModalWindow;
|
||||
import se.su.dsv.scipro.components.MaxLengthLabel;
|
||||
import se.su.dsv.scipro.components.ModalWindowPlus;
|
||||
@ -63,7 +64,7 @@ public class ProjectNoteColumn extends AbstractExportableColumn<Project, String>
|
||||
super(id, model);
|
||||
|
||||
ansv7779 marked this conversation as resolved
|
||||
ModalWindowPlus modal = new LargeModalWindow("edit_note_modal");
|
||||
modal.setTitle(model.map(Project::getTitle).map(projectTitle -> "View/Edit note for " + projectTitle));
|
||||
modal.setTitle(new StringResourceModel("note.modal.title", this, model));
|
||||
modal.setContent(componentId -> new ViewAndEditNoteForm(componentId, model));
|
||||
add(modal);
|
||||
|
||||
@ -91,7 +92,6 @@ public class ProjectNoteColumn extends AbstractExportableColumn<Project, String>
|
||||
modal.show(target);
|
||||
}
|
||||
};
|
||||
noteLink.setBody(Model.of("View/Edit note"));
|
||||
add(noteLink);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user
Use of String.format could work here?
Example
modal.setTitle(model.map(Project::getTitle).map(projectTitle -> String.format("View/Edit note for %s", projectTitle)));
What do you think?
Replaced with proper i18n