1*0d40e9d0SAdam Hornáček<%-- 2*0d40e9d0SAdam Hornáček$Id$ 3*0d40e9d0SAdam Hornáček 4*0d40e9d0SAdam HornáčekCDDL HEADER START 5*0d40e9d0SAdam Hornáček 6*0d40e9d0SAdam HornáčekThe contents of this file are subject to the terms of the 7*0d40e9d0SAdam HornáčekCommon Development and Distribution License (the "License"). 8*0d40e9d0SAdam HornáčekYou may not use this file except in compliance with the License. 9*0d40e9d0SAdam Hornáček 10*0d40e9d0SAdam HornáčekSee LICENSE.txt included in this distribution for the specific 11*0d40e9d0SAdam Hornáčeklanguage governing permissions and limitations under the License. 12*0d40e9d0SAdam Hornáček 13*0d40e9d0SAdam HornáčekWhen distributing Covered Code, include this CDDL HEADER in each 14*0d40e9d0SAdam Hornáčekfile and include the License file at LICENSE.txt. 15*0d40e9d0SAdam HornáčekIf applicable, add the following below this CDDL HEADER, with the 16*0d40e9d0SAdam Hornáčekfields enclosed by brackets "[]" replaced with your own identifying 17*0d40e9d0SAdam Hornáčekinformation: Portions Copyright [yyyy] [name of copyright owner] 18*0d40e9d0SAdam Hornáček 19*0d40e9d0SAdam HornáčekCDDL HEADER END 20*0d40e9d0SAdam Hornáček 21*0d40e9d0SAdam HornáčekCopyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. 22*0d40e9d0SAdam HornáčekPortions Copyright 2011 Jens Elkner. 23*0d40e9d0SAdam HornáčekPortions Copyright (c) 2018, Chris Fraire <cfraire@me.com>. 24*0d40e9d0SAdam Hornáček 25*0d40e9d0SAdam Hornáček--%> 26*0d40e9d0SAdam Hornáček<%@page import="org.opensolaris.opengrok.web.Util"%> 27*0d40e9d0SAdam Hornáček<%@page import="org.opensolaris.opengrok.history.HistoryGuru"%> 28*0d40e9d0SAdam Hornáček<%@page import="java.io.File"%> 29*0d40e9d0SAdam Hornáček<%@page errorPage="error.jsp" import=" 30*0d40e9d0SAdam Hornáčekjava.text.Format, 31*0d40e9d0SAdam Hornáčekjava.text.SimpleDateFormat, 32*0d40e9d0SAdam Hornáčekjava.util.Date, 33*0d40e9d0SAdam Hornáčekjava.util.Set, 34*0d40e9d0SAdam Hornáčekjava.util.regex.Pattern, 35*0d40e9d0SAdam Hornáček 36*0d40e9d0SAdam Hornáčekorg.opensolaris.opengrok.history.History, 37*0d40e9d0SAdam Hornáčekorg.opensolaris.opengrok.history.HistoryEntry, 38*0d40e9d0SAdam Hornáčekorg.opensolaris.opengrok.history.HistoryException, 39*0d40e9d0SAdam Hornáčekorg.opensolaris.opengrok.configuration.RuntimeEnvironment" 40*0d40e9d0SAdam Hornáček%> 41*0d40e9d0SAdam Hornáček<%/* ---------------------- history.jsp start --------------------- */ 42*0d40e9d0SAdam Hornáček{ 43*0d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 44*0d40e9d0SAdam Hornáček 45*0d40e9d0SAdam Hornáček cfg.checkSourceRootExistence(); 46*0d40e9d0SAdam Hornáček 47*0d40e9d0SAdam Hornáček // Need to set the title before including httpheader.jspf 48*0d40e9d0SAdam Hornáček cfg.setTitle(cfg.getHistoryTitle()); 49*0d40e9d0SAdam Hornáček 50*0d40e9d0SAdam Hornáček String path = cfg.getPath(); 51*0d40e9d0SAdam Hornáček 52*0d40e9d0SAdam Hornáček if (path.length() > 0) { 53*0d40e9d0SAdam Hornáček File f = cfg.getResourceFile(); 54*0d40e9d0SAdam Hornáček History hist = null; 55*0d40e9d0SAdam Hornáček try { 56*0d40e9d0SAdam Hornáček hist = HistoryGuru.getInstance().getHistoryUI(f); 57*0d40e9d0SAdam Hornáček } catch (Exception e) { 58*0d40e9d0SAdam Hornáček // should not happen 59*0d40e9d0SAdam Hornáček response.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage()); 60*0d40e9d0SAdam Hornáček return; 61*0d40e9d0SAdam Hornáček } 62*0d40e9d0SAdam Hornáček 63*0d40e9d0SAdam Hornáček if (hist == null) { 64*0d40e9d0SAdam Hornáček /** 65*0d40e9d0SAdam Hornáček * The history is not available even for a renamed file. 66*0d40e9d0SAdam Hornáček * Send 404 Not Found. 67*0d40e9d0SAdam Hornáček */ 68*0d40e9d0SAdam Hornáček response.sendError(HttpServletResponse.SC_NOT_FOUND); 69*0d40e9d0SAdam Hornáček return; 70*0d40e9d0SAdam Hornáček } 71*0d40e9d0SAdam Hornáček request.setAttribute("history.jsp-hist", hist); 72*0d40e9d0SAdam Hornáček } 73*0d40e9d0SAdam Hornáček} 74*0d40e9d0SAdam Hornáček%> 75*0d40e9d0SAdam Hornáček<%@ 76*0d40e9d0SAdam Hornáček 77*0d40e9d0SAdam Hornáčekinclude file="httpheader.jspf" 78*0d40e9d0SAdam Hornáček 79*0d40e9d0SAdam Hornáček%> 80*0d40e9d0SAdam Hornáček<% 81*0d40e9d0SAdam Hornáček{ 82*0d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 83*0d40e9d0SAdam Hornáček if ((request.getAttribute("history.jsp-hist")) != null) { 84*0d40e9d0SAdam Hornáček%> 85*0d40e9d0SAdam Hornáček<body> 86*0d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */ 87*0d40e9d0SAdam Hornáček document.rev = function() { return getParameter("r"); }; 88*0d40e9d0SAdam Hornáček document.annotate = <%= PageConfig.get(request).annotate() %>; 89*0d40e9d0SAdam Hornáček document.domReady.push(function() { domReadyMast(); }); 90*0d40e9d0SAdam Hornáček document.pageReady.push(function() { pageReadyMast(); }); 91*0d40e9d0SAdam Hornáček/* ]]> */</script> 92*0d40e9d0SAdam Hornáček<div id="page"> 93*0d40e9d0SAdam Hornáček <div id="whole_header"> 94*0d40e9d0SAdam Hornáček <div id="header"> 95*0d40e9d0SAdam Hornáček<% 96*0d40e9d0SAdam Hornáček } 97*0d40e9d0SAdam Hornáček} 98*0d40e9d0SAdam Hornáček{ 99*0d40e9d0SAdam Hornáček if (request.getAttribute("history.jsp-hist") != null) { 100*0d40e9d0SAdam Hornáček%><%@ 101*0d40e9d0SAdam Hornáček 102*0d40e9d0SAdam Hornáčekinclude file="pageheader.jspf" 103*0d40e9d0SAdam Hornáček 104*0d40e9d0SAdam Hornáček%> 105*0d40e9d0SAdam Hornáček<% 106*0d40e9d0SAdam Hornáček } 107*0d40e9d0SAdam Hornáček} 108*0d40e9d0SAdam Hornáček{ 109*0d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 110*0d40e9d0SAdam Hornáček String context = request.getContextPath(); 111*0d40e9d0SAdam Hornáček String path = cfg.getPath(); 112*0d40e9d0SAdam Hornáček 113*0d40e9d0SAdam Hornáček History hist = null; 114*0d40e9d0SAdam Hornáček if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) { 115*0d40e9d0SAdam Hornáček 116*0d40e9d0SAdam Hornáček int start = cfg.getSearchStart(); 117*0d40e9d0SAdam Hornáček int max = cfg.getSearchMaxItems(); 118*0d40e9d0SAdam Hornáček long totalHits = hist.getHistoryEntries().size(); 119*0d40e9d0SAdam Hornáček long thispage = Math.min(totalHits - start, max); 120*0d40e9d0SAdam Hornáček 121*0d40e9d0SAdam Hornáček // We have a lots of results to show: create a slider for them 122*0d40e9d0SAdam Hornáček request.setAttribute("history.jsp-slider", Util.createSlider(start, max, totalHits, request)); 123*0d40e9d0SAdam Hornáček%> 124*0d40e9d0SAdam Hornáček </div> 125*0d40e9d0SAdam Hornáček <div id="Masthead">History log of 126*0d40e9d0SAdam Hornáček <%= Util.breadcrumbPath(context + Prefix.XREF_P, path,'/',"",true,cfg.isDir()) %> 127*0d40e9d0SAdam Hornáček (Results <b> <%= start + 1 %> - <%= thispage + start 128*0d40e9d0SAdam Hornáček %></b> of <b><%= totalHits %></b>) 129*0d40e9d0SAdam Hornáček </div> 130*0d40e9d0SAdam Hornáček<% 131*0d40e9d0SAdam Hornáček } 132*0d40e9d0SAdam Hornáček} 133*0d40e9d0SAdam Hornáček{ 134*0d40e9d0SAdam Hornáček if (request.getAttribute("history.jsp-hist") != null) { 135*0d40e9d0SAdam Hornáček%> 136*0d40e9d0SAdam Hornáček <%@ 137*0d40e9d0SAdam Hornáček 138*0d40e9d0SAdam Hornáčekinclude file="minisearch.jspf" 139*0d40e9d0SAdam Hornáček 140*0d40e9d0SAdam Hornáček%> 141*0d40e9d0SAdam Hornáček<% 142*0d40e9d0SAdam Hornáček } 143*0d40e9d0SAdam Hornáček} 144*0d40e9d0SAdam Hornáček{ 145*0d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 146*0d40e9d0SAdam Hornáček String context = request.getContextPath(); 147*0d40e9d0SAdam Hornáček String path = cfg.getPath(); 148*0d40e9d0SAdam Hornáček History hist = null; 149*0d40e9d0SAdam Hornáček if ((hist = (History) request.getAttribute("history.jsp-hist")) != null) { 150*0d40e9d0SAdam Hornáček RuntimeEnvironment env = cfg.getEnv(); 151*0d40e9d0SAdam Hornáček String uriEncodedName = cfg.getUriEncodedPath(); 152*0d40e9d0SAdam Hornáček 153*0d40e9d0SAdam Hornáček boolean striked = false; 154*0d40e9d0SAdam Hornáček String userPage = env.getUserPage(); 155*0d40e9d0SAdam Hornáček String userPageSuffix = env.getUserPageSuffix(); 156*0d40e9d0SAdam Hornáček String bugPage = env.getBugPage(); 157*0d40e9d0SAdam Hornáček String bugRegex = env.getBugPattern(); 158*0d40e9d0SAdam Hornáček Pattern bugPattern = Pattern.compile(bugRegex); 159*0d40e9d0SAdam Hornáček String reviewPage = env.getReviewPage(); 160*0d40e9d0SAdam Hornáček String reviewRegex = env.getReviewPattern(); 161*0d40e9d0SAdam Hornáček Pattern reviewPattern = Pattern.compile(reviewRegex); 162*0d40e9d0SAdam Hornáček 163*0d40e9d0SAdam Hornáček Format df = new SimpleDateFormat("dd-MMM-yyyy"); 164*0d40e9d0SAdam Hornáček 165*0d40e9d0SAdam Hornáček int revision2 = cfg.getIntParam("r2", -1) < 0 ? 0 : cfg.getIntParam("r2", -1); 166*0d40e9d0SAdam Hornáček int revision1 = cfg.getIntParam("r1", -1) < revision2 ? revision2 + 1 : cfg.getIntParam("r1", -1); 167*0d40e9d0SAdam Hornáček revision2 = revision2 >= hist.getHistoryEntries().size() ? hist.getHistoryEntries().size() - 1 : revision2; 168*0d40e9d0SAdam Hornáček 169*0d40e9d0SAdam Hornáček int start = cfg.getSearchStart(); 170*0d40e9d0SAdam Hornáček int max = cfg.getSearchMaxItems(); 171*0d40e9d0SAdam Hornáček%> 172*0d40e9d0SAdam Hornáček<script type="text/javascript">/* <![CDATA[ */ 173*0d40e9d0SAdam Hornáčekdocument.domReady.push(function() {domReadyHistory();}); 174*0d40e9d0SAdam Hornáček/* ]]> */</script> 175*0d40e9d0SAdam Hornáček<!--[if IE]> 176*0d40e9d0SAdam Hornáček<style type="text/css"> 177*0d40e9d0SAdam Hornáček table#revisions tbody tr td p { 178*0d40e9d0SAdam Hornáček word-break: break-all; 179*0d40e9d0SAdam Hornáček } 180*0d40e9d0SAdam Hornáček</style> 181*0d40e9d0SAdam Hornáček<![endif]--> 182*0d40e9d0SAdam Hornáček<form action="<%= context + Prefix.DIFF_P + uriEncodedName %>"> 183*0d40e9d0SAdam Hornáček<table class="src" id="revisions"> 184*0d40e9d0SAdam Hornáček <thead> 185*0d40e9d0SAdam Hornáček <tr> 186*0d40e9d0SAdam Hornáček <th>Revision <% 187*0d40e9d0SAdam Hornáček if (hist.hasTags()) { 188*0d40e9d0SAdam Hornáček %><a href="#" onclick="javascript: toggle_revtags(); return false;"> 189*0d40e9d0SAdam Hornáček <span class="revtags-hidden"> 190*0d40e9d0SAdam Hornáček (<<< Hide revision tags)</span> 191*0d40e9d0SAdam Hornáček <span class="revtags"> 192*0d40e9d0SAdam Hornáček (Show revision tags >>>)</span></a><% 193*0d40e9d0SAdam Hornáček } 194*0d40e9d0SAdam Hornáček %></th><% 195*0d40e9d0SAdam Hornáček if (!cfg.isDir()) { 196*0d40e9d0SAdam Hornáček %> 197*0d40e9d0SAdam Hornáček <th><input type="submit" value=" Compare "/> 198*0d40e9d0SAdam Hornáček <% if (hist.getHistoryEntries().size() > revision1 && revision1 >= 0) { %> 199*0d40e9d0SAdam Hornáček <input type="hidden" id="input_r1" name="r1" value="<%= path + '@' + hist.getHistoryEntries().get(revision1).getRevision() %>" /> 200*0d40e9d0SAdam Hornáček <% } %> 201*0d40e9d0SAdam Hornáček <% if (hist.getHistoryEntries().size() > revision2 && revision2 >= 0) { %> 202*0d40e9d0SAdam Hornáček <input type="hidden" id="input_r2" name="r2" value="<%= path + '@' + hist.getHistoryEntries().get(revision2).getRevision() %>" /> 203*0d40e9d0SAdam Hornáček <% } %> 204*0d40e9d0SAdam Hornáček </th><% 205*0d40e9d0SAdam Hornáček } 206*0d40e9d0SAdam Hornáček %> 207*0d40e9d0SAdam Hornáček <th>Date</th> 208*0d40e9d0SAdam Hornáček <th>Author</th> 209*0d40e9d0SAdam Hornáček <th>Comments <% 210*0d40e9d0SAdam Hornáček if (hist.hasFileList()) { 211*0d40e9d0SAdam Hornáček %><a href="#" onclick="javascript: toggle_filelist(); return false;"> 212*0d40e9d0SAdam Hornáček <div class="filelist-hidden"> 213*0d40e9d0SAdam Hornáček (<<< Hide modified files)</div> 214*0d40e9d0SAdam Hornáček <div class="filelist"> 215*0d40e9d0SAdam Hornáček (Show modified files >>>)</div></a><% 216*0d40e9d0SAdam Hornáček } 217*0d40e9d0SAdam Hornáček %> 218*0d40e9d0SAdam Hornáček </th> 219*0d40e9d0SAdam Hornáček </tr> 220*0d40e9d0SAdam Hornáček </thead> 221*0d40e9d0SAdam Hornáček <tbody> 222*0d40e9d0SAdam Hornáček <% 223*0d40e9d0SAdam Hornáček int count=0; 224*0d40e9d0SAdam Hornáček for (HistoryEntry entry : hist.getHistoryEntries(max, start)) { 225*0d40e9d0SAdam Hornáček String rev = entry.getRevision(); 226*0d40e9d0SAdam Hornáček if (rev == null || rev.length() == 0) { 227*0d40e9d0SAdam Hornáček rev = ""; 228*0d40e9d0SAdam Hornáček } 229*0d40e9d0SAdam Hornáček String tags = entry.getTags(); 230*0d40e9d0SAdam Hornáček 231*0d40e9d0SAdam Hornáček if (tags != null) { 232*0d40e9d0SAdam Hornáček int colspan; 233*0d40e9d0SAdam Hornáček if (cfg.isDir()) 234*0d40e9d0SAdam Hornáček colspan = 4; 235*0d40e9d0SAdam Hornáček else 236*0d40e9d0SAdam Hornáček colspan = 5; 237*0d40e9d0SAdam Hornáček %> 238*0d40e9d0SAdam Hornáček <tr class="revtags-hidden"> 239*0d40e9d0SAdam Hornáček <td colspan="<%= colspan %>" class="revtags"> 240*0d40e9d0SAdam Hornáček <b>Revision tags:</b> <%= tags %> 241*0d40e9d0SAdam Hornáček </td> 242*0d40e9d0SAdam Hornáček </tr><tr style="display: none;"></tr><% 243*0d40e9d0SAdam Hornáček } 244*0d40e9d0SAdam Hornáček %> 245*0d40e9d0SAdam Hornáček <tr><% 246*0d40e9d0SAdam Hornáček if (cfg.isDir()) { 247*0d40e9d0SAdam Hornáček %> 248*0d40e9d0SAdam Hornáček <td><%= rev %></td><% 249*0d40e9d0SAdam Hornáček } else { 250*0d40e9d0SAdam Hornáček if (entry.isActive()) { 251*0d40e9d0SAdam Hornáček String rp = uriEncodedName; 252*0d40e9d0SAdam Hornáček StringBuffer urlBuffer = request.getRequestURL(); 253*0d40e9d0SAdam Hornáček if (request.getQueryString() != null) { 254*0d40e9d0SAdam Hornáček urlBuffer.append('?').append(request.getQueryString()); 255*0d40e9d0SAdam Hornáček } 256*0d40e9d0SAdam Hornáček urlBuffer.append('#').append(rev); 257*0d40e9d0SAdam Hornáček %> 258*0d40e9d0SAdam Hornáček <td><a href="<%= urlBuffer %>" 259*0d40e9d0SAdam Hornáček title="link to revision line">#</a> 260*0d40e9d0SAdam Hornáček <a href="<%= context + Prefix.XREF_P + rp + "?r=" + Util.URIEncode(rev) %>"><%= 261*0d40e9d0SAdam Hornáček rev %></a></td> 262*0d40e9d0SAdam Hornáček <td><% 263*0d40e9d0SAdam Hornáček %><input type="radio" 264*0d40e9d0SAdam Hornáček data-revision-1="<%= (start + count) %>" 265*0d40e9d0SAdam Hornáček data-revision-2="<%= revision2 %>" 266*0d40e9d0SAdam Hornáček data-diff-revision="r1" 267*0d40e9d0SAdam Hornáček data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision()%>" 268*0d40e9d0SAdam Hornáček <% 269*0d40e9d0SAdam Hornáček if (count + start > revision1 || (count + start > revision2 && count + start <= revision1 - 1)) { 270*0d40e9d0SAdam Hornáček // revision1 enabled 271*0d40e9d0SAdam Hornáček } else if (count + start == revision1 ) { 272*0d40e9d0SAdam Hornáček // revision1 selected 273*0d40e9d0SAdam Hornáček %> checked="checked"<% 274*0d40e9d0SAdam Hornáček } else if( count + start <= revision2 ) { 275*0d40e9d0SAdam Hornáček // revision1 disabled 276*0d40e9d0SAdam Hornáček %> disabled="disabled" <% 277*0d40e9d0SAdam Hornáček } 278*0d40e9d0SAdam Hornáček %>/><% 279*0d40e9d0SAdam Hornáček 280*0d40e9d0SAdam Hornáček %><input type="radio" 281*0d40e9d0SAdam Hornáček data-revision-1="<%= revision1 %>" 282*0d40e9d0SAdam Hornáček data-revision-2="<%= (start + count) %>" 283*0d40e9d0SAdam Hornáček data-diff-revision="r2" 284*0d40e9d0SAdam Hornáček data-revision-path="<%= path + '@' + hist.getHistoryEntries().get(start + count).getRevision() %>" 285*0d40e9d0SAdam Hornáček <% 286*0d40e9d0SAdam Hornáček if( count + start < revision2 || (count + start > revision2 && count + start <= revision1 - 1) ) { 287*0d40e9d0SAdam Hornáček // revision2 enabled 288*0d40e9d0SAdam Hornáček } else if( count + start == revision2 ) { 289*0d40e9d0SAdam Hornáček // revision2 selected 290*0d40e9d0SAdam Hornáček %> checked="checked" <% 291*0d40e9d0SAdam Hornáček } else if (count + start >= revision1 ) { 292*0d40e9d0SAdam Hornáček // revision2 disabled 293*0d40e9d0SAdam Hornáček %> disabled="disabled" <% 294*0d40e9d0SAdam Hornáček } 295*0d40e9d0SAdam Hornáček %>/><% 296*0d40e9d0SAdam Hornáček %></td><% 297*0d40e9d0SAdam Hornáček } else { 298*0d40e9d0SAdam Hornáček striked = true; 299*0d40e9d0SAdam Hornáček %> 300*0d40e9d0SAdam Hornáček <td><del><%= rev %></del></td> 301*0d40e9d0SAdam Hornáček <td></td><% 302*0d40e9d0SAdam Hornáček } 303*0d40e9d0SAdam Hornáček } 304*0d40e9d0SAdam Hornáček %> 305*0d40e9d0SAdam Hornáček <td><% 306*0d40e9d0SAdam Hornáček Date date = entry.getDate(); 307*0d40e9d0SAdam Hornáček if (date != null) { 308*0d40e9d0SAdam Hornáček %><%= df.format(date) %><% 309*0d40e9d0SAdam Hornáček } 310*0d40e9d0SAdam Hornáček %></td> 311*0d40e9d0SAdam Hornáček <td><% 312*0d40e9d0SAdam Hornáček String author = entry.getAuthor(); 313*0d40e9d0SAdam Hornáček if (author == null) { 314*0d40e9d0SAdam Hornáček %>(no author)<% 315*0d40e9d0SAdam Hornáček } else if (userPage != null && userPage.length() > 0) { 316*0d40e9d0SAdam Hornáček String alink = Util.getEmail(author); 317*0d40e9d0SAdam Hornáček %><a href="<%= userPage + Util.htmlize(alink) + userPageSuffix 318*0d40e9d0SAdam Hornáček %>"><%= Util.htmlize(author)%></a><% 319*0d40e9d0SAdam Hornáček } else { 320*0d40e9d0SAdam Hornáček %><%= author %><% 321*0d40e9d0SAdam Hornáček } 322*0d40e9d0SAdam Hornáček %></td> 323*0d40e9d0SAdam Hornáček <td><a name="<%= rev %>"></a><% 324*0d40e9d0SAdam Hornáček // revision message collapse threshold minimum of 10 325*0d40e9d0SAdam Hornáček int summaryLength = Math.max(10, cfg.getRevisionMessageCollapseThreshold()); 326*0d40e9d0SAdam Hornáček String cout = Util.htmlize(entry.getMessage()); 327*0d40e9d0SAdam Hornáček 328*0d40e9d0SAdam Hornáček if (bugPage != null && bugPage.length() > 0) { 329*0d40e9d0SAdam Hornáček cout = Util.linkifyPattern(cout, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request)); 330*0d40e9d0SAdam Hornáček } 331*0d40e9d0SAdam Hornáček if (reviewPage != null && reviewPage.length() > 0) { 332*0d40e9d0SAdam Hornáček cout = Util.linkifyPattern(cout, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request)); 333*0d40e9d0SAdam Hornáček } 334*0d40e9d0SAdam Hornáček 335*0d40e9d0SAdam Hornáček boolean showSummary = false; 336*0d40e9d0SAdam Hornáček String coutSummary = entry.getMessage(); 337*0d40e9d0SAdam Hornáček if (coutSummary.length() > summaryLength) { 338*0d40e9d0SAdam Hornáček showSummary = true; 339*0d40e9d0SAdam Hornáček coutSummary = coutSummary.substring(0, summaryLength - 1); 340*0d40e9d0SAdam Hornáček coutSummary = Util.htmlize(coutSummary); 341*0d40e9d0SAdam Hornáček if (bugPage != null && bugPage.length() > 0) { 342*0d40e9d0SAdam Hornáček coutSummary = Util.linkifyPattern(coutSummary, bugPattern, "$1", Util.completeUrl(bugPage + "$1", request)); 343*0d40e9d0SAdam Hornáček } 344*0d40e9d0SAdam Hornáček if (reviewPage != null && reviewPage.length() > 0) { 345*0d40e9d0SAdam Hornáček coutSummary = Util.linkifyPattern(coutSummary, reviewPattern, "$1", Util.completeUrl(reviewPage + "$1", request)); 346*0d40e9d0SAdam Hornáček } 347*0d40e9d0SAdam Hornáček } 348*0d40e9d0SAdam Hornáček 349*0d40e9d0SAdam Hornáček if (showSummary) { 350*0d40e9d0SAdam Hornáček %> 351*0d40e9d0SAdam Hornáček <p class="rev-message-summary"><%= coutSummary %></p> 352*0d40e9d0SAdam Hornáček <p class="rev-message-full rev-message-hidden"><%= cout %></p> 353*0d40e9d0SAdam Hornáček <p class="rev-message-toggle" data-toggle-state="less"><a class="rev-toggle-a" href="#">show more ... </a></p> 354*0d40e9d0SAdam Hornáček <% 355*0d40e9d0SAdam Hornáček } 356*0d40e9d0SAdam Hornáček else { 357*0d40e9d0SAdam Hornáček %><p class="rev-message-full"><%= cout %></p><% 358*0d40e9d0SAdam Hornáček } 359*0d40e9d0SAdam Hornáček 360*0d40e9d0SAdam Hornáček Set<String> files = entry.getFiles(); 361*0d40e9d0SAdam Hornáček if (files != null) { 362*0d40e9d0SAdam Hornáček %><div class="filelist-hidden"><br/><% 363*0d40e9d0SAdam Hornáček for (String ifile : files) { 364*0d40e9d0SAdam Hornáček String jfile = Util.stripPathPrefix(path, ifile); 365*0d40e9d0SAdam Hornáček if (rev == "") { 366*0d40e9d0SAdam Hornáček %> 367*0d40e9d0SAdam Hornáček<a class="h" href="<%= context + Prefix.XREF_P + ifile %>"><%= jfile %></a><br/><% 368*0d40e9d0SAdam Hornáček } else { 369*0d40e9d0SAdam Hornáček %> 370*0d40e9d0SAdam Hornáček<a class="h" href="<%= context + Prefix.XREF_P + ifile %>?r=<%= rev %>"><%= jfile %></a><br/><% 371*0d40e9d0SAdam Hornáček } 372*0d40e9d0SAdam Hornáček } 373*0d40e9d0SAdam Hornáček %></div><% 374*0d40e9d0SAdam Hornáček } 375*0d40e9d0SAdam Hornáček %></td> 376*0d40e9d0SAdam Hornáček </tr><% 377*0d40e9d0SAdam Hornáček count++; 378*0d40e9d0SAdam Hornáček } 379*0d40e9d0SAdam Hornáček %> 380*0d40e9d0SAdam Hornáček </tbody> 381*0d40e9d0SAdam Hornáček <tfoot> 382*0d40e9d0SAdam Hornáček <tr> 383*0d40e9d0SAdam Hornáček <td colspan="5"> 384*0d40e9d0SAdam Hornáček<% 385*0d40e9d0SAdam Hornáček String slider = null; 386*0d40e9d0SAdam Hornáček if ((slider = (String) request.getAttribute("history.jsp-slider")) != null) { 387*0d40e9d0SAdam Hornáček // NOTE: shouldn't happen that it doesn't have this attribute 388*0d40e9d0SAdam Hornáček %><p class="slider"><%= slider %></p><% 389*0d40e9d0SAdam Hornáček } 390*0d40e9d0SAdam Hornáček%> 391*0d40e9d0SAdam Hornáček </td> 392*0d40e9d0SAdam Hornáček </tr> 393*0d40e9d0SAdam Hornáček </tfoot> 394*0d40e9d0SAdam Hornáček</table> 395*0d40e9d0SAdam Hornáček 396*0d40e9d0SAdam Hornáček</form><% 397*0d40e9d0SAdam Hornáček if (striked) { 398*0d40e9d0SAdam Hornáček%><p><b>Note:</b> No associated file changes are available for 399*0d40e9d0SAdam Hornáčekrevisions with strike-through numbers (eg. <del>1.45</del>)</p><% 400*0d40e9d0SAdam Hornáček } 401*0d40e9d0SAdam Hornáček%> 402*0d40e9d0SAdam Hornáček<p class="rssbadge"><a href="<%=context + Prefix.RSS_P + uriEncodedName 403*0d40e9d0SAdam Hornáček%>" title="RSS XML Feed of latest changes"><span id="rssi"></span></a></p> 404*0d40e9d0SAdam Hornáček 405*0d40e9d0SAdam Hornáček<% 406*0d40e9d0SAdam Hornáček 407*0d40e9d0SAdam Hornáček } 408*0d40e9d0SAdam Hornáček} 409*0d40e9d0SAdam Hornáček/* ---------------------- history.jsp end --------------------- */ 410*0d40e9d0SAdam Hornáček%><%@ 411*0d40e9d0SAdam Hornáček 412*0d40e9d0SAdam Hornáčekinclude file="foot.jspf" 413*0d40e9d0SAdam Hornáček 414*0d40e9d0SAdam Hornáček%> 415