src/main/webapp/WEB-INF/jsp/project-form.jsp

Mon, 05 Apr 2021 17:56:46 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 05 Apr 2021 17:56:46 +0200
changeset 187
0bf35031a918
parent 184
e8eecee6aadf
child 284
671c1c8fbf1c
permissions
-rw-r--r--

project name and node may have 50 chars - fixes #118

     1 <%--
     2 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4 Copyright 2021 Mike Becker. All rights reserved.
     6 Redistribution and use in source and binary forms, with or without
     7 modification, are permitted provided that the following conditions are met:
     9 1. Redistributions of source code must retain the above copyright
    10 notice, this list of conditions and the following disclaimer.
    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.
    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" %>
    31 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.ProjectEditView" scope="request" />
    32 <c:set var="project" scope="page" value="${viewmodel.project}"/>
    34 <form action="./projects/-/commit" method="post">
    35     <table class="formtable">
    36         <colgroup>
    37             <col>
    38             <col style="width: 75ch">
    39         </colgroup>
    40         <tbody>
    41         <tr>
    42             <th><fmt:message key="project.name"/></th>
    43             <td><input name="name" type="text" maxlength="50" required value="<c:out value="${project.name}"/>" /></td>
    44         </tr>
    45         <tr title="<fmt:message key="node.tooltip"/>">
    46             <th><fmt:message key="node"/></th>
    47             <td><input name="node" type="text" maxlength="50" value="<c:out value="${project.node}"/>" /></td>
    48         </tr>
    49         <tr>
    50             <th><fmt:message key="description"/></th>
    51             <td><input type="text" name="description" maxlength="200" value="<c:out value="${project.description}"/>" /></td>
    52         </tr>
    53         <tr>
    54             <th><fmt:message key="project.repoUrl"/></th>
    55             <td><input name="repoUrl" type="url" maxlength="50" value="<c:out value="${project.repoUrl}"/>" /></td>
    56         </tr>
    57         <tr>
    58             <th><fmt:message key="project.owner"/></th>
    59             <td>
    60                 <select name="owner">
    61                     <option value="-1"><fmt:message key="placeholder.null-owner"/></option>
    62                     <c:forEach var="user" items="${viewmodel.users}">
    63                         <option
    64                                 <c:if test="${not empty project.owner and user eq project.owner}">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="ordinal.tooltip" />">
    71             <th><fmt:message key="ordinal"/></th>
    72             <td>
    73                 <input name="ordinal" type="number" value="${project.ordinal}"/>
    74             </td>
    75         </tr>
    76         </tbody>
    77         <tfoot>
    78         <tr>
    79             <td colspan="2">
    80                 <input type="hidden" name="id" value="${project.id}"/>
    81                 <a href="./projects/" class="button">
    82                     <fmt:message key="button.cancel"/>
    83                 </a>
    84                 <button type="submit"><fmt:message key="button.okay"/></button>
    85             </td>
    86         </tr>
    87         </tfoot>
    88     </table>
    89 </form>

mercurial