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 21*aa18fa28SAdam HornacekCopyright (c) 2005, 2021, 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"> 120*aa18fa28SAdam Hornacek <header id="whole_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%> 127*aa18fa28SAdam Hornacek <%@include file="pageheader.jspf" %> 1280d40e9d0SAdam Hornáček<% 1290d40e9d0SAdam Hornáček } 1300d40e9d0SAdam Hornáček} 1310d40e9d0SAdam Hornáček{ 1320d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 1330d40e9d0SAdam Hornáček String context = request.getContextPath(); 1340d40e9d0SAdam Hornáček String path = cfg.getPath(); 1350d40e9d0SAdam Hornáček 13606988439SChris Fraire History hist; 1370d40e9d0SAdam Hornáček if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) { 1380d40e9d0SAdam Hornáček 1390d40e9d0SAdam Hornáček int start = cfg.getSearchStart(); 1400d40e9d0SAdam Hornáček int max = cfg.getSearchMaxItems(); 1410d40e9d0SAdam Hornáček long totalHits = hist.getHistoryEntries().size(); 1420d40e9d0SAdam Hornáček long thispage = Math.min(totalHits - start, max); 1430d40e9d0SAdam Hornáček 1440d40e9d0SAdam Hornáček // We have a lots of results to show: create a slider for them 1450d40e9d0SAdam Hornáček request.setAttribute("history.jsp-slider", Util.createSlider(start, max, totalHits, request)); 1460d40e9d0SAdam Hornáček%> 1470d40e9d0SAdam Hornáček <div id="Masthead">History log of 1480d40e9d0SAdam Hornáček <%= Util.breadcrumbPath(context + Prefix.XREF_P, path,'/',"",true,cfg.isDir()) %> 149ab235745SChris Fraire (Results <b> <%= totalHits != 0 ? start + 1 : 0 %> – <%= thispage + start 1500d40e9d0SAdam Hornáček %></b> of <b><%= totalHits %></b>) 1510d40e9d0SAdam Hornáček </div> 1520d40e9d0SAdam Hornáček<% 1530d40e9d0SAdam Hornáček } 1540d40e9d0SAdam Hornáček} 1550d40e9d0SAdam Hornáček{ 1560d40e9d0SAdam Hornáček if (request.getAttribute("history.jsp-hist") != null) { 1570d40e9d0SAdam Hornáček%> 1580d40e9d0SAdam Hornáček <%@ 1590d40e9d0SAdam Hornáček 1600d40e9d0SAdam Hornáčekinclude file="minisearch.jspf" 1610d40e9d0SAdam Hornáček 1620d40e9d0SAdam Hornáček%> 1630d40e9d0SAdam Hornáček<% 1640d40e9d0SAdam Hornáček } 1650d40e9d0SAdam Hornáček} 1660d40e9d0SAdam Hornáček{ 1670d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 1680d40e9d0SAdam Hornáček String context = request.getContextPath(); 1690d40e9d0SAdam Hornáček String path = cfg.getPath(); 17006988439SChris Fraire History hist; 1710d40e9d0SAdam Hornáček if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) { 1720d40e9d0SAdam Hornáček RuntimeEnvironment env = cfg.getEnv(); 1730d40e9d0SAdam Hornáček String uriEncodedName = cfg.getUriEncodedPath(); 1740d40e9d0SAdam Hornáček 1750d40e9d0SAdam Hornáček boolean striked = false; 1760d40e9d0SAdam Hornáček String userPage = env.getUserPage(); 1770d40e9d0SAdam Hornáček String userPageSuffix = env.getUserPageSuffix(); 1780d40e9d0SAdam Hornáček String bugPage = env.getBugPage(); 1790d40e9d0SAdam Hornáček String bugRegex = env.getBugPattern(); 1800d40e9d0SAdam Hornáček Pattern bugPattern = Pattern.compile(bugRegex); 1810d40e9d0SAdam Hornáček String reviewPage = env.getReviewPage(); 1820d40e9d0SAdam Hornáček String reviewRegex = env.getReviewPattern(); 1830d40e9d0SAdam Hornáček Pattern reviewPattern = Pattern.compile(reviewRegex); 1840d40e9d0SAdam Hornáček 1850d40e9d0SAdam Hornáček Format df = new SimpleDateFormat("dd-MMM-yyyy"); 1860d40e9d0SAdam Hornáček 1871c830032SChris Fraire int revision2 = Math.max(cfg.getIntParam(QueryParameters.REVISION_2_PARAM, -1), 0); 1881c830032SChris Fraire int revision1 = cfg.getIntParam(QueryParameters.REVISION_1_PARAM, -1) < revision2 ? 1891c830032SChris Fraire revision2 + 1 : cfg.getIntParam(QueryParameters.REVISION_1_PARAM, -1); 1900d40e9d0SAdam Hornáček revision2 = revision2 >= hist.getHistoryEntries().size() ? hist.getHistoryEntries().size() - 1 : revision2; 1910d40e9d0SAdam Hornáček 1920d40e9d0SAdam Hornáček int start = cfg.getSearchStart(); 1930d40e9d0SAdam Hornáček int max = cfg.getSearchMaxItems(); 1940d40e9d0SAdam Hornáček%> 1950d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */ 1960d40e9d0SAdam Hornáčekdocument.domReady.push(function() {domReadyHistory();}); 1970d40e9d0SAdam Hornáček/* ]]> */</script> 1980d40e9d0SAdam Hornáček<!--[if IE]> 1990d40e9d0SAdam Hornáček<style type="text/css"> 2000d40e9d0SAdam Hornáček table#revisions tbody tr td p { 2010d40e9d0SAdam Hornáček word-break: break-all; 2020d40e9d0SAdam Hornáček } 2030d40e9d0SAdam Hornáček</style> 2040d40e9d0SAdam Hornáček<![endif]--> 2050d40e9d0SAdam Hornáček<form action="<%= context + Prefix.DIFF_P + uriEncodedName %>"> 2060d40e9d0SAdam Hornáček<table class="src" id="revisions"> 2070d40e9d0SAdam Hornáček <thead> 2080d40e9d0SAdam Hornáček <tr> 2090d40e9d0SAdam Hornáček <th>Revision <% 2100d40e9d0SAdam Hornáček if (hist.hasTags()) { 211c6f0939bSAdam Hornacek %><a href="#" onclick="toggle_revtags(); return false;"> 2120d40e9d0SAdam Hornáček <span class="revtags-hidden"> 2130d40e9d0SAdam Hornáček (<<< Hide revision tags)</span> 2140d40e9d0SAdam Hornáček <span class="revtags"> 2150d40e9d0SAdam Hornáček (Show revision tags >>>)</span></a><% 2160d40e9d0SAdam Hornáček } 2170d40e9d0SAdam Hornáček %></th><% 2180d40e9d0SAdam Hornáček if (!cfg.isDir()) { 2190d40e9d0SAdam Hornáček %> 2200d40e9d0SAdam Hornáček <th><input type="submit" value=" Compare "/> 2210d40e9d0SAdam Hornáček <% if (hist.getHistoryEntries().size() > revision1 && revision1 >= 0) { %> 2221c830032SChris Fraire <input type="hidden" id="input_r1" name="<%= QueryParameters.REVISION_1_PARAM %>" 2231c830032SChris Fraire value="<%= path + '@' + hist.getHistoryEntries().get(revision1).getRevision() %>"/> 2240d40e9d0SAdam Hornáček <% } %> 2250d40e9d0SAdam Hornáček <% if (hist.getHistoryEntries().size() > revision2 && revision2 >= 0) { %> 2261c830032SChris Fraire <input type="hidden" id="input_r2" name="<%= QueryParameters.REVISION_2_PARAM %>" 2271c830032SChris Fraire value="<%= path + '@' + hist.getHistoryEntries().get(revision2).getRevision() %>"/> 2280d40e9d0SAdam Hornáček <% } %> 2290d40e9d0SAdam Hornáček </th><% 2300d40e9d0SAdam Hornáček } 2310d40e9d0SAdam Hornáček %> 2320d40e9d0SAdam Hornáček <th>Date</th> 2330d40e9d0SAdam Hornáček <th>Author</th> 2340d40e9d0SAdam Hornáček <th>Comments <% 2350d40e9d0SAdam Hornáček if (hist.hasFileList()) { 236c6f0939bSAdam Hornacek %><a href="#" onclick="toggle_filelist(); return false;"> 2370d40e9d0SAdam Hornáček <div class="filelist-hidden"> 2380d40e9d0SAdam Hornáček (<<< Hide modified files)</div> 2390d40e9d0SAdam Hornáček <div class="filelist"> 2400d40e9d0SAdam Hornáček (Show modified files >>>)</div></a><% 2410d40e9d0SAdam Hornáček } 2420d40e9d0SAdam Hornáček %> 2430d40e9d0SAdam Hornáček </th> 2440d40e9d0SAdam Hornáček </tr> 2450d40e9d0SAdam Hornáček </thead> 2460d40e9d0SAdam Hornáček <tbody> 2470d40e9d0SAdam Hornáček <% 2480d40e9d0SAdam Hornáček int count=0; 2490d40e9d0SAdam Hornáček for (HistoryEntry entry : hist.getHistoryEntries(max, start)) { 2500d40e9d0SAdam Hornáček String rev = entry.getRevision(); 2510d40e9d0SAdam Hornáček if (rev == null || rev.length() == 0) { 2520d40e9d0SAdam Hornáček rev = ""; 2530d40e9d0SAdam Hornáček } 25407d1c02bSVladimir Kotal String tags = hist.getTags().get(rev); 2550d40e9d0SAdam Hornáček 2560d40e9d0SAdam Hornáček if (tags != null) { 2570d40e9d0SAdam Hornáček int colspan; 2580d40e9d0SAdam Hornáček if (cfg.isDir()) 2590d40e9d0SAdam Hornáček colspan = 4; 2600d40e9d0SAdam Hornáček else 2610d40e9d0SAdam Hornáček colspan = 5; 2620d40e9d0SAdam Hornáček %> 2630d40e9d0SAdam Hornáček <tr class="revtags-hidden"> 2640d40e9d0SAdam Hornáček <td colspan="<%= colspan %>" class="revtags"> 2650d40e9d0SAdam Hornáček <b>Revision tags:</b> <%= tags %> 2660d40e9d0SAdam Hornáček </td> 2670d40e9d0SAdam Hornáček </tr><tr style="display: none;"></tr><% 2680d40e9d0SAdam Hornáček } 2690d40e9d0SAdam Hornáček %> 2700d40e9d0SAdam Hornáček <tr><% 2710d40e9d0SAdam Hornáček if (cfg.isDir()) { 2720d40e9d0SAdam Hornáček %> 2730d40e9d0SAdam Hornáček <td><%= rev %></td><% 2740d40e9d0SAdam Hornáček } else { 2750d40e9d0SAdam Hornáček if (entry.isActive()) { 2760d40e9d0SAdam Hornáček StringBuffer urlBuffer = request.getRequestURL(); 2770d40e9d0SAdam Hornáček if (request.getQueryString() != null) { 2780d40e9d0SAdam Hornáček urlBuffer.append('?').append(request.getQueryString()); 2790d40e9d0SAdam Hornáček } 2800d40e9d0SAdam Hornáček urlBuffer.append('#').append(rev); 2810d40e9d0SAdam Hornáček %> 2820d40e9d0SAdam Hornáček <td><a href="<%= urlBuffer %>" 2830d40e9d0SAdam Hornáček title="link to revision line">#</a> 2841c830032SChris Fraire <a href="<%= context + Prefix.XREF_P + uriEncodedName + "?" + 2851c830032SChris Fraire QueryParameters.REVISION_PARAM_EQ + Util.URIEncode(rev) %>"><%= rev %> 2861c830032SChris Fraire </a></td> 2870d40e9d0SAdam Hornáček <td><% 2880d40e9d0SAdam Hornáček %><input type="radio" 2897b94bd45SAdam Hornacek aria-label="From" 2900d40e9d0SAdam Hornáček data-revision-1="<%= (start + count) %>" 2910d40e9d0SAdam Hornáček data-revision-2="<%= revision2 %>" 2921c830032SChris Fraire data-diff-revision="<%= QueryParameters.REVISION_1_PARAM %>" 2930d40e9d0SAdam Hornáček data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision()%>" 2940d40e9d0SAdam Hornáček <% 2950d40e9d0SAdam Hornáček if (count + start > revision1 || (count + start > revision2 && count + start <= revision1 - 1)) { 2960d40e9d0SAdam Hornáček // revision1 enabled 2970d40e9d0SAdam Hornáček } else if (count + start == revision1 ) { 2980d40e9d0SAdam Hornáček // revision1 selected 2990d40e9d0SAdam Hornáček %> checked="checked"<% 3000d40e9d0SAdam Hornáček } else if( count + start <= revision2 ) { 3010d40e9d0SAdam Hornáček // revision1 disabled 3020d40e9d0SAdam Hornáček %> disabled="disabled" <% 3030d40e9d0SAdam Hornáček } 3040d40e9d0SAdam Hornáček %>/><% 3050d40e9d0SAdam Hornáček 3060d40e9d0SAdam Hornáček %><input type="radio" 3077b94bd45SAdam Hornacek aria-label="To" 3080d40e9d0SAdam Hornáček data-revision-1="<%= revision1 %>" 3090d40e9d0SAdam Hornáček data-revision-2="<%= (start + count) %>" 3101c830032SChris Fraire data-diff-revision="<%= QueryParameters.REVISION_2_PARAM %>" 3110d40e9d0SAdam Hornáček data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision() %>" 3120d40e9d0SAdam Hornáček <% 3130d40e9d0SAdam Hornáček if( count + start < revision2 || (count + start > revision2 && count + start <= revision1 - 1) ) { 3140d40e9d0SAdam Hornáček // revision2 enabled 3150d40e9d0SAdam Hornáček } else if( count + start == revision2 ) { 3160d40e9d0SAdam Hornáček // revision2 selected 3170d40e9d0SAdam Hornáček %> checked="checked" <% 3180d40e9d0SAdam Hornáček } else if (count + start >= revision1 ) { 3190d40e9d0SAdam Hornáček // revision2 disabled 3200d40e9d0SAdam Hornáček %> disabled="disabled" <% 3210d40e9d0SAdam Hornáček } 3220d40e9d0SAdam Hornáček %>/><% 3230d40e9d0SAdam Hornáček %></td><% 3240d40e9d0SAdam Hornáček } else { 3250d40e9d0SAdam Hornáček striked = true; 3260d40e9d0SAdam Hornáček %> 3270d40e9d0SAdam Hornáček <td><del><%= rev %></del></td> 3280d40e9d0SAdam Hornáček <td></td><% 3290d40e9d0SAdam Hornáček } 3300d40e9d0SAdam Hornáček } 3310d40e9d0SAdam Hornáček %> 3320d40e9d0SAdam Hornáček <td><% 3330d40e9d0SAdam Hornáček Date date = entry.getDate(); 3340d40e9d0SAdam Hornáček if (date != null) { 3350d40e9d0SAdam Hornáček %><%= df.format(date) %><% 3360d40e9d0SAdam Hornáček } 3370d40e9d0SAdam Hornáček %></td> 3380d40e9d0SAdam Hornáček <td><% 3390d40e9d0SAdam Hornáček String author = entry.getAuthor(); 3400d40e9d0SAdam Hornáček if (author == null) { 3410d40e9d0SAdam Hornáček %>(no author)<% 3420d40e9d0SAdam Hornáček } else if (userPage != null && userPage.length() > 0) { 3430d40e9d0SAdam Hornáček String alink = Util.getEmail(author); 3440d40e9d0SAdam Hornáček %><a href="<%= userPage + Util.htmlize(alink) + userPageSuffix 3450d40e9d0SAdam Hornáček %>"><%= Util.htmlize(author)%></a><% 3460d40e9d0SAdam Hornáček } else { 3470d40e9d0SAdam Hornáček %><%= author %><% 3480d40e9d0SAdam Hornáček } 3490d40e9d0SAdam Hornáček %></td> 3500d40e9d0SAdam Hornáček <td><a name="<%= rev %>"></a><% 3510d40e9d0SAdam Hornáček // revision message collapse threshold minimum of 10 3520d40e9d0SAdam Hornáček int summaryLength = Math.max(10, cfg.getRevisionMessageCollapseThreshold()); 3530d40e9d0SAdam Hornáček String cout = Util.htmlize(entry.getMessage()); 3540d40e9d0SAdam Hornáček 3550d40e9d0SAdam Hornáček if (bugPage != null && bugPage.length() > 0) { 3560d40e9d0SAdam Hornáček cout = Util.linkifyPattern(cout, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request)); 3570d40e9d0SAdam Hornáček } 3580d40e9d0SAdam Hornáček if (reviewPage != null && reviewPage.length() > 0) { 3590d40e9d0SAdam Hornáček cout = Util.linkifyPattern(cout, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request)); 3600d40e9d0SAdam Hornáček } 3610d40e9d0SAdam Hornáček 3620d40e9d0SAdam Hornáček boolean showSummary = false; 3630d40e9d0SAdam Hornáček String coutSummary = entry.getMessage(); 3640d40e9d0SAdam Hornáček if (coutSummary.length() > summaryLength) { 3650d40e9d0SAdam Hornáček showSummary = true; 3660d40e9d0SAdam Hornáček coutSummary = coutSummary.substring(0, summaryLength - 1); 3670d40e9d0SAdam Hornáček coutSummary = Util.htmlize(coutSummary); 3680d40e9d0SAdam Hornáček if (bugPage != null && bugPage.length() > 0) { 3690d40e9d0SAdam Hornáček coutSummary = Util.linkifyPattern(coutSummary, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request)); 3700d40e9d0SAdam Hornáček } 3710d40e9d0SAdam Hornáček if (reviewPage != null && reviewPage.length() > 0) { 3720d40e9d0SAdam Hornáček coutSummary = Util.linkifyPattern(coutSummary, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request)); 3730d40e9d0SAdam Hornáček } 3740d40e9d0SAdam Hornáček } 3750d40e9d0SAdam Hornáček 3760d40e9d0SAdam Hornáček if (showSummary) { 3770d40e9d0SAdam Hornáček %> 3780d40e9d0SAdam Hornáček <p class="rev-message-summary"><%= coutSummary %></p> 3790d40e9d0SAdam Hornáček <p class="rev-message-full rev-message-hidden"><%= cout %></p> 3800d40e9d0SAdam Hornáček <p class="rev-message-toggle" data-toggle-state="less"><a class="rev-toggle-a" href="#">show more ... </a></p> 3810d40e9d0SAdam Hornáček <% 3820d40e9d0SAdam Hornáček } 3830d40e9d0SAdam Hornáček else { 3840d40e9d0SAdam Hornáček %><p class="rev-message-full"><%= cout %></p><% 3850d40e9d0SAdam Hornáček } 3860d40e9d0SAdam Hornáček 3870d40e9d0SAdam Hornáček Set<String> files = entry.getFiles(); 3880d40e9d0SAdam Hornáček if (files != null) { 3890d40e9d0SAdam Hornáček %><div class="filelist-hidden"><br/><% 3900d40e9d0SAdam Hornáček for (String ifile : files) { 3910d40e9d0SAdam Hornáček String jfile = Util.stripPathPrefix(path, ifile); 39206988439SChris Fraire if (Objects.equals(rev, "")) { 3930d40e9d0SAdam Hornáček %> 3940d40e9d0SAdam Hornáček<a class="h" href="<%= context + Prefix.XREF_P + ifile %>"><%= jfile %></a><br/><% 3950d40e9d0SAdam Hornáček } else { 3960d40e9d0SAdam Hornáček %> 3971c830032SChris Fraire<a class="h" href="<%= context + Prefix.XREF_P + ifile %>?<%= QueryParameters.REVISION_PARAM_EQ %> 3981c830032SChris Fraire<%= rev %>"><%= jfile %></a><br/><% 3990d40e9d0SAdam Hornáček } 4000d40e9d0SAdam Hornáček } 4010d40e9d0SAdam Hornáček %></div><% 4020d40e9d0SAdam Hornáček } 4030d40e9d0SAdam Hornáček %></td> 4040d40e9d0SAdam Hornáček </tr><% 4050d40e9d0SAdam Hornáček count++; 4060d40e9d0SAdam Hornáček } 4070d40e9d0SAdam Hornáček %> 4080d40e9d0SAdam Hornáček </tbody> 4090d40e9d0SAdam Hornáček <tfoot> 4100d40e9d0SAdam Hornáček <tr> 4110d40e9d0SAdam Hornáček <td colspan="5"> 4120d40e9d0SAdam Hornáček<% 41306988439SChris Fraire String slider; 4140d40e9d0SAdam Hornáček if ((slider = (String) request.getAttribute("history.jsp-slider")) != null) { 4150d40e9d0SAdam Hornáček // NOTE: shouldn't happen that it doesn't have this attribute 4160d40e9d0SAdam Hornáček %><p class="slider"><%= slider %></p><% 4170d40e9d0SAdam Hornáček } 4180d40e9d0SAdam Hornáček%> 4190d40e9d0SAdam Hornáček </td> 4200d40e9d0SAdam Hornáček </tr> 4210d40e9d0SAdam Hornáček </tfoot> 4220d40e9d0SAdam Hornáček</table> 4230d40e9d0SAdam Hornáček 4240d40e9d0SAdam Hornáček</form><% 4250d40e9d0SAdam Hornáček if (striked) { 4260d40e9d0SAdam Hornáček%><p><b>Note:</b> No associated file changes are available for 4270d40e9d0SAdam Hornáčekrevisions with strike-through numbers (eg. <del>1.45</del>)</p><% 4280d40e9d0SAdam Hornáček } 4290d40e9d0SAdam Hornáček%> 4300d40e9d0SAdam Hornáček<p class="rssbadge"><a href="<%=context + Prefix.RSS_P + uriEncodedName 4310d40e9d0SAdam Hornáček%>" title="RSS XML Feed of latest changes"><span id="rssi"></span></a></p> 4320d40e9d0SAdam Hornáček 4330d40e9d0SAdam Hornáček<% 4340d40e9d0SAdam Hornáček 4350d40e9d0SAdam Hornáček } 4360d40e9d0SAdam Hornáček} 4370d40e9d0SAdam Hornáček/* ---------------------- history.jsp end --------------------- */ 4380d40e9d0SAdam Hornáček%><%@ 4390d40e9d0SAdam Hornáček 4400d40e9d0SAdam Hornáčekinclude file="foot.jspf" 4410d40e9d0SAdam Hornáček 4420d40e9d0SAdam Hornáček%> 443