Skip to content

Commit

Permalink
[JENKINS-22215] Side panel menu is missing on pages with listing of s…
Browse files Browse the repository at this point in the history
…ource codes

- Side panel menu included to the page with listing of source codes.
- "Cppcheck Results" h1 header added.
- File name part moved from h1 to h2, <wbr /> element added after each slash "/" to allow wrapping of long paths without spaces and to hide unnecessary horizontal scrollbar.
  • Loading branch information
mixalturek committed Mar 16, 2014
1 parent f02efb9 commit 56e50f4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
Expand Up @@ -242,5 +242,14 @@ public String getSourceCode() {
public CppcheckWorkspaceFile getCppcheckWorkspaceFile() {
return cppcheckWorkspaceFile;
}

/**
* Get the owner build.
*
* @return the build
*/
public AbstractBuild<?, ?> getOwner() {
return owner;
}
}

Expand Up @@ -103,6 +103,18 @@ public final String getFileName() {
return fileName;
}

/**
* Returns the name of this file, allow wrap of long paths in a HTML page.
*
* @return the name of this file with <wbr /> element after each slash
*/
public final String getFileNameHtmlWrap() {
if(fileName == null)
return "";

return fileName.replace("/", "/<wbr />");
}

public String getTempName(final AbstractBuild<?, ?> owner) {
if (fileName != null) {
return owner.getRootDir().getAbsolutePath() + "/"
Expand Down
Expand Up @@ -28,12 +28,13 @@
xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<st:header name="Content-Type" value="text/html;charset=UTF-8"/>
<l:layout norefresh="true">

<st:include it="${it.owner}" page="sidepanel.jelly"/>
<l:main-panel>
<h1>${%sourcedetail.header(it.cppcheckWorkspaceFile.fileName)}</h1>
<h1>${%Cppcheck Results}</h1>

${it.sourceCode}
<h2>${%sourcedetail.header(it.cppcheckWorkspaceFile.fileNameHtmlWrap)}</h2>

${it.sourceCode}
</l:main-panel>
</l:layout>
</j:jelly>

0 comments on commit 56e50f4

Please sign in to comment.