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
4a53e028
Commit
4a53e028
authored
Jun 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'improve/dash_projects_page' of /home/git/repositories/gitlab/gitlabhq into 6-0-dev
parents
c9370b75
a3b42b6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
79 deletions
+38
-79
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+8
-6
app/views/dashboard/projects.html.haml
app/views/dashboard/projects.html.haml
+30
-57
features/dashboard/projects.feature
features/dashboard/projects.feature
+0
-4
features/steps/dashboard/dashboard_projects.rb
features/steps/dashboard/dashboard_projects.rb
+0
-12
No files found.
app/controllers/dashboard_controller.rb
View file @
4a53e028
class
DashboardController
<
ApplicationController
respond_to
:html
before_filter
:load_projects
before_filter
:load_projects
,
except:
[
:projects
]
before_filter
:event_filter
,
only: :show
def
show
...
...
@@ -26,16 +26,18 @@ class DashboardController < ApplicationController
def
projects
@projects
=
case
params
[
:scope
]
when
'personal'
then
@projects
.
personal
(
current_user
)
current_user
.
namespace
.
projects
when
'joined'
then
@projects
.
joined
(
current_user
)
current_user
.
authorized_projects
.
joined
(
current_user
)
when
'owned'
then
current_user
.
owned_projects
else
@
projects
end
current_user
.
authorized_
projects
end
.
sorted_by_activity
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@labels
=
Project
.
where
(
id:
@projects
.
map
(
&
:id
))
.
tags_on
(
:labels
)
@labels
=
current_user
.
authorized_projects
.
tags_on
(
:labels
)
@projects
=
@projects
.
tagged_with
(
params
[
:label
])
if
params
[
:label
].
present?
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
...
...
app/views/dashboard/projects.html.haml
View file @
4a53e028
%h3
.page_title
Projects
%span
(
#{
@projects
.
total_count
}
)
-
if
current_user
.
can_create_project?
%span
.pull-right
=
link_to
new_project_path
,
class:
"btn btn-tiny info"
do
%i
.icon-plus
New Project
%hr
.row
.span3
%ul
.nav.nav-pills.nav-stacked
...
...
@@ -19,58 +7,43 @@
=
link_to
"Personal"
,
projects_dashboard_path
(
scope:
'personal'
)
=
nav_tab
:scope
,
'joined'
do
=
link_to
"Joined"
,
projects_dashboard_path
(
scope:
'joined'
)
=
nav_tab
:scope
,
'owned'
do
=
link_to
"Owned"
,
projects_dashboard_path
(
scope:
'owned'
)
%p
.light
Filter by label:
%ul
.bordered-list
-
@labels
.
each
do
|
label
|
%li
{
class:
(
label
.
name
==
params
[
:label
])
?
'active'
:
'light'
}
=
link_to
projects_dashboard_path
(
scope:
params
[
:scope
],
label:
label
.
name
)
do
%i
.icon-tag
=
label
.
name
-
if
@labels
.
present?
%p
.light
Filter by label:
%ul
.bordered-list
-
@labels
.
each
do
|
label
|
%li
{
class:
(
label
.
name
==
params
[
:label
])
?
'active'
:
'light'
}
=
link_to
projects_dashboard_path
(
scope:
params
[
:scope
],
label:
label
.
name
)
do
%i
.icon-tag
=
label
.
name
.span9
=
form_tag
projects_dashboard_path
,
method:
'get'
do
%fieldset
.dashboard-search-filter
=
hidden_field_tag
"scope"
,
params
[
:scope
]
=
search_field_tag
"search"
,
params
[
:search
],
{
id:
'dashboard_projects_search'
,
placeholder:
'Search'
,
class:
'left input-xxlarge'
}
=
button_tag
type:
'submit'
,
class:
'btn'
do
%i
.icon-search
%ul
.bordered-list
-
@projects
.
each
do
|
project
|
%li
.clearfix
.clearfix
%h5
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
-
if
project
.
namespace
=
project
.
namespace
.
human_name
%span
=
"/"
%strong
=
truncate
(
project
.
name
,
length:
45
)
.pull-right.light
-
if
project
.
owner
==
current_user
%i
.icon-wrench
-
tm
=
project
.
team
.
get_tm
(
current_user
.
id
)
-
if
tm
%strong
=
tm
.
project_access_human
.clearfix
.left
-
if
project
.
description
.
present?
%span
.light
=
project
.
description
-
project
.
labels
.
each
do
|
label
|
%span
.label.label-info
%i
.icon-tag
=
label
.
name
.ui-box
%h5
.title
Projects (
#{
@projects
.
total_count
}
)
%ul
.well-list
-
@projects
.
each
do
|
project
|
%li
-
if
project
.
public
=
public_icon
-
else
=
private_icon
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
%strong
=
project
.
name_with_namespace
-
if
project
.
description
.
present?
%span
.light
=
truncate
project
.
description
,
length:
80
.pull-right.light
%small
.light
Last activity
#{
project_last_activity
(
project
)
}
%small
Last activity
#{
project_last_activity
(
project
)
}
-
if
@projects
.
blank?
%li
%h3
.nothing_here_message
There are no projects here.
-
if
@projects
.
blank?
%li
%h3
.nothing_here_message
There are no projects here.
.bottom
%hr
=
paginate
@projects
,
theme:
"gitlab"
features/dashboard/projects.feature
View file @
4a53e028
...
...
@@ -6,7 +6,3 @@ Feature: Dashboard projects
Scenario
:
I
should see projects list
Then
I should see projects list
Scenario
:
I
should see project I am looking for
Given
I search for
"Sho"
Then
I should see
"Shop"
project link
features/steps/dashboard/dashboard_projects.rb
View file @
4a53e028
...
...
@@ -8,16 +8,4 @@ class DashboardProjects < Spinach::FeatureSteps
page
.
should
have_link
project
.
name_with_namespace
end
end
Given
'I search for "Sho"'
do
fill_in
"dashboard_projects_search"
,
with:
"Sho"
within
".dashboard-search-filter"
do
find
(
'button'
).
click
end
end
Then
'I should see "Shop" project link'
do
page
.
should
have_link
"Shop"
end
end
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