diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 9609733c..e998b7bb 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -43,6 +43,18 @@ a:focus { background-color: #474D57; } +.pretty_label { + @include round-borders-all(4px); + padding:2px 4px; + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); + background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); + background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); + background-image: -o-linear-gradient(#fefefe 7.6%, #F6F7F8); + color: #777; + border: 1px solid #DEDFE1; + +} + .tabs > li > a, .pills > li > a { color:$style_color; } diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 8fa41298..f6b09e23 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -18,7 +18,7 @@ class DashboardController < ApplicationController # Get authored or assigned open merge requests def merge_requests @projects = current_user.projects.all - @merge_requests = MergeRequest.where("author_id = :id or assignee_id = :id", :id => current_user.id).opened.order("created_at DESC").limit(40) + @merge_requests = current_user.cared_merge_requests.order("created_at DESC").limit(40) end # Get only assigned issues diff --git a/app/models/user.rb b/app/models/user.rb index 660e5a21..5caa7451 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -86,6 +86,10 @@ class User < ActiveRecord::Base ) end end + + def cared_merge_requests + MergeRequest.where("author_id = :id or assignee_id = :id", :id => self.id).opened + end end # == Schema Information # diff --git a/app/views/layouts/_app_menu.html.haml b/app/views/layouts/_app_menu.html.haml index 60ff4854..e6a6ebf0 100644 --- a/app/views/layouts/_app_menu.html.haml +++ b/app/views/layouts/_app_menu.html.haml @@ -2,6 +2,10 @@ = render "layouts/const_menu_links" = link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path)}" = link_to "Search", search_path, :class => "#{"current" if current_page?(search_path)}" - = link_to "Issues", dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" - = link_to "Requests", dashboard_merge_requests_path, :class => "#{"current" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" + = link_to dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" do + Issues + %span.count= current_user.assigned_issues.opened.count + = link_to dashboard_merge_requests_path, :class => "#{"current" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" do + Requests + %span.count= current_user.cared_merge_requests.count = link_to "Help", help_path, :class => "#{"current" if controller.controller_name == "help"}"