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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
f9eda9b3
Commit
f9eda9b3
authored
Oct 02, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group filtering on dashboard
parent
d6363e93
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
26 deletions
+83
-26
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+18
-2
app/views/admin/groups/index.html.haml
app/views/admin/groups/index.html.haml
+2
-2
app/views/dashboard/_groups.html.haml
app/views/dashboard/_groups.html.haml
+15
-0
app/views/dashboard/_projects.html.haml
app/views/dashboard/_projects.html.haml
+21
-0
app/views/dashboard/index.html.haml
app/views/dashboard/index.html.haml
+3
-22
app/views/layouts/group.html.haml
app/views/layouts/group.html.haml
+24
-0
No files found.
app/controllers/dashboard_controller.rb
View file @
f9eda9b3
...
@@ -2,12 +2,22 @@ class DashboardController < ApplicationController
...
@@ -2,12 +2,22 @@ class DashboardController < ApplicationController
respond_to
:html
respond_to
:html
def
index
def
index
@projects
=
current_user
.
projects_with_events
.
page
(
params
[
:page
]).
per
(
40
)
@groups
=
Group
.
where
(
id:
current_user
.
projects
.
pluck
(
:group_id
))
@projects
=
current_user
.
projects_with_events
if
params
[
:group
].
present?
@group
=
Group
.
find_by_code
(
params
[
:group
])
@projects
=
@projects
.
where
(
group_id:
@group
.
id
)
end
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
40
)
@events
=
Event
.
recent_for_user
(
current_user
).
limit
(
20
).
offset
(
params
[
:offset
]
||
0
)
@events
=
Event
.
recent_for_user
(
current_user
).
limit
(
20
).
offset
(
params
[
:offset
]
||
0
)
@last_push
=
current_user
.
recent_push
@last_push
=
current_user
.
recent_push
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
{
render
'index'
,
layout:
determine_layout
}
format
.
js
format
.
js
format
.
atom
{
render
layout:
false
}
format
.
atom
{
render
layout:
false
}
end
end
...
@@ -31,4 +41,10 @@ class DashboardController < ApplicationController
...
@@ -31,4 +41,10 @@ class DashboardController < ApplicationController
format
.
atom
{
render
layout:
false
}
format
.
atom
{
render
layout:
false
}
end
end
end
end
protected
def
determine_layout
@group
?
'group'
:
'application'
end
end
end
app/views/admin/groups/index.html.haml
View file @
f9eda9b3
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
%table
%table
%thead
%thead
%th
Name
%th
Name
%th
Path
%th
Code
%th
Projects
%th
Projects
%th
Edit
%th
Edit
%th
.cred
Danger Zone!
%th
.cred
Danger Zone!
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
-
@groups
.
each
do
|
group
|
-
@groups
.
each
do
|
group
|
%tr
%tr
%td
=
link_to
group
.
name
,
[
:admin
,
group
]
%td
=
link_to
group
.
name
,
[
:admin
,
group
]
%td
=
group
.
path
%td
=
group
.
code
%td
=
group
.
projects
.
count
%td
=
group
.
projects
.
count
%td
=
link_to
'Edit'
,
edit_admin_group_path
(
group
),
id:
"edit_
#{
dom_id
(
group
)
}
"
,
class:
"btn small"
%td
=
link_to
'Edit'
,
edit_admin_group_path
(
group
),
id:
"edit_
#{
dom_id
(
group
)
}
"
,
class:
"btn small"
%td
.bgred
=
link_to
'Destroy'
,
[
:admin
,
group
],
confirm:
"REMOVE
#{
group
.
name
}
? Are you sure?"
,
method: :delete
,
class:
"btn small danger"
%td
.bgred
=
link_to
'Destroy'
,
[
:admin
,
group
],
confirm:
"REMOVE
#{
group
.
name
}
? Are you sure?"
,
method: :delete
,
class:
"btn small danger"
...
...
app/views/dashboard/_groups.html.haml
0 → 100644
View file @
f9eda9b3
.projects_box
%h5
Groups
%small
(
#{
groups
.
count
}
)
%ul
.unstyled
-
groups
.
each
do
|
group
|
%li
.wll
=
link_to
dashboard_path
(
group:
group
),
class:
dom_class
(
group
)
do
%strong
.group_name
=
truncate
(
group
.
name
,
length:
25
)
%span
.arrow
→
%span
.last_activity
%strong
Projects:
%span
=
group
.
projects
.
count
app/views/dashboard/_projects.html.haml
0 → 100644
View file @
f9eda9b3
.projects_box
%h5
Projects
%small
(
#{
projects
.
total_count
}
)
-
if
current_user
.
can_create_project?
%span
.right
=
link_to
new_project_path
,
class:
"btn very_small info"
do
%i
.icon-plus
New Project
%ul
.unstyled
-
projects
.
each
do
|
project
|
%li
.wll
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
%strong
.project_name
=
truncate
(
project
.
name
,
length:
25
)
%span
.arrow
→
%span
.last_activity
%strong
Last activity:
%span
=
project_last_activity
(
project
)
.bottom
=
paginate
projects
,
theme:
"gitlab"
app/views/dashboard/index.html.haml
View file @
f9eda9b3
...
@@ -9,28 +9,9 @@
...
@@ -9,28 +9,9 @@
.loading.hide
.loading.hide
.side
.side
=
render
"events/event_last_push"
,
event:
@last_push
=
render
"events/event_last_push"
,
event:
@last_push
.projects_box
-
unless
@group
%h5
=
render
"groups"
,
groups:
@groups
Projects
=
render
"projects"
,
projects:
@projects
%small
(
#{
@projects
.
total_count
}
)
-
if
current_user
.
can_create_project?
%span
.right
=
link_to
new_project_path
,
class:
"btn very_small info"
do
%i
.icon-plus
New Project
%ul
.unstyled
-
@projects
.
each
do
|
project
|
%li
.wll
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
%strong
.project_name
=
truncate
(
project
.
name
,
length:
25
)
%span
.arrow
→
%span
.last_activity
%strong
Last activity:
%span
=
project_last_activity
(
project
)
.bottom
=
paginate
@projects
,
theme:
"gitlab"
%div
%div
%span
.rss-icon
%span
.rss-icon
=
link_to
dashboard_path
(
:atom
,
{
private_token:
current_user
.
private_token
})
do
=
link_to
dashboard_path
(
:atom
,
{
private_token:
current_user
.
private_token
})
do
...
...
app/views/layouts/group.html.haml
0 → 100644
View file @
f9eda9b3
!!! 5
%html
{
lang:
"en"
}
=
render
"layouts/head"
%body
{
class:
"#{app_theme} application"
}
=
render
"layouts/flash"
=
render
"layouts/head_panel"
,
title:
"
#{
@group
.
name
}
:Dashboard"
.container
%ul
.main_menu
=
nav_link
(
path:
'dashboard#index'
,
html_options:
{
class:
'home'
})
do
=
link_to
"Home"
,
root_path
,
title:
"Home"
=
nav_link
(
path:
'dashboard#issues'
)
do
=
link_to
dashboard_issues_path
(
group:
@group
)
do
Issues
%span
.count
=
current_user
.
assigned_issues
.
opened
.
count
=
nav_link
(
path:
'dashboard#merge_requests'
)
do
=
link_to
dashboard_merge_requests_path
(
group:
@group
)
do
Merge Requests
%span
.count
=
current_user
.
cared_merge_requests
.
count
=
nav_link
(
path:
'search#show'
)
do
=
link_to
"People"
,
"#"
=
nav_link
(
path:
'help#index'
)
do
=
link_to
"Help"
,
help_path
.content
=
yield
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