From 9ce4d89e9922cc87bdb13d122339ae165a080c3d Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 14 Jun 2019 03:32:14 +0200 Subject: [PATCH] UI: Fix overflow issues in repo (#7190) - Fix layout overflow in repo file list. - Fix invisible status icon in file view and commit list. In file view, the icon was moved to the left because I could not figure out a proper fix because of HTML tables. - Added title attribute to commit messages. - Fixed two CSS linter warnings in existing CSS. - Fixed CI variable check in 'make css'. Fixes: https://github.com/go-gitea/gitea/issues/7180 --- Makefile | 2 +- public/css/index.css | 2 ++ public/less/_repository.less | 13 +++++++++++++ templates/repo/commit_status.tmpl | 10 +++++----- templates/repo/commits_table.tmpl | 18 ++++++++++-------- templates/repo/view_list.tmpl | 9 +++++---- 6 files changed, 36 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 56fa863c8e..1fca897d05 100644 --- a/Makefile +++ b/Makefile @@ -395,7 +395,7 @@ css: npx postcss --use autoprefixer --no-map --replace public/css/* @diff=$$(git diff public/css/*); \ - if ([ ! -z "$CI" ] && [ -n "$$diff" ]); then \ + if ([ -n "$$CI" ] && [ -n "$$diff" ]); then \ echo "Generated files in public/css have changed, please commit the result:"; \ echo "$${diff}"; \ exit 1; \ diff --git a/public/css/index.css b/public/css/index.css index d192f43d15..8f575fcd95 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -803,6 +803,8 @@ footer .ui.left,footer .ui.right{line-height:40px} .stats-table .table-cell{display:table-cell} .stats-table .table-cell.tiny{height:.5em} tbody.commit-list{vertical-align:baseline} +.commit-list .message-wrapper{overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 24px);display:inline-block;vertical-align:middle} +.commit-list .message-wrapper .commit-status-link{display:inline-block;vertical-align:middle} .commit-body{white-space:pre-wrap} .git-notes.top{text-align:left} .git-notes .commit-body{margin:0} diff --git a/public/less/_repository.less b/public/less/_repository.less index 71062bfa0e..acf8d7b870 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -2219,6 +2219,19 @@ tbody.commit-list { vertical-align: baseline; } +.commit-list .message-wrapper { + overflow: hidden; + text-overflow: ellipsis; + max-width: calc(100% - 24px); + display: inline-block; + vertical-align: middle; +} + +.commit-list .message-wrapper .commit-status-link { + display: inline-block; + vertical-align: middle; +} + .commit-body { white-space: pre-wrap; } diff --git a/templates/repo/commit_status.tmpl b/templates/repo/commit_status.tmpl index f5bbbb02d6..638f81ed8f 100644 --- a/templates/repo/commit_status.tmpl +++ b/templates/repo/commit_status.tmpl @@ -1,15 +1,15 @@ {{if eq .State "pending"}} - + {{end}} {{if eq .State "success"}} - + {{end}} {{if eq .State "error"}} - + {{end}} {{if eq .State "failure"}} - + {{end}} {{if eq .State "warning"}} - + {{end}} diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 10f4b60483..ebeb87b93c 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -47,9 +47,9 @@ {{if .User}} {{if .User.FullName}} -   {{.User.FullName}} +   {{.User.FullName}} {{else}} -   {{.Author.Name}} +   {{.Author.Name}} {{end}} {{else}}   {{.Author.Name}} @@ -69,12 +69,14 @@ {{end}} - - {{.Summary}} - {{if IsMultilineCommitMessage .Message}} - - - {{end}} + + + {{.Summary}} + {{if IsMultilineCommitMessage .Message}} + + + {{end}} + {{template "repo/commit_status" .Status}} {{TimeSince .Author.When $.Lang}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index d88c42ccae..75269837cb 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -1,4 +1,4 @@ - +
@@ -82,7 +83,7 @@ {{end}}
@@ -27,12 +27,13 @@ {{end}} - {{.LatestCommit.Summary}} + {{template "repo/commit_status" .LatestCommitStatus}} + {{.LatestCommit.Summary}} {{if IsMultilineCommitMessage .LatestCommit.Message}} {{end}} - {{template "repo/commit_status" .LatestCommitStatus}} + {{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}
- {{$commit.Summary}} + {{$commit.Summary}} {{TimeSince $commit.Committer.When $.Lang}}