|
| 1 | +<div class="ui attached table segment"> |
| 2 | + <table class="ui very basic striped fixed table single line" id="commits-table"> |
| 3 | + <thead> |
| 4 | + <tr> |
| 5 | + <th class="four wide">{{.i18n.Tr "repo.commits.author"}}</th> |
| 6 | + <th class="two wide sha">SHA1</th> |
| 7 | + <th class="seven wide message">{{.i18n.Tr "repo.commits.message"}}</th> |
| 8 | + <th class="three wide right aligned">{{.i18n.Tr "repo.commits.date"}}</th> |
| 9 | + </tr> |
| 10 | + </thead> |
| 11 | + <tbody class="commit-list"> |
| 12 | + {{ $r:= List .Commits}} |
| 13 | + {{range $r}} |
| 14 | + <tr> |
| 15 | + <td class="author"> |
| 16 | + {{$userName := .Author.Name}} |
| 17 | + {{if .User}} |
| 18 | + {{if .User.FullName}} |
| 19 | + {{$userName = .User.FullName}} |
| 20 | + {{end}} |
| 21 | + <img class="ui avatar image" src="{{.User.RelAvatarLink}}" alt=""/> <a href="{{AppSubUrl}}/{{.User.Name}}">{{$userName}}</a> |
| 22 | + {{else}} |
| 23 | + <img class="ui avatar image" src="{{AvatarLink .Author.Email}}" alt=""/> {{$userName}} |
| 24 | + {{end}} |
| 25 | + </td> |
| 26 | + <td class="sha"> |
| 27 | + {{$class := "ui sha label"}} |
| 28 | + {{if .Signature}} |
| 29 | + {{$class = (printf "%s%s" $class " isSigned")}} |
| 30 | + {{if .Verification.Verified}} |
| 31 | + {{$class = (printf "%s%s" $class " isVerified")}} |
| 32 | + {{else if .Verification.Warning}} |
| 33 | + {{$class = (printf "%s%s" $class " isWarning")}} |
| 34 | + {{end}} |
| 35 | + {{end}} |
| 36 | + {{if $.Reponame}} |
| 37 | + <a href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}"> |
| 38 | + {{else}} |
| 39 | + <span class="{{$class}}"> |
| 40 | + {{end}} |
| 41 | + {{ShortSha .ID.String}} |
| 42 | + {{if .Signature}} |
| 43 | + <div class="ui detail icon button"> |
| 44 | + {{if .Verification.Verified}} |
| 45 | + <i title="{{.Verification.Reason}}" class="lock green icon"></i> |
| 46 | + {{if ne .Verification.SigningUser.ID 0}} |
| 47 | + <i title="{{.Verification.Reason}}" class="lock green icon"></i> |
| 48 | + {{else}} |
| 49 | + <i title="{{.Verification.Reason}}" class="icons"> |
| 50 | + <i class="green lock icon"></i> |
| 51 | + <i class="tiny inverted cog icon centerlock"></i> |
| 52 | + </i> |
| 53 | + {{end}} |
| 54 | + {{else if .Verification.Warning}} |
| 55 | + <i title="{{$.i18n.Tr .Verification.Reason}}" class="red unlock icon"></i> |
| 56 | + {{else}} |
| 57 | + <i title="{{$.i18n.Tr .Verification.Reason}}" class="unlock icon"></i> |
| 58 | + {{end}} |
| 59 | + </div> |
| 60 | + {{end}} |
| 61 | + {{if $.Reponame}} |
| 62 | + </a> |
| 63 | + {{else}} |
| 64 | + </span> |
| 65 | + {{end}} |
| 66 | + </td> |
| 67 | + <td class="message"> |
| 68 | + <span class="message-wrapper"> |
| 69 | + {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Username $.Reponame .ID }} |
| 70 | + <span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}}</span> |
| 71 | + </span> |
| 72 | + {{if IsMultilineCommitMessage .Message}} |
| 73 | + <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button> |
| 74 | + {{end}} |
| 75 | + {{if eq (CommitType .) "SignCommitWithStatuses"}} |
| 76 | + {{template "repo/commit_status" .Status}} |
| 77 | + {{end}} |
| 78 | + {{if IsMultilineCommitMessage .Message}} |
| 79 | + <pre class="commit-body" style="display: none;">{{RenderCommitBody .Message $.RepoLink $.Repository.ComposeMetas}}</pre> |
| 80 | + {{end}} |
| 81 | + </td> |
| 82 | + <td class="grey text right aligned">{{TimeSince .Author.When $.Lang}}</td> |
| 83 | + </tr> |
| 84 | + {{end}} |
| 85 | + </tbody> |
| 86 | + </table> |
| 87 | + </div> |
0 commit comments