Skip to content

Commit 8e035f8

Browse files
CirnoTsilverwindtechknowlogick
authored
Fix styling for commiter on diff view (#11715)
* 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]>
1 parent dcefcc1 commit 8e035f8

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
@@ -1651,6 +1651,7 @@ diff.review.placeholder = Review comment
16511651
diff.review.comment = Comment
16521652
diff.review.approve = Approve
16531653
diff.review.reject = Request changes
1654+
diff.committed_by = committed by
16541655

16551656
releases.desc = Track project versions and downloads.
16561657
release.releases = Releases

templates/repo/commit_page.tmpl

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

web_src/less/_repository.less

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,24 @@
23762376
}
23772377
}
23782378
}
2379+
2380+
&.diff .committed-by {
2381+
padding-top: .5rem;
2382+
2383+
.ui.avatar {
2384+
width: 20px;
2385+
height: 20px;
2386+
}
2387+
2388+
span {
2389+
margin-right: .25rem;
2390+
2391+
svg {
2392+
vertical-align: text-bottom;
2393+
margin-right: 2px;
2394+
}
2395+
}
2396+
}
23792397
}
23802398

23812399
// End of .repository

0 commit comments

Comments
 (0)