| |
1 <%-- |
| |
2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
| |
3 |
| |
4 Copyright 2020 Mike Becker. All rights reserved. |
| |
5 |
| |
6 Redistribution and use in source and binary forms, with or without |
| |
7 modification, are permitted provided that the following conditions are met: |
| |
8 |
| |
9 1. Redistributions of source code must retain the above copyright |
| |
10 notice, this list of conditions and the following disclaimer. |
| |
11 |
| |
12 2. Redistributions in binary form must reproduce the above copyright |
| |
13 notice, this list of conditions and the following disclaimer in the |
| |
14 documentation and/or other materials provided with the distribution. |
| |
15 |
| |
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| |
17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| |
18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| |
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| |
20 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| |
21 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| |
22 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| |
23 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| |
24 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| |
25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| |
26 --%> |
| |
27 <%@page pageEncoding="UTF-8" %> |
| |
28 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> |
| |
29 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> |
| |
30 |
| |
31 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.ComponentEditView" scope="request" /> |
| |
32 <c:set var="component" scope="page" value="${viewmodel.component}"/> |
| |
33 <c:set var="project" scope="page" value="${viewmodel.projectInfo.project}"/> |
| |
34 |
| |
35 <form action="./projects/commit-component" method="post"> |
| |
36 <table class="formtable" style="width: 70ch"> |
| |
37 <colgroup> |
| |
38 <col> |
| |
39 <col style="width: 100%"> |
| |
40 </colgroup> |
| |
41 <tbody> |
| |
42 <tr> |
| |
43 <th><fmt:message key="component.project"/></th> |
| |
44 <td> |
| |
45 <c:out value="${project.name}" /> |
| |
46 <input type="hidden" name="pid" value="${project.id}" /> |
| |
47 </td> |
| |
48 </tr> |
| |
49 <tr> |
| |
50 <th><fmt:message key="component.name"/></th> |
| |
51 <td><input name="name" type="text" maxlength="20" required value="<c:out value="${component.name}"/>" /></td> |
| |
52 </tr> |
| |
53 <tr> |
| |
54 <th><fmt:message key="component.color"/></th> |
| |
55 <td><input name="color" type="color" required value="${component.color}" /></td> |
| |
56 </tr> |
| |
57 <tr> |
| |
58 <th><fmt:message key="component.lead"/></th> |
| |
59 <td> |
| |
60 <select name="lead"> |
| |
61 <option value="-1"><fmt:message key="placeholder.null-lead"/></option> |
| |
62 <c:forEach var="user" items="${viewmodel.users}"> |
| |
63 <option |
| |
64 <c:if test="${not empty component.lead and user eq component.lead}">selected</c:if> |
| |
65 value="${user.id}"><c:out value="${user.displayname}"/></option> |
| |
66 </c:forEach> |
| |
67 </select> |
| |
68 </td> |
| |
69 </tr> |
| |
70 <tr title="<fmt:message key="tooltip.ordinal" />"> |
| |
71 <th><fmt:message key="component.ordinal"/></th> |
| |
72 <td> |
| |
73 <input name="ordinal" type="number" min="0" value="${component.ordinal}"/> |
| |
74 </td> |
| |
75 </tr> |
| |
76 <tr> |
| |
77 <th class="vtop"><fmt:message key="component.description"/></th> |
| |
78 <td> |
| |
79 <textarea name="description" rows="5"><c:out value="${component.description}"/></textarea> |
| |
80 </td> |
| |
81 </tr> |
| |
82 </tbody> |
| |
83 <tfoot> |
| |
84 <tr> |
| |
85 <td colspan="2"> |
| |
86 <input type="hidden" name="id" value="${component.id}"/> |
| |
87 <a href="./projects/${project.node}/components/" class="button"> |
| |
88 <fmt:message bundle="${lightpit_bundle}" key="button.cancel"/> |
| |
89 </a> |
| |
90 <button type="submit"><fmt:message bundle="${lightpit_bundle}" key="button.okay"/></button> |
| |
91 </td> |
| |
92 </tr> |
| |
93 </tfoot> |
| |
94 </table> |
| |
95 </form> |