xref: /OpenGrok/opengrok-web/src/main/webapp/history.jsp (revision ab235745e67b1922c6d24e9173946fb9a53fa561)
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.
230d40e9d0SAdam HornáčekPortions Copyright (c) 2018, Chris Fraire <cfraire@me.com>.
240d40e9d0SAdam Hornáček
250d40e9d0SAdam Hornáček--%>
26a804b2d7SAdam Hornáček<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
27686556f2SAdam Hornáček<%@page import="org.opengrok.indexer.web.Util"%>
28686556f2SAdam Hornáček<%@page import="org.opengrok.indexer.history.HistoryGuru"%>
290d40e9d0SAdam Hornáček<%@page import="java.io.File"%>
300d40e9d0SAdam Hornáček<%@page errorPage="error.jsp" import="
310d40e9d0SAdam Hornáčekjava.text.Format,
320d40e9d0SAdam Hornáčekjava.text.SimpleDateFormat,
330d40e9d0SAdam Hornáčekjava.util.Date,
340d40e9d0SAdam Hornáčekjava.util.Set,
350d40e9d0SAdam Hornáčekjava.util.regex.Pattern,
360d40e9d0SAdam Hornáček
37686556f2SAdam Hornáčekorg.opengrok.indexer.history.History,
38686556f2SAdam Hornáčekorg.opengrok.indexer.history.HistoryEntry,
39686556f2SAdam Hornáčekorg.opengrok.indexer.history.HistoryException,
40686556f2SAdam Hornáčekorg.opengrok.indexer.configuration.RuntimeEnvironment"
410d40e9d0SAdam Hornáček%>
420d40e9d0SAdam Hornáček<%/* ---------------------- history.jsp start --------------------- */
430d40e9d0SAdam Hornáček{
440d40e9d0SAdam Hornáček    PageConfig cfg = PageConfig.get(request);
450d40e9d0SAdam Hornáček
460d40e9d0SAdam Hornáček    cfg.checkSourceRootExistence();
470d40e9d0SAdam Hornáček
480d40e9d0SAdam Hornáček    // Need to set the title before including httpheader.jspf
490d40e9d0SAdam Hornáček    cfg.setTitle(cfg.getHistoryTitle());
500d40e9d0SAdam Hornáček
510d40e9d0SAdam Hornáček    String path = cfg.getPath();
520d40e9d0SAdam Hornáček
530d40e9d0SAdam Hornáček    if (path.length() > 0) {
540d40e9d0SAdam Hornáček        File f = cfg.getResourceFile();
550d40e9d0SAdam Hornáček        History hist = null;
560d40e9d0SAdam Hornáček        try {
570d40e9d0SAdam Hornáček            hist = HistoryGuru.getInstance().getHistoryUI(f);
580d40e9d0SAdam Hornáček        } catch (Exception e) {
590d40e9d0SAdam Hornáček            // should not happen
600d40e9d0SAdam Hornáček            response.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage());
610d40e9d0SAdam Hornáček            return;
620d40e9d0SAdam Hornáček        }
630d40e9d0SAdam Hornáček
640d40e9d0SAdam Hornáček        if (hist == null) {
650d40e9d0SAdam Hornáček            /**
660d40e9d0SAdam Hornáček             * The history is not available even for a renamed file.
670d40e9d0SAdam Hornáček             * Send 404 Not Found.
680d40e9d0SAdam Hornáček             */
690d40e9d0SAdam Hornáček            response.sendError(HttpServletResponse.SC_NOT_FOUND);
700d40e9d0SAdam Hornáček            return;
710d40e9d0SAdam Hornáček        }
720d40e9d0SAdam Hornáček        request.setAttribute("history.jsp-hist", hist);
730d40e9d0SAdam Hornáček    }
740d40e9d0SAdam Hornáček}
750d40e9d0SAdam Hornáček%>
760d40e9d0SAdam Hornáček<%@
770d40e9d0SAdam Hornáček
780d40e9d0SAdam Hornáčekinclude file="httpheader.jspf"
790d40e9d0SAdam Hornáček
800d40e9d0SAdam Hornáček%>
810d40e9d0SAdam Hornáček<%
820d40e9d0SAdam Hornáček{
830d40e9d0SAdam Hornáček    PageConfig cfg = PageConfig.get(request);
840d40e9d0SAdam Hornáček    if ((request.getAttribute("history.jsp-hist")) != null) {
850d40e9d0SAdam Hornáček%>
860d40e9d0SAdam Hornáček<body>
870d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */
880d40e9d0SAdam Hornáček    document.rev = function() { return getParameter("r"); };
890d40e9d0SAdam Hornáček    document.annotate = <%= PageConfig.get(request).annotate() %>;
900d40e9d0SAdam Hornáček    document.domReady.push(function() { domReadyMast(); });
910d40e9d0SAdam Hornáček    document.pageReady.push(function() { pageReadyMast(); });
920d40e9d0SAdam Hornáček/* ]]> */</script>
930d40e9d0SAdam Hornáček<div id="page">
940d40e9d0SAdam Hornáček    <div id="whole_header">
950d40e9d0SAdam Hornáček        <div id="header">
960d40e9d0SAdam Hornáček<%
970d40e9d0SAdam Hornáček    }
980d40e9d0SAdam Hornáček}
990d40e9d0SAdam Hornáček{
1000d40e9d0SAdam Hornáček    if (request.getAttribute("history.jsp-hist") != null) {
1010d40e9d0SAdam Hornáček%><%@
1020d40e9d0SAdam Hornáček
1030d40e9d0SAdam Hornáčekinclude file="pageheader.jspf"
1040d40e9d0SAdam Hornáček
1050d40e9d0SAdam Hornáček%>
1060d40e9d0SAdam Hornáček<%
1070d40e9d0SAdam Hornáček    }
1080d40e9d0SAdam Hornáček}
1090d40e9d0SAdam Hornáček{
1100d40e9d0SAdam Hornáček    PageConfig cfg = PageConfig.get(request);
1110d40e9d0SAdam Hornáček    String context = request.getContextPath();
1120d40e9d0SAdam Hornáček    String path = cfg.getPath();
1130d40e9d0SAdam Hornáček
1140d40e9d0SAdam Hornáček    History hist = null;
1150d40e9d0SAdam Hornáček    if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) {
1160d40e9d0SAdam Hornáček
1170d40e9d0SAdam Hornáček        int start = cfg.getSearchStart();
1180d40e9d0SAdam Hornáček        int max = cfg.getSearchMaxItems();
1190d40e9d0SAdam Hornáček        long totalHits = hist.getHistoryEntries().size();
1200d40e9d0SAdam Hornáček        long thispage = Math.min(totalHits - start, max);
1210d40e9d0SAdam Hornáček
1220d40e9d0SAdam Hornáček        // We have a lots of results to show: create a slider for them
1230d40e9d0SAdam Hornáček        request.setAttribute("history.jsp-slider", Util.createSlider(start, max, totalHits, request));
1240d40e9d0SAdam Hornáček%>
1250d40e9d0SAdam Hornáček        </div>
1260d40e9d0SAdam Hornáček        <div id="Masthead">History log of
1270d40e9d0SAdam Hornáček        <%= Util.breadcrumbPath(context + Prefix.XREF_P, path,'/',"",true,cfg.isDir()) %>
128*ab235745SChris Fraire        (Results <b> <%= totalHits != 0 ? start + 1 : 0 %> – <%= thispage + start
1290d40e9d0SAdam Hornáček            %></b> of <b><%= totalHits %></b>)
1300d40e9d0SAdam Hornáček        </div>
1310d40e9d0SAdam Hornáček<%
1320d40e9d0SAdam Hornáček    }
1330d40e9d0SAdam Hornáček}
1340d40e9d0SAdam Hornáček{
1350d40e9d0SAdam Hornáček    if (request.getAttribute("history.jsp-hist") != null) {
1360d40e9d0SAdam Hornáček%>
1370d40e9d0SAdam Hornáček        <%@
1380d40e9d0SAdam Hornáček
1390d40e9d0SAdam Hornáčekinclude file="minisearch.jspf"
1400d40e9d0SAdam Hornáček
1410d40e9d0SAdam Hornáček%>
1420d40e9d0SAdam Hornáček<%
1430d40e9d0SAdam Hornáček    }
1440d40e9d0SAdam Hornáček}
1450d40e9d0SAdam Hornáček{
1460d40e9d0SAdam Hornáček    PageConfig cfg = PageConfig.get(request);
1470d40e9d0SAdam Hornáček    String context = request.getContextPath();
1480d40e9d0SAdam Hornáček    String path = cfg.getPath();
1490d40e9d0SAdam Hornáček    History hist = null;
1500d40e9d0SAdam Hornáček    if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) {
1510d40e9d0SAdam Hornáček        RuntimeEnvironment env = cfg.getEnv();
1520d40e9d0SAdam Hornáček        String uriEncodedName = cfg.getUriEncodedPath();
1530d40e9d0SAdam Hornáček
1540d40e9d0SAdam Hornáček        boolean striked = false;
1550d40e9d0SAdam Hornáček        String userPage = env.getUserPage();
1560d40e9d0SAdam Hornáček        String userPageSuffix = env.getUserPageSuffix();
1570d40e9d0SAdam Hornáček        String bugPage = env.getBugPage();
1580d40e9d0SAdam Hornáček        String bugRegex = env.getBugPattern();
1590d40e9d0SAdam Hornáček        Pattern bugPattern = Pattern.compile(bugRegex);
1600d40e9d0SAdam Hornáček        String reviewPage = env.getReviewPage();
1610d40e9d0SAdam Hornáček        String reviewRegex = env.getReviewPattern();
1620d40e9d0SAdam Hornáček        Pattern reviewPattern = Pattern.compile(reviewRegex);
1630d40e9d0SAdam Hornáček
1640d40e9d0SAdam Hornáček        Format df = new SimpleDateFormat("dd-MMM-yyyy");
1650d40e9d0SAdam Hornáček
1660d40e9d0SAdam Hornáček        int revision2 = cfg.getIntParam("r2", -1) < 0 ? 0 : cfg.getIntParam("r2", -1);
1670d40e9d0SAdam Hornáček        int revision1 = cfg.getIntParam("r1", -1) < revision2 ? revision2 + 1 : cfg.getIntParam("r1", -1);
1680d40e9d0SAdam Hornáček        revision2 = revision2 >= hist.getHistoryEntries().size() ? hist.getHistoryEntries().size() - 1 : revision2;
1690d40e9d0SAdam Hornáček
1700d40e9d0SAdam Hornáček        int start = cfg.getSearchStart();
1710d40e9d0SAdam Hornáček        int max = cfg.getSearchMaxItems();
1720d40e9d0SAdam Hornáček%>
1730d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */
1740d40e9d0SAdam Hornáčekdocument.domReady.push(function() {domReadyHistory();});
1750d40e9d0SAdam Hornáček/* ]]> */</script>
1760d40e9d0SAdam Hornáček<!--[if IE]>
1770d40e9d0SAdam Hornáček<style type="text/css">
1780d40e9d0SAdam Hornáček  table#revisions tbody tr td p {
1790d40e9d0SAdam Hornáček        word-break: break-all;
1800d40e9d0SAdam Hornáček    }
1810d40e9d0SAdam Hornáček</style>
1820d40e9d0SAdam Hornáček<![endif]-->
1830d40e9d0SAdam Hornáček<form action="<%= context + Prefix.DIFF_P + uriEncodedName %>">
1840d40e9d0SAdam Hornáček<table class="src" id="revisions">
1850d40e9d0SAdam Hornáček    <thead>
1860d40e9d0SAdam Hornáček        <tr>
1870d40e9d0SAdam Hornáček            <th>Revision <%
1880d40e9d0SAdam Hornáček            if (hist.hasTags()) {
1890d40e9d0SAdam Hornáček                %><a href="#" onclick="javascript: toggle_revtags(); return false;">
1900d40e9d0SAdam Hornáček                    <span class="revtags-hidden">
1910d40e9d0SAdam Hornáček                    (&lt;&lt;&lt; Hide revision tags)</span>
1920d40e9d0SAdam Hornáček                    <span class="revtags">
1930d40e9d0SAdam Hornáček                    (Show revision tags &gt;&gt;&gt;)</span></a><%
1940d40e9d0SAdam Hornáček            }
1950d40e9d0SAdam Hornáček            %></th><%
1960d40e9d0SAdam Hornáček            if (!cfg.isDir()) {
1970d40e9d0SAdam Hornáček            %>
1980d40e9d0SAdam Hornáček            <th><input type="submit" value=" Compare "/>
1990d40e9d0SAdam Hornáček            <% if (hist.getHistoryEntries().size() > revision1 && revision1 >= 0) { %>
2000d40e9d0SAdam Hornáček                <input type="hidden" id="input_r1" name="r1" value="<%= path + '@' + hist.getHistoryEntries().get(revision1).getRevision() %>" />
2010d40e9d0SAdam Hornáček            <% } %>
2020d40e9d0SAdam Hornáček            <% if (hist.getHistoryEntries().size() > revision2 && revision2 >= 0) { %>
2030d40e9d0SAdam Hornáček                <input type="hidden" id="input_r2" name="r2" value="<%= path + '@' + hist.getHistoryEntries().get(revision2).getRevision() %>" />
2040d40e9d0SAdam Hornáček            <% } %>
2050d40e9d0SAdam Hornáček            </th><%
2060d40e9d0SAdam Hornáček            }
2070d40e9d0SAdam Hornáček            %>
2080d40e9d0SAdam Hornáček            <th>Date</th>
2090d40e9d0SAdam Hornáček            <th>Author</th>
2100d40e9d0SAdam Hornáček            <th>Comments <%
2110d40e9d0SAdam Hornáček            if (hist.hasFileList()) {
2120d40e9d0SAdam Hornáček                %><a href="#" onclick="javascript: toggle_filelist(); return false;">
2130d40e9d0SAdam Hornáček                    <div class="filelist-hidden">
2140d40e9d0SAdam Hornáček                    (&lt;&lt;&lt; Hide modified files)</div>
2150d40e9d0SAdam Hornáček                    <div class="filelist">
2160d40e9d0SAdam Hornáček                    (Show modified files &gt;&gt;&gt;)</div></a><%
2170d40e9d0SAdam Hornáček            }
2180d40e9d0SAdam Hornáček            %>
2190d40e9d0SAdam Hornáček            </th>
2200d40e9d0SAdam Hornáček        </tr>
2210d40e9d0SAdam Hornáček    </thead>
2220d40e9d0SAdam Hornáček    <tbody>
2230d40e9d0SAdam Hornáček            <%
2240d40e9d0SAdam Hornáček            int count=0;
2250d40e9d0SAdam Hornáček            for (HistoryEntry entry : hist.getHistoryEntries(max, start)) {
2260d40e9d0SAdam Hornáček                String rev = entry.getRevision();
2270d40e9d0SAdam Hornáček                if (rev == null || rev.length() == 0) {
2280d40e9d0SAdam Hornáček                    rev = "";
2290d40e9d0SAdam Hornáček                }
2300d40e9d0SAdam Hornáček                String tags = entry.getTags();
2310d40e9d0SAdam Hornáček
2320d40e9d0SAdam Hornáček                if (tags != null) {
2330d40e9d0SAdam Hornáček			int colspan;
2340d40e9d0SAdam Hornáček			if (cfg.isDir())
2350d40e9d0SAdam Hornáček				colspan = 4;
2360d40e9d0SAdam Hornáček			else
2370d40e9d0SAdam Hornáček				colspan = 5;
2380d40e9d0SAdam Hornáček                    %>
2390d40e9d0SAdam Hornáček        <tr class="revtags-hidden">
2400d40e9d0SAdam Hornáček            <td colspan="<%= colspan %>" class="revtags">
2410d40e9d0SAdam Hornáček                <b>Revision tags:</b> <%= tags %>
2420d40e9d0SAdam Hornáček            </td>
2430d40e9d0SAdam Hornáček        </tr><tr style="display: none;"></tr><%
2440d40e9d0SAdam Hornáček                }
2450d40e9d0SAdam Hornáček    %>
2460d40e9d0SAdam Hornáček        <tr><%
2470d40e9d0SAdam Hornáček                if (cfg.isDir()) {
2480d40e9d0SAdam Hornáček            %>
2490d40e9d0SAdam Hornáček            <td><%= rev %></td><%
2500d40e9d0SAdam Hornáček                } else {
2510d40e9d0SAdam Hornáček                    if (entry.isActive()) {
2520d40e9d0SAdam Hornáček                        String rp = uriEncodedName;
2530d40e9d0SAdam Hornáček                        StringBuffer urlBuffer = request.getRequestURL();
2540d40e9d0SAdam Hornáček                        if (request.getQueryString() != null) {
2550d40e9d0SAdam Hornáček                            urlBuffer.append('?').append(request.getQueryString());
2560d40e9d0SAdam Hornáček                        }
2570d40e9d0SAdam Hornáček                        urlBuffer.append('#').append(rev);
2580d40e9d0SAdam Hornáček            %>
2590d40e9d0SAdam Hornáček            <td><a href="<%= urlBuffer %>"
2600d40e9d0SAdam Hornáček                title="link to revision line">#</a>
2610d40e9d0SAdam Hornáček                <a href="<%= context + Prefix.XREF_P + rp + "?r=" + Util.URIEncode(rev) %>"><%=
2620d40e9d0SAdam Hornáček                    rev %></a></td>
2630d40e9d0SAdam Hornáček            <td><%
2640d40e9d0SAdam Hornáček                %><input type="radio"
2650d40e9d0SAdam Hornáček                        data-revision-1="<%= (start + count) %>"
2660d40e9d0SAdam Hornáček                        data-revision-2="<%= revision2 %>"
2670d40e9d0SAdam Hornáček                        data-diff-revision="r1"
2680d40e9d0SAdam Hornáček                        data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision()%>"
2690d40e9d0SAdam Hornáček                <%
2700d40e9d0SAdam Hornáček                if (count + start > revision1 || (count + start > revision2 && count + start <= revision1 - 1)) {
2710d40e9d0SAdam Hornáček                    // revision1 enabled
2720d40e9d0SAdam Hornáček                } else if (count + start == revision1 ) {
2730d40e9d0SAdam Hornáček                    // revision1 selected
2740d40e9d0SAdam Hornáček                    %> checked="checked"<%
2750d40e9d0SAdam Hornáček                } else if( count + start <= revision2 ) {
2760d40e9d0SAdam Hornáček                    // revision1 disabled
2770d40e9d0SAdam Hornáček                    %> disabled="disabled" <%
2780d40e9d0SAdam Hornáček                }
2790d40e9d0SAdam Hornáček                %>/><%
2800d40e9d0SAdam Hornáček
2810d40e9d0SAdam Hornáček                %><input type="radio"
2820d40e9d0SAdam Hornáček                        data-revision-1="<%= revision1 %>"
2830d40e9d0SAdam Hornáček                        data-revision-2="<%= (start + count) %>"
2840d40e9d0SAdam Hornáček                        data-diff-revision="r2"
2850d40e9d0SAdam Hornáček                        data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision() %>"
2860d40e9d0SAdam Hornáček                <%
2870d40e9d0SAdam Hornáček                if( count + start < revision2 || (count + start > revision2 && count + start <= revision1 - 1) ) {
2880d40e9d0SAdam Hornáček                    // revision2 enabled
2890d40e9d0SAdam Hornáček                } else if( count + start == revision2 ) {
2900d40e9d0SAdam Hornáček                    // revision2 selected
2910d40e9d0SAdam Hornáček                    %> checked="checked" <%
2920d40e9d0SAdam Hornáček                } else if (count + start >= revision1 ) {
2930d40e9d0SAdam Hornáček                    // revision2 disabled
2940d40e9d0SAdam Hornáček                    %> disabled="disabled" <%
2950d40e9d0SAdam Hornáček                }
2960d40e9d0SAdam Hornáček                %>/><%
2970d40e9d0SAdam Hornáček                %></td><%
2980d40e9d0SAdam Hornáček                    } else {
2990d40e9d0SAdam Hornáček                        striked = true;
3000d40e9d0SAdam Hornáček                %>
3010d40e9d0SAdam Hornáček            <td><del><%= rev %></del></td>
3020d40e9d0SAdam Hornáček            <td></td><%
3030d40e9d0SAdam Hornáček                    }
3040d40e9d0SAdam Hornáček                }
3050d40e9d0SAdam Hornáček            %>
3060d40e9d0SAdam Hornáček            <td><%
3070d40e9d0SAdam Hornáček                Date date = entry.getDate();
3080d40e9d0SAdam Hornáček                if (date != null) {
3090d40e9d0SAdam Hornáček            %><%= df.format(date) %><%
3100d40e9d0SAdam Hornáček                }
3110d40e9d0SAdam Hornáček                %></td>
3120d40e9d0SAdam Hornáček            <td><%
3130d40e9d0SAdam Hornáček                String author = entry.getAuthor();
3140d40e9d0SAdam Hornáček                if (author == null) {
3150d40e9d0SAdam Hornáček                %>(no author)<%
3160d40e9d0SAdam Hornáček                } else if (userPage != null && userPage.length() > 0) {
3170d40e9d0SAdam Hornáček		String alink = Util.getEmail(author);
3180d40e9d0SAdam Hornáček                %><a href="<%= userPage + Util.htmlize(alink) + userPageSuffix
3190d40e9d0SAdam Hornáček                %>"><%= Util.htmlize(author)%></a><%
3200d40e9d0SAdam Hornáček                } else {
3210d40e9d0SAdam Hornáček                %><%= author %><%
3220d40e9d0SAdam Hornáček                }
3230d40e9d0SAdam Hornáček                %></td>
3240d40e9d0SAdam Hornáček            <td><a name="<%= rev %>"></a><%
3250d40e9d0SAdam Hornáček                // revision message collapse threshold minimum of 10
3260d40e9d0SAdam Hornáček                int summaryLength = Math.max(10, cfg.getRevisionMessageCollapseThreshold());
3270d40e9d0SAdam Hornáček                String cout = Util.htmlize(entry.getMessage());
3280d40e9d0SAdam Hornáček
3290d40e9d0SAdam Hornáček                if (bugPage != null && bugPage.length() > 0) {
3300d40e9d0SAdam Hornáček                    cout = Util.linkifyPattern(cout, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request));
3310d40e9d0SAdam Hornáček                }
3320d40e9d0SAdam Hornáček                if (reviewPage != null && reviewPage.length() > 0) {
3330d40e9d0SAdam Hornáček                    cout = Util.linkifyPattern(cout, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request));
3340d40e9d0SAdam Hornáček                }
3350d40e9d0SAdam Hornáček
3360d40e9d0SAdam Hornáček                boolean showSummary = false;
3370d40e9d0SAdam Hornáček                String coutSummary = entry.getMessage();
3380d40e9d0SAdam Hornáček                if (coutSummary.length() > summaryLength) {
3390d40e9d0SAdam Hornáček                    showSummary = true;
3400d40e9d0SAdam Hornáček                    coutSummary = coutSummary.substring(0, summaryLength - 1);
3410d40e9d0SAdam Hornáček                    coutSummary = Util.htmlize(coutSummary);
3420d40e9d0SAdam Hornáček                    if (bugPage != null && bugPage.length() > 0) {
3430d40e9d0SAdam Hornáček                        coutSummary = Util.linkifyPattern(coutSummary, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request));
3440d40e9d0SAdam Hornáček                    }
3450d40e9d0SAdam Hornáček                    if (reviewPage != null && reviewPage.length() > 0) {
3460d40e9d0SAdam Hornáček                        coutSummary = Util.linkifyPattern(coutSummary, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request));
3470d40e9d0SAdam Hornáček                    }
3480d40e9d0SAdam Hornáček                }
3490d40e9d0SAdam Hornáček
3500d40e9d0SAdam Hornáček                if (showSummary) {
3510d40e9d0SAdam Hornáček                    %>
3520d40e9d0SAdam Hornáček                    <p class="rev-message-summary"><%= coutSummary %></p>
3530d40e9d0SAdam Hornáček                    <p class="rev-message-full rev-message-hidden"><%= cout %></p>
3540d40e9d0SAdam Hornáček                    <p class="rev-message-toggle" data-toggle-state="less"><a class="rev-toggle-a" href="#">show more ... </a></p>
3550d40e9d0SAdam Hornáček                    <%
3560d40e9d0SAdam Hornáček                }
3570d40e9d0SAdam Hornáček                else {
3580d40e9d0SAdam Hornáček                     %><p class="rev-message-full"><%= cout %></p><%
3590d40e9d0SAdam Hornáček                }
3600d40e9d0SAdam Hornáček
3610d40e9d0SAdam Hornáček                Set<String> files = entry.getFiles();
3620d40e9d0SAdam Hornáček                if (files != null) {
3630d40e9d0SAdam Hornáček                %><div class="filelist-hidden"><br/><%
3640d40e9d0SAdam Hornáček                    for (String ifile : files) {
3650d40e9d0SAdam Hornáček                        String jfile = Util.stripPathPrefix(path, ifile);
3660d40e9d0SAdam Hornáček                        if (rev == "") {
3670d40e9d0SAdam Hornáček                %>
3680d40e9d0SAdam Hornáček<a class="h" href="<%= context + Prefix.XREF_P + ifile %>"><%= jfile %></a><br/><%
3690d40e9d0SAdam Hornáček                        } else {
3700d40e9d0SAdam Hornáček                %>
3710d40e9d0SAdam Hornáček<a class="h" href="<%= context + Prefix.XREF_P + ifile %>?r=<%= rev %>"><%= jfile %></a><br/><%
3720d40e9d0SAdam Hornáček                        }
3730d40e9d0SAdam Hornáček                    }
3740d40e9d0SAdam Hornáček                %></div><%
3750d40e9d0SAdam Hornáček                }
3760d40e9d0SAdam Hornáček                %></td>
3770d40e9d0SAdam Hornáček        </tr><%
3780d40e9d0SAdam Hornáček                count++;
3790d40e9d0SAdam Hornáček            }
3800d40e9d0SAdam Hornáček        %>
3810d40e9d0SAdam Hornáček    </tbody>
3820d40e9d0SAdam Hornáček    <tfoot>
3830d40e9d0SAdam Hornáček        <tr>
3840d40e9d0SAdam Hornáček            <td colspan="5">
3850d40e9d0SAdam Hornáček<%
3860d40e9d0SAdam Hornáček    String slider = null;
3870d40e9d0SAdam Hornáček    if ((slider = (String) request.getAttribute("history.jsp-slider")) != null) {
3880d40e9d0SAdam Hornáček        // NOTE: shouldn't happen that it doesn't have this attribute
3890d40e9d0SAdam Hornáček        %><p class="slider"><%= slider %></p><%
3900d40e9d0SAdam Hornáček    }
3910d40e9d0SAdam Hornáček%>
3920d40e9d0SAdam Hornáček            </td>
3930d40e9d0SAdam Hornáček        </tr>
3940d40e9d0SAdam Hornáček    </tfoot>
3950d40e9d0SAdam Hornáček</table>
3960d40e9d0SAdam Hornáček
3970d40e9d0SAdam Hornáček</form><%
3980d40e9d0SAdam Hornáček            if (striked) {
3990d40e9d0SAdam Hornáček%><p><b>Note:</b> No associated file changes are available for
4000d40e9d0SAdam Hornáčekrevisions with strike-through numbers (eg. <del>1.45</del>)</p><%
4010d40e9d0SAdam Hornáček            }
4020d40e9d0SAdam Hornáček%>
4030d40e9d0SAdam Hornáček<p class="rssbadge"><a href="<%=context + Prefix.RSS_P + uriEncodedName
4040d40e9d0SAdam Hornáček%>" title="RSS XML Feed of latest changes"><span id="rssi"></span></a></p>
4050d40e9d0SAdam Hornáček
4060d40e9d0SAdam Hornáček<%
4070d40e9d0SAdam Hornáček
4080d40e9d0SAdam Hornáček    }
4090d40e9d0SAdam Hornáček}
4100d40e9d0SAdam Hornáček/* ---------------------- history.jsp end --------------------- */
4110d40e9d0SAdam Hornáček%><%@
4120d40e9d0SAdam Hornáček
4130d40e9d0SAdam Hornáčekinclude file="foot.jspf"
4140d40e9d0SAdam Hornáček
4150d40e9d0SAdam Hornáček%>
416