Mercurial Hosting > nabble
diff src/nabble/view/web/help/Answer.jtp @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/nabble/view/web/help/Answer.jtp Thu Mar 21 19:15:52 2019 -0600 @@ -0,0 +1,58 @@ +<% +package nabble.view.web.help; + +import fschmidt.util.servlet.JtpContext; +import nabble.view.lib.Cache; +import nabble.view.lib.Jtp; +import nabble.view.lib.Shared; +import nabble.view.lib.help.Help; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; + + +public class Answer extends HttpServlet { + + protected void service(HttpServletRequest request,HttpServletResponse response) + throws ServletException, IOException + { + JtpContext jtpContext = (JtpContext)getServletContext().getAttribute(JtpContext.attrName); + jtpContext.setEtag(request,response); + PrintWriter out = response.getWriter(); + Help help = Help.getHelp(Jtp.getInt(request,"id")); + if (help == null) { + Shared.simplePage("Invalid Help Article", null, "Invalid Help Article", "The help article you are trying to open doesn't exist or was removed.<br>Please contact Nabble Support if you need help.", request, response); + return; + } + String metaDescription = help.getMetaDescription(); + String metaKeywords = help.getMetaKeywords(); + %> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> + <html> + <head> + <% if (metaDescription != null) { %><META NAME="description" CONTENT="<%=metaDescription%>"><% } %> + <% if (metaKeywords != null) { %><META NAME="keywords" CONTENT="<%=metaKeywords%>"><% } %> + <% Shared.canonical(request, response); %> + <% Shared.title(request,response,"Help - "+help.question); %> + </head> + <body> + <% Shared.helpHeader(request,response); %> + <div class="content-description"> + <h1><%=help.question%></h1> + <%=help.answer()%> + <p>If you still have questions, visit <a href="<%=Jtp.helpIndexUrl(request,response)%>">Nabble Help</a> or the <%=Jtp.supportLink()%> forum.</p> + + <p><br />« <a href="javascript:history.back();">Go Back</a></p> + </div> + <% Shared.footer(request,response); %> + <% Shared.analytics(request,response); %> + </body> + </html> + <% + } +} +%>