Skip to content

Commit

Permalink
Add merge arrow direction and update styling
Browse files Browse the repository at this point in the history
  • Loading branch information
kdumontnu committed Dec 19, 2023
1 parent e7cb8da commit d724ecb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions templates/repo/diff/compare.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{{- end -}}
{{- end -}}
<div class="ui segment choose branch">
<a href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
<a class="gt-mr-3" href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
<div class="ui floating filter dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}">
<div class="ui basic small button">
<span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_base"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_base"}}{{end}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span>
Expand Down Expand Up @@ -105,7 +105,7 @@
</div>
</div>
</div>
<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_comparison_type"}}">{{.CompareSeparator}}</a>
<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_comparison_type"}}">{{svg "octicon-arrow-left" 16}}<div class="gt-ml-2 -gt-mt-4">{{.CompareSeparator}}</div></a>
<div class="ui floating filter dropdown">
<div class="ui basic small button">
<span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_compare"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_head"}}{{end}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span>
Expand Down
6 changes: 6 additions & 0 deletions web_src/css/helpers.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ Gitea's private styles use `g-` prefix.
.gt-mt-4 { margin-top: 1rem !important; }
.gt-mt-5 { margin-top: 2rem !important; }

.-gt-mt-1 { margin-top: -.125rem !important; }
.-gt-mt-2 { margin-top: -.25rem !important; }
.-gt-mt-3 { margin-top: -.5rem !important; }
.-gt-mt-4 { margin-top: -1rem !important; }
.-gt-mt-5 { margin-top: -2rem !important; }

.gt-mb-0 { margin-bottom: 0 !important; }
.gt-mb-1 { margin-bottom: .125rem !important; }
.gt-mb-2 { margin-bottom: .25rem !important; }
Expand Down
4 changes: 0 additions & 4 deletions web_src/css/repo.css
Original file line number Diff line number Diff line change
Expand Up @@ -1166,10 +1166,6 @@
flex-wrap: wrap;
}

.repository .choose.branch .svg {
margin-right: 10px;
}

.repository.compare.pull .comment.form .content::before,
.repository.compare.pull .comment.form .content::after {
right: 100%;
Expand Down

0 comments on commit d724ecb

Please sign in to comment.