Commit 7f76d6cfee7f95e6d89691431540e8d948ca60ec
1 parent
5d2bd5ec
Exists in
master
and in
4 other branches
counters for dashboard panel
Showing
4 changed files
with
23 additions
and
3 deletions
Show diff stats
app/assets/stylesheets/common.scss
@@ -43,6 +43,18 @@ a:focus { | @@ -43,6 +43,18 @@ a:focus { | ||
43 | background-color: #474D57; | 43 | background-color: #474D57; |
44 | } | 44 | } |
45 | 45 | ||
46 | +.pretty_label { | ||
47 | + @include round-borders-all(4px); | ||
48 | + padding:2px 4px; | ||
49 | + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8)); | ||
50 | + background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8); | ||
51 | + background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8); | ||
52 | + background-image: -o-linear-gradient(#fefefe 7.6%, #F6F7F8); | ||
53 | + color: #777; | ||
54 | + border: 1px solid #DEDFE1; | ||
55 | + | ||
56 | +} | ||
57 | + | ||
46 | .tabs > li > a, .pills > li > a { | 58 | .tabs > li > a, .pills > li > a { |
47 | color:$style_color; | 59 | color:$style_color; |
48 | } | 60 | } |
app/controllers/dashboard_controller.rb
@@ -18,7 +18,7 @@ class DashboardController < ApplicationController | @@ -18,7 +18,7 @@ class DashboardController < ApplicationController | ||
18 | # Get authored or assigned open merge requests | 18 | # Get authored or assigned open merge requests |
19 | def merge_requests | 19 | def merge_requests |
20 | @projects = current_user.projects.all | 20 | @projects = current_user.projects.all |
21 | - @merge_requests = MergeRequest.where("author_id = :id or assignee_id = :id", :id => current_user.id).opened.order("created_at DESC").limit(40) | 21 | + @merge_requests = current_user.cared_merge_requests.order("created_at DESC").limit(40) |
22 | end | 22 | end |
23 | 23 | ||
24 | # Get only assigned issues | 24 | # Get only assigned issues |
app/models/user.rb
@@ -86,6 +86,10 @@ class User < ActiveRecord::Base | @@ -86,6 +86,10 @@ class User < ActiveRecord::Base | ||
86 | ) | 86 | ) |
87 | end | 87 | end |
88 | end | 88 | end |
89 | + | ||
90 | + def cared_merge_requests | ||
91 | + MergeRequest.where("author_id = :id or assignee_id = :id", :id => self.id).opened | ||
92 | + end | ||
89 | end | 93 | end |
90 | # == Schema Information | 94 | # == Schema Information |
91 | # | 95 | # |
app/views/layouts/_app_menu.html.haml
@@ -2,6 +2,10 @@ | @@ -2,6 +2,10 @@ | ||
2 | = render "layouts/const_menu_links" | 2 | = render "layouts/const_menu_links" |
3 | = link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path)}" | 3 | = link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path)}" |
4 | = link_to "Search", search_path, :class => "#{"current" if current_page?(search_path)}" | 4 | = link_to "Search", search_path, :class => "#{"current" if current_page?(search_path)}" |
5 | - = link_to "Issues", dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" | ||
6 | - = link_to "Requests", dashboard_merge_requests_path, :class => "#{"current" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" | 5 | + = link_to dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" do |
6 | + Issues | ||
7 | + %span.count= current_user.assigned_issues.opened.count | ||
8 | + = link_to dashboard_merge_requests_path, :class => "#{"current" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" do | ||
9 | + Requests | ||
10 | + %span.count= current_user.cared_merge_requests.count | ||
7 | = link_to "Help", help_path, :class => "#{"current" if controller.controller_name == "help"}" | 11 | = link_to "Help", help_path, :class => "#{"current" if controller.controller_name == "help"}" |