diff --git a/src/main/java/ai/elimu/web/content/letter/LetterEditController.java b/src/main/java/ai/elimu/web/content/letter/LetterEditController.java index 9054d5ec8..17d10df32 100644 --- a/src/main/java/ai/elimu/web/content/letter/LetterEditController.java +++ b/src/main/java/ai/elimu/web/content/letter/LetterEditController.java @@ -1,20 +1,14 @@ package ai.elimu.web.content.letter; import java.util.Calendar; -import javax.validation.Valid; -import org.apache.logging.log4j.Logger; -import ai.elimu.dao.LetterContributionEventDao; -import ai.elimu.dao.LetterDao; -import ai.elimu.model.content.Letter; -import ai.elimu.model.contributor.Contributor; -import ai.elimu.model.contributor.LetterContributionEvent; -import ai.elimu.util.DiscordHelper; -import ai.elimu.web.context.EnvironmentContextLoaderListener; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import javax.validation.Valid; + import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -23,6 +17,15 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import ai.elimu.dao.LetterContributionEventDao; +import ai.elimu.dao.LetterDao; +import ai.elimu.dao.LetterSoundDao; +import ai.elimu.model.content.Letter; +import ai.elimu.model.contributor.Contributor; +import ai.elimu.model.contributor.LetterContributionEvent; +import ai.elimu.util.DiscordHelper; +import ai.elimu.web.context.EnvironmentContextLoaderListener; + @Controller @RequestMapping("/content/letter/edit") public class LetterEditController { @@ -31,6 +34,9 @@ public class LetterEditController { @Autowired private LetterDao letterDao; + + @Autowired + private LetterSoundDao letterSoundDao; @Autowired private LetterContributionEventDao letterContributionEventDao; @@ -46,7 +52,9 @@ public String handleRequest( model.addAttribute("timeStart", System.currentTimeMillis()); model.addAttribute("letterContributionEvents", letterContributionEventDao.readAll(letter)); - + + model.addAttribute("letterSounds", letterSoundDao.readAll()); + return "content/letter/edit"; } diff --git a/src/main/webapp/WEB-INF/jsp/content/letter/edit.jsp b/src/main/webapp/WEB-INF/jsp/content/letter/edit.jsp index aa395f8ca..835913990 100644 --- a/src/main/webapp/WEB-INF/jsp/content/letter/edit.jsp +++ b/src/main/webapp/WEB-INF/jsp/content/letter/edit.jsp @@ -185,4 +185,48 @@ +
+ + + + + + + + + + + <%-- Check if the current letter is used by the letter-sound. --%> + + + + + + + + + + + + + + + + +
+ ${letterSound.usageCount} + + " + ${letter.text} + " + + ➞ + + / + + + ${s.valueIpa} + + / +