Skip to content

Commit

Permalink
customize logo and footer
Browse files Browse the repository at this point in the history
  • Loading branch information
cleydyr committed Jun 2, 2024
1 parent 156d0b3 commit de0aca7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
26 changes: 26 additions & 0 deletions src/main/java/biblivre/core/controllers/SchemaServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

public class SchemaServlet extends HttpServlet {

Expand All @@ -70,6 +71,24 @@ public class SchemaServlet extends HttpServlet {

private RequestParserHelper requestParserHelper;

@Value("${biblivre.logo.href:https://biblivre.org.br}")
private String logoHref;

@Value("${biblivre.logo.image.src:/static/images/logo.png}")
private String logoImageSrc;

@Value("${biblivre.logo.image.alt:Biblivre}")
private String logoImageAlt;

@Value("${biblivre.footer.copyright.pre:Copyright ©}")
private String footerPre;

@Value("${biblivre.footer.copyright.href:https://biblivre.org.br}")
private String footerHref;

@Value("${biblivre.footer.copyright.text}")
private String footerText;

@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Expand Down Expand Up @@ -168,6 +187,13 @@ protected void processDynamicRequest(
controller = "jsp";
}

request.setAttribute("logoHref", logoHref);
request.setAttribute("logoImageSrc", logoImageSrc);
request.setAttribute("logoImageAlt", logoImageAlt);
request.setAttribute("footerHref", footerHref);
request.setAttribute("footerText", footerText);
request.setAttribute("footerPre", footerPre);

switch (controller) {
case "jsp" -> {
jspController.setHeaderOnly(headerOnly);
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/WEB-INF/jsp/taglib/layout/body/end.jsp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

</div>
<div class="px"></div>
</div>
<div id="copyright">
Copyright &copy; <a href="http://biblivre.org.br" target="_blank">BIBLIVRE</a>
<c:out value="${footerPre}" /> <a href="${footerHref}" target="_blank"><c:out value="${footerText}" /></a>
</div>
</div>
</form>
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/jsp/taglib/layout/body/start.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
<input type="hidden" name="module" id="module" value="login">
<input type="hidden" name="action" id="action" value='${isLogged ? "logout" : "login"}'>

<div id="header">
<header id="header">
<div id="logo_biblivre">
<a href="http://biblivre.org.br/" target="_blank">
<img src="/static/images/logo_biblivre.png" width="117" height="66" alt="Biblivre V">
<a href="${logoHref}" target="_blank">
<img src="${logoImageSrc}" height="66" alt="Logo">
</a>
</div>

Expand Down Expand Up @@ -114,7 +114,7 @@
<div id=slider ></div>
</div>
</div>
</div>
</header>

<div id=notifications>
<div id=messages>
Expand Down

0 comments on commit de0aca7

Please sign in to comment.