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. 2306988439SChris FrairePortions Copyright (c) 2018-2019, 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, 34*80a75b43SChris Frairejava.util.logging.Level, 35*80a75b43SChris Frairejava.util.logging.Logger, 3606988439SChris Frairejava.util.Objects, 370d40e9d0SAdam Hornáčekjava.util.Set, 380d40e9d0SAdam Hornáčekjava.util.regex.Pattern, 390d40e9d0SAdam Hornáček 40*80a75b43SChris Fraireorg.opengrok.indexer.configuration.RuntimeEnvironment, 41686556f2SAdam Hornáčekorg.opengrok.indexer.history.History, 42686556f2SAdam Hornáčekorg.opengrok.indexer.history.HistoryEntry, 43*80a75b43SChris Fraireorg.opengrok.indexer.logger.LoggerFactory, 44*80a75b43SChris Fraireorg.opengrok.indexer.util.ForbiddenSymlinkException, 45*80a75b43SChris Fraireorg.opengrok.indexer.web.SearchHelper" 460d40e9d0SAdam Hornáček%> 470d40e9d0SAdam Hornáček<%/* ---------------------- history.jsp start --------------------- */ 480d40e9d0SAdam Hornáček{ 49*80a75b43SChris Fraire final Logger LOGGER = LoggerFactory.getLogger(getClass()); 500d40e9d0SAdam Hornáček 51*80a75b43SChris Fraire PageConfig cfg = PageConfig.get(request); 520d40e9d0SAdam Hornáček cfg.checkSourceRootExistence(); 530d40e9d0SAdam Hornáček 540d40e9d0SAdam Hornáček // Need to set the title before including httpheader.jspf 550d40e9d0SAdam Hornáček cfg.setTitle(cfg.getHistoryTitle()); 560d40e9d0SAdam Hornáček 570d40e9d0SAdam Hornáček String path = cfg.getPath(); 580d40e9d0SAdam Hornáček 590d40e9d0SAdam Hornáček if (path.length() > 0) { 60*80a75b43SChris Fraire String primePath = path; 61*80a75b43SChris Fraire Project project = cfg.getProject(); 62*80a75b43SChris Fraire if (project != null) { 63*80a75b43SChris Fraire SearchHelper searchHelper = cfg.prepareInternalSearch(); 64*80a75b43SChris Fraire /* 65*80a75b43SChris Fraire * N.b. searchHelper.destroy() is called via 66*80a75b43SChris Fraire * WebappListener.requestDestroyed() on presence of the following 67*80a75b43SChris Fraire * REQUEST_ATTR. 68*80a75b43SChris Fraire */ 69*80a75b43SChris Fraire request.setAttribute(SearchHelper.REQUEST_ATTR, searchHelper); 70*80a75b43SChris Fraire searchHelper.prepareExec(project); 71*80a75b43SChris Fraire 720d40e9d0SAdam Hornáček try { 73*80a75b43SChris Fraire primePath = searchHelper.getPrimeRelativePath(project.getName(), path); 74*80a75b43SChris Fraire } catch (IOException | ForbiddenSymlinkException ex) { 75*80a75b43SChris Fraire LOGGER.log(Level.WARNING, String.format( 76*80a75b43SChris Fraire "Error getting prime relative for %s", path), ex); 77*80a75b43SChris Fraire } 78*80a75b43SChris Fraire } 79*80a75b43SChris Fraire 80*80a75b43SChris Fraire File file = cfg.getResourceFile(primePath); 81*80a75b43SChris Fraire History hist; 82*80a75b43SChris Fraire try { 83*80a75b43SChris Fraire hist = HistoryGuru.getInstance().getHistoryUI(file); 840d40e9d0SAdam Hornáček } catch (Exception e) { 850d40e9d0SAdam Hornáček // should not happen 860d40e9d0SAdam Hornáček response.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage()); 870d40e9d0SAdam Hornáček return; 880d40e9d0SAdam Hornáček } 890d40e9d0SAdam Hornáček 900d40e9d0SAdam Hornáček if (hist == null) { 9106988439SChris Fraire /* 920d40e9d0SAdam Hornáček * The history is not available even for a renamed file. 930d40e9d0SAdam Hornáček * Send 404 Not Found. 940d40e9d0SAdam Hornáček */ 950d40e9d0SAdam Hornáček response.sendError(HttpServletResponse.SC_NOT_FOUND); 960d40e9d0SAdam Hornáček return; 970d40e9d0SAdam Hornáček } 980d40e9d0SAdam Hornáček request.setAttribute("history.jsp-hist", hist); 990d40e9d0SAdam Hornáček } 1000d40e9d0SAdam Hornáček} 1010d40e9d0SAdam Hornáček%> 1020d40e9d0SAdam Hornáček<%@ 1030d40e9d0SAdam Hornáček 1040d40e9d0SAdam Hornáčekinclude file="httpheader.jspf" 1050d40e9d0SAdam Hornáček 1060d40e9d0SAdam Hornáček%> 1070d40e9d0SAdam Hornáček<% 1080d40e9d0SAdam Hornáček{ 1090d40e9d0SAdam Hornáček if ((request.getAttribute("history.jsp-hist")) != null) { 1100d40e9d0SAdam Hornáček%> 1110d40e9d0SAdam Hornáček<body> 1120d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */ 1130d40e9d0SAdam Hornáček document.rev = function() { return getParameter("r"); }; 1140d40e9d0SAdam Hornáček document.annotate = <%= PageConfig.get(request).annotate() %>; 1150d40e9d0SAdam Hornáček document.domReady.push(function() { domReadyMast(); }); 1160d40e9d0SAdam Hornáček document.pageReady.push(function() { pageReadyMast(); }); 1170d40e9d0SAdam Hornáček/* ]]> */</script> 1180d40e9d0SAdam Hornáček<div id="page"> 1190d40e9d0SAdam Hornáček <div id="whole_header"> 1200d40e9d0SAdam Hornáček <div id="header"> 1210d40e9d0SAdam Hornáček<% 1220d40e9d0SAdam Hornáček } 1230d40e9d0SAdam Hornáček} 1240d40e9d0SAdam Hornáček{ 1250d40e9d0SAdam Hornáček if (request.getAttribute("history.jsp-hist") != null) { 1260d40e9d0SAdam Hornáček%><%@ 1270d40e9d0SAdam Hornáček 1280d40e9d0SAdam Hornáčekinclude file="pageheader.jspf" 1290d40e9d0SAdam Hornáček 1300d40e9d0SAdam Hornáček%> 1310d40e9d0SAdam Hornáček<% 1320d40e9d0SAdam Hornáček } 1330d40e9d0SAdam Hornáček} 1340d40e9d0SAdam Hornáček{ 1350d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 1360d40e9d0SAdam Hornáček String context = request.getContextPath(); 1370d40e9d0SAdam Hornáček String path = cfg.getPath(); 1380d40e9d0SAdam Hornáček 13906988439SChris Fraire History hist; 1400d40e9d0SAdam Hornáček if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) { 1410d40e9d0SAdam Hornáček 1420d40e9d0SAdam Hornáček int start = cfg.getSearchStart(); 1430d40e9d0SAdam Hornáček int max = cfg.getSearchMaxItems(); 1440d40e9d0SAdam Hornáček long totalHits = hist.getHistoryEntries().size(); 1450d40e9d0SAdam Hornáček long thispage = Math.min(totalHits - start, max); 1460d40e9d0SAdam Hornáček 1470d40e9d0SAdam Hornáček // We have a lots of results to show: create a slider for them 1480d40e9d0SAdam Hornáček request.setAttribute("history.jsp-slider", Util.createSlider(start, max, totalHits, request)); 1490d40e9d0SAdam Hornáček%> 1500d40e9d0SAdam Hornáček </div> 1510d40e9d0SAdam Hornáček <div id="Masthead">History log of 1520d40e9d0SAdam Hornáček <%= Util.breadcrumbPath(context + Prefix.XREF_P, path,'/',"",true,cfg.isDir()) %> 153ab235745SChris Fraire (Results <b> <%= totalHits != 0 ? start + 1 : 0 %> – <%= thispage + start 1540d40e9d0SAdam Hornáček %></b> of <b><%= totalHits %></b>) 1550d40e9d0SAdam Hornáček </div> 1560d40e9d0SAdam Hornáček<% 1570d40e9d0SAdam Hornáček } 1580d40e9d0SAdam Hornáček} 1590d40e9d0SAdam Hornáček{ 1600d40e9d0SAdam Hornáček if (request.getAttribute("history.jsp-hist") != null) { 1610d40e9d0SAdam Hornáček%> 1620d40e9d0SAdam Hornáček <%@ 1630d40e9d0SAdam Hornáček 1640d40e9d0SAdam Hornáčekinclude file="minisearch.jspf" 1650d40e9d0SAdam Hornáček 1660d40e9d0SAdam Hornáček%> 1670d40e9d0SAdam Hornáček<% 1680d40e9d0SAdam Hornáček } 1690d40e9d0SAdam Hornáček} 1700d40e9d0SAdam Hornáček{ 1710d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 1720d40e9d0SAdam Hornáček String context = request.getContextPath(); 1730d40e9d0SAdam Hornáček String path = cfg.getPath(); 17406988439SChris Fraire History hist; 1750d40e9d0SAdam Hornáček if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) { 1760d40e9d0SAdam Hornáček RuntimeEnvironment env = cfg.getEnv(); 1770d40e9d0SAdam Hornáček String uriEncodedName = cfg.getUriEncodedPath(); 1780d40e9d0SAdam Hornáček 1790d40e9d0SAdam Hornáček boolean striked = false; 1800d40e9d0SAdam Hornáček String userPage = env.getUserPage(); 1810d40e9d0SAdam Hornáček String userPageSuffix = env.getUserPageSuffix(); 1820d40e9d0SAdam Hornáček String bugPage = env.getBugPage(); 1830d40e9d0SAdam Hornáček String bugRegex = env.getBugPattern(); 1840d40e9d0SAdam Hornáček Pattern bugPattern = Pattern.compile(bugRegex); 1850d40e9d0SAdam Hornáček String reviewPage = env.getReviewPage(); 1860d40e9d0SAdam Hornáček String reviewRegex = env.getReviewPattern(); 1870d40e9d0SAdam Hornáček Pattern reviewPattern = Pattern.compile(reviewRegex); 1880d40e9d0SAdam Hornáček 1890d40e9d0SAdam Hornáček Format df = new SimpleDateFormat("dd-MMM-yyyy"); 1900d40e9d0SAdam Hornáček 1910d40e9d0SAdam Hornáček int revision2 = cfg.getIntParam("r2", -1) < 0 ? 0 : cfg.getIntParam("r2", -1); 1920d40e9d0SAdam Hornáček int revision1 = cfg.getIntParam("r1", -1) < revision2 ? revision2 + 1 : cfg.getIntParam("r1", -1); 1930d40e9d0SAdam Hornáček revision2 = revision2 >= hist.getHistoryEntries().size() ? hist.getHistoryEntries().size() - 1 : revision2; 1940d40e9d0SAdam Hornáček 1950d40e9d0SAdam Hornáček int start = cfg.getSearchStart(); 1960d40e9d0SAdam Hornáček int max = cfg.getSearchMaxItems(); 1970d40e9d0SAdam Hornáček%> 1980d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */ 1990d40e9d0SAdam Hornáčekdocument.domReady.push(function() {domReadyHistory();}); 2000d40e9d0SAdam Hornáček/* ]]> */</script> 2010d40e9d0SAdam Hornáček<!--[if IE]> 2020d40e9d0SAdam Hornáček<style type="text/css"> 2030d40e9d0SAdam Hornáček table#revisions tbody tr td p { 2040d40e9d0SAdam Hornáček word-break: break-all; 2050d40e9d0SAdam Hornáček } 2060d40e9d0SAdam Hornáček</style> 2070d40e9d0SAdam Hornáček<![endif]--> 2080d40e9d0SAdam Hornáček<form action="<%= context + Prefix.DIFF_P + uriEncodedName %>"> 2090d40e9d0SAdam Hornáček<table class="src" id="revisions"> 2100d40e9d0SAdam Hornáček <thead> 2110d40e9d0SAdam Hornáček <tr> 2120d40e9d0SAdam Hornáček <th>Revision <% 2130d40e9d0SAdam Hornáček if (hist.hasTags()) { 2140d40e9d0SAdam Hornáček %><a href="#" onclick="javascript: toggle_revtags(); return false;"> 2150d40e9d0SAdam Hornáček <span class="revtags-hidden"> 2160d40e9d0SAdam Hornáček (<<< Hide revision tags)</span> 2170d40e9d0SAdam Hornáček <span class="revtags"> 2180d40e9d0SAdam Hornáček (Show revision tags >>>)</span></a><% 2190d40e9d0SAdam Hornáček } 2200d40e9d0SAdam Hornáček %></th><% 2210d40e9d0SAdam Hornáček if (!cfg.isDir()) { 2220d40e9d0SAdam Hornáček %> 2230d40e9d0SAdam Hornáček <th><input type="submit" value=" Compare "/> 2240d40e9d0SAdam Hornáček <% if (hist.getHistoryEntries().size() > revision1 && revision1 >= 0) { %> 2250d40e9d0SAdam Hornáček <input type="hidden" id="input_r1" name="r1" value="<%= path + '@' + hist.getHistoryEntries().get(revision1).getRevision() %>" /> 2260d40e9d0SAdam Hornáček <% } %> 2270d40e9d0SAdam Hornáček <% if (hist.getHistoryEntries().size() > revision2 && revision2 >= 0) { %> 2280d40e9d0SAdam Hornáček <input type="hidden" id="input_r2" name="r2" value="<%= path + '@' + hist.getHistoryEntries().get(revision2).getRevision() %>" /> 2290d40e9d0SAdam Hornáček <% } %> 2300d40e9d0SAdam Hornáček </th><% 2310d40e9d0SAdam Hornáček } 2320d40e9d0SAdam Hornáček %> 2330d40e9d0SAdam Hornáček <th>Date</th> 2340d40e9d0SAdam Hornáček <th>Author</th> 2350d40e9d0SAdam Hornáček <th>Comments <% 2360d40e9d0SAdam Hornáček if (hist.hasFileList()) { 2370d40e9d0SAdam Hornáček %><a href="#" onclick="javascript: toggle_filelist(); return false;"> 2380d40e9d0SAdam Hornáček <div class="filelist-hidden"> 2390d40e9d0SAdam Hornáček (<<< Hide modified files)</div> 2400d40e9d0SAdam Hornáček <div class="filelist"> 2410d40e9d0SAdam Hornáček (Show modified files >>>)</div></a><% 2420d40e9d0SAdam Hornáček } 2430d40e9d0SAdam Hornáček %> 2440d40e9d0SAdam Hornáček </th> 2450d40e9d0SAdam Hornáček </tr> 2460d40e9d0SAdam Hornáček </thead> 2470d40e9d0SAdam Hornáček <tbody> 2480d40e9d0SAdam Hornáček <% 2490d40e9d0SAdam Hornáček int count=0; 2500d40e9d0SAdam Hornáček for (HistoryEntry entry : hist.getHistoryEntries(max, start)) { 2510d40e9d0SAdam Hornáček String rev = entry.getRevision(); 2520d40e9d0SAdam Hornáček if (rev == null || rev.length() == 0) { 2530d40e9d0SAdam Hornáček rev = ""; 2540d40e9d0SAdam Hornáček } 2550d40e9d0SAdam Hornáček String tags = entry.getTags(); 2560d40e9d0SAdam Hornáček 2570d40e9d0SAdam Hornáček if (tags != null) { 2580d40e9d0SAdam Hornáček int colspan; 2590d40e9d0SAdam Hornáček if (cfg.isDir()) 2600d40e9d0SAdam Hornáček colspan = 4; 2610d40e9d0SAdam Hornáček else 2620d40e9d0SAdam Hornáček colspan = 5; 2630d40e9d0SAdam Hornáček %> 2640d40e9d0SAdam Hornáček <tr class="revtags-hidden"> 2650d40e9d0SAdam Hornáček <td colspan="<%= colspan %>" class="revtags"> 2660d40e9d0SAdam Hornáček <b>Revision tags:</b> <%= tags %> 2670d40e9d0SAdam Hornáček </td> 2680d40e9d0SAdam Hornáček </tr><tr style="display: none;"></tr><% 2690d40e9d0SAdam Hornáček } 2700d40e9d0SAdam Hornáček %> 2710d40e9d0SAdam Hornáček <tr><% 2720d40e9d0SAdam Hornáček if (cfg.isDir()) { 2730d40e9d0SAdam Hornáček %> 2740d40e9d0SAdam Hornáček <td><%= rev %></td><% 2750d40e9d0SAdam Hornáček } else { 2760d40e9d0SAdam Hornáček if (entry.isActive()) { 2770d40e9d0SAdam Hornáček StringBuffer urlBuffer = request.getRequestURL(); 2780d40e9d0SAdam Hornáček if (request.getQueryString() != null) { 2790d40e9d0SAdam Hornáček urlBuffer.append('?').append(request.getQueryString()); 2800d40e9d0SAdam Hornáček } 2810d40e9d0SAdam Hornáček urlBuffer.append('#').append(rev); 2820d40e9d0SAdam Hornáček %> 2830d40e9d0SAdam Hornáček <td><a href="<%= urlBuffer %>" 2840d40e9d0SAdam Hornáček title="link to revision line">#</a> 28506988439SChris Fraire <a href="<%= context + Prefix.XREF_P + uriEncodedName + "?r=" + Util.URIEncode(rev) %>"><%= 2860d40e9d0SAdam Hornáček rev %></a></td> 2870d40e9d0SAdam Hornáček <td><% 2880d40e9d0SAdam Hornáček %><input type="radio" 2890d40e9d0SAdam Hornáček data-revision-1="<%= (start + count) %>" 2900d40e9d0SAdam Hornáček data-revision-2="<%= revision2 %>" 2910d40e9d0SAdam Hornáček data-diff-revision="r1" 2920d40e9d0SAdam Hornáček data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision()%>" 2930d40e9d0SAdam Hornáček <% 2940d40e9d0SAdam Hornáček if (count + start > revision1 || (count + start > revision2 && count + start <= revision1 - 1)) { 2950d40e9d0SAdam Hornáček // revision1 enabled 2960d40e9d0SAdam Hornáček } else if (count + start == revision1 ) { 2970d40e9d0SAdam Hornáček // revision1 selected 2980d40e9d0SAdam Hornáček %> checked="checked"<% 2990d40e9d0SAdam Hornáček } else if( count + start <= revision2 ) { 3000d40e9d0SAdam Hornáček // revision1 disabled 3010d40e9d0SAdam Hornáček %> disabled="disabled" <% 3020d40e9d0SAdam Hornáček } 3030d40e9d0SAdam Hornáček %>/><% 3040d40e9d0SAdam Hornáček 3050d40e9d0SAdam Hornáček %><input type="radio" 3060d40e9d0SAdam Hornáček data-revision-1="<%= revision1 %>" 3070d40e9d0SAdam Hornáček data-revision-2="<%= (start + count) %>" 3080d40e9d0SAdam Hornáček data-diff-revision="r2" 3090d40e9d0SAdam Hornáček data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision() %>" 3100d40e9d0SAdam Hornáček <% 3110d40e9d0SAdam Hornáček if( count + start < revision2 || (count + start > revision2 && count + start <= revision1 - 1) ) { 3120d40e9d0SAdam Hornáček // revision2 enabled 3130d40e9d0SAdam Hornáček } else if( count + start == revision2 ) { 3140d40e9d0SAdam Hornáček // revision2 selected 3150d40e9d0SAdam Hornáček %> checked="checked" <% 3160d40e9d0SAdam Hornáček } else if (count + start >= revision1 ) { 3170d40e9d0SAdam Hornáček // revision2 disabled 3180d40e9d0SAdam Hornáček %> disabled="disabled" <% 3190d40e9d0SAdam Hornáček } 3200d40e9d0SAdam Hornáček %>/><% 3210d40e9d0SAdam Hornáček %></td><% 3220d40e9d0SAdam Hornáček } else { 3230d40e9d0SAdam Hornáček striked = true; 3240d40e9d0SAdam Hornáček %> 3250d40e9d0SAdam Hornáček <td><del><%= rev %></del></td> 3260d40e9d0SAdam Hornáček <td></td><% 3270d40e9d0SAdam Hornáček } 3280d40e9d0SAdam Hornáček } 3290d40e9d0SAdam Hornáček %> 3300d40e9d0SAdam Hornáček <td><% 3310d40e9d0SAdam Hornáček Date date = entry.getDate(); 3320d40e9d0SAdam Hornáček if (date != null) { 3330d40e9d0SAdam Hornáček %><%= df.format(date) %><% 3340d40e9d0SAdam Hornáček } 3350d40e9d0SAdam Hornáček %></td> 3360d40e9d0SAdam Hornáček <td><% 3370d40e9d0SAdam Hornáček String author = entry.getAuthor(); 3380d40e9d0SAdam Hornáček if (author == null) { 3390d40e9d0SAdam Hornáček %>(no author)<% 3400d40e9d0SAdam Hornáček } else if (userPage != null && userPage.length() > 0) { 3410d40e9d0SAdam Hornáček String alink = Util.getEmail(author); 3420d40e9d0SAdam Hornáček %><a href="<%= userPage + Util.htmlize(alink) + userPageSuffix 3430d40e9d0SAdam Hornáček %>"><%= Util.htmlize(author)%></a><% 3440d40e9d0SAdam Hornáček } else { 3450d40e9d0SAdam Hornáček %><%= author %><% 3460d40e9d0SAdam Hornáček } 3470d40e9d0SAdam Hornáček %></td> 3480d40e9d0SAdam Hornáček <td><a name="<%= rev %>"></a><% 3490d40e9d0SAdam Hornáček // revision message collapse threshold minimum of 10 3500d40e9d0SAdam Hornáček int summaryLength = Math.max(10, cfg.getRevisionMessageCollapseThreshold()); 3510d40e9d0SAdam Hornáček String cout = Util.htmlize(entry.getMessage()); 3520d40e9d0SAdam Hornáček 3530d40e9d0SAdam Hornáček if (bugPage != null && bugPage.length() > 0) { 3540d40e9d0SAdam Hornáček cout = Util.linkifyPattern(cout, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request)); 3550d40e9d0SAdam Hornáček } 3560d40e9d0SAdam Hornáček if (reviewPage != null && reviewPage.length() > 0) { 3570d40e9d0SAdam Hornáček cout = Util.linkifyPattern(cout, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request)); 3580d40e9d0SAdam Hornáček } 3590d40e9d0SAdam Hornáček 3600d40e9d0SAdam Hornáček boolean showSummary = false; 3610d40e9d0SAdam Hornáček String coutSummary = entry.getMessage(); 3620d40e9d0SAdam Hornáček if (coutSummary.length() > summaryLength) { 3630d40e9d0SAdam Hornáček showSummary = true; 3640d40e9d0SAdam Hornáček coutSummary = coutSummary.substring(0, summaryLength - 1); 3650d40e9d0SAdam Hornáček coutSummary = Util.htmlize(coutSummary); 3660d40e9d0SAdam Hornáček if (bugPage != null && bugPage.length() > 0) { 3670d40e9d0SAdam Hornáček coutSummary = Util.linkifyPattern(coutSummary, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request)); 3680d40e9d0SAdam Hornáček } 3690d40e9d0SAdam Hornáček if (reviewPage != null && reviewPage.length() > 0) { 3700d40e9d0SAdam Hornáček coutSummary = Util.linkifyPattern(coutSummary, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request)); 3710d40e9d0SAdam Hornáček } 3720d40e9d0SAdam Hornáček } 3730d40e9d0SAdam Hornáček 3740d40e9d0SAdam Hornáček if (showSummary) { 3750d40e9d0SAdam Hornáček %> 3760d40e9d0SAdam Hornáček <p class="rev-message-summary"><%= coutSummary %></p> 3770d40e9d0SAdam Hornáček <p class="rev-message-full rev-message-hidden"><%= cout %></p> 3780d40e9d0SAdam Hornáček <p class="rev-message-toggle" data-toggle-state="less"><a class="rev-toggle-a" href="#">show more ... </a></p> 3790d40e9d0SAdam Hornáček <% 3800d40e9d0SAdam Hornáček } 3810d40e9d0SAdam Hornáček else { 3820d40e9d0SAdam Hornáček %><p class="rev-message-full"><%= cout %></p><% 3830d40e9d0SAdam Hornáček } 3840d40e9d0SAdam Hornáček 3850d40e9d0SAdam Hornáček Set<String> files = entry.getFiles(); 3860d40e9d0SAdam Hornáček if (files != null) { 3870d40e9d0SAdam Hornáček %><div class="filelist-hidden"><br/><% 3880d40e9d0SAdam Hornáček for (String ifile : files) { 3890d40e9d0SAdam Hornáček String jfile = Util.stripPathPrefix(path, ifile); 39006988439SChris Fraire if (Objects.equals(rev, "")) { 3910d40e9d0SAdam Hornáček %> 3920d40e9d0SAdam Hornáček<a class="h" href="<%= context + Prefix.XREF_P + ifile %>"><%= jfile %></a><br/><% 3930d40e9d0SAdam Hornáček } else { 3940d40e9d0SAdam Hornáček %> 3950d40e9d0SAdam Hornáček<a class="h" href="<%= context + Prefix.XREF_P + ifile %>?r=<%= rev %>"><%= jfile %></a><br/><% 3960d40e9d0SAdam Hornáček } 3970d40e9d0SAdam Hornáček } 3980d40e9d0SAdam Hornáček %></div><% 3990d40e9d0SAdam Hornáček } 4000d40e9d0SAdam Hornáček %></td> 4010d40e9d0SAdam Hornáček </tr><% 4020d40e9d0SAdam Hornáček count++; 4030d40e9d0SAdam Hornáček } 4040d40e9d0SAdam Hornáček %> 4050d40e9d0SAdam Hornáček </tbody> 4060d40e9d0SAdam Hornáček <tfoot> 4070d40e9d0SAdam Hornáček <tr> 4080d40e9d0SAdam Hornáček <td colspan="5"> 4090d40e9d0SAdam Hornáček<% 41006988439SChris Fraire String slider; 4110d40e9d0SAdam Hornáček if ((slider = (String) request.getAttribute("history.jsp-slider")) != null) { 4120d40e9d0SAdam Hornáček // NOTE: shouldn't happen that it doesn't have this attribute 4130d40e9d0SAdam Hornáček %><p class="slider"><%= slider %></p><% 4140d40e9d0SAdam Hornáček } 4150d40e9d0SAdam Hornáček%> 4160d40e9d0SAdam Hornáček </td> 4170d40e9d0SAdam Hornáček </tr> 4180d40e9d0SAdam Hornáček </tfoot> 4190d40e9d0SAdam Hornáček</table> 4200d40e9d0SAdam Hornáček 4210d40e9d0SAdam Hornáček</form><% 4220d40e9d0SAdam Hornáček if (striked) { 4230d40e9d0SAdam Hornáček%><p><b>Note:</b> No associated file changes are available for 4240d40e9d0SAdam Hornáčekrevisions with strike-through numbers (eg. <del>1.45</del>)</p><% 4250d40e9d0SAdam Hornáček } 4260d40e9d0SAdam Hornáček%> 4270d40e9d0SAdam Hornáček<p class="rssbadge"><a href="<%=context + Prefix.RSS_P + uriEncodedName 4280d40e9d0SAdam Hornáček%>" title="RSS XML Feed of latest changes"><span id="rssi"></span></a></p> 4290d40e9d0SAdam Hornáček 4300d40e9d0SAdam Hornáček<% 4310d40e9d0SAdam Hornáček 4320d40e9d0SAdam Hornáček } 4330d40e9d0SAdam Hornáček} 4340d40e9d0SAdam Hornáček/* ---------------------- history.jsp end --------------------- */ 4350d40e9d0SAdam Hornáček%><%@ 4360d40e9d0SAdam Hornáček 4370d40e9d0SAdam Hornáčekinclude file="foot.jspf" 4380d40e9d0SAdam Hornáček 4390d40e9d0SAdam Hornáček%> 440