Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fbf6c5b8
authored
Jan 05, 2015
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add notification count to favicon
parent
7fed7d2c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
4 deletions
+17
-4
circle/bower.json
+2
-1
circle/circle/settings/base.py
+1
-0
circle/dashboard/static/dashboard/dashboard.js
+9
-1
circle/dashboard/templates/dashboard/base.html
+5
-2
No files found.
circle/bower.json
View file @
fbf6c5b8
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
"jquery-knob"
:
"~1.2.9"
,
"jquery-knob"
:
"~1.2.9"
,
"jquery-simple-slider"
:
"https://github.com/BME-IK/jquery-simple-slider.git"
,
"jquery-simple-slider"
:
"https://github.com/BME-IK/jquery-simple-slider.git"
,
"bootbox"
:
"~4.3.0"
,
"bootbox"
:
"~4.3.0"
,
"intro.js"
:
"0.9.0"
"intro.js"
:
"0.9.0"
,
"favico.js"
:
"~0.3.5"
}
}
}
}
circle/circle/settings/base.py
View file @
fbf6c5b8
...
@@ -197,6 +197,7 @@ PIPELINE_JS = {
...
@@ -197,6 +197,7 @@ PIPELINE_JS = {
"intro.js/intro.js"
,
"intro.js/intro.js"
,
"jquery-knob/dist/jquery.knob.min.js"
,
"jquery-knob/dist/jquery.knob.min.js"
,
"jquery-simple-slider/js/simple-slider.js"
,
"jquery-simple-slider/js/simple-slider.js"
,
"favico.js/favico.js"
,
"dashboard/dashboard.js"
,
"dashboard/dashboard.js"
,
"dashboard/activity.js"
,
"dashboard/activity.js"
,
"dashboard/group-details.js"
,
"dashboard/group-details.js"
,
...
...
circle/dashboard/static/dashboard/dashboard.js
View file @
fbf6c5b8
$
(
function
()
{
$
(
function
()
{
var
favicon
=
new
Favico
({
animation
:
'none'
});
var
notifications
=
$
(
"#notification_count"
).
data
(
"notifications"
);
favicon
.
badge
(
notifications
);
$
(
".not-tab-pane"
).
removeClass
(
"not-tab-pane"
).
addClass
(
"tab-pane"
);
$
(
".not-tab-pane"
).
removeClass
(
"not-tab-pane"
).
addClass
(
"tab-pane"
);
$
(
'.vm-create'
).
click
(
function
(
e
)
{
$
(
'.vm-create'
).
click
(
function
(
e
)
{
...
@@ -311,6 +318,8 @@ $(function () {
...
@@ -311,6 +318,8 @@ $(function () {
$
(
"#notification-button a"
).
click
(
function
()
{
$
(
"#notification-button a"
).
click
(
function
()
{
$
(
'#notification-messages'
).
load
(
"/dashboard/notifications/"
);
$
(
'#notification-messages'
).
load
(
"/dashboard/notifications/"
);
$
(
'#notification-button a span[class*="badge-pulse"]'
).
remove
();
$
(
'#notification-button a span[class*="badge-pulse"]'
).
remove
();
favicon
.
reset
();
});
});
/* on the client confirmation button fire the clientInstalledAction */
/* on the client confirmation button fire the clientInstalledAction */
...
@@ -349,7 +358,6 @@ $(function () {
...
@@ -349,7 +358,6 @@ $(function () {
li
.
addClass
(
'panel-primary'
).
find
(
'input'
).
prop
(
"checked"
,
true
);
li
.
addClass
(
'panel-primary'
).
find
(
'input'
).
prop
(
"checked"
,
true
);
return
true
;
return
true
;
});
});
});
});
function
generateVmHTML
(
pk
,
name
,
host
,
icon
,
_status
,
fav
,
is_last
)
{
function
generateVmHTML
(
pk
,
name
,
host
,
icon
,
_status
,
fav
,
is_last
)
{
...
...
circle/dashboard/templates/dashboard/base.html
View file @
fbf6c5b8
...
@@ -21,10 +21,13 @@
...
@@ -21,10 +21,13 @@
<ul
class=
"nav navbar-nav pull-right"
>
<ul
class=
"nav navbar-nav pull-right"
>
<li
class=
"dropdown"
id=
"notification-button"
>
<li
class=
"dropdown"
id=
"notification-button"
>
<a
href=
"{% url "
dashboard
.
views
.
notifications
"
%}"
<a
href=
"{% url "
dashboard
.
views
.
notifications
"
%}"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
class=
"dropdown-toggle"
data-toggle=
"dropdown"
id=
"notification_count"
data-notifications=
"{{ NEW_NOTIFICATIONS_COUNT }}"
>
{% trans "Notifications" %}
{% trans "Notifications" %}
{% if NEW_NOTIFICATIONS_COUNT > 0 %}
{% if NEW_NOTIFICATIONS_COUNT > 0 %}
<span
class=
"badge badge-pulse"
>
{{ NEW_NOTIFICATIONS_COUNT }}
</span>
<span
class=
"badge badge-pulse"
>
{{ NEW_NOTIFICATIONS_COUNT }}
</span>
{% endif %}
{% endif %}
</a>
</a>
<ul
class=
"dropdown-menu"
id=
"notification-messages"
>
<ul
class=
"dropdown-menu"
id=
"notification-messages"
>
...
...
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