From bcf13b670baa6c0f12a9cc3b26d13374f9d9fc8b Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 16 May 2022 16:45:12 +0000 Subject: [PATCH] Improve commit list/view on mobile (#19712) - This is a continuation on [the work](https://github.com/go-gitea/gitea/pull/19546) I've done for improving mobile experience on Gitea. - The current behavior of going trough the commits list is horrible, each individual item gets it's own row and thereby isn't quite compact as it should be on mobile. The commit view's header is in a bit better state, it's quite only that content is overlapping each other. - This patch fixes those problems. Each row in the commit list table will actually take a row in the UI. The commit view's header has now a better organized way of placing the information. --- templates/repo/commit_page.tmpl | 25 +++++----- templates/repo/commits_list.tmpl | 4 +- web_src/less/_repository.less | 79 ++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 15 deletions(-) diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index f43050ad0..70cc7d02e 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -17,8 +17,8 @@ {{$class = (printf "%s%s" $class " isWarning")}} {{end}} {{end}} -
-
+
+

{{RenderCommitMessage $.Context .Commit.Message $.RepoLink $.Repository.ComposeMetas}}{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses "root" $}}

{{if not $.PageIsWiki}}
@@ -143,8 +143,8 @@ {{svg "octicon-tag" 16 "mr-2"}}{{.TagName}} {{end}}
-
-
+
+
{{if .Author}} {{avatar .Author 28 "mr-3"}} {{if .Author.FullName}} @@ -171,9 +171,7 @@
{{if .Parents}}
- {{.i18n.Tr "repo.diff.parent"}} -
-
+ {{.i18n.Tr "repo.diff.parent"}} {{range .Parents}} {{if $.PageIsWiki}} {{ShortSha .}} @@ -183,13 +181,14 @@ {{end}}
{{end}} -
-
{{.i18n.Tr "repo.diff.commit"}}
-
{{ShortSha .CommitID}}
+
+ {{.i18n.Tr "repo.diff.commit"}} + {{ShortSha .CommitID}} +
{{if .Commit.Signature}} -
+
{{if .Verification.Verified}} {{if ne .Verification.SigningUser.ID 0}} @@ -204,8 +203,8 @@ {{avatar .Verification.SigningUser 28}} {{.Verification.SigningUser.GetDisplayName}} {{else}} - {{svg "gitea-lock-cog"}} - {{.i18n.Tr "repo.commits.signed_by"}}: + {{svg "gitea-lock-cog" 16 "mr-3"}} + {{.i18n.Tr "repo.commits.signed_by"}}: {{avatarByEmail .Verification.SigningEmail "" 28}} {{.Verification.SigningUser.GetDisplayName}} {{end}} diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 86ad83520..65baee6b6 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -1,5 +1,5 @@ -
- +
+
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 13f9384ba..f8a23e071 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -3328,4 +3328,83 @@ td.blob-excerpt { } } } + .commit-header-row { + .ui.horizontal.list { + width: 100%; + overflow-x: scroll; + margin-top: 2px; + + .item { + align-items: center; + display: flex; + } + } + + .author { + padding: 3px 0; + } + } + + .commit-header h3 { + flex-basis: auto !important; + margin-bottom: .5rem !important; + } + + .commits-table { + flex-direction: column; + + .commits-table-left { + align-items: initial !important; + margin-bottom: 6px; + } + + .commits-table-right form { + display: flex; + flex-wrap: wrap; + + > div:nth-child(1) { + order: 1; + } + + > div:nth-child(2) { + order: 3; + margin-left: .5rem; + margin-top: .5rem; + } + + > button:nth-child(3) { + order: 2; + margin-left: .25rem; + } + } + } + + .commit-table { + overflow-x: scroll; + + td.sha, + th.sha { + display: none !important; + } + + .commit-list { + span.message-wrapper { + max-width: none; + } + + tr td:last-child { + display: block; + width: max-content; + } + + td.author { + display: block; + width: calc(100% + .5rem); + } + + .copy-commit-sha { + display: none !important; + } + } + } }
{{.i18n.Tr "repo.commits.author"}}