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
Boxiang Sun
gitlab-ce
Commits
63a67bb4
Commit
63a67bb4
authored
Jun 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove second search. More compact list. Additional filter
parent
6e35acef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
63 deletions
+38
-63
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
No files found.
app/controllers/dashboard_controller.rb
View file @
63a67bb4
class
DashboardController
<
ApplicationController
class
DashboardController
<
ApplicationController
respond_to
:html
respond_to
:html
before_filter
:load_projects
before_filter
:load_projects
,
except:
[
:projects
]
before_filter
:event_filter
,
only: :show
before_filter
:event_filter
,
only: :show
def
show
def
show
...
@@ -26,16 +26,18 @@ class DashboardController < ApplicationController
...
@@ -26,16 +26,18 @@ class DashboardController < ApplicationController
def
projects
def
projects
@projects
=
case
params
[
:scope
]
@projects
=
case
params
[
:scope
]
when
'personal'
then
when
'personal'
then
@projects
.
personal
(
current_user
)
current_user
.
namespace
.
projects
when
'joined'
then
when
'joined'
then
@projects
.
joined
(
current_user
)
current_user
.
authorized_projects
.
joined
(
current_user
)
when
'owned'
then
current_user
.
owned_projects
else
else
@
projects
current_user
.
authorized_
projects
end
end
.
sorted_by_activity
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@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
.
tagged_with
(
params
[
:label
])
if
params
[
:label
].
present?
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
@projects
=
@projects
.
page
(
params
[
:page
]).
per
(
30
)
...
...
app/views/dashboard/projects.html.haml
View file @
63a67bb4
%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
.row
.span3
.span3
%ul
.nav.nav-pills.nav-stacked
%ul
.nav.nav-pills.nav-stacked
...
@@ -19,58 +7,43 @@
...
@@ -19,58 +7,43 @@
=
link_to
"Personal"
,
projects_dashboard_path
(
scope:
'personal'
)
=
link_to
"Personal"
,
projects_dashboard_path
(
scope:
'personal'
)
=
nav_tab
:scope
,
'joined'
do
=
nav_tab
:scope
,
'joined'
do
=
link_to
"Joined"
,
projects_dashboard_path
(
scope:
'joined'
)
=
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:
-
if
@labels
.
present?
%ul
.bordered-list
%p
.light
Filter by label:
-
@labels
.
each
do
|
label
|
%ul
.bordered-list
%li
{
class:
(
label
.
name
==
params
[
:label
])
?
'active'
:
'light'
}
-
@labels
.
each
do
|
label
|
=
link_to
projects_dashboard_path
(
scope:
params
[
:scope
],
label:
label
.
name
)
do
%li
{
class:
(
label
.
name
==
params
[
:label
])
?
'active'
:
'light'
}
%i
.icon-tag
=
link_to
projects_dashboard_path
(
scope:
params
[
:scope
],
label:
label
.
name
)
do
=
label
.
name
%i
.icon-tag
=
label
.
name
.span9
.span9
=
form_tag
projects_dashboard_path
,
method:
'get'
do
.ui-box
%fieldset
.dashboard-search-filter
%h5
.title
=
hidden_field_tag
"scope"
,
params
[
:scope
]
Projects (
#{
@projects
.
total_count
}
)
=
search_field_tag
"search"
,
params
[
:search
],
{
id:
'dashboard_projects_search'
,
placeholder:
'Search'
,
class:
'left input-xxlarge'
}
%ul
.well-list
=
button_tag
type:
'submit'
,
class:
'btn'
do
-
@projects
.
each
do
|
project
|
%i
.icon-search
%li
-
if
project
.
public
%ul
.bordered-list
=
public_icon
-
@projects
.
each
do
|
project
|
-
else
%li
.clearfix
=
private_icon
.clearfix
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
%h5
%strong
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
=
project
.
name_with_namespace
-
if
project
.
namespace
-
if
project
.
description
.
present?
=
project
.
namespace
.
human_name
%span
.light
%span
=
"/"
=
truncate
project
.
description
,
length:
80
%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
.pull-right.light
.pull-right.light
%small
.light
%small
Last activity
#{
project_last_activity
(
project
)
}
Last activity
#{
project_last_activity
(
project
)
}
-
if
@projects
.
blank?
-
if
@projects
.
blank?
%li
%li
%h3
.nothing_here_message
There are no projects here.
%h3
.nothing_here_message
There are no projects here.
.bottom
.bottom
%hr
=
paginate
@projects
,
theme:
"gitlab"
=
paginate
@projects
,
theme:
"gitlab"
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