Commit 986c3ad7 by Czémán Arnold

dashboard: small improvements on destktop notifications

parent 9012bf31
Pipeline #46 passed with stage
in 0 seconds
......@@ -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);
}
});
}
......
......@@ -14,7 +14,4 @@
({% trans "username" %}: {{ user.username }})
{% endif %}
{% endif %}
<span id="user-options" data-desktop_notifications="{{ user.profile.desktop_notifications }}"><span>
{% endif %}
......@@ -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 %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment