Fix bug getting started message when navigate to personal projects w/o them exist
This commit is contained in:
parent
87e0429fb1
commit
7f6bbf06f8
|
@ -7,6 +7,8 @@ class DashboardController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@groups = current_user.authorized_groups
|
@groups = current_user.authorized_groups
|
||||||
|
|
||||||
|
@has_authorized_projects = @projects.count > 0
|
||||||
|
|
||||||
@projects = case params[:scope]
|
@projects = case params[:scope]
|
||||||
when 'personal' then
|
when 'personal' then
|
||||||
@projects.personal(current_user)
|
@projects.personal(current_user)
|
||||||
|
|
13
app/views/dashboard/_activities.html.haml
Normal file
13
app/views/dashboard/_activities.html.haml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
= render "events/event_last_push", event: @last_push
|
||||||
|
|
||||||
|
.event_filter
|
||||||
|
= event_filter_link EventFilter.push, 'Push events'
|
||||||
|
= event_filter_link EventFilter.merged, 'Merge events'
|
||||||
|
= event_filter_link EventFilter.comments, 'Comments'
|
||||||
|
= event_filter_link EventFilter.team, 'Team'
|
||||||
|
|
||||||
|
- if @events.any?
|
||||||
|
.content_list= render @events
|
||||||
|
- else
|
||||||
|
%p.nothing_here_message Projects activity will be displayed here
|
||||||
|
.loading.hide
|
|
@ -30,4 +30,7 @@
|
||||||
%span.last_activity
|
%span.last_activity
|
||||||
%strong Last activity:
|
%strong Last activity:
|
||||||
%span= project_last_activity(project)
|
%span= project_last_activity(project)
|
||||||
|
- if projects.blank?
|
||||||
|
%li.wll
|
||||||
|
%h3.nothing_here_message There are no projects here.
|
||||||
.bottom= paginate projects, theme: "gitlab"
|
.bottom= paginate projects, theme: "gitlab"
|
||||||
|
|
14
app/views/dashboard/_sidebar.html.haml
Normal file
14
app/views/dashboard/_sidebar.html.haml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
- if @groups.present?
|
||||||
|
= render "groups", groups: @groups
|
||||||
|
= render "projects", projects: @projects
|
||||||
|
%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
|
||||||
|
|
||||||
|
%hr
|
||||||
|
.gitlab-promo
|
||||||
|
= link_to "Homepage", "http://gitlabhq.com"
|
||||||
|
= link_to "Blog", "http://blog.gitlabhq.com"
|
||||||
|
= link_to "@gitlabhq", "https://twitter.com/gitlabhq"
|
12
app/views/dashboard/_zero_authorized_projects.html.haml
Normal file
12
app/views/dashboard/_zero_authorized_projects.html.haml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
%h3.nothing_here_message
|
||||||
|
There are no projects you have access to.
|
||||||
|
%br
|
||||||
|
- if current_user.can_create_project?
|
||||||
|
You can create up to
|
||||||
|
= current_user.projects_limit
|
||||||
|
projects. Click on button below to add a new one
|
||||||
|
.link_holder
|
||||||
|
= link_to new_project_path, class: "btn primary" do
|
||||||
|
New Project »
|
||||||
|
- else
|
||||||
|
If you will be added to project - it will be displayed here
|
|
@ -1,50 +1,11 @@
|
||||||
- if @projects.any?
|
- if @has_authorized_projects
|
||||||
.projects
|
.projects
|
||||||
.activities.span8
|
.activities.span8
|
||||||
= render "events/event_last_push", event: @last_push
|
= render 'activities'
|
||||||
|
|
||||||
.event_filter
|
|
||||||
= event_filter_link EventFilter.push, 'Push events'
|
|
||||||
= event_filter_link EventFilter.merged, 'Merge events'
|
|
||||||
= event_filter_link EventFilter.comments, 'Comments'
|
|
||||||
= event_filter_link EventFilter.team, 'Team'
|
|
||||||
|
|
||||||
- if @events.any?
|
|
||||||
.content_list= render @events
|
|
||||||
- else
|
|
||||||
%p.nothing_here_message Projects activity will be displayed here
|
|
||||||
.loading.hide
|
|
||||||
.side
|
.side
|
||||||
- if @groups.present?
|
= render 'sidebar'
|
||||||
= render "groups", groups: @groups
|
|
||||||
= render "projects", projects: @projects
|
|
||||||
%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
|
|
||||||
|
|
||||||
%hr
|
|
||||||
.gitlab-promo
|
|
||||||
= link_to "Homepage", "http://gitlabhq.com"
|
|
||||||
= link_to "Blog", "http://blog.gitlabhq.com"
|
|
||||||
= link_to "@gitlabhq", "https://twitter.com/gitlabhq"
|
|
||||||
|
|
||||||
|
|
||||||
- else
|
- else
|
||||||
%h3.nothing_here_message There are no projects you have access to.
|
= render "zero_authorized_projects"
|
||||||
%br
|
|
||||||
%h4.nothing_here_message
|
|
||||||
- if current_user.can_create_project?
|
|
||||||
You can create up to
|
|
||||||
= current_user.projects_limit
|
|
||||||
projects. Click on button below to add a new one
|
|
||||||
.link_holder
|
|
||||||
= link_to new_project_path, class: "btn primary" do
|
|
||||||
New Project »
|
|
||||||
- else
|
|
||||||
If you will be added to project - it will be displayed here
|
|
||||||
|
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(function(){ Pager.init(20); });
|
$(function(){ Pager.init(20); });
|
||||||
|
|
Loading…
Reference in a new issue