BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
7 deletions
+25
-7
tasks.scss
app/assets/stylesheets/pages/tasks.scss
+10
-0
tasks_controller.rb
app/controllers/dashboard/tasks_controller.rb
+0
-3
tasks_helper.rb
app/helpers/tasks_helper.rb
+8
-0
index.html.haml
app/views/dashboard/tasks/index.html.haml
+2
-2
_default.html.haml
app/views/layouts/header/_default.html.haml
+5
-2
No files found.
app/assets/stylesheets/pages/tasks.scss
View file @
38026e5f
...
...
@@ -2,6 +2,16 @@
* Dashboard tasks queue
*
*/
.navbar-nav
{
li
{
.badge.tasks-pending-count
{
background-color
:
#7f8fa4
;
margin-top
:
-5px
;
}
}
}
.tasks
{
.panel
{
border-top
:
none
;
...
...
app/controllers/dashboard/tasks_controller.rb
View file @
38026e5f
...
...
@@ -10,9 +10,6 @@ class Dashboard::TasksController < Dashboard::ApplicationController
end
@tasks
=
@tasks
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@pending_count
=
current_user
.
tasks
.
pending
.
count
@done_count
=
current_user
.
tasks
.
done
.
count
end
def
destroy
...
...
app/helpers/tasks_helper.rb
View file @
38026e5f
...
...
@@ -9,6 +9,14 @@ module TasksHelper
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
)
target
=
task
.
target_type
.
titleize
.
downcase
...
...
app/views/dashboard/tasks/index.html.haml
View file @
38026e5f
...
...
@@ -5,10 +5,10 @@
%ul
.nav-links
%li
{
class:
(
"active"
if
params
[
:state
].
blank?
||
params
[
:state
]
==
'pending'
)}
=
link_to
dashboard_tasks_path
(
state:
'pending'
)
do
Tasks (
#{
@
pending_count
}
)
Tasks (
#{
tasks_
pending_count
}
)
%li
{
class:
(
"active"
if
params
[
:state
]
==
'done'
)}
=
link_to
dashboard_tasks_path
(
state:
'done'
)
do
Done (
#{
@
done_count
}
)
Done (
#{
tasks_
done_count
}
)
.tasks
-
if
@tasks
.
any?
...
...
app/views/layouts/header/_default.html.haml
View file @
38026e5f
...
...
@@ -21,6 +21,10 @@
%li
=
link_to
admin_root_path
,
title:
'Admin Area'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
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?
%li
=
link_to
new_project_path
,
title:
'New project'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
...
...
@@ -39,4 +43,4 @@
=
render
'shared/outdated_browser'
-
if
@project
&&
!
@project
.
empty_repo?
:javascript
var
findFileURL
=
"
#{
namespace_project_find_file_path
(
@project
.
namespace
,
@project
,
@ref
||
@project
.
repository
.
root_ref
)
}
"
;
\ No newline at end of file
var
findFileURL
=
"
#{
namespace_project_find_file_path
(
@project
.
namespace
,
@project
,
@ref
||
@project
.
repository
.
root_ref
)
}
"
;
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