Skip to content

Commit

Permalink
Fix styling and padding for commit list on PR view (go-gitea#11588)
Browse files Browse the repository at this point in the history
* Fix styling and padding for commit list on PR view

* fix bold on author
  • Loading branch information
CirnoT authored and Yohann Delafollye committed Jul 31, 2020
1 parent 69ba7e0 commit fdd1941
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions templates/repo/commits_list_small.tmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{ $r:= List .Commits}}
{{ $index := 0}}
<div class="timeline-item commits-list">
{{range $r}}
{{ $tag := printf "%s-%d" $.HashTag $index }}
{{ $index = Add $index 1}}
<div class="timeline-item event small-line-spacing" id="{{$tag}}">
<div class="singular-commit" id="{{$tag}}">
<span class="badge badge-commit">{{svg "octicon-git-commit" 16}}</span>
{{if .User}}
<a class="ui avatar image" href="{{AppSubUrl}}/{{.User.Name}}"><img src="{{.User.RelAvatarLink}}" alt=""/></a>
Expand Down Expand Up @@ -42,7 +43,7 @@

<span class="message-wrapper">
{{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Issue.PullRequest.BaseRepo.OwnerName $.Issue.PullRequest.BaseRepo.Name .ID }}
<span class="commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message ($.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink $.Issue.PullRequest.BaseRepo.ComposeMetas}}</span>
<span class="mono commit-summary has-emoji{{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject .Message ($.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink $.Issue.PullRequest.BaseRepo.ComposeMetas}}</span>
</span>
{{if IsMultilineCommitMessage .Message}}
<button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
Expand All @@ -55,3 +56,4 @@
{{end}}
</div>
{{end}}
</div>
2 changes: 1 addition & 1 deletion templates/repo/issue/view_content/comments.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@
<img src="{{.Poster.RelAvatarLink}}">
</a>
<span class="text grey">
<a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{ if .IsForcePush }}
{{$.i18n.Tr "repo.issues.force_push_codes" $.Issue.PullRequest.HeadBranch (ShortSha .OldCommit) ($.Issue.Repo.CommitLink .OldCommit) (ShortSha .NewCommit) ($.Issue.Repo.CommitLink .NewCommit) $createdStr | Safe}}
{{else}}
Expand Down
9 changes: 5 additions & 4 deletions web_src/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,11 @@
}
}

&:first-child {
&:first-child:not(.commit) {
padding-top: 0 !important;
}

&:last-child {
&:last-child:not(.commit) {
padding-bottom: 0 !important;
}

Expand Down Expand Up @@ -807,8 +807,9 @@
line-height: 30px;
}

&.event.small-line-spacing {
padding: 2px 0 0 15px;
&.commits-list {
padding-left: 15px;
padding-top: 0;
}

&.event > .commit-status-link {
Expand Down

0 comments on commit fdd1941

Please sign in to comment.