updates for cancel link to accept parameter vivo-393
This commit is contained in:
parent
9f9e833253
commit
271c1e9063
3 changed files with 32 additions and 19 deletions
|
@ -55,6 +55,15 @@ public class PostEditCleanupController extends FreemarkerHttpServlet{
|
|||
return new RedirectResponseValues( UrlBuilder.getHomeUrl() );
|
||||
}
|
||||
|
||||
//In some cases, a generator/form may have a regular URL to return to but the same generator
|
||||
//may be used from different pages, so a parameter allowing the form to return to a specific page
|
||||
//would be useful
|
||||
|
||||
String returnURLParameter = vreq.getParameter("returnURL");
|
||||
if(returnURLParameter != null) {
|
||||
return new DirectRedirectResponseValues( returnURLParameter );
|
||||
}
|
||||
|
||||
// If there is a urlToReturnTo that takes precedence
|
||||
if( editConfig.getUrlToReturnTo() != null && ! editConfig.getUrlToReturnTo().trim().isEmpty()){
|
||||
//this does not get value substitution or the predicate anchor
|
||||
|
|
|
@ -666,7 +666,13 @@ public class EditConfigurationTemplateModel extends BaseTemplateModel {
|
|||
//this url is for canceling
|
||||
public String getCancelUrl() {
|
||||
String editKey = editConfig.getEditKey();
|
||||
return EditConfigurationUtils.getCancelUrlBase(vreq) + "?editKey=" + editKey + "&cancel=true";
|
||||
String cancelURL = EditConfigurationUtils.getCancelUrlBase(vreq) + "?editKey=" + editKey + "&cancel=true";
|
||||
//Check for special return url parameter
|
||||
String returnURLParameter = vreq.getParameter("returnURL");
|
||||
if(returnURLParameter != null && !returnURLParameter.isEmpty() ) {
|
||||
cancelURL += "&returnURL=" + returnURLParameter;
|
||||
}
|
||||
return cancelURL;
|
||||
}
|
||||
|
||||
//Get confirm deletion url
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
<#include "individual-setup.ftl">
|
||||
|
||||
<#assign hasElement = propertyGroups.pullProperty("${namespaces.display}hasElement")!>
|
||||
|
||||
<#assign addNewMenuItemUrl = "${urls.base}/menuManagementController?cmd=add" >
|
||||
<#assign returnURL = "/vivo/individual?uri=http%3A%2F%2Fvitro.mannlib.cornell.edu%2Fontologies%2Fdisplay%2F1.1%23DefaultMenu&switchToDisplayModel=true" />
|
||||
|
||||
<#if hasElement?has_content>
|
||||
<script type="text/javascript">
|
||||
|
@ -24,13 +23,13 @@
|
|||
|
||||
<#-- Link to add a new menu item -->
|
||||
<#if editable>
|
||||
<#if addNewMenuItemUrl?has_content>
|
||||
<form id="pageListForm" action="${urls.base}/editRequestDispatch" method="get">
|
||||
<input type="hidden" name="typeOfNew" value="http://vitro.mannlib.cornell.edu/ontologies/display/1.1#Page">
|
||||
<input type="hidden" name="switchToDisplayModel" value="1">
|
||||
<input type="hidden" name="editForm" value="edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManagePageGenerator" role="input">
|
||||
<input type="hidden" name="addMenuItem" value="true" />
|
||||
<input id="submit" value="Add new menu page" role="button" type="submit" >
|
||||
<input type="hidden" name="returnURL" value="${returnURL?url}" />
|
||||
<#if verbosePropertySwitch.url?contains("pageManagement")>
|
||||
<span class="or"> ${i18n().or} </span>
|
||||
<a style="margin-left:7px" href="${urls.base}/pageList" title="Return to Profile Page">Return to Page Management</a>
|
||||
|
@ -40,7 +39,6 @@
|
|||
<br />
|
||||
<p class="note">${i18n().refresh_page_after_reordering}</p>
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/individual/individual.css" />',
|
||||
'<link rel="stylesheet" href="${urls.base}/css/individual/menuManagement-menuItems.css" />')}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue