Mon, 09 Aug 2021 16:22:56 +0200
#153 adds comment box to issues form
1.1 --- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Mon Aug 09 15:50:37 2021 +0200 1.2 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Mon Aug 09 16:22:56 2021 +0200 1.3 @@ -557,6 +557,13 @@ 1.4 dao.insertIssue(issue) 1.5 } else { 1.6 dao.updateIssue(issue) 1.7 + val newComment = http.param("comment") 1.8 + if (!newComment.isNullOrBlank()) { 1.9 + dao.insertComment(IssueComment(-1, issue.id).apply { 1.10 + author = http.remoteUser?.let { dao.findUserByName(it) } 1.11 + comment = newComment 1.12 + }) 1.13 + } 1.14 issue.id 1.15 } 1.16
2.1 --- a/src/main/resources/localization/strings.properties Mon Aug 09 15:50:37 2021 +0200 2.2 +++ b/src/main/resources/localization/strings.properties Mon Aug 09 16:22:56 2021 +0200 2.3 @@ -71,6 +71,7 @@ 2.4 issue.category.Task=Task 2.5 issue.category.Test=Test 2.6 issue.category=Category 2.7 +issue.comment=Comment 2.8 issue.comments.anonauthor=Anonymous Author 2.9 issue.comments.lastupdate=Last edited: 2.10 issue.comments.updateCount=total edits
3.1 --- a/src/main/resources/localization/strings_de.properties Mon Aug 09 15:50:37 2021 +0200 3.2 +++ b/src/main/resources/localization/strings_de.properties Mon Aug 09 16:22:56 2021 +0200 3.3 @@ -70,6 +70,7 @@ 3.4 issue.category.Task=Aufgabe 3.5 issue.category.Test=Test 3.6 issue.category=Kategorie 3.7 +issue.comment=Kommentar 3.8 issue.comments.anonauthor=Anonymer Autor 3.9 issue.comments.lastupdate=Zuletzt bearbeitet: 3.10 issue.comments.updateCount=mal bearbeitet
4.1 --- a/src/main/webapp/WEB-INF/jsp/issue-form.jsp Mon Aug 09 15:50:37 2021 +0200 4.2 +++ b/src/main/webapp/WEB-INF/jsp/issue-form.jsp Mon Aug 09 16:22:56 2021 +0200 4.3 @@ -52,9 +52,9 @@ 4.4 </tr> 4.5 </c:if> 4.6 <tr> 4.7 - <th><fmt:message key="component"/></th> 4.8 + <th><label for="issue-component"><fmt:message key="component"/></label></th> 4.9 <td> 4.10 - <select name="component"> 4.11 + <select id="issue-component" name="component"> 4.12 <option value="-1"><fmt:message key="placeholder.null-component"/></option> 4.13 <c:forEach var="comp" items="${viewmodel.components}"> 4.14 <option 4.15 @@ -65,9 +65,9 @@ 4.16 </td> 4.17 </tr> 4.18 <tr> 4.19 - <th><fmt:message key="issue.category"/></th> 4.20 + <th><label for="issue-category"><fmt:message key="issue.category"/></label></th> 4.21 <td> 4.22 - <select name="category"> 4.23 + <select id="issue-category" name="category"> 4.24 <c:forEach var="category" items="${viewmodel.issueCategory}"> 4.25 <option 4.26 <c:if test="${category eq issue.category}">selected</c:if> 4.27 @@ -79,9 +79,9 @@ 4.28 </td> 4.29 </tr> 4.30 <tr> 4.31 - <th><fmt:message key="issue.status"/></th> 4.32 + <th><label for="issue-status"><fmt:message key="issue.status"/></label></th> 4.33 <td> 4.34 - <select name="status"> 4.35 + <select id="issue-status" name="status"> 4.36 <c:forEach var="status" items="${viewmodel.issueStatus}"> 4.37 <option 4.38 <c:if test="${status eq issue.status}">selected</c:if> 4.39 @@ -93,19 +93,19 @@ 4.40 </td> 4.41 </tr> 4.42 <tr> 4.43 - <th><fmt:message key="issue.subject"/></th> 4.44 - <td><input name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td> 4.45 + <th><label for="issue-subject"><fmt:message key="issue.subject"/></label></th> 4.46 + <td><input id="issue-subject" name="subject" type="text" maxlength="200" required value="<c:out value="${issue.subject}"/>" /></td> 4.47 </tr> 4.48 <tr> 4.49 - <th class="vtop"><fmt:message key="issue.description"/></th> 4.50 + <th class="vtop"><label for="issue-description"><fmt:message key="issue.description"/></label></th> 4.51 <td> 4.52 - <textarea name="description" rows="10"><c:out value="${issue.description}"/></textarea> 4.53 + <textarea id="issue-description" name="description" rows="10"><c:out value="${issue.description}"/></textarea> 4.54 </td> 4.55 </tr> 4.56 <tr> 4.57 - <th><fmt:message key="issue.assignee"/></th> 4.58 + <th><label for="issue-assignee"><fmt:message key="issue.assignee"/></label></th> 4.59 <td> 4.60 - <select name="assignee"> 4.61 + <select id="issue-assignee" name="assignee"> 4.62 <option value="-2" title="<fmt:message key="placeholder.auto-assignee.tooltip"/>"><fmt:message key="placeholder.auto-assignee"/></option> 4.63 <option value="-1" 4.64 <c:if test="${issue.id ge 0 and empty issue.assignee}">selected</c:if> 4.65 @@ -120,7 +120,7 @@ 4.66 </tr> 4.67 <c:if test="${issue.project.id ge 0}"> 4.68 <tr> 4.69 - <th class="vtop"><fmt:message key="issue.affected-versions"/></th> 4.70 + <th class="vtop"><label for="issue-affected"><fmt:message key="issue.affected-versions"/></label></th> 4.71 <td> 4.72 <c:set var="fieldname" value="affected"/> 4.73 <c:set var="selectionList" value="${viewmodel.versionsRecent}"/> 4.74 @@ -129,7 +129,7 @@ 4.75 </td> 4.76 </tr> 4.77 <tr> 4.78 - <th class="vtop"><fmt:message key="issue.resolved-versions"/></th> 4.79 + <th class="vtop"><label for="issue-resolved"><fmt:message key="issue.resolved-versions"/></label></th> 4.80 <td> 4.81 <c:set var="fieldname" value="resolved"/> 4.82 <c:set var="selectionList" value="${viewmodel.versionsUpcoming}"/> 4.83 @@ -139,9 +139,15 @@ 4.84 </tr> 4.85 </c:if> 4.86 <tr> 4.87 - <th><fmt:message key="issue.eta"/></th> 4.88 - <td><input name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td> 4.89 + <th><label for="issue-eta"><fmt:message key="issue.eta"/></label></th> 4.90 + <td><input id="issue-eta" name="eta" type="date" value="<fmt:formatDate value="${issue.eta}" pattern="YYYY-MM-dd" />" /> </td> 4.91 </tr> 4.92 + <c:if test="${issue.id ge 0}"> 4.93 + <tr> 4.94 + <th class="vtop"><label for="issue-comment"><fmt:message key="issue.comment"/></label> </th> 4.95 + <td><textarea id="issue-comment" rows="3" name="comment"></textarea></td> 4.96 + </tr> 4.97 + </c:if> 4.98 </tbody> 4.99 <tfoot> 4.100 <tr>
5.1 --- a/src/main/webapp/WEB-INF/jsp/issue-view.jsp Mon Aug 09 15:50:37 2021 +0200 5.2 +++ b/src/main/webapp/WEB-INF/jsp/issue-view.jsp Mon Aug 09 16:22:56 2021 +0200 5.3 @@ -158,7 +158,7 @@ 5.4 <table class="formtable fullwidth"> 5.5 <tbody> 5.6 <tr> 5.7 - <td><textarea rows="5" name="comment" required></textarea></td> 5.8 + <td><textarea rows="3" name="comment" required></textarea></td> 5.9 </tr> 5.10 </tbody> 5.11 <tfoot>
6.1 --- a/src/main/webapp/WEB-INF/jspf/version-list.jspf Mon Aug 09 15:50:37 2021 +0200 6.2 +++ b/src/main/webapp/WEB-INF/jspf/version-list.jspf Mon Aug 09 16:22:56 2021 +0200 6.3 @@ -1,6 +1,6 @@ 6.4 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 6.5 6.6 -<select name="${fieldname}" multiple> 6.7 +<select id="issue-${fieldname}" name="${fieldname}" multiple> 6.8 <c:forEach var="vselitem" items="${selectionList}"> 6.9 <option value="${vselitem.id}" 6.10 <c:forEach var="v" items="${data}">