Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add links for repository and commit #3

Merged
merged 2 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/tfb/status/view/HomePageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,20 @@ public static final class ResultsGitView {
public final String commitId;
@Nullable public final String repositoryUrl;
@Nullable public final String branchName;
@Nullable public final String commitUrl;

public ResultsGitView(String commitId,
@Nullable String repositoryUrl,
@Nullable String branchName) {
this.commitId = Objects.requireNonNull(commitId);
this.repositoryUrl = repositoryUrl;
this.branchName = branchName;
if (this.repositoryUrl != null) {
this.commitUrl = repositoryUrl.replace(".git$", "")
+ "/tree/" + this.commitId;
} else {
this.commitUrl = null;
}
}
}
}
12 changes: 9 additions & 3 deletions src/main/resources/mustache/detail.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ The HTML of the results detail page.
{{#git}}
<dl>
<dt>TFB git commit ID</dt>
<dd><code>{{commitId}}</code></dd>
<dd>
{{#commitUrl}}<a href="{{commitUrl}}">{{commitId}}</a>{{/commitUrl}}
{{^commitUrl}}<code>{{commitId}}</code>{{/commitUrl}}
</dd>
<dt>TFB git repository URL</dt>
<dd>{{#repositoryUrl}}<code>{{repositoryUrl}}</code>{{/repositoryUrl}}
{{^repositoryUrl}}(unknown, probably <code>https://github.com/TechEmpower/FrameworkBenchmarks.git</code>){{/repositoryUrl}}</dd>
<dd>{{#repositoryUrl}}<a href="{{repositoryUrl}}">{{repositoryUrl}}</a>{{/repositoryUrl}}
{{^repositoryUrl}}
(unknown, probably <a href="https://github.com/TechEmpower/FrameworkBenchmarks.git">
https://github.com/TechEmpower/FrameworkBenchmarks.git</a>)
{{/repositoryUrl}}</dd>
<dt>TFB git branch name</dt>
<dd>{{#branchName}}<code>{{branchName}}</code>{{/branchName}}
{{^branchName}}(unknown, probably <code>master</code>){{/branchName}}</dd>
Expand Down