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
cd779e56
Commit
cd779e56
authored
Dec 08, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard v1
parent
4107f2cc
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
189 additions
and
129 deletions
+189
-129
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+31
-0
app/controllers/user_issues_controller.rb
app/controllers/user_issues_controller.rb
+0
-20
app/controllers/user_merge_requests_controller.rb
app/controllers/user_merge_requests_controller.rb
+0
-8
app/views/dashboard/_issues_feed.html.haml
app/views/dashboard/_issues_feed.html.haml
+16
-13
app/views/dashboard/_merge_requests_feed.html.haml
app/views/dashboard/_merge_requests_feed.html.haml
+16
-15
app/views/dashboard/_projects_feed.html.haml
app/views/dashboard/_projects_feed.html.haml
+10
-10
app/views/dashboard/_sidebar.html.haml
app/views/dashboard/_sidebar.html.haml
+15
-0
app/views/dashboard/index.html.haml
app/views/dashboard/index.html.haml
+2
-15
app/views/dashboard/index.js.haml
app/views/dashboard/index.js.haml
+7
-0
app/views/dashboard/issues.atom.builder
app/views/dashboard/issues.atom.builder
+3
-3
app/views/dashboard/issues.html.haml
app/views/dashboard/issues.html.haml
+5
-0
app/views/dashboard/issues.js.haml
app/views/dashboard/issues.js.haml
+7
-0
app/views/dashboard/merge_requests.html.haml
app/views/dashboard/merge_requests.html.haml
+5
-0
app/views/dashboard/merge_requests.js.haml
app/views/dashboard/merge_requests.js.haml
+7
-0
app/views/merge_requests/_merge_request.html.haml
app/views/merge_requests/_merge_request.html.haml
+0
-3
app/views/user_issues/index.html.haml
app/views/user_issues/index.html.haml
+0
-18
app/views/user_merge_requests/index.html.haml
app/views/user_merge_requests/index.html.haml
+0
-18
config/routes.rb
config/routes.rb
+3
-3
spec/requests/dashboard_issues_spec.rb
spec/requests/dashboard_issues_spec.rb
+58
-0
spec/requests/dashboard_merge_requests_spec.rb
spec/requests/dashboard_merge_requests_spec.rb
+3
-2
spec/requests/issues_spec.rb
spec/requests/issues_spec.rb
+1
-1
No files found.
app/controllers/dashboard_controller.rb
View file @
cd779e56
class
DashboardController
<
ApplicationController
class
DashboardController
<
ApplicationController
respond_to
:js
,
:html
def
index
def
index
@projects
=
current_user
.
projects
.
all
@projects
=
current_user
.
projects
.
all
@active_projects
=
@projects
.
select
(
&
:last_activity_date
).
sort_by
(
&
:last_activity_date
).
reverse
@active_projects
=
@projects
.
select
(
&
:last_activity_date
).
sort_by
(
&
:last_activity_date
).
reverse
respond_to
do
|
format
|
format
.
html
format
.
js
{
no_cache_headers
}
end
end
def
merge_requests
@projects
=
current_user
.
projects
.
all
@merge_requests
=
current_user
.
assigned_merge_requests
.
order
(
"created_at DESC"
).
limit
(
40
)
respond_to
do
|
format
|
format
.
html
format
.
js
{
no_cache_headers
}
end
end
def
issues
@projects
=
current_user
.
projects
.
all
@user
=
current_user
@issues
=
current_user
.
assigned_issues
.
opened
.
order
(
"created_at DESC"
).
limit
(
40
)
@issues
=
@issues
.
includes
(
:author
,
:project
)
respond_to
do
|
format
|
format
.
html
format
.
js
{
no_cache_headers
}
format
.
atom
{
render
:layout
=>
false
}
end
end
end
end
end
app/controllers/user_issues_controller.rb
deleted
100644 → 0
View file @
4107f2cc
class
UserIssuesController
<
ApplicationController
before_filter
:authenticate_user!
respond_to
:js
,
:html
def
index
@projects
=
current_user
.
projects
.
all
@user
=
current_user
@issues
=
current_user
.
assigned_issues
.
opened
@issues
=
@issues
.
includes
(
:author
,
:project
)
respond_to
do
|
format
|
format
.
html
format
.
js
format
.
atom
{
render
:layout
=>
false
}
end
end
end
app/controllers/user_merge_requests_controller.rb
deleted
100644 → 0
View file @
4107f2cc
class
UserMergeRequestsController
<
ApplicationController
before_filter
:authenticate_user!
def
index
@projects
=
current_user
.
projects
.
all
@merge_requests
=
current_user
.
assigned_merge_requests
end
end
app/views/dashboard/_issues_feed.html.haml
View file @
cd779e56
#news-feed
.news-feed
%div
%div
=
link_to
dashboard_path
,
:remote
=>
true
,
:class
=>
"left"
do
=
link_to
dashboard_path
,
:class
=>
"left"
do
.box-arrow
.box-arrow
←
←
%h2
{
:style
=>
"width:86%; text-align:center"
}
%h2
{
:style
=>
"width:86%; text-align:center"
}
Issues
Issues
=
link_to
merge_requests_path
,
:class
=>
"right"
do
=
link_to
dashboard_merge_requests_path
,
:remote
=>
true
,
:class
=>
"right"
do
.box-arrow
.box-arrow
→
→
#feeds_content_holder
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
.data
.data
-
@issues
.
each
do
|
update
|
-
@issues
.
each
do
|
update
|
%a
.project-update
{
:href
=>
dashboard_feed_path
(
update
.
project
,
update
)}
%a
.project-update
{
:href
=>
dashboard_feed_path
(
update
.
project
,
update
)}
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
%span
.update-title
%span
.update-title
=
dashboard_feed_title
(
update
)
=
truncate
update
.
title
,
:length
=>
50
.right
=
update
.
project
.
name
%span
.update-author
%span
.update-author
%strong
=
update
.
author_name
%strong
=
update
.
author_name
authored
authored
=
time_ago_in_words
(
update
.
created_at
)
=
time_ago_in_words
(
update
.
created_at
)
ago
ago
.right
.right
-
klass
=
update
.
class
.
to_s
.
split
(
"::"
).
last
.
downcase
-
if
update
.
critical
%span
.tag
{
:class
=>
klass
}=
klass
%span
.tag.high
critical
-
if
update
.
today?
%span
.tag.today
today
app/views/dashboard/_merge_requests_feed.html.haml
View file @
cd779e56
#news-feed
.news-feed
%div
%div
=
link_to
dashboard_issues_path
,
:remote
=>
true
,
:class
=>
"left"
do
=
link_to
issues_path
,
:class
=>
"left"
do
.box-arrow
.box-arrow
←
←
%h2
{
:style
=>
"width:86%; text-align:center"
}
%h2
{
:style
=>
"width:86%; text-align:center"
}
Merge Requests
Merge Requests
=
link_to
dashboard_path
,
:class
=>
"right"
do
=
link_to
dashboard_path
,
:remote
=>
true
,
:class
=>
"right"
do
.box-arrow
.box-arrow
→
→
#feeds_content_holder
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
.data
.data
-
@merge_requests
.
each
do
|
update
|
-
@merge_requests
.
each
do
|
update
|
%a
.project-update
{
:href
=>
dashboard_feed
_path
(
update
.
project
,
update
)}
%a
.project-update
{
:href
=>
project_merge_request
_path
(
update
.
project
,
update
)}
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
%span
.update-title
%span
.update-title
=
dashboard_feed_title
(
update
)
=
truncate
update
.
title
,
:length
=>
70
.right
=
update
.
project
.
name
%span
.update-author
%span
.update-author
%strong
=
update
.
author_name
%strong
=
update
.
author_name
authored
authored
=
time_ago_in_words
(
update
.
created_at
)
=
time_ago_in_words
(
update
.
created_at
)
ago
ago
.right
.right
-
klass
=
update
.
class
.
to_s
.
split
(
"::"
).
last
.
downcase
%span
.tag.commit
=
update
.
source_branch
%span
.tag
{
:class
=>
klass
}=
klass
→
%span
.tag.commit
=
update
.
target_branch
app/views/dashboard/_projects_feed.html.haml
View file @
cd779e56
#news-feed
.news-feed
%div
%div
=
link_to
dashboard_merge_requests_path
,
:remote
=>
true
,
:class
=>
"left"
,
:id
=>
"merge_requests_slide"
do
=
link_to
merge_requests_path
,
:class
=>
"left"
do
.box-arrow
.box-arrow
←
←
%h2
{
:style
=>
"width:86%; text-align:center"
}
%h2
{
:style
=>
"width:86%; text-align:center"
}
Activities
Activities
=
link_to
issues_path
,
:class
=>
"right
"
do
=
link_to
dashboard_issues_path
,
:remote
=>
true
,
:class
=>
"right"
,
:id
=>
"issues_slide
"
do
.box-arrow
.box-arrow
→
→
#feeds_content_holder
-
@active_projects
.
first
(
3
).
each
do
|
project
|
-
@active_projects
.
first
(
3
).
each
do
|
project
|
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
=
link_to
project
,
do
=
link_to
project
,
do
...
...
app/views/dashboard/_sidebar.html.haml
0 → 100644
View file @
cd779e56
%aside
%h4
-
if
current_user
.
can_create_project?
%a
.button-small.button-green
{
:href
=>
new_project_path
}
New Project
Your Projects
%ol
.project-list
-
@projects
.
each
do
|
project
|
%li
%a
{
:href
=>
project_path
(
project
)}
%span
.arrow
→
%span
.project-name
=
project
.
name
%span
.time
%strong
Last activity:
=
project
.
last_activity_date
?
time_ago_in_words
(
project
.
last_activity_date
)
+
" ago"
:
"Never"
app/views/dashboard/index.html.haml
View file @
cd779e56
-
content_for
(
:body_class
,
"dashboard-page"
)
-
content_for
(
:body_class
,
"dashboard-page"
)
#dashboard-content
.dashboard-content.content
#dashboard-content
.dashboard-content.content
%aside
=
render
"dashboard/sidebar"
%h4
#news-feed
.news-feed
=
render
"dashboard/projects_feed"
-
if
current_user
.
can_create_project?
%a
.button-small.button-green
{
:href
=>
new_project_path
}
New Project
Your Projects
%ol
.project-list
-
@projects
.
each
do
|
project
|
%li
%a
{
:href
=>
project_path
(
project
)}
%span
.arrow
→
%span
.project-name
=
project
.
name
%span
.time
%strong
Last activity:
=
project
.
last_activity_date
?
time_ago_in_words
(
project
.
last_activity_date
)
+
" ago"
:
"Never"
=
render
"dashboard/projects_feed"
app/views/dashboard/index.js.haml
0 → 100644
View file @
cd779e56
:plain
$("#feeds_content_holder").hide("slide", { direction: "left" }, 150, function(){
$("#news-feed").html("
#{
escape_javascript
(
render
(
:partial
=>
"projects_feed"
))
}
");
$("#feeds_content_holder").show("slide", { direction: "right" }, 150);
history.pushState({ path: this.path }, '', '
#{
dashboard_path
}
')
});
app/views/
user_issues/index
.atom.builder
→
app/views/
dashboard/issues
.atom.builder
View file @
cd779e56
xml.instruct!
xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
xml.title "#{@user.name} issues"
xml.title "#{@user.name} issues"
xml.link :href => issues_url(:atom, :private_token => @user.private_token), :rel => "self", :type => "application/atom+xml"
xml.link :href =>
dashboard_
issues_url(:atom, :private_token => @user.private_token), :rel => "self", :type => "application/atom+xml"
xml.link :href => issues_url(:private_token => @user.private_token), :rel => "alternate", :type => "text/html"
xml.link :href =>
dashboard_
issues_url(:private_token => @user.private_token), :rel => "alternate", :type => "text/html"
xml.id issues_url(:private_token => @user.private_token)
xml.id
dashboard_
issues_url(:private_token => @user.private_token)
xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any?
xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any?
@issues.each do |issue|
@issues.each do |issue|
...
...
app/views/dashboard/issues.html.haml
0 → 100644
View file @
cd779e56
-
content_for
(
:body_class
,
"dashboard-page"
)
#dashboard-content
.dashboard-content.content
=
render
"dashboard/sidebar"
#news-feed
.news-feed
=
render
"dashboard/issues_feed"
app/views/dashboard/issues.js.haml
0 → 100644
View file @
cd779e56
:plain
$("#feeds_content_holder").hide("slide", { direction: "left" }, 150, function(){
$("#news-feed").html("
#{
escape_javascript
(
render
(
:partial
=>
"issues_feed"
))
}
");
$("#feeds_content_holder").show("slide", { direction: "right" }, 150);
history.pushState({ path: this.path }, '', '
#{
dashboard_issues_path
}
')
});
app/views/dashboard/merge_requests.html.haml
0 → 100644
View file @
cd779e56
-
content_for
(
:body_class
,
"dashboard-page"
)
#dashboard-content
.dashboard-content.content
=
render
"dashboard/sidebar"
#news-feed
.news-feed
=
render
"dashboard/merge_requests_feed"
app/views/dashboard/merge_requests.js.haml
0 → 100644
View file @
cd779e56
:plain
$("#feeds_content_holder").hide("slide", { direction: "left" }, 150, function(){
$("#news-feed").html("
#{
escape_javascript
(
render
(
:partial
=>
"merge_requests_feed"
))
}
");
$("#feeds_content_holder").show("slide", { direction: "right" }, 150);
history.pushState({ path: this.path }, '', '
#{
dashboard_merge_requests_path
}
')
});
app/views/merge_requests/_merge_request.html.haml
View file @
cd779e56
...
@@ -3,9 +3,6 @@
...
@@ -3,9 +3,6 @@
%span
.update-title
%span
.update-title
=
merge_request
.
title
=
merge_request
.
title
%span
.update-author
%span
.update-author
-
if
not
@project
.
present?
%strong
=
merge_request
.
project
.
name
=
'-'
%strong
=
merge_request
.
author_name
%strong
=
merge_request
.
author_name
authored
authored
=
time_ago_in_words
(
merge_request
.
created_at
)
=
time_ago_in_words
(
merge_request
.
created_at
)
...
...
app/views/user_issues/index.html.haml
deleted
100644 → 0
View file @
4107f2cc
-
content_for
(
:body_class
,
"dashboard-page"
)
#dashboard-content
.dashboard-content.content
%aside
%h4
-
if
current_user
.
can_create_project?
%a
.button-small.button-green
{
:href
=>
new_project_path
}
New Project
Your Projects
%ol
.project-list
-
@projects
.
each
do
|
project
|
%li
%a
{
:href
=>
project_path
(
project
)}
%span
.arrow
→
%span
.project-name
=
project
.
name
%span
.time
%strong
Last activity:
=
project
.
last_activity_date
?
time_ago_in_words
(
project
.
last_activity_date
)
+
" ago"
:
"Never"
=
render
"dashboard/issues_feed"
app/views/user_merge_requests/index.html.haml
deleted
100644 → 0
View file @
4107f2cc
-
content_for
(
:body_class
,
"dashboard-page"
)
#dashboard-content
.dashboard-content.content
%aside
%h4
-
if
current_user
.
can_create_project?
%a
.button-small.button-green
{
:href
=>
new_project_path
}
New Project
Your Projects
%ol
.project-list
-
@projects
.
each
do
|
project
|
%li
%a
{
:href
=>
project_path
(
project
)}
%span
.arrow
→
%span
.project-name
=
project
.
name
%span
.time
%strong
Last activity:
=
project
.
last_activity_date
?
time_ago_in_words
(
project
.
last_activity_date
)
+
" ago"
:
"Never"
=
render
"dashboard/merge_requests_feed"
config/routes.rb
View file @
cd779e56
Gitlab
::
Application
.
routes
.
draw
do
Gitlab
::
Application
.
routes
.
draw
do
get
"user_issues/index"
get
'tags'
=>
'tags#index'
get
'tags'
=>
'tags#index'
get
'tags/:tag'
=>
'projects#index'
get
'tags/:tag'
=>
'projects#index'
...
@@ -22,9 +21,10 @@ Gitlab::Application.routes.draw do
...
@@ -22,9 +21,10 @@ Gitlab::Application.routes.draw do
put
"profile/reset_private_token"
,
:to
=>
"profile#reset_private_token"
put
"profile/reset_private_token"
,
:to
=>
"profile#reset_private_token"
put
"profile/edit"
,
:to
=>
"profile#social_update"
put
"profile/edit"
,
:to
=>
"profile#social_update"
get
"profile"
,
:to
=>
"profile#show"
get
"profile"
,
:to
=>
"profile#show"
get
"dashboard"
,
:to
=>
"dashboard#index"
get
"dashboard"
,
:to
=>
"dashboard#index"
get
"
issues"
,
:to
=>
"user_issues#index"
,
:as
=>
"
issues"
get
"
dashboard/issues"
,
:to
=>
"dashboard#
issues"
get
"
merge_requests"
,
:to
=>
"user_merge_requests#index"
,
:as
=>
"
merge_requests"
get
"
dashboard/merge_requests"
,
:to
=>
"dashboard#
merge_requests"
#get "profile/:id", :to => "profile#show"
#get "profile/:id", :to => "profile#show"
...
...
spec/requests/
user
_issues_spec.rb
→
spec/requests/
dashboard
_issues_spec.rb
View file @
cd779e56
require
'spec_helper'
require
'spec_helper'
describe
"User Issues Dashboard"
do
describe
"User Issues Dashboard"
,
:js
=>
true
do
describe
"GET /issues"
do
describe
"GET /issues"
do
before
do
before
do
...
@@ -27,22 +27,24 @@ describe "User Issues Dashboard" do
...
@@ -27,22 +27,24 @@ describe "User Issues Dashboard" do
:assignee
=>
@user
,
:assignee
=>
@user
,
:project
=>
@project2
:project
=>
@project2
visit
issues_path
visit
dashboard_path
click_link
"issues_slide"
end
end
subject
{
page
}
subject
{
page
}
it
{
should
have_content
(
@issue1
.
title
)
}
it
{
should
have_content
(
@issue1
.
title
[
0
..
10
]
)
}
it
{
should
have_content
(
@issue1
.
project
.
name
)
}
it
{
should
have_content
(
@issue1
.
project
.
name
)
}
it
{
should
have_content
(
@issue1
.
assignee
.
name
)
}
it
{
should
have_content
(
@issue1
.
assignee
.
name
)
}
it
{
should
have_content
(
@issue2
.
title
)
}
it
{
should
have_content
(
@issue2
.
title
[
0
..
10
]
)
}
it
{
should
have_content
(
@issue2
.
project
.
name
)
}
it
{
should
have_content
(
@issue2
.
project
.
name
)
}
it
{
should
have_content
(
@issue2
.
assignee
.
name
)
}
it
{
should
have_content
(
@issue2
.
assignee
.
name
)
}
describe
"atom feed"
,
:js
=>
false
do
it
"should render atom feed via private token"
do
it
"should render atom feed via private token"
do
logout
logout
visit
issues_path
(
:atom
,
:private_token
=>
@user
.
private_token
)
visit
dashboard_
issues_path
(
:atom
,
:private_token
=>
@user
.
private_token
)
page
.
response_headers
[
'Content-Type'
].
should
have_content
(
"application/atom+xml"
)
page
.
response_headers
[
'Content-Type'
].
should
have_content
(
"application/atom+xml"
)
page
.
body
.
should
have_selector
(
"title"
,
:text
=>
"
#{
@user
.
name
}
issues"
)
page
.
body
.
should
have_selector
(
"title"
,
:text
=>
"
#{
@user
.
name
}
issues"
)
...
@@ -52,4 +54,5 @@ describe "User Issues Dashboard" do
...
@@ -52,4 +54,5 @@ describe "User Issues Dashboard" do
page
.
body
.
should
have_selector
(
"entry summary"
,
:text
=>
@issue2
.
title
)
page
.
body
.
should
have_selector
(
"entry summary"
,
:text
=>
@issue2
.
title
)
end
end
end
end
end
end
end
spec/requests/
user
_merge_requests_spec.rb
→
spec/requests/
dashboard
_merge_requests_spec.rb
View file @
cd779e56
require
'spec_helper'
require
'spec_helper'
describe
"User MergeRequests"
do
describe
"User MergeRequests"
,
:js
=>
true
do
describe
"GET /issues"
do
describe
"GET /issues"
do
before
do
before
do
...
@@ -27,7 +27,8 @@ describe "User MergeRequests" do
...
@@ -27,7 +27,8 @@ describe "User MergeRequests" do
:assignee
=>
@user
,
:assignee
=>
@user
,
:project
=>
@project2
:project
=>
@project2
visit
merge_requests_path
visit
dashboard_path
click_link
"merge_requests_slide"
end
end
subject
{
page
}
subject
{
page
}
...
...
spec/requests/issues_spec.rb
View file @
cd779e56
...
@@ -23,7 +23,7 @@ describe "Issues" do
...
@@ -23,7 +23,7 @@ describe "Issues" do
subject
{
page
}
subject
{
page
}
it
{
should
have_content
(
@issue
.
title
)
}
it
{
should
have_content
(
@issue
.
title
[
0
..
20
]
)
}
it
{
should
have_content
(
@issue
.
project
.
name
)
}
it
{
should
have_content
(
@issue
.
project
.
name
)
}
it
{
should
have_content
(
@issue
.
assignee
.
name
)
}
it
{
should
have_content
(
@issue
.
assignee
.
name
)
}
...
...
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