<div class="ui top attached header flex-left-right">
	<div class="flex-text-block">
		{{if .Commits}}
			{{if gt .CommitCount 0}}{{.CommitCount}}{{end}}{{/* CommitCount is -1 when "follow rename" */}}
			{{ctx.Locale.Tr "repo.commits.commits"}}
		{{else if .IsNothingToCompare}}
			{{ctx.Locale.Tr "repo.commits.nothing_to_compare"}}
		{{else}}
			{{ctx.Locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}}
		{{end}}
	</div>
	<div class="flex-text-block">
		{{if .ShowFollowRename}}
		<div class="ui checkbox">
			<input type="checkbox" {{if .FollowRenameChecked}}checked{{end}} data-global-init="initCommitHistoryFollowRename">
			<label>{{ctx.Locale.Tr "repo.commits.history_enable_follow_renames"}}</label>
		</div>
		{{end}}
		{{if .IsDiffCompare}}
		<div class="flex-text-inline">
			<a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID | PathEscape}}" class="ui green sha label tw-mx-0">{{template "repo/commits_ref_name" .CompareInfo.BaseRef}}</a>
			{{$.CompareInfo.CompareSeparator}}
			<a href="{{$.CommitRepoLink}}/commit/{{.AfterCommitID | PathEscape}}" class="ui green sha label tw-mx-0">{{template "repo/commits_ref_name" .CompareInfo.HeadRef}}</a>
		</div>
		{{end}}
	</div>
</div>

{{if .PageIsCommits}}
	<div class="ui attached segment">
		<form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.RefTypeNameSubURL}}/search">
			<div class="ui small fluid action input">
				{{template "shared/search/input" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.commit_kind")}}
				{{template "repo/commits_search_dropdown" .}}
				{{template "shared/search/button" dict "Tooltip" (ctx.Locale.Tr "repo.commits.search.tooltip")}}
			</div>
		</form>
	</div>
{{end}}

{{if .Commits}}
	{{template "repo/commits_list" .}}
{{end}}

{{template "base/paginate" .}}
