Skip to content

Commit 0ea4795

Browse files
Add org avatar on top of internal repo icon (#11895)
* Add org avatar on top of internal repo icon * add color for arc-green * use wrapper div to avoid negative margins * rename class and move div * move div to icon tmpl * remove unnecessary margin for lock octicon * fix label align together with #11891 Co-authored-by: techknowlogick <[email protected]>
1 parent 6764daf commit 0ea4795

File tree

4 files changed

+45
-23
lines changed

4 files changed

+45
-23
lines changed

templates/repo/header_icon.tmpl

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
{{if $.IsTemplate}}
2-
{{if $.IsPrivate}}
3-
{{svg "octicon-repo-template-private" 32}}
1+
<div class="repo-header-icon">
2+
{{if $.IsTemplate}}
3+
{{if $.IsPrivate}}
4+
{{svg "octicon-repo-template-private" 32}}
5+
{{else}}
6+
{{svg "octicon-repo-template" 32}}
7+
{{end}}
48
{{else}}
5-
{{svg "octicon-repo-template" 32}}
6-
{{end}}
7-
{{else}}
8-
{{if $.IsPrivate}}
9-
{{svg "octicon-lock" 32}}
10-
{{else if and (not $.IsMirror) (not $.IsFork) ($.Owner)}}
11-
{{if $.Owner.Visibility.IsPrivate}}
12-
{{svg "octicon-internal-repo" 32}}
9+
{{if $.IsPrivate}}
10+
{{svg "octicon-lock" 32}}
11+
{{else if and (not $.IsMirror) (not $.IsFork) ($.Owner)}}
12+
{{if $.Owner.Visibility.IsPrivate}}
13+
{{svg "octicon-internal-repo" 32}}
14+
<img class="ui avatar image" src="{{$.Owner.RelAvatarLink}}">
15+
{{else}}
16+
{{svg "octicon-repo" 32}}
17+
{{end}}
18+
{{else if $.IsMirror}}
19+
{{svg "octicon-repo-clone" 32}}
20+
{{else if $.IsFork}}
21+
{{svg "octicon-repo-forked" 32}}
1322
{{else}}
1423
{{svg "octicon-repo" 32}}
1524
{{end}}
16-
{{else if $.IsMirror}}
17-
{{svg "octicon-repo-clone" 32}}
18-
{{else if $.IsFork}}
19-
{{svg "octicon-repo-forked" 32}}
20-
{{else}}
21-
{{svg "octicon-repo" 32}}
2225
{{end}}
23-
{{end}}
26+
</div>

web_src/less/_base.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,3 +1317,7 @@ table th[data-sortt-desc] {
13171317
.ui.secondary.pointing.menu .item {
13181318
padding: 12px;
13191319
}
1320+
1321+
.ui.header > .ui.label.compact {
1322+
margin-top: inherit;
1323+
}

web_src/less/_repository.less

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,24 @@
1414
font-weight: 400;
1515
font-size: 1.5rem;
1616

17-
svg {
18-
position: relative;
19-
top: 5px;
17+
.label {
18+
vertical-align: middle;
2019
}
2120

22-
svg.octicon-lock {
23-
margin-left: 5px;
21+
&.repo-title .repo-header-icon {
22+
display: inline-block;
23+
position: relative;
24+
25+
.avatar {
26+
position: absolute;
27+
right: 0;
28+
bottom: 0;
29+
width: 16px;
30+
height: 16px;
31+
color: #fafafa;
32+
box-shadow: 0 0 0 2px;
33+
margin: 0;
34+
}
2435
}
2536
}
2637

web_src/less/themes/theme-arc-green.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,3 +1596,7 @@ footer .container .links > * {
15961596
.tribute-container li:hover {
15971597
background: #728e5e !important;
15981598
}
1599+
1600+
.repository .repo-header .ui.huge.breadcrumb.repo-title .repo-header-icon .avatar {
1601+
color: #2a2e3a;
1602+
}

0 commit comments

Comments
 (0)