Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,4 @@ public List<ImageWithLinkDto> banners(Long dataverseId) {
dataverseSession.getLocaleCode());
}

public void redirect(String link) throws IOException {

if (!link.startsWith("http")) {
link = "http://".concat(link);
}
FacesContext.getCurrentInstance().getExternalContext().redirect(link);
}
}
13 changes: 7 additions & 6 deletions fairchive-webapp/src/main/webapp/text-messagesAndBanners.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@
<ui:repeat value="#{banners}"
var="banner">
<div style="display: flex;align-content: center;">
<h:commandLink style="text-align: center; display: block; margin: auto; padding: 10px; "
target="_blank"
disabled="#{banner.link == null}"
action="#{MessagesAndBannersFragment.redirect(banner.link)}">
<h:outputLink style="text-align: center; display: block; margin: auto; padding: 10px; "
value="#{banner.link}"
target="_blank"
disabled="#{banner.link == null}"
title="#{bundle['opensInNewTab']}">
<p:graphicImage
stream="false"
value="#{banner.image}"
alt="#{bundle['header.banner.alt']} #{banner.link != null ? bundle['opensInNewTab'] : ''}"
title="#{bundle['header.banner.alt']} #{banner.link != null ? bundle['opensInNewTab'] : ''}"
/>
</h:commandLink>
</div>
</h:outputLink>
</div>
</ui:repeat>
</div>
</h:form>
Expand Down
Loading