Skip to content

Commit 1b65ae2

Browse files
committed
Don't render contents of Commits tab and Files tab if commits is empty.
1 parent 3ba31f2 commit 1b65ae2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/twirl/gitbucket/core/pulls/pullreq.scala.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,14 @@ <h1 class="body-title">
8888
@gitbucket.core.pulls.html.conversation(issue, pullreq, commits, comments, issueLabels, collaborators, milestones, labels, isEditable, isManageable, isManageableForkedRepository, repository, forkedRepository)
8989
</div>
9090
<div class="tab-pane" id="commits">
91-
@gitbucket.core.pulls.html.commits(dayByDayCommits, Some(comments), repository)
91+
@if(commits.nonEmpty){
92+
@gitbucket.core.pulls.html.commits(dayByDayCommits, Some(comments), repository)
93+
}
9294
</div>
9395
<div class="tab-pane" id="files">
94-
@gitbucket.core.helper.html.diff(diffs, repository, commits.headOption.map(_.id), commits.lastOption.map(_.id), true, Some(pullreq.issueId), isManageable, true)
96+
@if(commits.nonEmpty){
97+
@gitbucket.core.helper.html.diff(diffs, repository, commits.headOption.map(_.id), commits.lastOption.map(_.id), true, Some(pullreq.issueId), isManageable, true)
98+
}
9599
</div>
96100
</div>
97101
}

0 commit comments

Comments
 (0)