Mercurial Hosting > nabble
diff src/global/HtmlGlobalUtils.jtp @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children | e424dc827823 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/global/HtmlGlobalUtils.jtp Thu Mar 21 19:15:52 2019 -0600 @@ -0,0 +1,71 @@ +<% +package global; + +import global.web.Terms; +import nabble.view.lib.HtmlViewUtils; +import nabble.model.Init; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Calendar; + + +public class HtmlGlobalUtils { + + public static final String nabbleHost = (String)Init.get("nabbleHost"); + public static final String nabbleContextUrl = "http://" + nabbleHost; + + private static final int cssVersion = 13; + + public static final String nabbleSupportUrl = "http://support.nabble.com/"; + + public static void head(HttpServletRequest request, HttpServletResponse response, String title) + throws IOException + { + PrintWriter out = response.getWriter(); + %> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + <title>Nabble • <%=title%></title> + <link href='https://fonts.googleapis.com/css?family=Lato|Oswald' rel='stylesheet' type='text/css'> + <link rel="stylesheet" href="/assets/font-awesome/css/font-awesome.min.css?<%=cssVersion%>"> + <link rel="stylesheet" href="/assets/global.css?<%=cssVersion%>"> + <% + HtmlViewUtils.googleAnalytics(out); + } + + public static void header(HttpServletRequest request,HttpServletResponse response) + throws IOException + { + PrintWriter out = response.getWriter(); + %> + <div header center> + <a href="/"><img src="/assets/images/logo_nabble_home.png" width="236" height="50" alt="Nabble"/></a> + </div> + <% + } + + public static void footer(HttpServletRequest request,HttpServletResponse response) + throws IOException + { + PrintWriter out = response.getWriter(); + %> + <div dark full marginTop center footer> + <div content> + <a href="<%=HtmlGlobalUtils.nabbleContextUrl%>/help/Index.jtp" title="Nabble help articles">Help</a> + <a href="/PoweredBy.jtp" rel="nofollow">Powered by</a> + <a href="<%=Terms.path(false)%>" rel="nofollow">Terms of Use</a> + <a href="/PrivacyPolicy.jtp" rel="nofollow">Privacy Policy</a> + <a href="/ContactUs.jtp">Contact Us</a> + <div>© 2005-<%=Calendar.getInstance().get(Calendar.YEAR)%> Nabble, LLC.</div> + </div> + </div> + <% + } + + private HtmlGlobalUtils() {} // never +} + +%>