Skip to content

Commit f428d40

Browse files
CirnoTsilverwindtechknowlogick
authored
Fix styling for commiter on diff view (#11715) (#11744)
* Fix styling for commiter on diff view * Update options/locale/locale_en-US.ini * Update templates/repo/commit_page.tmpl Co-authored-by: silverwind <[email protected]> * Update templates/repo/commit_page.tmpl Co-authored-by: silverwind <[email protected]> * Apply suggestions from code review Co-authored-by: silverwind <[email protected]> Co-authored-by: silverwind <[email protected]> Co-authored-by: techknowlogick <[email protected]> (cherry picked from commit 8e035f8)
1 parent 7339018 commit f428d40

File tree

3 files changed

+33
-11
lines changed

3 files changed

+33
-11
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,7 @@ diff.review.placeholder = Review comment
16471647
diff.review.comment = Comment
16481648
diff.review.approve = Approve
16491649
diff.review.reject = Request changes
1650+
diff.committed_by = committed by
16501651

16511652
releases.desc = Track project versions and downloads.
16521653
release.releases = Releases

templates/repo/commit_page.tmpl

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</div>
3232
<div class="ui attached info segment {{$class}}">
3333
<div class="ui stackable grid">
34-
<div class="ten wide column">
34+
<div class="nine wide column">
3535
{{if .Author}}
3636
<img class="ui avatar image" src="{{.Author.RelAvatarLink}}" />
3737
{{if .Author.FullName}}
@@ -43,19 +43,22 @@
4343
<img class="ui avatar image" src="{{AvatarLink .Commit.Author.Email}}" />
4444
<strong>{{.Commit.Author.Name}}</strong>
4545
{{end}}
46+
<span class="text grey" id="authored-time">{{TimeSince .Commit.Author.When $.Lang}}</span>
4647
{{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}}
47-
<span> </span>
48-
{{if ne .Verification.CommittingUser.ID 0}}
49-
<img class="ui avatar image" src="{{.Verification.CommittingUser.RelAvatarLink}}" />
50-
<a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong> &lt;{{.Commit.Committer.Email}}&gt;</a>
51-
{{else}}
52-
<img class="ui avatar image" src="{{AvatarLink .Commit.Committer.Email}}" />
53-
<strong>{{.Commit.Committer.Name}}</strong>
54-
{{end}}
48+
<div class="committed-by">
49+
<span class="text grey">{{svg "octicon-git-commit" 16}}{{.i18n.Tr "repo.diff.committed_by"}}</span>
50+
{{if ne .Verification.CommittingUser.ID 0}}
51+
<img class="ui avatar image" src="{{.Verification.CommittingUser.RelAvatarLink}}" />
52+
<a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong> &lt;{{.Commit.Committer.Email}}&gt;</a>
53+
{{else}}
54+
<img class="ui avatar image" src="{{AvatarLink .Commit.Committer.Email}}" />
55+
<strong>{{.Commit.Committer.Name}}</strong>
56+
{{end}}
57+
</div>
5558
{{end}}
56-
<span class="text grey" id="authored-time">{{TimeSince .Commit.Author.When $.Lang}}</span>
59+
5760
</div>
58-
<div class="six wide right aligned column">
61+
<div class="seven wide right aligned column">
5962
<div class="ui horizontal list">
6063
{{if .Parents}}
6164
<div class="item">

web_src/less/_repository.less

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,6 +2293,24 @@
22932293
}
22942294
}
22952295
}
2296+
2297+
&.diff .committed-by {
2298+
padding-top: .5rem;
2299+
2300+
.ui.avatar {
2301+
width: 20px;
2302+
height: 20px;
2303+
}
2304+
2305+
span {
2306+
margin-right: .25rem;
2307+
2308+
svg {
2309+
vertical-align: text-bottom;
2310+
margin-right: 2px;
2311+
}
2312+
}
2313+
}
22962314
}
22972315

22982316
// End of .repository

0 commit comments

Comments
 (0)