Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve notification and stopwatch styles #22169

Merged
merged 4 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions templates/base/head_navbar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@
{{if .IsSigned}}
{{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
{{end}}
<div class="item brand" style="justify-content: space-between;">
<div class="item brand sb">
<a href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}">
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}" aria-hidden="true">
</a>
{{if .IsSigned}}
<a href="{{AppSubUrl}}/notifications" class="tooltip mobile-only" data-content='{{.locale.Tr "notifications"}}'>
<span class="text black">
<span class="fitted">{{svg "octicon-bell"}}</span>
<span class="ui red label mini{{if not $notificationUnreadCount}} hidden{{end}} notification_count">
{{$notificationUnreadCount}}
<div class="df ac">
{{if .IsSigned}}
<a href="{{AppSubUrl}}/notifications" class="tooltip mobile-only mr-4 mt-3" data-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
<span class="fitted item">
{{svg "octicon-bell"}}
<span class="notification_count{{if not $notificationUnreadCount}} hidden{{end}}">
{{$notificationUnreadCount}}
</span>
</span>
</span>
</a>
{{end}}
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
<i class="sidebar icon"></i>
</a>
{{end}}
<div class="ui icon button mobile-only" id="navbar-expand-toggle">
{{svg "octicon-three-bars"}}
</div>
</div>
</div>

Expand Down Expand Up @@ -77,12 +79,10 @@
</div>
{{else if .IsSigned}}
<div class="right stackable menu">
<a class="active-stopwatch-trigger item ui label {{if not .ActiveStopwatch}}hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}">
<span class="text">
<span class="fitted item">
{{svg "octicon-stopwatch"}}
<span class="red" style="position:absolute; right:-0.6em; top:-0.6em;">{{svg "octicon-dot-fill"}}</span>
</span>
<a class="active-stopwatch-trigger item ui mx-0{{if not .ActiveStopwatch}} hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}">
<span class="fitted relative">
{{svg "octicon-stopwatch"}}
<span class="header-stopwatch-dot"></span>
<span class="sr-mobile-only">{{.locale.Tr "active_stopwatch"}}</span>
</span>
</a>
Expand Down Expand Up @@ -116,16 +116,16 @@
</div>
</div>

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

<div class="ui dropdown jump item tooltip" data-content="{{.locale.Tr "create_new"}}">
<div class="ui dropdown jump item tooltip mx-0" data-content="{{.locale.Tr "create_new"}}">
<span class="text">
<span class="fitted">{{svg "octicon-plus"}}</span>
<span class="sr-mobile-only">{{.locale.Tr "create_new"}}</span>
Expand All @@ -148,7 +148,7 @@
</div><!-- end content create new menu -->
</div><!-- end dropdown menu create new -->

<div class="ui dropdown jump item tooltip" tabindex="-1" data-content="{{.locale.Tr "user_profile_and_more"}}">
<div class="ui dropdown jump item tooltip mx-0" tabindex="-1" data-content="{{.locale.Tr "user_profile_and_more"}}">
<span class="text">
{{avatar .SignedUser 24 "tiny"}}
<span class="sr-only">{{.locale.Tr "user_profile_and_more"}}</span>
Expand Down
28 changes: 28 additions & 0 deletions web_src/less/_base.less
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,7 @@ a.ui.card:hover,
visibility: hidden;
}

.text.primary { color: var(--color-primary) !important; }
silverwind marked this conversation as resolved.
Show resolved Hide resolved
.text.red { color: var(--color-red) !important; }
.text.orange { color: var(--color-orange) !important; }
.text.yellow { color: var(--color-yellow) !important; }
Expand Down Expand Up @@ -2427,6 +2428,33 @@ a.ui.basic.label:hover {
margin-top: 1rem;
}

.header-stopwatch-dot {
position: absolute;
left: 8px;
top: -8px;
width: 13px;
height: 13px;
background: var(--color-primary);
border: 2px solid var(--color-header-bar);
border-radius: 100%;
}

.notification_count {
position: absolute;
left: 5px;
top: -8px;
min-width: 1.5em;
text-align: center;
background: var(--color-primary);
border: 2px solid var(--color-header-bar);
color: var(--color-header-bar);
padding: 2px;
border-radius: 1em;
font-size: 10px;
font-weight: 700;
line-height: .7;
}

table th[data-sortt-asc],
table th[data-sortt-desc] {
&:hover {
Expand Down
1 change: 1 addition & 0 deletions web_src/less/helpers.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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

.mono {
font-family: var(--fonts-monospace) !important;
Expand Down