NIHVIVO-2893 Add a Cancel link to the "
This commit is contained in:
parent
0e3d374e25
commit
00f146c992
2 changed files with 7 additions and 1 deletions
|
@ -269,6 +269,7 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
||||||
urls.put("theme", UrlBuilder.getUrl(themeDir));
|
urls.put("theme", UrlBuilder.getUrl(themeDir));
|
||||||
urls.put("index", UrlBuilder.getUrl("/browse"));
|
urls.put("index", UrlBuilder.getUrl("/browse"));
|
||||||
urls.put("currentPage", getCurrentPageUrl(vreq));
|
urls.put("currentPage", getCurrentPageUrl(vreq));
|
||||||
|
urls.put("referringPage", getReferringPageUrl(vreq));
|
||||||
|
|
||||||
if (PolicyHelper.isAuthorizedForActions(vreq, new EditOwnAccount())) {
|
if (PolicyHelper.isAuthorizedForActions(vreq, new EditOwnAccount())) {
|
||||||
urls.put("myAccount", UrlBuilder.getUrl("/accounts/myAccount"));
|
urls.put("myAccount", UrlBuilder.getUrl("/accounts/myAccount"));
|
||||||
|
@ -287,6 +288,11 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
||||||
return UrlBuilder.getUrl(path);
|
return UrlBuilder.getUrl(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getReferringPageUrl(HttpServletRequest request) {
|
||||||
|
String referrer = request.getHeader("referer");
|
||||||
|
return (referrer == null) ? UrlBuilder.getHomeUrl() : referrer;
|
||||||
|
}
|
||||||
|
|
||||||
protected TemplateModel wrap(Object obj, int exposureLevel) throws TemplateModelException {
|
protected TemplateModel wrap(Object obj, int exposureLevel) throws TemplateModelException {
|
||||||
BeansWrapper wrapper = getBeansWrapper(exposureLevel);
|
BeansWrapper wrapper = getBeansWrapper(exposureLevel);
|
||||||
return wrapper.wrap(obj);
|
return wrapper.wrap(obj);
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
<input type="password" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input" />
|
<input type="password" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input" />
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<p><input type="submit" name="submitMyAccount" value="Save changes" class="submit" /></p>
|
<p><input type="submit" name="submitMyAccount" value="Save changes" class="submit" /> or <a class="cancel" href="${urls.referringPage}">Cancel</a></p>
|
||||||
|
|
||||||
<p class="requiredHint">* required fields</p>
|
<p class="requiredHint">* required fields</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Add table
Reference in a new issue