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

changeset 392
c0c7b4ca2946
parent 348
1dc9c405e9e2
--- a/src/main/webapp/WEB-INF/jsp/variant-form.jsp	Mon Sep 22 20:00:59 2025 +0200
+++ b/src/main/webapp/WEB-INF/jsp/variant-form.jsp	Sat Oct 04 13:34:33 2025 +0200
@@ -29,8 +29,12 @@
 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 
 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.VariantEditView" scope="request" />
+<c:set var="project" scope="page" value="${viewmodel.projectInfo.project}"/>
 <c:set var="variant" scope="page" value="${viewmodel.variant}"/>
-<c:set var="project" scope="page" value="${viewmodel.projectInfo.project}"/>
+<c:set scope="page" var="returnLink" value="${requestScope[Constants.REQ_ATTR_REFERER]}"/>
+<c:if test="${empty returnLink}">
+    <c:set scope="page" var="returnLink" value="./projects/${project.node}/variants/"/>
+</c:if>
 
 <form action="./projects/${project.node}/variants/-/commit" method="post">
     <table class="formtable" style="width: 70ch">
@@ -81,7 +85,8 @@
         <tr>
             <td colspan="2">
                 <input type="hidden" name="id" value="${variant.id}"/>
-                <a href="./projects/${project.node}/variants/" class="button">
+                <input type="hidden" name="returnLink" value="${returnLink}"/>
+                <a href="${returnLink}" class="button">
                     <fmt:message key="button.cancel"/>
                 </a>
                 <button type="submit"><fmt:message key="button.okay"/></button>

mercurial