From 53d30ccde92f7891cf8691d18f109e28ea81d15c Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 7 Nov 2019 11:18:21 -0800 Subject: [PATCH] templates: fix line wrap for very long commit message --- gogs.go | 2 +- internal/template/template.go | 2 +- public/css/gogs.css | 3 +++ public/less/_repository.less | 24 +++++++++++++++--------- templates/.VERSION | 2 +- templates/repo/diff/page.tmpl | 4 +++- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/gogs.go b/gogs.go index a59e6d7ef..8bbff8289 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "gogs.io/gogs/internal/setting" ) -const Version = "0.11.96.1105" +const Version = "0.11.96.1107" func init() { setting.AppVer = Version diff --git a/internal/template/template.go b/internal/template/template.go index 36fb26126..abbf416e6 100644 --- a/internal/template/template.go +++ b/internal/template/template.go @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" "github.com/microcosm-cc/bluemonday" "golang.org/x/net/html/charset" "golang.org/x/text/transform" diff --git a/public/css/gogs.css b/public/css/gogs.css index 0b866b85a..6f4665b6f 100644 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -2066,6 +2066,9 @@ footer .ui.language .menu { .repository .filter.dropdown .menu { margin-top: 1px!important; } +.repository.diff .commit-message pre { + white-space: pre-wrap; +} .repository.commits .header .ui.right .search input { font-weight: normal; padding: 5px 10px; diff --git a/public/less/_repository.less b/public/less/_repository.less index 5f9efe6b3..5ddd1e2a3 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -194,7 +194,7 @@ } #file-buttons { font-weight: normal; - + .ui.button { padding: 8px 10px; font-weight: normal; @@ -324,12 +324,12 @@ } .nb-cell { - position: relative; + position: relative; &.nb-heading-cell { margin-top: 0.5em; } - + img { max-width: 100%; } @@ -343,9 +343,9 @@ margin: .5em 0; } - .nb-input:before, + .nb-input:before, .nb-output:before { - position: absolute; + position: absolute; font-family: monospace; color: #999; left: -7.5em; @@ -373,7 +373,7 @@ &:before { content: "Out [" attr(data-prompt-number) "]:"; } - + pre { padding: 5px 10px; font-size: 14px; @@ -391,7 +391,7 @@ th, td { border: 1px solid #000; - padding: 0.25em; + padding: 0.25em; text-align: left; vertical-align: middle; border-collapse: collapse; @@ -406,7 +406,7 @@ // Fix pandas dataframe formatting div[style="max-height:1000px;max-width:1500px;overflow:auto;"] { - max-height: none !important; + max-height: none !important; } } @@ -948,7 +948,13 @@ .filter.dropdown .menu { margin-top: 1px!important; - } + } + + &.diff { + .commit-message pre { + white-space: pre-wrap; + } + } &.commits { .header { diff --git a/templates/.VERSION b/templates/.VERSION index 473ef8c48..00996c5b9 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.11.96.1105 +0.11.96.1107 diff --git a/templates/repo/diff/page.tmpl b/templates/repo/diff/page.tmpl index 6cddae6e9..53a2c4eb9 100644 --- a/templates/repo/diff/page.tmpl +++ b/templates/repo/diff/page.tmpl @@ -9,7 +9,9 @@ {{.i18n.Tr "repo.diff.browse_source"}} - {{RenderCommitMessage true .Commit.Message $.RepoLink $.Repository.ComposeMetas | Str2HTML}} +
+ {{RenderCommitMessage true .Commit.Message $.RepoLink $.Repository.ComposeMetas | Str2HTML}} +
{{if .Author}}