xref: /OpenGrok/opengrok-web/src/main/webapp/mast.jsp (revision 3db691be5c4efc07627cb326110daaec37d6820a)
10d40e9d0SAdam Hornáček<%--
20d40e9d0SAdam Hornáček$Id$
30d40e9d0SAdam Hornáček
40d40e9d0SAdam HornáčekCDDL HEADER START
50d40e9d0SAdam Hornáček
60d40e9d0SAdam HornáčekThe contents of this file are subject to the terms of the
70d40e9d0SAdam HornáčekCommon Development and Distribution License (the "License").
80d40e9d0SAdam HornáčekYou may not use this file except in compliance with the License.
90d40e9d0SAdam Hornáček
100d40e9d0SAdam HornáčekSee LICENSE.txt included in this distribution for the specific
110d40e9d0SAdam Hornáčeklanguage governing permissions and limitations under the License.
120d40e9d0SAdam Hornáček
130d40e9d0SAdam HornáčekWhen distributing Covered Code, include this CDDL HEADER in each
140d40e9d0SAdam Hornáčekfile and include the License file at LICENSE.txt.
150d40e9d0SAdam HornáčekIf applicable, add the following below this CDDL HEADER, with the
160d40e9d0SAdam Hornáčekfields enclosed by brackets "[]" replaced with your own identifying
170d40e9d0SAdam Hornáčekinformation: Portions Copyright [yyyy] [name of copyright owner]
180d40e9d0SAdam Hornáček
190d40e9d0SAdam HornáčekCDDL HEADER END
200d40e9d0SAdam Hornáček
2156f072caSAdam HornáčekCopyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
220d40e9d0SAdam HornáčekPortions Copyright 2011 Jens Elkner.
23a804b2d7SAdam HornáčekPortions Copyright (c) 2018, Chris Fraire <cfraire@me.com>.
240d40e9d0SAdam Hornáček
250d40e9d0SAdam Hornáček--%><%--
260d40e9d0SAdam Hornáček
270d40e9d0SAdam HornáčekAfter include you are here: /body/div#page/div#content/
280d40e9d0SAdam Hornáček
290d40e9d0SAdam Hornáček--%>
30a804b2d7SAdam Hornáček<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
314ce4e2b9SAdam Hornáček<%@page import="org.opengrok.indexer.web.messages.MessagesContainer"%>
320d40e9d0SAdam Hornáček<%@ page session="false" errorPage="error.jsp" import="
33686556f2SAdam Hornáčekorg.opengrok.indexer.web.PageConfig,
34686556f2SAdam Hornáčekorg.opengrok.indexer.web.Prefix,
35*3db691beSVladimir Kotalorg.opengrok.indexer.web.Util"%>
36*3db691beSVladimir Kotal<%@ page import="org.opengrok.indexer.web.messages.MessagesUtils" %>
37*3db691beSVladimir Kotal<%
380d40e9d0SAdam Hornáček/* ---------------------- mast.jsp start --------------------- */
390d40e9d0SAdam Hornáček{
400d40e9d0SAdam Hornáček    PageConfig cfg = PageConfig.get(request);
410d40e9d0SAdam Hornáček    String redir = cfg.canProcess();
420d40e9d0SAdam Hornáček    if (redir == null || redir.length() > 0) {
430d40e9d0SAdam Hornáček        if (redir == null) {
440d40e9d0SAdam Hornáček            response.sendError(HttpServletResponse.SC_NOT_FOUND);
450d40e9d0SAdam Hornáček        } else {
460d40e9d0SAdam Hornáček            response.sendRedirect(redir);
470d40e9d0SAdam Hornáček        }
480d40e9d0SAdam Hornáček        return;
490d40e9d0SAdam Hornáček    }
500d40e9d0SAdam Hornáček
517d84fb5dSKryštof Tulinger    if (cfg.isNotModified(request, response)) {
527d84fb5dSKryštof Tulinger        // the resource was not modified
537d84fb5dSKryštof Tulinger        // the code 304 NOT MODIFIED has been inserted to the response
540d40e9d0SAdam Hornáček        return;
550d40e9d0SAdam Hornáček    }
560d40e9d0SAdam Hornáček
570d40e9d0SAdam Hornáček    // Use UTF-8 if no encoding is specified in the request
580d40e9d0SAdam Hornáček    if (request.getCharacterEncoding() == null) {
590d40e9d0SAdam Hornáček        request.setCharacterEncoding("UTF-8");
600d40e9d0SAdam Hornáček    }
610d40e9d0SAdam Hornáček
620d40e9d0SAdam Hornáček    // set the default page title
630d40e9d0SAdam Hornáček    String path = cfg.getPath();
640d40e9d0SAdam Hornáček    cfg.setTitle(cfg.getPathTitle());
650d40e9d0SAdam Hornáček}
660d40e9d0SAdam Hornáček%>
670d40e9d0SAdam Hornáček<%@
680d40e9d0SAdam Hornáček
690d40e9d0SAdam Hornáčekinclude file="httpheader.jspf"
700d40e9d0SAdam Hornáček
710d40e9d0SAdam Hornáček        %><body>
720d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */
730d40e9d0SAdam Hornáček    document.rev = function() { return getParameter("r"); };
740d40e9d0SAdam Hornáček    document.annotate = <%= PageConfig.get(request).annotate() %>;
750d40e9d0SAdam Hornáček    document.domReady.push(function() { domReadyMast(); });
760d40e9d0SAdam Hornáček    document.pageReady.push(function() { pageReadyMast(); });
770d40e9d0SAdam Hornáček/* ]]> */</script>
780d40e9d0SAdam Hornáček<div id="page">
790d40e9d0SAdam Hornáček    <div id="whole_header">
800d40e9d0SAdam Hornáček<div id="header"><%@
810d40e9d0SAdam Hornáček
820d40e9d0SAdam Hornáčekinclude file="pageheader.jspf"
830d40e9d0SAdam Hornáček
840d40e9d0SAdam Hornáček%>
850d40e9d0SAdam Hornáček</div>
860d40e9d0SAdam Hornáček<div id="Masthead">
870d40e9d0SAdam Hornáček    <%
880d40e9d0SAdam Hornáček{
890d40e9d0SAdam Hornáček    PageConfig cfg = PageConfig.get(request);
900d40e9d0SAdam Hornáček    String path = cfg.getPath();
910d40e9d0SAdam Hornáček    String context = request.getContextPath();
920d40e9d0SAdam Hornáček    String rev = cfg.getRequestedRevision();
930d40e9d0SAdam Hornáček
94*3db691beSVladimir Kotal    String messages = "";
950d40e9d0SAdam Hornáček    if (cfg.getProject() != null) {
96*3db691beSVladimir Kotal        messages = MessagesUtils.messagesToJson(cfg.getProject(),
974ce4e2b9SAdam Hornáček                    MessagesContainer.MESSAGES_MAIN_PAGE_TAG);
980d40e9d0SAdam Hornáček    }
990d40e9d0SAdam Hornáček    %>
1000d40e9d0SAdam Hornáček    <% if (!messages.isEmpty()) { %>
1010d40e9d0SAdam Hornáček    <span class="important-note">
1020d40e9d0SAdam Hornáček    <% } %>
1030d40e9d0SAdam Hornáček        <a href="<%= context + Prefix.XREF_P %>/">xref</a>: <%= Util
1040d40e9d0SAdam Hornáček        .breadcrumbPath(context + Prefix.XREF_P, path,'/',"",true,cfg.isDir()) %>
1050d40e9d0SAdam Hornáček        <% if (rev.length() != 0) { %>
1060d40e9d0SAdam Hornáček        (revision <%= Util.htmlize(rev) %>)
1070d40e9d0SAdam Hornáček        <% } %>
1080d40e9d0SAdam Hornáček    <span id="dtag">
1090d40e9d0SAdam Hornáček    <%
1100d40e9d0SAdam Hornáček    String dtag = cfg.getDefineTagsIndex();
1110d40e9d0SAdam Hornáček    if (dtag.length() > 0) {
1120d40e9d0SAdam Hornáček        %> (<%= dtag %>)<%
1130d40e9d0SAdam Hornáček    }
1140d40e9d0SAdam Hornáček    %></span>
1150d40e9d0SAdam Hornáček    <% if (!messages.isEmpty()) { %>
1160d40e9d0SAdam Hornáček    </span>
1170d40e9d0SAdam Hornáček    <span class="important-note important-note-rounded"
1180d40e9d0SAdam Hornáček          data-messages='<%= messages %>'>!</span>
1190d40e9d0SAdam Hornáček    <% }
1200d40e9d0SAdam Hornáček}
1210d40e9d0SAdam Hornáček%>
1220d40e9d0SAdam Hornáček</div>
1230d40e9d0SAdam Hornáček<%@
1240d40e9d0SAdam Hornáček
1250d40e9d0SAdam Hornáčekinclude file="minisearch.jspf"
1260d40e9d0SAdam Hornáček
1270d40e9d0SAdam Hornáček%>
1280d40e9d0SAdam Hornáček<%
1290d40e9d0SAdam Hornáček/* ---------------------- mast.jsp end --------------------- */
1300d40e9d0SAdam Hornáček%>
131