From 1fb94ca9b22023da02bcbca85880ade90c70a4c8 Mon Sep 17 00:00:00 2001 From: Nate Brady Date: Tue, 17 Apr 2018 09:21:26 -0700 Subject: [PATCH 1/2] add links for repository and commit --- src/main/java/tfb/status/view/HomePageView.java | 7 +++++++ src/main/resources/mustache/detail.mustache | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/tfb/status/view/HomePageView.java b/src/main/java/tfb/status/view/HomePageView.java index bebfd256..24c4dfd6 100644 --- a/src/main/java/tfb/status/view/HomePageView.java +++ b/src/main/java/tfb/status/view/HomePageView.java @@ -167,6 +167,7 @@ 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, @@ -174,6 +175,12 @@ public ResultsGitView(String commitId, this.commitId = Objects.requireNonNull(commitId); this.repositoryUrl = repositoryUrl; this.branchName = branchName; + if (this.repositoryUrl != null) { + this.commitUrl = repositoryUrl.replace(".git$", "") + + "/commit/" + this.commitId; + } else { + this.commitUrl = null; + } } } } diff --git a/src/main/resources/mustache/detail.mustache b/src/main/resources/mustache/detail.mustache index 5039f23b..11f6c3db 100644 --- a/src/main/resources/mustache/detail.mustache +++ b/src/main/resources/mustache/detail.mustache @@ -28,10 +28,16 @@ The HTML of the results detail page. {{#git}}
TFB git commit ID
-
{{commitId}}
+
+ {{#commitUrl}}{{commitId}}{{/commitUrl}} + {{^commitUrl}}{{commitId}}{{/commitUrl}} +
TFB git repository URL
-
{{#repositoryUrl}}{{repositoryUrl}}{{/repositoryUrl}} - {{^repositoryUrl}}(unknown, probably https://github.com/TechEmpower/FrameworkBenchmarks.git){{/repositoryUrl}}
+
{{#repositoryUrl}}{{repositoryUrl}}{{/repositoryUrl}} + {{^repositoryUrl}} + (unknown, probably + https://github.com/TechEmpower/FrameworkBenchmarks.git) + {{/repositoryUrl}}
TFB git branch name
{{#branchName}}{{branchName}}{{/branchName}} {{^branchName}}(unknown, probably master){{/branchName}}
From 4c1e772995187112fb7d863ed42db8922b652523 Mon Sep 17 00:00:00 2001 From: Nate Brady Date: Tue, 17 Apr 2018 10:14:46 -0700 Subject: [PATCH 2/2] link to tree, not commit --- src/main/java/tfb/status/view/HomePageView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/tfb/status/view/HomePageView.java b/src/main/java/tfb/status/view/HomePageView.java index 24c4dfd6..394431aa 100644 --- a/src/main/java/tfb/status/view/HomePageView.java +++ b/src/main/java/tfb/status/view/HomePageView.java @@ -177,7 +177,7 @@ public ResultsGitView(String commitId, this.branchName = branchName; if (this.repositoryUrl != null) { this.commitUrl = repositoryUrl.replace(".git$", "") - + "/commit/" + this.commitId; + + "/tree/" + this.commitId; } else { this.commitUrl = null; }