Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
38026e5f
Commit
38026e5f
authored
Feb 15, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pending tasks badge on top right next to the new and logout button
parent
77d7910b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
6 deletions
+25
-6
app/assets/stylesheets/pages/tasks.scss
app/assets/stylesheets/pages/tasks.scss
+10
-0
app/controllers/dashboard/tasks_controller.rb
app/controllers/dashboard/tasks_controller.rb
+0
-3
app/helpers/tasks_helper.rb
app/helpers/tasks_helper.rb
+8
-0
app/views/dashboard/tasks/index.html.haml
app/views/dashboard/tasks/index.html.haml
+2
-2
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+5
-1
No files found.
app/assets/stylesheets/pages/tasks.scss
View file @
38026e5f
...
@@ -2,6 +2,16 @@
...
@@ -2,6 +2,16 @@
* Dashboard tasks queue
* Dashboard tasks queue
*
*
*/
*/
.navbar-nav
{
li
{
.badge.tasks-pending-count
{
background-color
:
#7f8fa4
;
margin-top
:
-5px
;
}
}
}
.tasks
{
.tasks
{
.panel
{
.panel
{
border-top
:
none
;
border-top
:
none
;
...
...
app/controllers/dashboard/tasks_controller.rb
View file @
38026e5f
...
@@ -10,9 +10,6 @@ class Dashboard::TasksController < Dashboard::ApplicationController
...
@@ -10,9 +10,6 @@ class Dashboard::TasksController < Dashboard::ApplicationController
end
end
@tasks
=
@tasks
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@tasks
=
@tasks
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@pending_count
=
current_user
.
tasks
.
pending
.
count
@done_count
=
current_user
.
tasks
.
done
.
count
end
end
def
destroy
def
destroy
...
...
app/helpers/tasks_helper.rb
View file @
38026e5f
...
@@ -9,6 +9,14 @@ module TasksHelper
...
@@ -9,6 +9,14 @@ module TasksHelper
end
end
end
end
def
tasks_pending_count
current_user
.
tasks
.
pending
.
count
end
def
tasks_done_count
current_user
.
tasks
.
done
.
count
end
def
task_action_name
(
task
)
def
task_action_name
(
task
)
target
=
task
.
target_type
.
titleize
.
downcase
target
=
task
.
target_type
.
titleize
.
downcase
...
...
app/views/dashboard/tasks/index.html.haml
View file @
38026e5f
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
%ul
.nav-links
%ul
.nav-links
%li
{
class:
(
"active"
if
params
[
:state
].
blank?
||
params
[
:state
]
==
'pending'
)}
%li
{
class:
(
"active"
if
params
[
:state
].
blank?
||
params
[
:state
]
==
'pending'
)}
=
link_to
dashboard_tasks_path
(
state:
'pending'
)
do
=
link_to
dashboard_tasks_path
(
state:
'pending'
)
do
Tasks (
#{
@
pending_count
}
)
Tasks (
#{
tasks_
pending_count
}
)
%li
{
class:
(
"active"
if
params
[
:state
]
==
'done'
)}
%li
{
class:
(
"active"
if
params
[
:state
]
==
'done'
)}
=
link_to
dashboard_tasks_path
(
state:
'done'
)
do
=
link_to
dashboard_tasks_path
(
state:
'done'
)
do
Done (
#{
@
done_count
}
)
Done (
#{
tasks_
done_count
}
)
.tasks
.tasks
-
if
@tasks
.
any?
-
if
@tasks
.
any?
...
...
app/views/layouts/header/_default.html.haml
View file @
38026e5f
...
@@ -21,6 +21,10 @@
...
@@ -21,6 +21,10 @@
%li
%li
=
link_to
admin_root_path
,
title:
'Admin Area'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
link_to
admin_root_path
,
title:
'Admin Area'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'wrench fw'
)
=
icon
(
'wrench fw'
)
%li
=
link_to
dashboard_tasks_path
,
title:
'Task Queue'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
%span
.badge.tasks-pending-count
=
tasks_pending_count
-
if
current_user
.
can_create_project?
-
if
current_user
.
can_create_project?
%li
%li
=
link_to
new_project_path
,
title:
'New project'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
link_to
new_project_path
,
title:
'New project'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
...
@@ -39,4 +43,4 @@
...
@@ -39,4 +43,4 @@
=
render
'shared/outdated_browser'
=
render
'shared/outdated_browser'
-
if
@project
&&
!
@project
.
empty_repo?
-
if
@project
&&
!
@project
.
empty_repo?
:javascript
:javascript
var
findFileURL
=
"
#{
namespace_project_find_file_path
(
@project
.
namespace
,
@project
,
@ref
||
@project
.
repository
.
root_ref
)
}
"
;
var
findFileURL
=
"
#{
namespace_project_find_file_path
(
@project
.
namespace
,
@project
,
@ref
||
@project
.
repository
.
root_ref
)
}
"
;
\ No newline at end of file
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