From 22b0dfbb35f10f22ef0485e289f44532d7a71863 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Mon, 30 Nov 2015 15:38:58 +0100 Subject: [PATCH 1/9] CSS: Ensure Octicons are used with 16px font size Semantic UI .icon 1em font-size has priority over .octicon 16px, resulting octicons rendered at 14px font-size, which is not okay since Octicons are meant to be shown sizes that are multiples of 16px. --- public/css/gogs.css | 4 +++- public/less/_octicons.less | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index d58c4e2540..19a34b8fe2 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -5,7 +5,9 @@ font-style: normal; } .octicon, -.mega-octicon { +.mega-octicon, +.icon.octicon, +.icon.mega-octicon { font: normal normal normal 16px/1 octicons; display: inline-block; text-decoration: none; diff --git a/public/less/_octicons.less b/public/less/_octicons.less index dfd437e6b1..a159dec851 100755 --- a/public/less/_octicons.less +++ b/public/less/_octicons.less @@ -14,7 +14,9 @@ // .octicon is optimized for 16px. // .mega-octicon is optimized for 32px but can be used larger. -.octicon, .mega-octicon { +.octicon, .mega-octicon, +// ensure Semantic UI .icon of 14px does not apply to .icon.octicon: +.icon.octicon, .icon.mega-octicon { font: normal normal normal 16px/1 octicons; display: inline-block; text-decoration: none; From 99b958db4325fd52566dd0d0e81afb8d891bac27 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Mon, 30 Nov 2015 15:22:24 +0100 Subject: [PATCH 2/9] UI: Mark top menu icons blue only when non-zero --- templates/repo/sidebar.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/sidebar.tmpl b/templates/repo/sidebar.tmpl index 912b50570b..4c0ab588c6 100644 --- a/templates/repo/sidebar.tmpl +++ b/templates/repo/sidebar.tmpl @@ -4,16 +4,16 @@ {{.i18n.Tr "repo.code"}} - {{.i18n.Tr "repo.issues"}} {{.Repository.NumOpenIssues}} + {{.i18n.Tr "repo.issues"}} {{.Repository.NumOpenIssues}} - {{.i18n.Tr "repo.pulls"}} {{.Repository.NumOpenPulls}} + {{.i18n.Tr "repo.pulls"}} {{.Repository.NumOpenPulls}} - {{.i18n.Tr "repo.commits"}} {{.CommitsCount}} + {{.i18n.Tr "repo.commits"}} {{.CommitsCount}} - {{.i18n.Tr "repo.releases"}} {{.Repository.NumTags}} + {{.i18n.Tr "repo.releases"}} {{.Repository.NumTags}} {{.i18n.Tr "repo.wiki"}} From 640dce12a892eaf1fa21399f5cac12e8ea83bd9e Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Mon, 30 Nov 2015 23:57:07 +0100 Subject: [PATCH 3/9] CSS: .repository .sha.label -> .ui .sha.label This is because SHA1 label is used in many other places, not only inside .repository container. --- public/css/gogs.css | 13 +++++++------ public/less/_base.less | 8 ++++++++ public/less/_repository.less | 6 ------ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index 19a34b8fe2..d3565b192b 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -913,6 +913,13 @@ pre.raw { .ui .form .fake { display: none !important; } +.ui .sha.label { + font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace; + font-size: 14px; + padding: 6px 10px 4px 10px; + font-weight: normal; + margin: 0 6px; +} .ui.status.buttons .octicon { margin-right: 4px; } @@ -2267,12 +2274,6 @@ footer .container .links > *:first-child { .repository .commits.table .date { width: 120px; } -.repository .sha.label { - font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace; - font-size: 14px; - padding: 6px 10px 4px 10px; - font-weight: normal; -} .repository .diff-detail-box { margin: 15px 0; line-height: 30px; diff --git a/public/less/_base.less b/public/less/_base.less index 086c687709..2ae2fea6e7 100644 --- a/public/less/_base.less +++ b/public/less/_base.less @@ -219,6 +219,14 @@ pre { } } + .sha.label { + font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace; + font-size: 14px; + padding: 6px 10px 4px 10px; + font-weight: normal; + margin: 0 6px; + } + &.status.buttons { .octicon { margin-right: 4px; diff --git a/public/less/_repository.less b/public/less/_repository.less index 928d5cf357..2e0ea17c79 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -630,12 +630,6 @@ width: 120px; } } - .sha.label { - font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace; - font-size: 14px; - padding: 6px 10px 4px 10px; - font-weight: normal; - } .diff-detail-box { margin: 15px 0; From 4813665d0ad600729fe0aba3346f026502fe3b14 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Mon, 30 Nov 2015 23:59:23 +0100 Subject: [PATCH 4/9] CSS: Reduce .sha.label font size to 13px --- public/css/gogs.css | 2 +- public/less/_base.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index d3565b192b..9cf6e39b27 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -915,7 +915,7 @@ pre.raw { } .ui .sha.label { font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace; - font-size: 14px; + font-size: 13px; padding: 6px 10px 4px 10px; font-weight: normal; margin: 0 6px; diff --git a/public/less/_base.less b/public/less/_base.less index 2ae2fea6e7..77ed754518 100644 --- a/public/less/_base.less +++ b/public/less/_base.less @@ -221,7 +221,7 @@ pre { .sha.label { font-family: Consolas, Menlo, Monaco, "Lucida Console", monospace; - font-size: 14px; + font-size: 13px; padding: 6px 10px 4px 10px; font-weight: normal; margin: 0 6px; From 61fdd8c57120e25a31a686ad60f35ac6445786bd Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Tue, 1 Dec 2015 00:04:13 +0100 Subject: [PATCH 5/9] 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}} - - From ec98deeb8cc6727a01ac8510805d66acd2c7d152 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Wed, 2 Dec 2015 22:06:50 +0100 Subject: [PATCH 6/9] UI: Keep repository settings menu button right --- templates/repo/sidebar.tmpl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/repo/sidebar.tmpl b/templates/repo/sidebar.tmpl index 4c0ab588c6..4d68600172 100644 --- a/templates/repo/sidebar.tmpl +++ b/templates/repo/sidebar.tmpl @@ -19,9 +19,11 @@ {{.i18n.Tr "repo.wiki"}} {{if .IsRepositoryAdmin}} - - {{.i18n.Tr "repo.settings"}} - + {{end}} {{end}} \ No newline at end of file From 3eae4ecde76d3196b8fb5c7d4482c74e438d5a87 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Wed, 2 Dec 2015 22:40:22 +0100 Subject: [PATCH 7/9] UI: Make repository menu divide header and content This is more inline with way GitHub looks like and feels much more natural and in style with rest of the interface. --- public/css/gogs.css | 11 +++++ public/less/_repository.less | 14 ++++++ templates/repo/commits.tmpl | 8 ++-- templates/repo/forks.tmpl | 2 +- templates/repo/header.tmpl | 1 - templates/repo/home.tmpl | 2 +- templates/repo/issue/labels.tmpl | 2 +- templates/repo/issue/list.tmpl | 2 +- templates/repo/issue/milestones.tmpl | 2 +- templates/repo/release/list.tmpl | 2 +- templates/repo/release/new.tmpl | 2 +- templates/repo/settings/collaboration.tmpl | 2 +- templates/repo/settings/deploy_keys.tmpl | 2 +- templates/repo/settings/githook_edit.tmpl | 2 +- templates/repo/settings/githooks.tmpl | 2 +- templates/repo/settings/hook_new.tmpl | 2 +- templates/repo/settings/hooks.tmpl | 2 +- templates/repo/settings/options.tmpl | 2 +- templates/repo/sidebar.tmpl | 53 ++++++++++++---------- templates/repo/watchers.tmpl | 2 +- templates/repo/wiki/new.tmpl | 4 +- templates/repo/wiki/pages.tmpl | 2 +- templates/repo/wiki/start.tmpl | 2 +- templates/repo/wiki/view.tmpl | 2 +- 24 files changed, 78 insertions(+), 49 deletions(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index cd27a674ae..eba8454a1c 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1815,6 +1815,17 @@ footer .container .links > *:first-child { margin: 1px; padding-right: 0; } +.repository .ui.tabs.container { + margin-top: 14px; + margin-bottom: 0px; +} +.repository .ui.tabs.container .ui.menu { + border-bottom: none; +} +.repository .ui.tabs.divider { + margin-top: 0; + margin-bottom: 20px; +} .repository #clone-panel { margin-top: -8px; width: 100%; diff --git a/public/less/_repository.less b/public/less/_repository.less index ffd432db2d..7f66948c42 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -91,6 +91,20 @@ } } + .ui.tabs { + &.container { + margin-top: 14px; + margin-bottom: 0px; + .ui.menu { + border-bottom: none; + } + } + &.divider { + margin-top: 0; + margin-bottom: 20px; + } + } + #clone-panel { margin-top: -8px; width: 100%; diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl index 769841deea..03a07935c8 100644 --- a/templates/repo/commits.tmpl +++ b/templates/repo/commits.tmpl @@ -1,9 +1,9 @@ {{template "base/head" .}}
- {{template "repo/header" .}} + {{template "repo/header" .}} + {{template "repo/sidebar" .}}
- {{template "repo/sidebar" .}} - {{template "repo/commits_table" .}} -
+ {{template "repo/commits_table" .}} +
{{template "base/footer" .}} diff --git a/templates/repo/forks.tmpl b/templates/repo/forks.tmpl index e3fd90c671..f541cd0a84 100644 --- a/templates/repo/forks.tmpl +++ b/templates/repo/forks.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}}
{{template "repo/header" .}} + {{template "repo/sidebar" .}}
- {{template "repo/sidebar" .}}

{{.i18n.Tr "repo.forks"}}

diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 06bd49b9cd..10455db516 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -44,5 +44,4 @@
-
{{end}} diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 260f637532..61387f8e13 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}}
{{template "repo/header" .}} + {{template "repo/sidebar" .}}
- {{template "repo/sidebar" .}}

diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl index f622d1a23b..f955973c6d 100644 --- a/templates/repo/issue/labels.tmpl +++ b/templates/repo/issue/labels.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}}

{{template "repo/header" .}} + {{template "repo/sidebar" .}}
- {{template "repo/sidebar" .}}
- - {{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}}
- {{ShortSha .LastCommit.ID.String}} - {{RenderCommitMessage .LastCommit.Summary .RepoLink}} {{TimeSince .LastCommit.Author.When $.Lang}}