From 61fdd8c57120e25a31a686ad60f35ac6445786bd Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Tue, 1 Dec 2015 00:04:13 +0100 Subject: [PATCH] Commits & files UI: SUI fixed single line table Instead using own ellipsis, uses Semantic UI fixed single line table which effectively applies ellipsis to all overflowing table cells. NOTE: File list cannot use colspan="2" for 1st "Last commit" elements, otherwise layout breaks with fixed table. --- public/css/gogs.css | 45 +--------------------------- public/less/_repository.less | 49 +----------------------------- templates/repo/commits_table.tmpl | 17 ++++++----- templates/repo/view_list.tmpl | 50 +++++++++++++------------------ 4 files changed, 32 insertions(+), 129 deletions(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index 9cf6e39b27..cd27a674ae 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1857,40 +1857,16 @@ footer .container .links > *:first-child { .repository.file.list .head.meta li .ui.breadcrumb a { font-size: 16px; } -.repository.file.list #repo-files-table .table.list { - width: 80% !important; -} .repository.file.list #repo-files-table thead th { padding-top: 8px; padding-bottom: 5px; font-weight: normal; } -.repository.file.list #repo-files-table thead th #last-commit-message { - margin-left: 5px; - margin-bottom: -4px; - width: 400px; -} -.repository.file.list #repo-files-table thead th .age { - margin-top: 2px; -} .repository.file.list #repo-files-table thead .ui.avatar { margin-bottom: 5px; } .repository.file.list #repo-files-table tbody .icon { - margin-left: 5px; -} -.repository.file.list #repo-files-table tbody .name { - max-width: 120px; -} -.repository.file.list #repo-files-table tbody .message { - max-width: 300px; -} -.repository.file.list #repo-files-table tbody .age { - min-width: 150px; -} -.repository.file.list #repo-files-table tbody .text.truncate { - margin-bottom: -5px; - max-width: 100%; + margin-right: 5px; } .repository.file.list #repo-files-table td { padding-top: 8px; @@ -2255,25 +2231,6 @@ footer .container .links > *:first-child { font-weight: normal; padding: 5px 10px; } -.repository .commits.table { - font-size: 13px; -} -.repository .commits.table th:first-child, -.repository .commits.table td:first-child { - padding-left: 15px; -} -.repository .commits.table td { - line-height: 15px; -} -.repository .commits.table .author { - min-width: 180px; -} -.repository .commits.table .message span { - max-width: 500px; -} -.repository .commits.table .date { - width: 120px; -} .repository .diff-detail-box { margin: 15px 0; line-height: 30px; diff --git a/public/less/_repository.less b/public/less/_repository.less index 2e0ea17c79..ffd432db2d 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -143,24 +143,11 @@ } #repo-files-table { - .table.list { - width: 80% !important; - } - thead { th { padding-top: 8px; padding-bottom: 5px; font-weight: normal; - - #last-commit-message { - margin-left: 5px; - margin-bottom: -4px; - width: 400px; - } - .age { - margin-top: 2px; - } } .ui.avatar { margin-bottom: 5px; @@ -168,21 +155,7 @@ } tbody { .icon { - margin-left: 5px; - } - .name { - max-width: 120px; - } - .message { - max-width: 300px; - } - .age { - min-width: 150px; - } - - .text.truncate { - margin-bottom: -5px; - max-width: 100%; + margin-right: 5px; } } td { @@ -610,26 +583,6 @@ } } } - .commits.table { - font-size: 13px; - th, td { - &:first-child { - padding-left: 15px; - } - } - td { - line-height: 15px; - } - .author { - min-width: 180px; - } - .message span { - max-width: 500px; - } - .date { - width: 120px; - } - } .diff-detail-box { margin: 15px 0; diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 58ab1ebb1e..5e207486ff 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -16,13 +16,12 @@ {{if .Commits}}
- +
- - - - + + + @@ -36,9 +35,11 @@   {{.Author.Name}} {{end}} - - - + + {{end}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 9edbd687c8..9b6c0aaa19 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -1,28 +1,26 @@ -
{{.i18n.Tr "repo.commits.author"}}SHA1{{.i18n.Tr "repo.commits.message"}}{{.i18n.Tr "repo.commits.date"}}{{.i18n.Tr "repo.commits.author"}}   SHA1    {{.i18n.Tr "repo.commits.message"}}{{.i18n.Tr "repo.commits.date"}}
{{SubStr .ID.String 0 10}} {{RenderCommitMessage .Summary $.RepoLink}}{{TimeSince .Author.When $.Lang}} + {{ShortSha .ID.String}} + {{RenderCommitMessage .Summary $.RepoLink}} + {{TimeSince .Author.When $.Lang}}
+
- + + {{if .HasParentPath}} - - + {{end}} {{range $item := .Files}} @@ -32,27 +30,21 @@ {{if $entry.IsSubModule}} - {{else}} - {{end}} - -
- - {{if .LastCommitUser}} - - {{.LastCommit.Author.Name}}: - {{else}} - - {{.LastCommit.Author.Name}}: - {{end}} - - - {{ShortSha .LastCommit.ID.String}} - {{RenderCommitMessage .LastCommit.Summary .RepoLink}} - {{TimeSince .LastCommit.Author.When $.Lang}} + + {{if .LastCommitUser}} + + {{.LastCommit.Author.Name}} + {{else}} + + {{.LastCommit.Author.Name}} + {{end}} + {{ShortSha .LastCommit.ID.String}} + {{RenderCommitMessage .LastCommit.Summary .RepoLink}} + {{TimeSince .LastCommit.Author.When $.Lang}}
....
- {{if $commit.RefUrl}} - {{$entry.Name}} @ {{ShortSha $commit.RefId}} + {{$entry.Name}} @ {{ShortSha $commit.RefId}} {{else}} {{$entry.Name}} @ {{ShortSha $commit.RefId}} {{end}} - - - {{$entry.Name}} + + {{$entry.Name}} - {{SubStr $commit.ID.String 0 10}} - - {{RenderCommitMessage $commit.Summary $.RepoLink}} + + {{ShortSha $commit.ID.String}} + {{RenderCommitMessage $commit.Summary $.RepoLink}} {{TimeSince $commit.Committer.When $.Lang}}