link.setVisible(ISIApplication.get().isPageNumbersOn());
link.add(new Label("pageNum", String.valueOf(pageNumDisplay)).setRenderBodyOnly(true));
feedbackRequired = false;
Icon envelopImage;
if (page.equals(currentPage)) {
envelopImage = new EnvelopImageWithStatusUpdate("icon", new Model<ISIXmlSection>(page));
link.setEnabled(false);
link.add(new ClassAttributeModifier("current"));
} else {
envelopImage = new EnvelopeImage("icon", new Model<ISIXmlSection>(page));
}
// for teachers add any of the status icons, for students, just add the envelope if appropriate
if (teacher && (currentSectionStatus != null)) {
// if the page has feedback (red envelope) then display the envelope
// otherwise, display the needs review icon or no icon at all
if ((currentSectionStatus.getCompleted() == true) &&
(currentSectionStatus.getReviewed() == false) &&
(!feedbackRequired)) {
Icon icon = new Icon("icon", "img/icons/status_ready.png", "Ready for review");
link.add(icon);
// don't display the status icon if there's no response group on this page
icon.setVisible(page.hasResponseGroup());
} else {
link.add(envelopImage);
}
} else { // just add the envelope for the student
link.add(envelopImage);