diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-09-25 10:32:56 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-09-25 10:32:56 +0000 |
commit | 0948d03190adac0f241dfbbd71fb52d13c1650af (patch) | |
tree | 0be6935b925fb1f5ce7f7902f37ae8ae551b5f36 /app | |
parent | 6c57d894688930de25521fa1e276c6c2990b6d7a (diff) | |
parent | 8eb2d741ad038a80759b8db94ad475ad86f46543 (diff) | |
download | gitlab-ce-0948d03190adac0f241dfbbd71fb52d13c1650af.tar.gz |
Merge branch 'project-page-clearer' into 'master'
Add context tabs to dashboard/projects
Closes #29045
See merge request gitlab-org/gitlab-ce!14364
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/projects_helper.rb | 4 | ||||
-rw-r--r-- | app/views/dashboard/projects/_nav.html.haml | 6 | ||||
-rw-r--r-- | app/views/dashboard/projects/index.html.haml | 3 |
3 files changed, 10 insertions, 3 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index ddeff490d3a..21fb17e06d6 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -239,8 +239,8 @@ module ProjectsHelper end end - def has_projects_or_name?(projects, params) - !!(params[:name] || any_projects?(projects)) + def show_projects?(projects, params) + !!(params[:personal] || params[:name] || any_projects?(projects)) end private diff --git a/app/views/dashboard/projects/_nav.html.haml b/app/views/dashboard/projects/_nav.html.haml new file mode 100644 index 00000000000..3701e1c0578 --- /dev/null +++ b/app/views/dashboard/projects/_nav.html.haml @@ -0,0 +1,6 @@ +.top-area + %ul.nav-links + = nav_link(html_options: { class: ("active" unless params[:personal].present?) }) do + = link_to s_('DashboardProjects|All'), dashboard_projects_path + = nav_link(html_options: { class: ("active" if params[:personal].present?) }) do + = link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true) diff --git a/app/views/dashboard/projects/index.html.haml b/app/views/dashboard/projects/index.html.haml index a4dc49d2120..57a4da353fe 100644 --- a/app/views/dashboard/projects/index.html.haml +++ b/app/views/dashboard/projects/index.html.haml @@ -10,8 +10,9 @@ = render "projects/last_push" %div{ class: container_class } - - if has_projects_or_name?(@projects, params) + - if show_projects?(@projects, params) = render 'dashboard/projects_head' + = render 'nav' = render 'projects' - else = render "zero_authorized_projects" |