counters for dashboard panel
This commit is contained in:
parent
5d2bd5ec3a
commit
7f76d6cfee
4 changed files with 23 additions and 3 deletions
|
@ -43,6 +43,18 @@ a:focus {
|
||||||
background-color: #474D57;
|
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 {
|
.tabs > li > a, .pills > li > a {
|
||||||
color:$style_color;
|
color:$style_color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ class DashboardController < ApplicationController
|
||||||
# Get authored or assigned open merge requests
|
# Get authored or assigned open merge requests
|
||||||
def merge_requests
|
def merge_requests
|
||||||
@projects = current_user.projects.all
|
@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
|
end
|
||||||
|
|
||||||
# Get only assigned issues
|
# Get only assigned issues
|
||||||
|
|
|
@ -86,6 +86,10 @@ class User < ActiveRecord::Base
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cared_merge_requests
|
||||||
|
MergeRequest.where("author_id = :id or assignee_id = :id", :id => self.id).opened
|
||||||
|
end
|
||||||
end
|
end
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
= render "layouts/const_menu_links"
|
= render "layouts/const_menu_links"
|
||||||
= link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path)}"
|
= 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 "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 dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" do
|
||||||
= link_to "Requests", dashboard_merge_requests_path, :class => "#{"current" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide"
|
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"}"
|
= link_to "Help", help_path, :class => "#{"current" if controller.controller_name == "help"}"
|
||||||
|
|
Loading…
Reference in a new issue