Provide links in commit summaries in commits table/view list (#7659)

* Provide links in commit summaries in commits table/view list

Signed-off-by: Gary Kim <gary@garykim.dev>

* Check that hashes are commits before making them links

Signed-off-by: Gary Kim <gary@garykim.dev>

* Revert "Check that hashes are commits before making them links"

This reverts commit a88564b8bc9872d4bf11062a4ebcb2f42b702200.

* Add Commit Message Links to Files List

Signed-off-by: Gary Kim <gary@garykim.dev>
This commit is contained in:
Gary Kim 2019-08-20 12:40:06 +00:00 committed by Lunny Xiao
parent 08c63190c6
commit 852876a982
2 changed files with 4 additions and 4 deletions

View file

@ -71,7 +71,7 @@
</td> </td>
<td class="message"> <td class="message">
<span class="message-wrapper"> <span class="message-wrapper">
<span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary}}</span> <span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessage .Message $.RepoLink $.Repository.ComposeMetas}}</span>
</span> </span>
{{if IsMultilineCommitMessage .Message}} {{if IsMultilineCommitMessage .Message}}
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button> <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>

View file

@ -28,12 +28,12 @@
{{end}} {{end}}
</a> </a>
{{template "repo/commit_status" .LatestCommitStatus}} {{template "repo/commit_status" .LatestCommitStatus}}
<span class="grey has-emoji commit-summary" title="{{.LatestCommit.Summary}}">{{.LatestCommit.Summary}} <span class="grey has-emoji commit-summary" title="{{.LatestCommit.Summary}}">{{RenderCommitMessage .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}
{{if IsMultilineCommitMessage .LatestCommit.Message}} {{if IsMultilineCommitMessage .LatestCommit.Message}}
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button> <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
<pre class="commit-body" style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre> <pre class="commit-body" style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
{{end}} {{end}}
</span> </span>
</th> </th>
<th class="text grey right age">{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th> <th class="text grey right age">{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}</th>
</tr> </tr>
@ -83,7 +83,7 @@
{{end}} {{end}}
<td class="message"> <td class="message">
<span class="truncate has-emoji"> <span class="truncate has-emoji">
<a href="{{$.RepoLink}}/commit/{{$commit.ID}}" title="{{$commit.Summary}}">{{$commit.Summary}}</a> {{RenderCommitMessageLink $commit.Message $.RepoLink (Printf "%s/commit/%s" $.RepoLink $commit.ID) $.Repository.ComposeMetas}}
</span> </span>
</td> </td>
<td class="text grey right age">{{TimeSince $commit.Committer.When $.Lang}}</td> <td class="text grey right age">{{TimeSince $commit.Committer.When $.Lang}}</td>