File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- ai.elimu:webapp:war:2.6.73 -SNAPSHOT
1+ ai.elimu:webapp:war:2.6.76 -SNAPSHOT
22+- ai.elimu:model:jar:model-2.0.114:compile
33| \- com.google.code.gson:gson:jar:2.13.1:compile
44| \- com.google.errorprone:error_prone_annotations:jar:2.38.0:compile
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public StoryBook readByTitle(String title) throws DataAccessException {
1919 "FROM StoryBook book " +
2020 "WHERE book.title = :title" )
2121 .setParameter ("title" , title )
22+ .setMaxResults (1 )
2223 .getSingleResult ();
2324 } catch (NoResultException e ) {
2425 return null ;
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ public String handleSubmit(
6868 StoryBook existingStoryBook = storybookDao .readByTitle (storyBook .getTitle ());
6969 if (existingStoryBook != null ) {
7070 result .rejectValue ("title" , "NonUnique" );
71+ model .addAttribute ("existingStoryBook" , existingStoryBook );
7172 }
7273
7374 if (result .hasErrors ()) {
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ public String handleSubmit(
149149 StoryBook existingStoryBook = storyBookDao .readByTitle (storyBook .getTitle ());
150150 if ((existingStoryBook != null ) && !existingStoryBook .getId ().equals (storyBook .getId ())) {
151151 result .rejectValue ("title" , "NonUnique" );
152+ model .addAttribute ("existingStoryBook" , existingStoryBook );
152153 }
153154
154155 if (result .hasErrors ()) {
Original file line number Diff line number Diff line change 77 <div class =" card-panel" >
88 <form:form modelAttribute =" storyBook" enctype =" multipart/form-data" >
99 <tag:formErrors modelAttribute =" storyBook" />
10+ <c:if test =" ${ not empty existingStoryBook } " >
11+ <div class =" row" >
12+ <div class =" col s12 m8 l6" >
13+ <div class =" storyBook card" >
14+ <div class =" headband" ></div >
15+ <c:set var =" coverImageUrl" value =" " />
16+ <c:if test =" ${ not empty existingStoryBook. coverImage } " >
17+ <c:set var =" coverImageUrl" value =" ${ existingStoryBook. coverImage. url } " />
18+ </c:if >
19+ <a class =" editLink" href =" <spring:url value='/content/storybook/edit/${ existingStoryBook. id } ' />" >
20+ <div class =" card-image" style =" background-image : url (<spring:url value= ' ${coverImageUrl}' /> ); background-color : #DDD ;" >
21+ <span class =" card-title" ><c:out value =" ${ existingStoryBook. title } " /></span >
22+ </div >
23+ </a >
24+ <div class =" card-content" >
25+ <p class =" grey-text" style =" margin-bottom : 0.5em ;" ><c:out value =" ${ existingStoryBook. description } " /></p >
26+ </div >
27+ </div >
28+ </div >
29+ </div >
30+ </c:if >
1031
1132 <div class =" col s12" style =" padding : 3em ; background : #F4F4F4 ; border : 2px dashed #CCC ; border-radius : 8px ;" >
1233 <p class =" center grey-text" >
Original file line number Diff line number Diff line change 77 <div class =" card-panel" >
88 <form:form modelAttribute =" storyBook" >
99 <tag:formErrors modelAttribute =" storyBook" />
10+ <c:if test =" ${ not empty existingStoryBook } " >
11+ <div class =" row" >
12+ <div class =" col s12 m8 l6" >
13+ <div class =" storyBook card" >
14+ <div class =" headband" ></div >
15+ <c:set var =" coverImageUrl" value =" " />
16+ <c:if test =" ${ not empty existingStoryBook. coverImage } " >
17+ <c:set var =" coverImageUrl" value =" ${ existingStoryBook. coverImage. url } " />
18+ </c:if >
19+ <a class =" editLink" href =" <spring:url value='/content/storybook/edit/${ existingStoryBook. id } ' />" >
20+ <div class =" card-image" style =" background-image : url (<spring:url value= ' ${coverImageUrl}' /> ); background-color : #DDD ;" >
21+ <span class =" card-title" ><c:out value =" ${ existingStoryBook. title } " /></span >
22+ </div >
23+ </a >
24+ <div class =" card-content" >
25+ <p class =" grey-text" style =" margin-bottom : 0.5em ;" ><c:out value =" ${ existingStoryBook. description } " /></p >
26+ </div >
27+ </div >
28+ </div >
29+ </div >
30+ </c:if >
1031
1132 <div class =" row" >
1233 <div class =" input-field col s12" >
Original file line number Diff line number Diff line change 2121 <div class =" card-panel" >
2222 <form:form modelAttribute =" storyBook" >
2323 <tag:formErrors modelAttribute =" storyBook" />
24+ <c:if test =" ${ not empty existingStoryBook } " >
25+ <div class =" row" >
26+ <div class =" col s12 m8 l6" >
27+ <div class =" storyBook card" >
28+ <div class =" headband" ></div >
29+ <c:set var =" coverImageUrl" value =" " />
30+ <c:if test =" ${ not empty existingStoryBook. coverImage } " >
31+ <c:set var =" coverImageUrl" value =" ${ existingStoryBook. coverImage. url } " />
32+ </c:if >
33+ <a class =" editLink" href =" <spring:url value='/content/storybook/edit/${ existingStoryBook. id } ' />" >
34+ <div class =" card-image" style =" background-image : url (<spring:url value= ' ${coverImageUrl}' /> ); background-color : #DDD ;" >
35+ <span class =" card-title" ><c:out value =" ${ existingStoryBook. title } " /></span >
36+ </div >
37+ </a >
38+ <div class =" card-content" >
39+ <p class =" grey-text" style =" margin-bottom : 0.5em ;" ><c:out value =" ${ existingStoryBook. description } " /></p >
40+ </div >
41+ </div >
42+ </div >
43+ </div >
44+ </c:if >
2445
2546 <form:hidden path =" revisionNumber" value =" ${ storyBook. revisionNumber } " />
2647
Original file line number Diff line number Diff line change 4848 <c:when test =" ${ code == ' NonUnique.packageName' } " >The package name already exists</c:when >
4949 <c:when test =" ${ code == ' NonUnique.valueIpa' } " >The IPA value already exists</c:when >
5050 <c:when test =" ${ code == ' NonUnique.valueSampa' } " >The X-SAMPA value already exists</c:when >
51+ <c:when test =" ${ code == ' NonUnique' } " >${ error. field } already exists</c:when >
5152 <c:when test =" ${ code == ' NotNull.bytes' } " >File must be selected</c:when >
5253 <c:when test =" ${ code == ' NotNull.motivation' } " >Personal motivation must be provided</c:when >
5354 <c:when test =" ${ code == ' NotNull.packageName' } " >Package name must be provided</c:when >
You can’t perform that action at this time.
0 commit comments