Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEzekiel Kigbo <ekigbo@gitlab.com>2019-04-17 14:02:34 +0300
committerEzekiel Kigbo <ekigbo@gitlab.com>2019-05-06 18:42:43 +0300
commitb736a9f000d1e1f6c2c94ea74a700abf5a44139e (patch)
treef24f71c49402bb77cd4a03dcd0a0566cb63d6f58 /app/views/dashboard
parent5f22907418397861d9b07cbaeea05ef7264d5605 (diff)
Minor review fixes
Externalize strings Simplify locals passed through views Ensure we can still filter when logged out Cleanup conditional rendering for explore filters
Diffstat (limited to 'app/views/dashboard')
-rw-r--r--app/views/dashboard/_projects_head.html.haml6
-rw-r--r--app/views/dashboard/projects/_nav.html.haml7
-rw-r--r--app/views/dashboard/projects/starred.html.haml3
3 files changed, 6 insertions, 10 deletions
diff --git a/app/views/dashboard/_projects_head.html.haml b/app/views/dashboard/_projects_head.html.haml
index e62ec3afd0b..128a766374e 100644
--- a/app/views/dashboard/_projects_head.html.haml
+++ b/app/views/dashboard/_projects_head.html.haml
@@ -1,6 +1,4 @@
-- is_explore = local_assigns.fetch(:is_explore, false)
-- is_explore_trending = local_assigns.fetch(:is_explore_trending, false)
-- without_tabs = local_assigns.fetch(:without_tabs, false)
+- project_tab_filter = local_assigns.fetch(:project_tab_filter, "")
- feature_project_list_filter_bar = Feature.enabled?(:project_list_filter_bar)
= content_for :flash_message do
= render 'shared/project_limit'
@@ -33,4 +31,4 @@
= render 'shared/projects/dropdown'
- if feature_project_list_filter_bar
.project-filters
- = render 'shared/projects/search_bar', is_explore: is_explore, is_explore_trending: is_explore_trending, without_tabs: without_tabs
+ = render 'shared/projects/search_bar', project_tab_filter: project_tab_filter
diff --git a/app/views/dashboard/projects/_nav.html.haml b/app/views/dashboard/projects/_nav.html.haml
index b01e6c4293c..2da24e37c86 100644
--- a/app/views/dashboard/projects/_nav.html.haml
+++ b/app/views/dashboard/projects/_nav.html.haml
@@ -1,8 +1,7 @@
-
-- is_explore = local_assigns.fetch(:is_explore, false)
- inactive_class = 'btn p-2'
- active_class = 'btn p-2 active'
-- is_explore_trending = local_assigns.fetch(:is_explore_trending, false)
+- project_tab_filter = local_assigns.fetch(:project_tab_filter, "")
+- is_explore_trending = project_tab_filter == :explore_trending
.nav-block{ class: Feature.enabled?(:project_list_filter_bar) ? "w-100" : "" }
- if !Feature.enabled?(:project_list_filter_bar)
%ul.nav-links.mobile-separator.nav.nav-tabs
@@ -12,7 +11,7 @@
= link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true)
- else
.btn-group.button-filter-group.d-flex.m-0.p-0
- - if is_explore
+ - if project_tab_filter == :explore || is_explore_trending
= link_to s_('DashboardProjects|Trending'), trending_explore_projects_path, class: is_explore_trending ? active_class : inactive_class
= link_to s_('DashboardProjects|All'), explore_projects_path, class: is_explore_trending ? inactive_class : active_class
- else
diff --git a/app/views/dashboard/projects/starred.html.haml b/app/views/dashboard/projects/starred.html.haml
index a9075e462db..0fcc6894b68 100644
--- a/app/views/dashboard/projects/starred.html.haml
+++ b/app/views/dashboard/projects/starred.html.haml
@@ -3,13 +3,12 @@
- breadcrumb_title _("Projects")
- page_title _("Starred Projects")
- header_title _("Projects"), dashboard_projects_path
-- without_tabs = true
= render_dashboard_gold_trial(current_user)
%div{ class: container_class }
= render "projects/last_push"
- = render 'dashboard/projects_head', without_tabs: without_tabs
+ = render 'dashboard/projects_head', project_tab_filter: :starred
- if params[:filter_projects] || any_projects?(@projects)
= render 'projects'