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. 231c830032SChris FrairePortions Copyright (c) 2018-2020, Chris Fraire <cfraire@me.com>. 240d40e9d0SAdam Hornáček--%> 25a804b2d7SAdam Hornáček<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 260d40e9d0SAdam Hornáček<%@page errorPage="error.jsp" import=" 271c830032SChris Frairejava.io.IOException, 281c830032SChris Frairejava.io.File, 290d40e9d0SAdam Hornáčekjava.text.Format, 300d40e9d0SAdam Hornáčekjava.text.SimpleDateFormat, 310d40e9d0SAdam Hornáčekjava.util.Date, 3280a75b43SChris Frairejava.util.logging.Level, 3380a75b43SChris Frairejava.util.logging.Logger, 3406988439SChris Frairejava.util.Objects, 350d40e9d0SAdam Hornáčekjava.util.Set, 360d40e9d0SAdam Hornáčekjava.util.regex.Pattern, 370d40e9d0SAdam Hornáček 3880a75b43SChris Fraireorg.opengrok.indexer.configuration.RuntimeEnvironment, 39686556f2SAdam Hornáčekorg.opengrok.indexer.history.History, 40686556f2SAdam Hornáčekorg.opengrok.indexer.history.HistoryEntry, 411c830032SChris Fraireorg.opengrok.indexer.history.HistoryGuru, 4280a75b43SChris Fraireorg.opengrok.indexer.logger.LoggerFactory, 4380a75b43SChris Fraireorg.opengrok.indexer.util.ForbiddenSymlinkException, 441c830032SChris Fraireorg.opengrok.indexer.web.QueryParameters, 451c830032SChris Fraireorg.opengrok.indexer.web.SearchHelper, 461c830032SChris Fraireorg.opengrok.indexer.web.Util" 470d40e9d0SAdam Hornáček%> 480d40e9d0SAdam Hornáček<%/* ---------------------- history.jsp start --------------------- */ 490d40e9d0SAdam Hornáček{ 5080a75b43SChris Fraire final Logger LOGGER = LoggerFactory.getLogger(getClass()); 510d40e9d0SAdam Hornáček 5280a75b43SChris Fraire PageConfig cfg = PageConfig.get(request); 530d40e9d0SAdam Hornáček cfg.checkSourceRootExistence(); 540d40e9d0SAdam Hornáček 550d40e9d0SAdam Hornáček // Need to set the title before including httpheader.jspf 560d40e9d0SAdam Hornáček cfg.setTitle(cfg.getHistoryTitle()); 570d40e9d0SAdam Hornáček 580d40e9d0SAdam Hornáček String path = cfg.getPath(); 590d40e9d0SAdam Hornáček 600d40e9d0SAdam Hornáček if (path.length() > 0) { 6180a75b43SChris Fraire String primePath = path; 6280a75b43SChris Fraire Project project = cfg.getProject(); 6380a75b43SChris Fraire if (project != null) { 6480a75b43SChris Fraire SearchHelper searchHelper = cfg.prepareInternalSearch(); 6580a75b43SChris Fraire /* 6680a75b43SChris Fraire * N.b. searchHelper.destroy() is called via 6780a75b43SChris Fraire * WebappListener.requestDestroyed() on presence of the following 6880a75b43SChris Fraire * REQUEST_ATTR. 6980a75b43SChris Fraire */ 7080a75b43SChris Fraire request.setAttribute(SearchHelper.REQUEST_ATTR, searchHelper); 7180a75b43SChris Fraire searchHelper.prepareExec(project); 7280a75b43SChris Fraire 730d40e9d0SAdam Hornáček try { 7480a75b43SChris Fraire primePath = searchHelper.getPrimeRelativePath(project.getName(), path); 7580a75b43SChris Fraire } catch (IOException | ForbiddenSymlinkException ex) { 7680a75b43SChris Fraire LOGGER.log(Level.WARNING, String.format( 7780a75b43SChris Fraire "Error getting prime relative for %s", path), ex); 7880a75b43SChris Fraire } 7980a75b43SChris Fraire } 8080a75b43SChris Fraire 8180a75b43SChris Fraire File file = cfg.getResourceFile(primePath); 8280a75b43SChris Fraire History hist; 8380a75b43SChris Fraire try { 8480a75b43SChris Fraire hist = HistoryGuru.getInstance().getHistoryUI(file); 850d40e9d0SAdam Hornáček } catch (Exception e) { 860d40e9d0SAdam Hornáček // should not happen 870d40e9d0SAdam Hornáček response.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage()); 880d40e9d0SAdam Hornáček return; 890d40e9d0SAdam Hornáček } 900d40e9d0SAdam Hornáček 910d40e9d0SAdam Hornáček if (hist == null) { 9206988439SChris Fraire /* 930d40e9d0SAdam Hornáček * The history is not available even for a renamed file. 940d40e9d0SAdam Hornáček * Send 404 Not Found. 950d40e9d0SAdam Hornáček */ 960d40e9d0SAdam Hornáček response.sendError(HttpServletResponse.SC_NOT_FOUND); 970d40e9d0SAdam Hornáček return; 980d40e9d0SAdam Hornáček } 990d40e9d0SAdam Hornáček request.setAttribute("history.jsp-hist", hist); 1000d40e9d0SAdam Hornáček } 1010d40e9d0SAdam Hornáček} 1020d40e9d0SAdam Hornáček%> 1030d40e9d0SAdam Hornáček<%@ 1040d40e9d0SAdam Hornáček 1050d40e9d0SAdam Hornáčekinclude file="httpheader.jspf" 1060d40e9d0SAdam Hornáček 1070d40e9d0SAdam Hornáček%> 1080d40e9d0SAdam Hornáček<% 1090d40e9d0SAdam Hornáček{ 1100d40e9d0SAdam Hornáček if ((request.getAttribute("history.jsp-hist")) != null) { 1110d40e9d0SAdam Hornáček%> 1120d40e9d0SAdam Hornáček<body> 1130d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */ 1141c830032SChris Fraire document.rev = function() { return getParameter("<%= QueryParameters.REVISION_PARAM %>"); }; 1150d40e9d0SAdam Hornáček document.annotate = <%= PageConfig.get(request).annotate() %>; 1160d40e9d0SAdam Hornáček document.domReady.push(function() { domReadyMast(); }); 1170d40e9d0SAdam Hornáček document.pageReady.push(function() { pageReadyMast(); }); 1180d40e9d0SAdam Hornáček/* ]]> */</script> 1190d40e9d0SAdam Hornáček<div id="page"> 1200d40e9d0SAdam Hornáček <div id="whole_header"> 1210d40e9d0SAdam Hornáček <div id="header"> 1220d40e9d0SAdam Hornáček<% 1230d40e9d0SAdam Hornáček } 1240d40e9d0SAdam Hornáček} 1250d40e9d0SAdam Hornáček{ 1260d40e9d0SAdam Hornáček if (request.getAttribute("history.jsp-hist") != null) { 1270d40e9d0SAdam Hornáček%><%@ 1280d40e9d0SAdam Hornáček 1290d40e9d0SAdam Hornáčekinclude file="pageheader.jspf" 1300d40e9d0SAdam Hornáček 1310d40e9d0SAdam Hornáček%> 1320d40e9d0SAdam Hornáček<% 1330d40e9d0SAdam Hornáček } 1340d40e9d0SAdam Hornáček} 1350d40e9d0SAdam Hornáček{ 1360d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 1370d40e9d0SAdam Hornáček String context = request.getContextPath(); 1380d40e9d0SAdam Hornáček String path = cfg.getPath(); 1390d40e9d0SAdam Hornáček 14006988439SChris Fraire History hist; 1410d40e9d0SAdam Hornáček if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) { 1420d40e9d0SAdam Hornáček 1430d40e9d0SAdam Hornáček int start = cfg.getSearchStart(); 1440d40e9d0SAdam Hornáček int max = cfg.getSearchMaxItems(); 1450d40e9d0SAdam Hornáček long totalHits = hist.getHistoryEntries().size(); 1460d40e9d0SAdam Hornáček long thispage = Math.min(totalHits - start, max); 1470d40e9d0SAdam Hornáček 1480d40e9d0SAdam Hornáček // We have a lots of results to show: create a slider for them 1490d40e9d0SAdam Hornáček request.setAttribute("history.jsp-slider", Util.createSlider(start, max, totalHits, request)); 1500d40e9d0SAdam Hornáček%> 1510d40e9d0SAdam Hornáček </div> 1520d40e9d0SAdam Hornáček <div id="Masthead">History log of 1530d40e9d0SAdam Hornáček <%= Util.breadcrumbPath(context + Prefix.XREF_P, path,'/',"",true,cfg.isDir()) %> 154ab235745SChris Fraire (Results <b> <%= totalHits != 0 ? start + 1 : 0 %> – <%= thispage + start 1550d40e9d0SAdam Hornáček %></b> of <b><%= totalHits %></b>) 1560d40e9d0SAdam Hornáček </div> 1570d40e9d0SAdam Hornáček<% 1580d40e9d0SAdam Hornáček } 1590d40e9d0SAdam Hornáček} 1600d40e9d0SAdam Hornáček{ 1610d40e9d0SAdam Hornáček if (request.getAttribute("history.jsp-hist") != null) { 1620d40e9d0SAdam Hornáček%> 1630d40e9d0SAdam Hornáček <%@ 1640d40e9d0SAdam Hornáček 1650d40e9d0SAdam Hornáčekinclude file="minisearch.jspf" 1660d40e9d0SAdam Hornáček 1670d40e9d0SAdam Hornáček%> 1680d40e9d0SAdam Hornáček<% 1690d40e9d0SAdam Hornáček } 1700d40e9d0SAdam Hornáček} 1710d40e9d0SAdam Hornáček{ 1720d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 1730d40e9d0SAdam Hornáček String context = request.getContextPath(); 1740d40e9d0SAdam Hornáček String path = cfg.getPath(); 17506988439SChris Fraire History hist; 1760d40e9d0SAdam Hornáček if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) { 1770d40e9d0SAdam Hornáček RuntimeEnvironment env = cfg.getEnv(); 1780d40e9d0SAdam Hornáček String uriEncodedName = cfg.getUriEncodedPath(); 1790d40e9d0SAdam Hornáček 1800d40e9d0SAdam Hornáček boolean striked = false; 1810d40e9d0SAdam Hornáček String userPage = env.getUserPage(); 1820d40e9d0SAdam Hornáček String userPageSuffix = env.getUserPageSuffix(); 1830d40e9d0SAdam Hornáček String bugPage = env.getBugPage(); 1840d40e9d0SAdam Hornáček String bugRegex = env.getBugPattern(); 1850d40e9d0SAdam Hornáček Pattern bugPattern = Pattern.compile(bugRegex); 1860d40e9d0SAdam Hornáček String reviewPage = env.getReviewPage(); 1870d40e9d0SAdam Hornáček String reviewRegex = env.getReviewPattern(); 1880d40e9d0SAdam Hornáček Pattern reviewPattern = Pattern.compile(reviewRegex); 1890d40e9d0SAdam Hornáček 1900d40e9d0SAdam Hornáček Format df = new SimpleDateFormat("dd-MMM-yyyy"); 1910d40e9d0SAdam Hornáček 1921c830032SChris Fraire int revision2 = Math.max(cfg.getIntParam(QueryParameters.REVISION_2_PARAM, -1), 0); 1931c830032SChris Fraire int revision1 = cfg.getIntParam(QueryParameters.REVISION_1_PARAM, -1) < revision2 ? 1941c830032SChris Fraire revision2 + 1 : cfg.getIntParam(QueryParameters.REVISION_1_PARAM, -1); 1950d40e9d0SAdam Hornáček revision2 = revision2 >= hist.getHistoryEntries().size() ? hist.getHistoryEntries().size() - 1 : revision2; 1960d40e9d0SAdam Hornáček 1970d40e9d0SAdam Hornáček int start = cfg.getSearchStart(); 1980d40e9d0SAdam Hornáček int max = cfg.getSearchMaxItems(); 1990d40e9d0SAdam Hornáček%> 2000d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */ 2010d40e9d0SAdam Hornáčekdocument.domReady.push(function() {domReadyHistory();}); 2020d40e9d0SAdam Hornáček/* ]]> */</script> 2030d40e9d0SAdam Hornáček<!--[if IE]> 2040d40e9d0SAdam Hornáček<style type="text/css"> 2050d40e9d0SAdam Hornáček table#revisions tbody tr td p { 2060d40e9d0SAdam Hornáček word-break: break-all; 2070d40e9d0SAdam Hornáček } 2080d40e9d0SAdam Hornáček</style> 2090d40e9d0SAdam Hornáček<![endif]--> 2100d40e9d0SAdam Hornáček<form action="<%= context + Prefix.DIFF_P + uriEncodedName %>"> 2110d40e9d0SAdam Hornáček<table class="src" id="revisions"> 2120d40e9d0SAdam Hornáček <thead> 2130d40e9d0SAdam Hornáček <tr> 2140d40e9d0SAdam Hornáček <th>Revision <% 2150d40e9d0SAdam Hornáček if (hist.hasTags()) { 216c6f0939bSAdam Hornacek %><a href="#" onclick="toggle_revtags(); return false;"> 2170d40e9d0SAdam Hornáček <span class="revtags-hidden"> 2180d40e9d0SAdam Hornáček (<<< Hide revision tags)</span> 2190d40e9d0SAdam Hornáček <span class="revtags"> 2200d40e9d0SAdam Hornáček (Show revision tags >>>)</span></a><% 2210d40e9d0SAdam Hornáček } 2220d40e9d0SAdam Hornáček %></th><% 2230d40e9d0SAdam Hornáček if (!cfg.isDir()) { 2240d40e9d0SAdam Hornáček %> 2250d40e9d0SAdam Hornáček <th><input type="submit" value=" Compare "/> 2260d40e9d0SAdam Hornáček <% if (hist.getHistoryEntries().size() > revision1 && revision1 >= 0) { %> 2271c830032SChris Fraire <input type="hidden" id="input_r1" name="<%= QueryParameters.REVISION_1_PARAM %>" 2281c830032SChris Fraire value="<%= path + '@' + hist.getHistoryEntries().get(revision1).getRevision() %>"/> 2290d40e9d0SAdam Hornáček <% } %> 2300d40e9d0SAdam Hornáček <% if (hist.getHistoryEntries().size() > revision2 && revision2 >= 0) { %> 2311c830032SChris Fraire <input type="hidden" id="input_r2" name="<%= QueryParameters.REVISION_2_PARAM %>" 2321c830032SChris Fraire value="<%= path + '@' + hist.getHistoryEntries().get(revision2).getRevision() %>"/> 2330d40e9d0SAdam Hornáček <% } %> 2340d40e9d0SAdam Hornáček </th><% 2350d40e9d0SAdam Hornáček } 2360d40e9d0SAdam Hornáček %> 2370d40e9d0SAdam Hornáček <th>Date</th> 2380d40e9d0SAdam Hornáček <th>Author</th> 2390d40e9d0SAdam Hornáček <th>Comments <% 2400d40e9d0SAdam Hornáček if (hist.hasFileList()) { 241c6f0939bSAdam Hornacek %><a href="#" onclick="toggle_filelist(); return false;"> 2420d40e9d0SAdam Hornáček <div class="filelist-hidden"> 2430d40e9d0SAdam Hornáček (<<< Hide modified files)</div> 2440d40e9d0SAdam Hornáček <div class="filelist"> 2450d40e9d0SAdam Hornáček (Show modified files >>>)</div></a><% 2460d40e9d0SAdam Hornáček } 2470d40e9d0SAdam Hornáček %> 2480d40e9d0SAdam Hornáček </th> 2490d40e9d0SAdam Hornáček </tr> 2500d40e9d0SAdam Hornáček </thead> 2510d40e9d0SAdam Hornáček <tbody> 2520d40e9d0SAdam Hornáček <% 2530d40e9d0SAdam Hornáček int count=0; 2540d40e9d0SAdam Hornáček for (HistoryEntry entry : hist.getHistoryEntries(max, start)) { 2550d40e9d0SAdam Hornáček String rev = entry.getRevision(); 2560d40e9d0SAdam Hornáček if (rev == null || rev.length() == 0) { 2570d40e9d0SAdam Hornáček rev = ""; 2580d40e9d0SAdam Hornáček } 259*07d1c02bSVladimir Kotal String tags = hist.getTags().get(rev); 2600d40e9d0SAdam Hornáček 2610d40e9d0SAdam Hornáček if (tags != null) { 2620d40e9d0SAdam Hornáček int colspan; 2630d40e9d0SAdam Hornáček if (cfg.isDir()) 2640d40e9d0SAdam Hornáček colspan = 4; 2650d40e9d0SAdam Hornáček else 2660d40e9d0SAdam Hornáček colspan = 5; 2670d40e9d0SAdam Hornáček %> 2680d40e9d0SAdam Hornáček <tr class="revtags-hidden"> 2690d40e9d0SAdam Hornáček <td colspan="<%= colspan %>" class="revtags"> 2700d40e9d0SAdam Hornáček <b>Revision tags:</b> <%= tags %> 2710d40e9d0SAdam Hornáček </td> 2720d40e9d0SAdam Hornáček </tr><tr style="display: none;"></tr><% 2730d40e9d0SAdam Hornáček } 2740d40e9d0SAdam Hornáček %> 2750d40e9d0SAdam Hornáček <tr><% 2760d40e9d0SAdam Hornáček if (cfg.isDir()) { 2770d40e9d0SAdam Hornáček %> 2780d40e9d0SAdam Hornáček <td><%= rev %></td><% 2790d40e9d0SAdam Hornáček } else { 2800d40e9d0SAdam Hornáček if (entry.isActive()) { 2810d40e9d0SAdam Hornáček StringBuffer urlBuffer = request.getRequestURL(); 2820d40e9d0SAdam Hornáček if (request.getQueryString() != null) { 2830d40e9d0SAdam Hornáček urlBuffer.append('?').append(request.getQueryString()); 2840d40e9d0SAdam Hornáček } 2850d40e9d0SAdam Hornáček urlBuffer.append('#').append(rev); 2860d40e9d0SAdam Hornáček %> 2870d40e9d0SAdam Hornáček <td><a href="<%= urlBuffer %>" 2880d40e9d0SAdam Hornáček title="link to revision line">#</a> 2891c830032SChris Fraire <a href="<%= context + Prefix.XREF_P + uriEncodedName + "?" + 2901c830032SChris Fraire QueryParameters.REVISION_PARAM_EQ + Util.URIEncode(rev) %>"><%= rev %> 2911c830032SChris Fraire </a></td> 2920d40e9d0SAdam Hornáček <td><% 2930d40e9d0SAdam Hornáček %><input type="radio" 2947b94bd45SAdam Hornacek aria-label="From" 2950d40e9d0SAdam Hornáček data-revision-1="<%= (start + count) %>" 2960d40e9d0SAdam Hornáček data-revision-2="<%= revision2 %>" 2971c830032SChris Fraire data-diff-revision="<%= QueryParameters.REVISION_1_PARAM %>" 2980d40e9d0SAdam Hornáček data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision()%>" 2990d40e9d0SAdam Hornáček <% 3000d40e9d0SAdam Hornáček if (count + start > revision1 || (count + start > revision2 && count + start <= revision1 - 1)) { 3010d40e9d0SAdam Hornáček // revision1 enabled 3020d40e9d0SAdam Hornáček } else if (count + start == revision1 ) { 3030d40e9d0SAdam Hornáček // revision1 selected 3040d40e9d0SAdam Hornáček %> checked="checked"<% 3050d40e9d0SAdam Hornáček } else if( count + start <= revision2 ) { 3060d40e9d0SAdam Hornáček // revision1 disabled 3070d40e9d0SAdam Hornáček %> disabled="disabled" <% 3080d40e9d0SAdam Hornáček } 3090d40e9d0SAdam Hornáček %>/><% 3100d40e9d0SAdam Hornáček 3110d40e9d0SAdam Hornáček %><input type="radio" 3127b94bd45SAdam Hornacek aria-label="To" 3130d40e9d0SAdam Hornáček data-revision-1="<%= revision1 %>" 3140d40e9d0SAdam Hornáček data-revision-2="<%= (start + count) %>" 3151c830032SChris Fraire data-diff-revision="<%= QueryParameters.REVISION_2_PARAM %>" 3160d40e9d0SAdam Hornáček data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision() %>" 3170d40e9d0SAdam Hornáček <% 3180d40e9d0SAdam Hornáček if( count + start < revision2 || (count + start > revision2 && count + start <= revision1 - 1) ) { 3190d40e9d0SAdam Hornáček // revision2 enabled 3200d40e9d0SAdam Hornáček } else if( count + start == revision2 ) { 3210d40e9d0SAdam Hornáček // revision2 selected 3220d40e9d0SAdam Hornáček %> checked="checked" <% 3230d40e9d0SAdam Hornáček } else if (count + start >= revision1 ) { 3240d40e9d0SAdam Hornáček // revision2 disabled 3250d40e9d0SAdam Hornáček %> disabled="disabled" <% 3260d40e9d0SAdam Hornáček } 3270d40e9d0SAdam Hornáček %>/><% 3280d40e9d0SAdam Hornáček %></td><% 3290d40e9d0SAdam Hornáček } else { 3300d40e9d0SAdam Hornáček striked = true; 3310d40e9d0SAdam Hornáček %> 3320d40e9d0SAdam Hornáček <td><del><%= rev %></del></td> 3330d40e9d0SAdam Hornáček <td></td><% 3340d40e9d0SAdam Hornáček } 3350d40e9d0SAdam Hornáček } 3360d40e9d0SAdam Hornáček %> 3370d40e9d0SAdam Hornáček <td><% 3380d40e9d0SAdam Hornáček Date date = entry.getDate(); 3390d40e9d0SAdam Hornáček if (date != null) { 3400d40e9d0SAdam Hornáček %><%= df.format(date) %><% 3410d40e9d0SAdam Hornáček } 3420d40e9d0SAdam Hornáček %></td> 3430d40e9d0SAdam Hornáček <td><% 3440d40e9d0SAdam Hornáček String author = entry.getAuthor(); 3450d40e9d0SAdam Hornáček if (author == null) { 3460d40e9d0SAdam Hornáček %>(no author)<% 3470d40e9d0SAdam Hornáček } else if (userPage != null && userPage.length() > 0) { 3480d40e9d0SAdam Hornáček String alink = Util.getEmail(author); 3490d40e9d0SAdam Hornáček %><a href="<%= userPage + Util.htmlize(alink) + userPageSuffix 3500d40e9d0SAdam Hornáček %>"><%= Util.htmlize(author)%></a><% 3510d40e9d0SAdam Hornáček } else { 3520d40e9d0SAdam Hornáček %><%= author %><% 3530d40e9d0SAdam Hornáček } 3540d40e9d0SAdam Hornáček %></td> 3550d40e9d0SAdam Hornáček <td><a name="<%= rev %>"></a><% 3560d40e9d0SAdam Hornáček // revision message collapse threshold minimum of 10 3570d40e9d0SAdam Hornáček int summaryLength = Math.max(10, cfg.getRevisionMessageCollapseThreshold()); 3580d40e9d0SAdam Hornáček String cout = Util.htmlize(entry.getMessage()); 3590d40e9d0SAdam Hornáček 3600d40e9d0SAdam Hornáček if (bugPage != null && bugPage.length() > 0) { 3610d40e9d0SAdam Hornáček cout = Util.linkifyPattern(cout, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request)); 3620d40e9d0SAdam Hornáček } 3630d40e9d0SAdam Hornáček if (reviewPage != null && reviewPage.length() > 0) { 3640d40e9d0SAdam Hornáček cout = Util.linkifyPattern(cout, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request)); 3650d40e9d0SAdam Hornáček } 3660d40e9d0SAdam Hornáček 3670d40e9d0SAdam Hornáček boolean showSummary = false; 3680d40e9d0SAdam Hornáček String coutSummary = entry.getMessage(); 3690d40e9d0SAdam Hornáček if (coutSummary.length() > summaryLength) { 3700d40e9d0SAdam Hornáček showSummary = true; 3710d40e9d0SAdam Hornáček coutSummary = coutSummary.substring(0, summaryLength - 1); 3720d40e9d0SAdam Hornáček coutSummary = Util.htmlize(coutSummary); 3730d40e9d0SAdam Hornáček if (bugPage != null && bugPage.length() > 0) { 3740d40e9d0SAdam Hornáček coutSummary = Util.linkifyPattern(coutSummary, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request)); 3750d40e9d0SAdam Hornáček } 3760d40e9d0SAdam Hornáček if (reviewPage != null && reviewPage.length() > 0) { 3770d40e9d0SAdam Hornáček coutSummary = Util.linkifyPattern(coutSummary, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request)); 3780d40e9d0SAdam Hornáček } 3790d40e9d0SAdam Hornáček } 3800d40e9d0SAdam Hornáček 3810d40e9d0SAdam Hornáček if (showSummary) { 3820d40e9d0SAdam Hornáček %> 3830d40e9d0SAdam Hornáček <p class="rev-message-summary"><%= coutSummary %></p> 3840d40e9d0SAdam Hornáček <p class="rev-message-full rev-message-hidden"><%= cout %></p> 3850d40e9d0SAdam Hornáček <p class="rev-message-toggle" data-toggle-state="less"><a class="rev-toggle-a" href="#">show more ... </a></p> 3860d40e9d0SAdam Hornáček <% 3870d40e9d0SAdam Hornáček } 3880d40e9d0SAdam Hornáček else { 3890d40e9d0SAdam Hornáček %><p class="rev-message-full"><%= cout %></p><% 3900d40e9d0SAdam Hornáček } 3910d40e9d0SAdam Hornáček 3920d40e9d0SAdam Hornáček Set<String> files = entry.getFiles(); 3930d40e9d0SAdam Hornáček if (files != null) { 3940d40e9d0SAdam Hornáček %><div class="filelist-hidden"><br/><% 3950d40e9d0SAdam Hornáček for (String ifile : files) { 3960d40e9d0SAdam Hornáček String jfile = Util.stripPathPrefix(path, ifile); 39706988439SChris Fraire if (Objects.equals(rev, "")) { 3980d40e9d0SAdam Hornáček %> 3990d40e9d0SAdam Hornáček<a class="h" href="<%= context + Prefix.XREF_P + ifile %>"><%= jfile %></a><br/><% 4000d40e9d0SAdam Hornáček } else { 4010d40e9d0SAdam Hornáček %> 4021c830032SChris Fraire<a class="h" href="<%= context + Prefix.XREF_P + ifile %>?<%= QueryParameters.REVISION_PARAM_EQ %> 4031c830032SChris Fraire<%= rev %>"><%= jfile %></a><br/><% 4040d40e9d0SAdam Hornáček } 4050d40e9d0SAdam Hornáček } 4060d40e9d0SAdam Hornáček %></div><% 4070d40e9d0SAdam Hornáček } 4080d40e9d0SAdam Hornáček %></td> 4090d40e9d0SAdam Hornáček </tr><% 4100d40e9d0SAdam Hornáček count++; 4110d40e9d0SAdam Hornáček } 4120d40e9d0SAdam Hornáček %> 4130d40e9d0SAdam Hornáček </tbody> 4140d40e9d0SAdam Hornáček <tfoot> 4150d40e9d0SAdam Hornáček <tr> 4160d40e9d0SAdam Hornáček <td colspan="5"> 4170d40e9d0SAdam Hornáček<% 41806988439SChris Fraire String slider; 4190d40e9d0SAdam Hornáček if ((slider = (String) request.getAttribute("history.jsp-slider")) != null) { 4200d40e9d0SAdam Hornáček // NOTE: shouldn't happen that it doesn't have this attribute 4210d40e9d0SAdam Hornáček %><p class="slider"><%= slider %></p><% 4220d40e9d0SAdam Hornáček } 4230d40e9d0SAdam Hornáček%> 4240d40e9d0SAdam Hornáček </td> 4250d40e9d0SAdam Hornáček </tr> 4260d40e9d0SAdam Hornáček </tfoot> 4270d40e9d0SAdam Hornáček</table> 4280d40e9d0SAdam Hornáček 4290d40e9d0SAdam Hornáček</form><% 4300d40e9d0SAdam Hornáček if (striked) { 4310d40e9d0SAdam Hornáček%><p><b>Note:</b> No associated file changes are available for 4320d40e9d0SAdam Hornáčekrevisions with strike-through numbers (eg. <del>1.45</del>)</p><% 4330d40e9d0SAdam Hornáček } 4340d40e9d0SAdam Hornáček%> 4350d40e9d0SAdam Hornáček<p class="rssbadge"><a href="<%=context + Prefix.RSS_P + uriEncodedName 4360d40e9d0SAdam Hornáček%>" title="RSS XML Feed of latest changes"><span id="rssi"></span></a></p> 4370d40e9d0SAdam Hornáček 4380d40e9d0SAdam Hornáček<% 4390d40e9d0SAdam Hornáček 4400d40e9d0SAdam Hornáček } 4410d40e9d0SAdam Hornáček} 4420d40e9d0SAdam Hornáček/* ---------------------- history.jsp end --------------------- */ 4430d40e9d0SAdam Hornáček%><%@ 4440d40e9d0SAdam Hornáček 4450d40e9d0SAdam Hornáčekinclude file="foot.jspf" 4460d40e9d0SAdam Hornáček 4470d40e9d0SAdam Hornáček%> 448