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
Kazuhiko Shiozaki
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
Hide 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
respond_to
:html
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
)
@last_push
=
current_user
.
recent_push
respond_to
do
|
format
|
format
.
html
format
.
html
{
render
'index'
,
layout:
determine_layout
}
format
.
js
format
.
atom
{
render
layout:
false
}
end
...
...
@@ -31,4 +41,10 @@ class DashboardController < ApplicationController
format
.
atom
{
render
layout:
false
}
end
end
protected
def
determine_layout
@group
?
'group'
:
'application'
end
end
app/views/admin/groups/index.html.haml
View file @
f9eda9b3
...
...
@@ -9,7 +9,7 @@
%table
%thead
%th
Name
%th
Path
%th
Code
%th
Projects
%th
Edit
%th
.cred
Danger Zone!
...
...
@@ -17,7 +17,7 @@
-
@groups
.
each
do
|
group
|
%tr
%td
=
link_to
group
.
name
,
[
:admin
,
group
]
%td
=
group
.
path
%td
=
group
.
code
%td
=
group
.
projects
.
count
%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"
...
...
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 @@
.loading.hide
.side
=
render
"events/event_last_push"
,
event:
@last_push
.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"
-
unless
@group
=
render
"groups"
,
groups:
@groups
=
render
"projects"
,
projects:
@projects
%div
%span
.rss-icon
=
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