summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-12-15 09:22:24 +0200
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-12-15 09:22:24 +0200
commit42c46f3720d86857ef256ad368226093f7768ecd (patch)
treeeb6a7dabb8a1043fc8c9df81c2542ad16ffe5a4c
parented3f3a0d4ded937b8c9864b006c15ce8148f35c1 (diff)
downloadgitlab-ce-42c46f3720d86857ef256ad368226093f7768ecd.tar.gz
Dashboard tabs restyle, messages if no issue or merge request
-rw-r--r--app/assets/stylesheets/projects.css.scss15
-rw-r--r--app/controllers/dashboard_controller.rb4
-rw-r--r--app/views/dashboard/_issues_feed.html.haml42
-rw-r--r--app/views/dashboard/_menu.html.haml6
-rw-r--r--app/views/dashboard/_merge_requests_feed.html.haml42
5 files changed, 65 insertions, 44 deletions
diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss
index f4e79dac334..5e3777d95eb 100644
--- a/app/assets/stylesheets/projects.css.scss
+++ b/app/assets/stylesheets/projects.css.scss
@@ -496,14 +496,23 @@ h4.dash-tabs {
font-weight: bold; text-transform: uppercase;
background: #F7F7F7;
margin-bottom:20px;
+ height:13px;
+
}
.dash-button {
- margin-right:5px;
- @include round-borders-all(4px);
- border: 1px solid #ddd;
+ border-right: 1px solid #ddd;
background:none;
+ padding: 10px 15px;
+ float:left;
+ position:relative;
+ top:-10px;
+ left:0px;
+ height:13px;
+ &:first-child {
+ border-left: 1px solid #ddd;
+ }
&.active {
background: #eaeaea;
}
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 7c5739936cd..959585adbd6 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -11,9 +11,10 @@ class DashboardController < ApplicationController
end
end
+ # Get authored or assigned open merge requests
def merge_requests
@projects = current_user.projects.all
- @merge_requests = current_user.assigned_merge_requests.order("created_at DESC").limit(40)
+ @merge_requests = MergeRequest.where("author_id = :id or assignee_id = :id", :id => current_user.id).opened.order("created_at DESC").limit(40)
respond_to do |format|
format.html
@@ -21,6 +22,7 @@ class DashboardController < ApplicationController
end
end
+ # Get only assigned issues
def issues
@projects = current_user.projects.all
@user = current_user
diff --git a/app/views/dashboard/_issues_feed.html.haml b/app/views/dashboard/_issues_feed.html.haml
index 528b7b03961..45892664df7 100644
--- a/app/views/dashboard/_issues_feed.html.haml
+++ b/app/views/dashboard/_issues_feed.html.haml
@@ -1,20 +1,26 @@
#feeds_content_holder
- .project-box.project-updates.ui-box.ui-box-small.ui-box-big
- .data
- - @issues.each do |update|
- %a.project-update{:href => dashboard_feed_path(update.project, update)}
- = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
- %span.update-title
- = truncate update.title, :length => 50
- .right= update.project.name
- %span.update-author
- %strong= update.author_name
- authored
- = time_ago_in_words(update.created_at)
- ago
- .right
- - if update.critical
- %span.tag.high critical
- - if update.today?
- %span.tag.today today
+ - unless @issues.empty?
+ .project-box.project-updates.ui-box.ui-box-small.ui-box-big
+ .data
+ - @issues.each do |update|
+ %a.project-update{:href => dashboard_feed_path(update.project, update)}
+ %strong.issue-number= "##{update.id}"
+ %span.update-title
+ = truncate update.title, :length => 35
+ .right= truncate update.project.name
+ %span.update-author
+ %strong= update.author_name
+ authored
+ = time_ago_in_words(update.created_at)
+ ago
+ .right
+ - if update.critical
+ %span.tag.high critical
+ - if update.today?
+ %span.tag.today today
+ - else
+ %h2
+ No assigned
+ %span.tag.open open
+ issues
diff --git a/app/views/dashboard/_menu.html.haml b/app/views/dashboard/_menu.html.haml
index 64ef12c5339..0fb11b6a906 100644
--- a/app/views/dashboard/_menu.html.haml
+++ b/app/views/dashboard/_menu.html.haml
@@ -1,7 +1,7 @@
%h4.dash-tabs
- = link_to "Activities", dashboard_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_path) || current_page?(root_path) }", :id => "activities_slide"
- = link_to "Issues", dashboard_issues_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide"
- = link_to "Merge Requests", dashboard_merge_requests_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide"
+ = link_to "Activities", dashboard_path, :remote => true, :class => "dash-button #{"active" if current_page?(dashboard_path) || current_page?(root_path) }", :id => "activities_slide"
+ = link_to "Issues", dashboard_issues_path, :remote => true, :class => "dash-button #{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide"
+ = link_to "Merge Requests", dashboard_merge_requests_path, :remote => true, :class => "dash-button #{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide"
= image_tag "ajax-loader-facebook.gif", :class => "dashboard-loader"
:javascript
diff --git a/app/views/dashboard/_merge_requests_feed.html.haml b/app/views/dashboard/_merge_requests_feed.html.haml
index 5448a7aa037..1f8553e4a70 100644
--- a/app/views/dashboard/_merge_requests_feed.html.haml
+++ b/app/views/dashboard/_merge_requests_feed.html.haml
@@ -1,20 +1,24 @@
#feeds_content_holder
- .project-box.project-updates.ui-box.ui-box-small.ui-box-big
- .data
- - @merge_requests.each do |update|
- %a.project-update{:href => project_merge_request_path(update.project, update)}
- = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
- %span.update-title
- - state = update.closed ? 'closed' : 'open'
- %span.tag{ :class => state } #{state.capitalize}
- = truncate update.title, :length => 70
- .right= update.project.name
- %span.update-author
- %strong= update.author_name
- authored
- = time_ago_in_words(update.created_at)
- ago
- .right
- %span.tag.commit= update.source_branch
- &rarr;
- %span.tag.commit= update.target_branch
+ - unless @merge_requests.empty?
+ .project-box.project-updates.ui-box.ui-box-small.ui-box-big
+ .data
+ - @merge_requests.each do |update|
+ %a.project-update{:href => project_merge_request_path(update.project, update)}
+ = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
+ %span.update-title
+ = truncate update.title, :length => 35
+ .right= truncate update.project.name
+ %span.update-author
+ %strong= update.author_name
+ authored
+ = time_ago_in_words(update.created_at)
+ ago
+ .right
+ %span.tag.commit= update.source_branch
+ &rarr;
+ %span.tag.commit= update.target_branch
+ - else
+ %h2
+ No authored or assigned
+ %span.tag.open open
+ merge requests