From c5e249c0be18784b9d34f3058c54cbae083458ed Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Thu, 3 Dec 2015 13:18:57 +0100 Subject: [PATCH 1/6] UI: Remove CSS rule making last-commit SHA bold This removes remains from old design, that was not cleaned by previous #2068 PR. --- public/css/gogs.css | 3 --- public/less/_repository.less | 4 ---- 2 files changed, 7 deletions(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index ab399f6c68..40e8545681 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1863,9 +1863,6 @@ footer .container .links > *:first-child { position: relative; width: 325%; } -.repository.file.list #repo-files-table thead th .ui.sha.label { - font-weight: bold; -} .repository.file.list #repo-files-table thead .ui.avatar { margin-bottom: 5px; } diff --git a/public/less/_repository.less b/public/less/_repository.less index aef608bcac..85b76973d4 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -152,10 +152,6 @@ position: relative; width: 325%; } - - .ui.sha.label { - font-weight: bold; - } } .ui.avatar { margin-bottom: 5px; From edbb67cb3fd8e56d6ce18e27c5398fa7282a8cf5 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Thu, 3 Dec 2015 00:03:49 +0100 Subject: [PATCH 2/6] UI: Use more subtle grey SHA1 labels Current green SHA1 labels are more pronounced than other UI elements attracting attention as if they were most important thing in the UI, while they are not as important, especially without real Git client. Using grey SHA1 labels makes the UI more balanced, less aggressive and lets user to focus on other content elements. NOTE: Neither GitHub or Bitbucket uses so heavy pronunciation as Gogs. --- templates/repo/commits_table.tmpl | 2 +- templates/repo/view_list.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 35c7a48cc7..f87866bf44 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -36,7 +36,7 @@ {{end}} - {{ShortSha .ID.String}} + {{ShortSha .ID.String}} {{RenderCommitMessage .Summary $.RepoLink}} {{TimeSince .Author.When $.Lang}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 4acfa2b676..5bf496dafd 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -43,7 +43,7 @@ {{end}} - {{ShortSha $commit.ID.String}} + {{ShortSha $commit.ID.String}} {{RenderCommitMessage $commit.Summary $.RepoLink}} {{TimeSince $commit.Committer.When $.Lang}} From 81133d45a150e82a0d7f6bdef25802c3a3482fa7 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 3 Dec 2015 14:21:13 -0500 Subject: [PATCH 3/6] work on #2093 --- models/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/repo.go b/models/repo.go index 772551db88..b4ad19c069 100644 --- a/models/repo.go +++ b/models/repo.go @@ -350,7 +350,7 @@ func (repo *Repository) SavePatch(index int64, patch []byte) error { return fmt.Errorf("PatchPath: %v", err) } - os.MkdirAll(path.Dir(patchPath), os.ModePerm) + os.MkdirAll(filepath.Dir(patchPath), os.ModePerm) if err = ioutil.WriteFile(patchPath, patch, 0644); err != nil { return fmt.Errorf("WriteFile: %v", err) } From cab2911f23e396f565b4f1d3db10277676a8d9de Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Thu, 3 Dec 2015 13:49:52 +0100 Subject: [PATCH 4/6] UI: More subtle strips on commits list With grey SHA1 labels, we should consider having also more subtle strips on commits list. As current strips blend too much with grey SHA1 labels and top bar, making hard to distinguish headers from content. --- public/css/gogs.css | 3 +++ public/less/_repository.less | 3 +++ 2 files changed, 6 insertions(+) diff --git a/public/css/gogs.css b/public/css/gogs.css index ab399f6c68..1fbcfdf15f 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -2243,6 +2243,9 @@ footer .container .links > *:first-child { font-size: 13px; padding: 6px 40px 4px 35px; } +.repository #commits-table.ui.basic.striped.table tbody tr:nth-child(2n) { + background-color: rgba(0, 0, 0, 0.02) !important; +} .repository .diff-detail-box { margin: 15px 0; line-height: 30px; diff --git a/public/less/_repository.less b/public/less/_repository.less index aef608bcac..29d4abbbbe 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -602,6 +602,9 @@ padding: 6px 40px 4px 35px; } } + &.ui.basic.striped.table tbody tr:nth-child(2n) { + background-color: rgba(0, 0, 0, .02)!important; + } } .diff-detail-box { From 5742f9fe69107858a622b77f33c11c77f8d69d92 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 3 Dec 2015 14:31:31 -0500 Subject: [PATCH 5/6] fix #2095 --- cmd/web.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/web.go b/cmd/web.go index 899b733297..808b03ecde 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -539,10 +539,10 @@ func runWeb(ctx *cli.Context) { m.Group("", func() { m.Get("/releases", repo.Releases) m.Get("/^:type(issues|pulls)$", repo.RetrieveLabels, repo.Issues) + m.Get("/^:type(issues|pulls)$/:index", repo.ViewIssue) m.Get("/labels/", repo.RetrieveLabels, repo.Labels) m.Get("/milestones", repo.Milestones) }, middleware.RepoRef()) - m.Get("/^:type(issues|pulls)$/:index", repo.ViewIssue) // m.Get("/branches", repo.Branches) From 98e989d52c61f6f38a57753d9f4c81a2b332fa82 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 3 Dec 2015 15:01:15 -0500 Subject: [PATCH 6/6] minor JS and UI fix --- public/css/gogs.css | 1 + public/js/gogs.js | 2 +- public/less/_repository.less | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index e6dc435f32..a926bc4180 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -2318,6 +2318,7 @@ footer .container .links > *:first-child { } .repository .diff-file-box .code-diff pre { margin: 0; + font-size: 13px; } .repository .diff-file-box .code-diff .lines-num { border-right: 1px solid #d4d4d5; diff --git a/public/js/gogs.js b/public/js/gogs.js index 93af48e37b..489b6996d6 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -938,7 +938,7 @@ $(window).load(function () { } // Code view. - if ($('.code-view').length > 0) { + if ($('.code-view .linenums').length > 0) { var $block = $('.code-view .linenums'); var lines = $block.html().split("\n"); $block.html(''); diff --git a/public/less/_repository.less b/public/less/_repository.less index a03a0a849e..0490bfa0af 100644 --- a/public/less/_repository.less +++ b/public/less/_repository.less @@ -676,12 +676,14 @@ } .code-diff { font-size: 13px; + td { padding: 0; border-top: none; } pre { margin: 0; + font-size: 13px; } .lines-num { border-right: 1px solid #d4d4d5;