Skip to content

Commit e0d20fb

Browse files
authored
Merge branch 'main' into fix-more-htmlurl
2 parents 505a48d + 29aea36 commit e0d20fb

File tree

5 files changed

+64
-28
lines changed

5 files changed

+64
-28
lines changed

modules/structs/org_type.go renamed to modules/structs/visible_type.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
package structs
55

6-
// VisibleType defines the visibility (Organization only)
6+
// VisibleType defines the visibility of user and org
77
type VisibleType int
88

99
const (
@@ -13,11 +13,11 @@ const (
1313
// VisibleTypeLimited Visible for every connected user
1414
VisibleTypeLimited
1515

16-
// VisibleTypePrivate Visible only for organization's members
16+
// VisibleTypePrivate Visible only for self or admin user
1717
VisibleTypePrivate
1818
)
1919

20-
// VisibilityModes is a map of org Visibility types
20+
// VisibilityModes is a map of Visibility types
2121
var VisibilityModes = map[string]VisibleType{
2222
"public": VisibleTypePublic,
2323
"limited": VisibleTypeLimited,

templates/base/head_navbar.tmpl

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@
33
{{if .IsSigned}}
44
{{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
55
{{end}}
6-
<div class="item brand" style="justify-content: space-between;">
6+
<div class="item brand sb">
77
<a href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}">
88
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}" aria-hidden="true">
99
</a>
10-
{{if .IsSigned}}
11-
<a href="{{AppSubUrl}}/notifications" class="tooltip mobile-only" data-content='{{.locale.Tr "notifications"}}'>
12-
<span class="text black">
13-
<span class="fitted">{{svg "octicon-bell"}}</span>
14-
<span class="ui red label mini{{if not $notificationUnreadCount}} hidden{{end}} notification_count">
15-
{{$notificationUnreadCount}}
10+
<div class="df ac">
11+
{{if .IsSigned}}
12+
<a href="{{AppSubUrl}}/notifications" class="tooltip mobile-only mr-4 mt-3" data-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
13+
<span class="fitted item">
14+
{{svg "octicon-bell"}}
15+
<span class="notification_count{{if not $notificationUnreadCount}} hidden{{end}}">
16+
{{$notificationUnreadCount}}
17+
</span>
1618
</span>
17-
</span>
18-
</a>
19-
{{end}}
20-
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
21-
<i class="sidebar icon"></i>
19+
</a>
20+
{{end}}
21+
<div class="ui icon button mobile-only" id="navbar-expand-toggle">
22+
{{svg "octicon-three-bars"}}
23+
</div>
2224
</div>
2325
</div>
2426

@@ -78,12 +80,10 @@
7880
{{else if .IsSigned}}
7981
<div class="right stackable menu">
8082
{{if EnableTimetracking}}
81-
<a class="active-stopwatch-trigger item ui label {{if not .ActiveStopwatch}}hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}">
82-
<span class="text">
83-
<span class="fitted item">
84-
{{svg "octicon-stopwatch"}}
85-
<span class="red" style="position:absolute; right:-0.6em; top:-0.6em;">{{svg "octicon-dot-fill"}}</span>
86-
</span>
83+
<a class="active-stopwatch-trigger item ui mx-0{{if not .ActiveStopwatch}} hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}">
84+
<span class="fitted relative">
85+
{{svg "octicon-stopwatch"}}
86+
<span class="header-stopwatch-dot"></span>
8787
<span class="sr-mobile-only">{{.locale.Tr "active_stopwatch"}}</span>
8888
</span>
8989
</a>
@@ -118,16 +118,16 @@
118118
</div>
119119
{{end}}
120120

121-
<a href="{{AppSubUrl}}/notifications" class="item tooltip not-mobile" data-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
122-
<span class="text">
123-
<span class="fitted">{{svg "octicon-bell"}}</span>
124-
<span class="ui red label {{if not $notificationUnreadCount}}hidden{{end}} notification_count">
121+
<a href="{{AppSubUrl}}/notifications" class="item tooltip not-mobile mx-0" data-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
122+
<span class="fitted item">
123+
{{svg "octicon-bell"}}
124+
<span class="notification_count{{if not $notificationUnreadCount}} hidden{{end}}">
125125
{{$notificationUnreadCount}}
126126
</span>
127127
</span>
128128
</a>
129129

130-
<div class="ui dropdown jump item tooltip" data-content="{{.locale.Tr "create_new"}}">
130+
<div class="ui dropdown jump item tooltip mx-0" data-content="{{.locale.Tr "create_new"}}">
131131
<span class="text">
132132
<span class="fitted">{{svg "octicon-plus"}}</span>
133133
<span class="sr-mobile-only">{{.locale.Tr "create_new"}}</span>
@@ -150,7 +150,7 @@
150150
</div><!-- end content create new menu -->
151151
</div><!-- end dropdown menu create new -->
152152

153-
<div class="ui dropdown jump item tooltip" tabindex="-1" data-content="{{.locale.Tr "user_profile_and_more"}}">
153+
<div class="ui dropdown jump item tooltip mx-0" tabindex="-1" data-content="{{.locale.Tr "user_profile_and_more"}}">
154154
<span class="text">
155155
{{avatar .SignedUser 24 "tiny"}}
156156
<span class="sr-only">{{.locale.Tr "user_profile_and_more"}}</span>

templates/repo/clone_script.tmpl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@
1717
const btn = isSSH ? sshBtn : httpsBtn;
1818
if (!btn) return;
1919

20-
const link = btn.getAttribute('data-link');
20+
let link = btn.getAttribute('data-link');
21+
if (link.startsWith('http://') || link.startsWith('https://')) {
22+
// use current protocol/host as the clone link
23+
const url = new URL(link);
24+
url.protocol = window.location.protocol;
25+
url.host = window.location.host;
26+
link = url.toString();
27+
}
2128
for (const el of document.getElementsByClassName('js-clone-url')) {
2229
el[el.nodeName === 'INPUT' ? 'value' : 'textContent'] = link;
2330
}

web_src/less/_base.less

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,7 @@ a.ui.card:hover,
13641364
visibility: hidden;
13651365
}
13661366

1367+
.text.primary { color: var(--color-primary) !important; }
13671368
.text.red { color: var(--color-red) !important; }
13681369
.text.orange { color: var(--color-orange) !important; }
13691370
.text.yellow { color: var(--color-yellow) !important; }
@@ -2434,6 +2435,33 @@ a.ui.basic.label:hover {
24342435
margin-top: 1rem;
24352436
}
24362437

2438+
.header-stopwatch-dot {
2439+
position: absolute;
2440+
left: 8px;
2441+
top: -8px;
2442+
width: 13px;
2443+
height: 13px;
2444+
background: var(--color-primary);
2445+
border: 2px solid var(--color-header-bar);
2446+
border-radius: 100%;
2447+
}
2448+
2449+
.notification_count {
2450+
position: absolute;
2451+
left: 5px;
2452+
top: -8px;
2453+
min-width: 1.5em;
2454+
text-align: center;
2455+
background: var(--color-primary);
2456+
border: 2px solid var(--color-header-bar);
2457+
color: var(--color-header-bar);
2458+
padding: 2px;
2459+
border-radius: 1em;
2460+
font-size: 10px;
2461+
font-weight: 700;
2462+
line-height: .7;
2463+
}
2464+
24372465
table th[data-sortt-asc],
24382466
table th[data-sortt-desc] {
24392467
&:hover {

web_src/less/helpers.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
/* below class names match Tailwind CSS */
2323
.pointer-events-none { pointer-events: none !important; }
24+
.relative { position: relative !important; }
2425

2526
.mono {
2627
font-family: var(--fonts-monospace) !important;

0 commit comments

Comments
 (0)