Dashboard refactoring:
* dashboard should be in dashboard controller not project index * projects index removed
This commit is contained in:
parent
9ef9c58f55
commit
edd81a79c5
15 changed files with 84 additions and 101 deletions
|
@ -659,6 +659,10 @@ li.note {
|
|||
width:24px;
|
||||
vertical-align:top;
|
||||
}
|
||||
|
||||
strong {
|
||||
line-height:24px;
|
||||
}
|
||||
}
|
||||
|
||||
.automerge_widget {
|
||||
|
@ -741,7 +745,7 @@ li.note {
|
|||
*/
|
||||
.event_lp {
|
||||
@extend .alert-info;
|
||||
margin-bottom:15px;
|
||||
margin-bottom:20px;
|
||||
padding:8px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
|
|
|
@ -2,18 +2,17 @@ class DashboardController < ApplicationController
|
|||
respond_to :html
|
||||
|
||||
def index
|
||||
@projects = current_user.projects.all
|
||||
@projects = current_user.projects.includes(:events).order("events.created_at DESC")
|
||||
@projects = @projects.page(params[:page]).per(40)
|
||||
|
||||
@active_projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
|
||||
@events = Event.where(:project_id => current_user.projects.map(&:id)).recent.limit(20)
|
||||
|
||||
@merge_requests = MergeRequest.where("author_id = :id or assignee_id = :id", :id => current_user.id).opened.order("created_at DESC").limit(5)
|
||||
@last_push = current_user.recent_push
|
||||
|
||||
@user = current_user
|
||||
@issues = current_user.assigned_issues.opened.order("created_at DESC").limit(5)
|
||||
@issues = @issues.includes(:author, :project)
|
||||
|
||||
@events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20)
|
||||
@last_push = Event.where(:project_id => @projects.map(&:id)).recent.code_push.limit(1).first
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.atom { render :layout => false }
|
||||
end
|
||||
end
|
||||
|
||||
# Get authored or assigned open merge requests
|
||||
|
|
|
@ -60,8 +60,9 @@ module ApplicationHelper
|
|||
def search_autocomplete_source
|
||||
projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } }
|
||||
default_nav = [
|
||||
{ :label => "Profile", :url => profile_path },
|
||||
{ :label => "Keys", :url => keys_path },
|
||||
{ :label => "Projects", :url => projects_path },
|
||||
{ :label => "Dashboard", :url => root_path },
|
||||
{ :label => "Admin", :url => admin_root_path }
|
||||
]
|
||||
|
||||
|
|
|
@ -34,6 +34,13 @@
|
|||
→
|
||||
.bottom= paginate @projects, :theme => "gitlab"
|
||||
|
||||
%hr
|
||||
%div
|
||||
%span.rss-icon
|
||||
= link_to dashboard_path(:atom, { :private_token => current_user.private_token }) do
|
||||
= image_tag "rss_ui.png", :title => "feed"
|
||||
%strong News Feed
|
||||
|
||||
- else
|
||||
%h3.nothing_here_message There are no projects you have access to.
|
||||
%br
|
2
app/views/dashboard/index.js.haml
Normal file
2
app/views/dashboard/index.js.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
:plain
|
||||
$(".projects .activities").append("#{escape_javascript(render(@events))}");
|
|
@ -1,5 +1,5 @@
|
|||
%nav.main_menu
|
||||
= link_to "Home", root_path, :class => "home #{"current" if current_page?(projects_path) || current_page?(root_path)}", :title => "Home"
|
||||
= link_to "Home", root_path, :class => "home #{"current" if current_page?(dashboard_path) || current_page?(root_path)}", :title => "Home"
|
||||
= 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
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
:plain
|
||||
Pager.append(#{@projects.count}, "#{escape_javascript(render(:partial => 'projects/tile'))}");
|
|
@ -2,10 +2,6 @@
|
|||
|
||||
.entry
|
||||
.row
|
||||
-#.span2
|
||||
.back_link
|
||||
= link_to projects_path do
|
||||
← To projects list
|
||||
.span7
|
||||
.form-horizontal
|
||||
.input-prepend
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue