summaryrefslogtreecommitdiffstats
path: root/templates/repo/graph
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2021-12-11 06:12:18 -0800
committerGitHub <noreply@github.com>2021-12-11 16:12:18 +0200
commit379a5241c69cbedd8cdba04f57f3ee8c50083957 (patch)
treec059051cb70278e4f41f773996d198b40dcbac28 /templates/repo/graph
parentf550e356d6cfe84b2891776d778531afa92ef902 (diff)
downloadgitea-379a5241c69cbedd8cdba04f57f3ee8c50083957.tar.gz
gitea-379a5241c69cbedd8cdba04f57f3ee8c50083957.zip
Fix overflow in commit graph (#17947)
* Fix overflow in commit graph Limit commit message to 50% width. This is rather crude but should work for common use cases with not too-long author names. Fixes: https://github.com/go-gitea/gitea/issues/17944 * Make it work with dynamic width * use span * use explicit none Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates/repo/graph')
-rw-r--r--templates/repo/graph/commits.tmpl12
1 files changed, 7 insertions, 5 deletions
diff --git a/templates/repo/graph/commits.tmpl b/templates/repo/graph/commits.tmpl
index d054462ebc..d213c53e96 100644
--- a/templates/repo/graph/commits.tmpl
+++ b/templates/repo/graph/commits.tmpl
@@ -28,27 +28,29 @@
{{- end -}}
</a>
</span>
- <span class="message df ac mr-2">{{RenderCommitMessage $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
+ <span class="message dib ellipsis mr-2">
+ <span>{{RenderCommitMessage $commit.Subject $.RepoLink $.Repository.ComposeMetas}}</span>
+ </span>
<span class="tags df ac">
{{range $commit.Refs}}
{{$refGroup := .RefGroup}}
{{if eq $refGroup "pull"}}
{{if or (not $.HidePRRefs) (containGeneric $.SelectedBranches .Name)}}
<!-- it's intended to use issues not pulls, if it's a pull you will get redirected -->
- <a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled $.UnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}">
+ <a class="ui labelled icon button basic tiny mr-2" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled $.UnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}">
{{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
</a>
{{end}}
{{else if eq $refGroup "tags"}}
- <a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/tag/{{.ShortName|PathEscape}}">
+ <a class="ui labelled icon button basic tiny mr-2" href="{{$.RepoLink}}/src/tag/{{.ShortName|PathEscape}}">
{{svg "octicon-tag" 16 "mr-2"}}{{.ShortName}}
</a>
{{else if eq $refGroup "remotes"}}
- <a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/commit/{{$commit.Rev|PathEscape}}">
+ <a class="ui labelled icon button basic tiny mr-2" href="{{$.RepoLink}}/src/commit/{{$commit.Rev|PathEscape}}">
{{svg "octicon-cross-reference" 16 "mr-2"}}{{.ShortName}}
</a>
{{else if eq $refGroup "heads"}}
- <a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
+ <a class="ui labelled icon button basic tiny mr-2" href="{{$.RepoLink}}/src/branch/{{.ShortName|PathEscape}}">
{{svg "octicon-git-branch" 16 "mr-2"}}{{.ShortName}}
</a>
{{else}}