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

Sat, 15 Jul 2023 13:45:48 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 15 Jul 2023 13:45:48 +0200
changeset 276
2a169e4d1d13
parent 227
f0ede8046b59
permissions
-rw-r--r--

fix typo in component node field name - fixes #268

     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.ComponentEditView" scope="request" />
    32 <c:set var="component" scope="page" value="${viewmodel.component}"/>
    33 <c:set var="project" scope="page" value="${viewmodel.projectInfo.project}"/>
    35 <form action="./projects/${project.node}/components/-/commit" 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="project"/></th>
    44             <td>
    45                 <c:out value="${project.name}" />
    46                 <input type="hidden" name="projectid" value="${project.id}" />
    47             </td>
    48         </tr>
    49         <tr>
    50             <th><label for="component-name"><fmt:message key="component"/></label></th>
    51             <td><input id="component-name" name="name" type="text" maxlength="20" required value="<c:out value="${component.name}"/>" /></td>
    52         </tr>
    53         <tr title="<fmt:message key="node.tooltip"/>">
    54             <th><label for="component-node"><fmt:message key="node"/></label></th>
    55             <td><input id="component-node" name="node" type="text" maxlength="20" value="<c:out value="${component.node}"/>" /></td>
    56         </tr>
    57         <tr>
    58             <th><label for="component-color"><fmt:message key="component.color"/></label></th>
    59             <td><input id="component-color" name="color" type="color" required value="${component.color}" /></td>
    60         </tr>
    61         <tr>
    62             <th><label for="component-lead"><fmt:message key="component.lead"/></label></th>
    63             <td>
    64                 <select id="component-lead" name="lead">
    65                     <option value="-1"><fmt:message key="placeholder.null-lead"/></option>
    66                     <c:forEach var="user" items="${viewmodel.users}">
    67                         <option
    68                                 <c:if test="${not empty component.lead and user eq component.lead}">selected</c:if>
    69                                 value="${user.id}"><c:out value="${user.displayname}"/></option>
    70                     </c:forEach>
    71                 </select>
    72             </td>
    73         </tr>
    74         <tr title="<fmt:message key="ordinal.tooltip" />">
    75             <th><label for="component-ordinal"><fmt:message key="ordinal"/></label></th>
    76             <td>
    77                 <input id="component-ordinal" name="ordinal" type="number" value="${component.ordinal}"/>
    78             </td>
    79         </tr>
    80         <tr>
    81             <th class="vtop"><label for="component-description"><fmt:message key="description"/></label></th>
    82             <td>
    83                 <textarea id="component-description" name="description" rows="5"><c:out value="${component.description}"/></textarea>
    84             </td>
    85         </tr>
    86         <tr>
    87             <th><label for="component-active"><fmt:message key="component.active"/></label></th>
    88             <td>
    89                 <input type="checkbox" id="component-active" name="active" <c:if test="${component.active}">checked</c:if> >
    90             </td>
    91         </tr>
    92         </tbody>
    93         <tfoot>
    94         <tr>
    95             <td colspan="2">
    96                 <input type="hidden" name="id" value="${component.id}"/>
    97                 <a href="./projects/${project.node}/components/" class="button">
    98                     <fmt:message key="button.cancel"/>
    99                 </a>
   100                 <button type="submit"><fmt:message key="button.okay"/></button>
   101             </td>
   102         </tr>
   103         </tfoot>
   104     </table>
   105 </form>

mercurial