Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
986c3ad7
authored
Apr 15, 2016
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: small improvements on destktop notifications
parent
9012bf31
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
circle/dashboard/static/dashboard/activity.js
+4
-3
circle/dashboard/templates/dashboard/_display-name.html
+0
-3
circle/dashboard/templates/dashboard/base.html
+3
-0
No files found.
circle/dashboard/static/dashboard/activity.js
View file @
986c3ad7
...
...
@@ -203,18 +203,19 @@ function generateMessageFromLastActivity(){
var
ac
=
$
(
'div.activity'
).
first
();
var
error
=
ac
.
children
(
".timeline-icon-failed"
).
length
;
var
sign
=
(
error
===
1
)
?
"❌ "
:
"✓ "
;
var
msg
=
ac
.
children
(
"strong"
).
text
().
trim
(
);
var
msg
=
ac
.
children
(
"strong"
).
text
().
replace
(
/
\s\s
+/g
,
" "
);
return
sign
+
msg
;
}
function
sendNotification
(
message
)
{
var
options
=
{
icon
:
"/static/dashboard/img/favicon.png"
};
if
(
Notification
.
permission
===
"granted"
)
{
var
notification
=
new
Notification
(
message
);
var
notification
=
new
Notification
(
message
,
options
);
}
else
if
(
Notification
.
permission
!==
'denied'
)
{
Notification
.
requestPermission
(
function
(
permission
)
{
if
(
permission
===
"granted"
)
{
var
notification
=
new
Notification
(
message
);
var
notification
=
new
Notification
(
message
,
options
);
}
});
}
...
...
circle/dashboard/templates/dashboard/_display-name.html
View file @
986c3ad7
...
...
@@ -14,7 +14,4 @@
({% trans "username" %}: {{ user.username }})
{% endif %}
{% endif %}
<span
id=
"user-options"
data-desktop_notifications=
"{{ user.profile.desktop_notifications }}"
><span>
{% endif %}
circle/dashboard/templates/dashboard/base.html
View file @
986c3ad7
...
...
@@ -12,6 +12,9 @@
{% block navbar %}
{% if request.user.is_authenticated and request.user.pk and not request.token_user %}
<span
id=
"user-options"
data-desktop_notifications=
"{{ request.user.profile.desktop_notifications }}"
><span>
<ul
class=
"nav navbar-nav navbar-right"
id=
"dashboard-menu"
>
{% if request.user.is_superuser %}
{% if ADMIN_ENABLED %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment