-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New commits list #24423
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
Closed
Closed
New commits list #24423
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,74 @@ | ||
<div class="ui attached table segment commit-table"> | ||
<table class="ui very basic striped table unstackable fixed" id="commits-table"> | ||
<thead> | ||
<tr> | ||
<th class="three wide">{{.locale.Tr "repo.commits.author"}}</th> | ||
<th class="two wide sha">SHA1</th> | ||
<th class="nine wide message">{{.locale.Tr "repo.commits.message"}}</th> | ||
<th class="two wide right aligned">{{.locale.Tr "repo.commits.date"}}</th> | ||
</tr> | ||
</thead> | ||
<tbody class="commit-list"> | ||
{{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}} | ||
{{range .Commits}} | ||
<tr> | ||
<td class="author"> | ||
{{$userName := .Author.Name}} | ||
{{if .User}} | ||
{{if .User.FullName}} | ||
{{$userName = .User.FullName}} | ||
{{end}} | ||
{{avatar $.Context .User 28 "gt-mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a> | ||
<div class="ui attached table segment commits-list"> | ||
{{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}} | ||
{{range .Commits}} | ||
<div class="commits-list-row gt-df gt-ac gt-px-4 gt-py-2"> | ||
<div class="commits-list-left gt-df gt-fc gt-f1"> | ||
<div class="commits-list-top-row"> | ||
<span class="message-wrapper"> | ||
{{if $.PageIsWiki}} | ||
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji $.Context}}</span> | ||
{{else}} | ||
{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} | ||
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}}</span> | ||
{{end}} | ||
</span> | ||
{{if IsMultilineCommitMessage .Message}} | ||
<button class="ui button ellipsis-button" aria-expanded="false">...</button> | ||
{{end}} | ||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}} | ||
{{if IsMultilineCommitMessage .Message}} | ||
<pre class="commit-body gt-hidden">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre> | ||
{{end}} | ||
</div> | ||
<div class="commits-list-bottom-row gt-df gt-ac gt-fw gt-my-1"> | ||
{{if .User}} | ||
{{avatar $.Context .User 16 "gt-mr-2"}} | ||
{{else}} | ||
{{avatarByEmail $.Context .Author.Email .Author.Name 16 "gt-mr-2"}} | ||
{{end}} | ||
<div class="gt-dib"> | ||
{{$.locale.Tr "repo.user_committed_date" | ||
(printf "<a href='%s'>%s</a>" (.User.HomeLink | Escape) (.Author.Name | Escape)) | ||
(TimeSince .Committer.When $.locale) | Safe}} | ||
</div> | ||
</div> | ||
</div> | ||
<div class="commits-list-right gt-df gt-ac"> | ||
<div class="sha gt-df"> | ||
<button class="ui button copy-commit-sha gt-df gt-ac" data-clipboard-text="{{.ID}}">{{svg "octicon-copy" 14}}</button> | ||
{{$class := "ui sha label"}} | ||
{{if .Signature}} | ||
{{$class = (printf "%s%s" $class " isSigned")}} | ||
{{if .Verification.Verified}} | ||
{{if eq .Verification.TrustStatus "trusted"}} | ||
{{$class = (printf "%s%s" $class " isVerified")}} | ||
{{else if eq .Verification.TrustStatus "untrusted"}} | ||
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}} | ||
{{else}} | ||
{{avatarByEmail $.Context .Author.Email .Author.Name 28 "gt-mr-2"}} | ||
{{$userName}} | ||
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}} | ||
{{end}} | ||
</td> | ||
<td class="sha gt-df"> | ||
<button class="ui button copy-commit-sha gt-df gt-ac" data-clipboard-text="{{.ID}}">{{svg "octicon-copy" 14}}</button> | ||
{{$class := "ui sha label"}} | ||
{{if .Signature}} | ||
{{$class = (printf "%s%s" $class " isSigned")}} | ||
{{if .Verification.Verified}} | ||
{{if eq .Verification.TrustStatus "trusted"}} | ||
{{$class = (printf "%s%s" $class " isVerified")}} | ||
{{else if eq .Verification.TrustStatus "untrusted"}} | ||
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}} | ||
{{else}} | ||
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}} | ||
{{end}} | ||
{{else if .Verification.Warning}} | ||
{{$class = (printf "%s%s" $class " isWarning")}} | ||
{{end}} | ||
{{end}} | ||
{{if $.PageIsWiki}} | ||
<a href="{{$commitRepoLink}}/wiki/commit/{{.ID}}" rel="nofollow" class="{{$class}}"> | ||
{{else if $.Reponame}} | ||
<a href="{{$commitRepoLink}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}"> | ||
{{else}} | ||
<span class="{{$class}}"> | ||
{{end}} | ||
<span class="shortsha">{{ShortSha .ID.String}}</span> | ||
{{if .Signature}} | ||
{{template "repo/shabox_badge" dict "root" $ "verification" .Verification}} | ||
{{end}} | ||
{{if $.Reponame}} | ||
</a> | ||
{{else}} | ||
</span> | ||
{{end}} | ||
</td> | ||
<td class="message"> | ||
<span class="message-wrapper"> | ||
{{if $.PageIsWiki}} | ||
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji $.Context}}</span> | ||
{{else}} | ||
{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}} | ||
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}}</span> | ||
{{end}} | ||
</span> | ||
{{if IsMultilineCommitMessage .Message}} | ||
<button class="ui button ellipsis-button" aria-expanded="false">...</button> | ||
{{end}} | ||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}} | ||
{{if IsMultilineCommitMessage .Message}} | ||
<pre class="commit-body gt-hidden">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre> | ||
{{end}} | ||
</td> | ||
{{if .Committer}} | ||
<td class="text right aligned">{{TimeSince .Committer.When $.locale}}</td> | ||
{{else}} | ||
<td class="text right aligned">{{TimeSince .Author.When $.locale}}</td> | ||
{{else if .Verification.Warning}} | ||
{{$class = (printf "%s%s" $class " isWarning")}} | ||
{{end}} | ||
{{end}} | ||
{{if $.PageIsWiki}} | ||
<a href="{{$commitRepoLink}}/wiki/commit/{{.ID}}" rel="nofollow" class="{{$class}}"> | ||
{{else if $.Reponame}} | ||
<a href="{{$commitRepoLink}}/commit/{{.ID}}" rel="nofollow" class="{{$class}}"> | ||
{{else}} | ||
<span class="{{$class}}"> | ||
{{end}} | ||
<span class="shortsha">{{ShortSha .ID.String}}</span> | ||
{{if .Signature}} | ||
{{template "repo/shabox_badge" dict "root" $ "verification" .Verification}} | ||
{{end}} | ||
</tr> | ||
{{end}} | ||
</tbody> | ||
</table> | ||
</div> | ||
{{if $.Reponame}} | ||
</a> | ||
{{else}} | ||
</span> | ||
{{end}} | ||
</div> | ||
</div> | ||
</div> | ||
{{end}} | ||
</div> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These "gt-df gt-ac gt-px-4 gt-py-2" seems quite wordy.
Since it has a class
commits-list-row
, is it better to put the styles on the particular CSS class name?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the other issue, I think what can be done with helper classes should be done with them. I see CSS currently only for stuff that can not be done with helper classes.
Another benefit of helper classes is that they move when the element moves, so won't leave garbage CSS during refactoring.
I do like to retain descriptive class names, primarily as a visual aid for reading the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree. It helps when working on other people's code.
Interesting idea. I'll give that a try,