From 680e061a7da688a089d64712d2bce3742c518880 Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Mon, 15 Jun 2020 14:23:49 +0200 Subject: [PATCH 1/7] Add org avatar on top of internal repo icon --- templates/repo/header_icon.tmpl | 1 + web_src/less/_repository.less | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/templates/repo/header_icon.tmpl b/templates/repo/header_icon.tmpl index 7184734bbff6f..feb2a3465bf99 100644 --- a/templates/repo/header_icon.tmpl +++ b/templates/repo/header_icon.tmpl @@ -10,6 +10,7 @@ {{else if and (not $.IsMirror) (not $.IsFork) ($.Owner)}} {{if $.Owner.Visibility.IsPrivate}} {{svg "octicon-internal-repo" 32}} + {{else}} {{svg "octicon-repo" 32}} {{end}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 69568c85843d7..63870e709e74c 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -20,6 +20,15 @@ top: 5px; } + &.repo-title .avatar { + margin-left: -23px; + box-shadow: 0 0 0 2px #fff; + width: 16px; + height: 16px; + margin-bottom: -30px; + border-radius: 2px; + } + svg.octicon-lock { margin-left: 5px; } From c96107079f4c12f0ee81443b1eaccd24d85ae72e Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Mon, 15 Jun 2020 18:07:39 +0200 Subject: [PATCH 2/7] add color for arc-green --- web_src/less/_repository.less | 3 ++- web_src/less/themes/theme-arc-green.less | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 63870e709e74c..7299b1cf6b12f 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -22,7 +22,8 @@ &.repo-title .avatar { margin-left: -23px; - box-shadow: 0 0 0 2px #fff; + color: #fafafa; + box-shadow: 0 0 0 2px; width: 16px; height: 16px; margin-bottom: -30px; diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index 718c7b38f44e0..3abe950f46f06 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -1593,3 +1593,7 @@ footer .container .links > * { .tribute-container li:hover { background: #728e5e !important; } + +.repository .repo-header .ui.huge.breadcrumb.repo-title .avatar { + color: #2a2e3a; +} From 7c7287754e68365326149483e273bc454fce52b0 Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Mon, 15 Jun 2020 18:29:23 +0200 Subject: [PATCH 3/7] use wrapper div to avoid negative margins --- templates/repo/header_icon.tmpl | 6 ++++-- web_src/less/_repository.less | 23 ++++++++++++----------- web_src/less/themes/theme-arc-green.less | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/templates/repo/header_icon.tmpl b/templates/repo/header_icon.tmpl index feb2a3465bf99..f2e3973c1e4a8 100644 --- a/templates/repo/header_icon.tmpl +++ b/templates/repo/header_icon.tmpl @@ -9,8 +9,10 @@ {{svg "octicon-lock" 32}} {{else if and (not $.IsMirror) (not $.IsFork) ($.Owner)}} {{if $.Owner.Visibility.IsPrivate}} - {{svg "octicon-internal-repo" 32}} - +
+ {{svg "octicon-internal-repo" 32}} + +
{{else}} {{svg "octicon-repo" 32}} {{end}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 7299b1cf6b12f..36827d236ca96 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -15,19 +15,20 @@ font-weight: 400; font-size: 1.5rem; - svg { + &.repo-title .repo-owner-avatar { + display: inline-block; position: relative; - top: 5px; - } - &.repo-title .avatar { - margin-left: -23px; - color: #fafafa; - box-shadow: 0 0 0 2px; - width: 16px; - height: 16px; - margin-bottom: -30px; - border-radius: 2px; + .avatar { + position: absolute; + right: 0; + bottom: 0; + width: 16px; + height: 16px; + color: #fafafa; + box-shadow: 0 0 0 2px; + margin: 0; + } } svg.octicon-lock { diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index 3abe950f46f06..cd6fbd4d9fd58 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -1594,6 +1594,6 @@ footer .container .links > * { background: #728e5e !important; } -.repository .repo-header .ui.huge.breadcrumb.repo-title .avatar { +.repository .repo-header .ui.huge.breadcrumb.repo-title .repo-owner-avatar .avatar { color: #2a2e3a; } From 23a852462d9658277cec586841df300248ded174 Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Mon, 15 Jun 2020 22:09:00 +0200 Subject: [PATCH 4/7] rename class and move div --- templates/repo/header.tmpl | 4 +++- templates/repo/header_icon.tmpl | 6 ++---- web_src/less/_repository.less | 2 +- web_src/less/themes/theme-arc-green.less | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 76102529dfe45..4c9d37dfee35b 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -6,7 +6,9 @@ {{if .RelAvatarLink}} {{else}} - {{template "repo/header_icon" .}} +
+ {{template "repo/header_icon" .}} +
{{end}} {{.Owner.Name}}
/
diff --git a/templates/repo/header_icon.tmpl b/templates/repo/header_icon.tmpl index f2e3973c1e4a8..feb2a3465bf99 100644 --- a/templates/repo/header_icon.tmpl +++ b/templates/repo/header_icon.tmpl @@ -9,10 +9,8 @@ {{svg "octicon-lock" 32}} {{else if and (not $.IsMirror) (not $.IsFork) ($.Owner)}} {{if $.Owner.Visibility.IsPrivate}} -
- {{svg "octicon-internal-repo" 32}} - -
+ {{svg "octicon-internal-repo" 32}} + {{else}} {{svg "octicon-repo" 32}} {{end}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 36827d236ca96..2ccd72e48687e 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -15,7 +15,7 @@ font-weight: 400; font-size: 1.5rem; - &.repo-title .repo-owner-avatar { + &.repo-title .repo-header-icon { display: inline-block; position: relative; diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index cd6fbd4d9fd58..7c3cb675b2ef6 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -1594,6 +1594,6 @@ footer .container .links > * { background: #728e5e !important; } -.repository .repo-header .ui.huge.breadcrumb.repo-title .repo-owner-avatar .avatar { +.repository .repo-header .ui.huge.breadcrumb.repo-title .repo-header-icon .avatar { color: #2a2e3a; } From 814151c396cf50ee166ebbecaf2e3f5ccd7964d5 Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Mon, 15 Jun 2020 22:31:47 +0200 Subject: [PATCH 5/7] move div to icon tmpl --- templates/repo/header.tmpl | 4 +--- templates/repo/header_icon.tmpl | 40 +++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 4c9d37dfee35b..76102529dfe45 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -6,9 +6,7 @@ {{if .RelAvatarLink}} {{else}} -
- {{template "repo/header_icon" .}} -
+ {{template "repo/header_icon" .}} {{end}} {{.Owner.Name}}
/
diff --git a/templates/repo/header_icon.tmpl b/templates/repo/header_icon.tmpl index feb2a3465bf99..ad169c5df3d46 100644 --- a/templates/repo/header_icon.tmpl +++ b/templates/repo/header_icon.tmpl @@ -1,24 +1,26 @@ -{{if $.IsTemplate}} - {{if $.IsPrivate}} - {{svg "octicon-repo-template-private" 32}} +
+ {{if $.IsTemplate}} + {{if $.IsPrivate}} + {{svg "octicon-repo-template-private" 32}} + {{else}} + {{svg "octicon-repo-template" 32}} + {{end}} {{else}} - {{svg "octicon-repo-template" 32}} - {{end}} -{{else}} - {{if $.IsPrivate}} - {{svg "octicon-lock" 32}} - {{else if and (not $.IsMirror) (not $.IsFork) ($.Owner)}} - {{if $.Owner.Visibility.IsPrivate}} - {{svg "octicon-internal-repo" 32}} - + {{if $.IsPrivate}} + {{svg "octicon-lock" 32}} + {{else if and (not $.IsMirror) (not $.IsFork) ($.Owner)}} + {{if $.Owner.Visibility.IsPrivate}} + {{svg "octicon-internal-repo" 32}} + + {{else}} + {{svg "octicon-repo" 32}} + {{end}} + {{else if $.IsMirror}} + {{svg "octicon-repo-clone" 32}} + {{else if $.IsFork}} + {{svg "octicon-repo-forked" 32}} {{else}} {{svg "octicon-repo" 32}} {{end}} - {{else if $.IsMirror}} - {{svg "octicon-repo-clone" 32}} - {{else if $.IsFork}} - {{svg "octicon-repo-forked" 32}} - {{else}} - {{svg "octicon-repo" 32}} {{end}} -{{end}} +
From c08ee7d1b9817b57c08e54aa00c73e0566eef118 Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Mon, 15 Jun 2020 22:34:10 +0200 Subject: [PATCH 6/7] remove unnecessary margin for lock octicon --- web_src/less/_repository.less | 4 ---- 1 file changed, 4 deletions(-) diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 2ccd72e48687e..3a351c1538691 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -30,10 +30,6 @@ margin: 0; } } - - svg.octicon-lock { - margin-left: 5px; - } } .fork-flag { From cc9dae37124802cc238f147bad42a5750e4fec1a Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Mon, 22 Jun 2020 23:40:48 +0200 Subject: [PATCH 7/7] fix label align together with #11891 --- web_src/less/_base.less | 4 ++++ web_src/less/_repository.less | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 08bc1785958b8..04c2153af1a0f 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -1307,3 +1307,7 @@ i.icon.centerlock { .ui.secondary.pointing.menu .item { padding: 12px; } + +.ui.header > .ui.label.compact { + margin-top: inherit; +} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index e2e23394bf0e2..34262682dc420 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -14,6 +14,10 @@ font-weight: 400; font-size: 1.5rem; + .label { + vertical-align: middle; + } + &.repo-title .repo-header-icon { display: inline-block; position: relative;