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/explore
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/explore')
-rw-r--r--app/views/explore/projects/_filter.html.haml2
-rw-r--r--app/views/explore/projects/_nav.html.haml4
-rw-r--r--app/views/explore/projects/index.html.haml5
-rw-r--r--app/views/explore/projects/starred.html.haml5
-rw-r--r--app/views/explore/projects/trending.html.haml5
5 files changed, 8 insertions, 13 deletions
diff --git a/app/views/explore/projects/_filter.html.haml b/app/views/explore/projects/_filter.html.haml
index bd21ba6cc71..4606f3ec674 100644
--- a/app/views/explore/projects/_filter.html.haml
+++ b/app/views/explore/projects/_filter.html.haml
@@ -1,4 +1,4 @@
-- has_label = local_assigns[:has_label] ? local_assigns[:has_label] : false
+- has_label = local_assigns.fetch(:has_label, false)
- if current_user
.dropdown.js-project-filter-dropdown-wrap
%button.dropdown-menu-toggle{ href: '#', "data-toggle" => "dropdown", 'data-display' => 'static' }
diff --git a/app/views/explore/projects/_nav.html.haml b/app/views/explore/projects/_nav.html.haml
index e4e8d4fc008..9ec2122d5a3 100644
--- a/app/views/explore/projects/_nav.html.haml
+++ b/app/views/explore/projects/_nav.html.haml
@@ -11,10 +11,8 @@
= _('All')
.nav-controls
- -# TODO: filters are currently only shown when logged out, I assume we want to show them all the time?
- unless current_user
= render 'shared/projects/search_form'
= render 'shared/projects/dropdown'
- - unless Feature.enabled?(:project_list_filter_bar)
- = render 'filter'
+ = render 'filter'
diff --git a/app/views/explore/projects/index.html.haml b/app/views/explore/projects/index.html.haml
index fed226a184c..341ad681c7c 100644
--- a/app/views/explore/projects/index.html.haml
+++ b/app/views/explore/projects/index.html.haml
@@ -5,10 +5,9 @@
= render_dashboard_gold_trial(current_user)
- if current_user
- = render 'dashboard/projects_head', is_explore: true
+ = render 'dashboard/projects_head', project_tab_filter: :explore
- else
= render 'explore/head'
-- unless Feature.enabled?(:project_list_filter_bar)
- = render 'explore/projects/nav'
+= render 'explore/projects/nav' unless Feature.enabled?(:project_list_filter_bar) && current_user
= render 'projects', projects: @projects
diff --git a/app/views/explore/projects/starred.html.haml b/app/views/explore/projects/starred.html.haml
index fed226a184c..ec92852ddde 100644
--- a/app/views/explore/projects/starred.html.haml
+++ b/app/views/explore/projects/starred.html.haml
@@ -5,10 +5,9 @@
= render_dashboard_gold_trial(current_user)
- if current_user
- = render 'dashboard/projects_head', is_explore: true
+ = render 'dashboard/projects_head', project_tab_filter: :starred
- else
= render 'explore/head'
-- unless Feature.enabled?(:project_list_filter_bar)
- = render 'explore/projects/nav'
+= render 'explore/projects/nav' unless Feature.enabled?(:project_list_filter_bar) && current_user
= render 'projects', projects: @projects
diff --git a/app/views/explore/projects/trending.html.haml b/app/views/explore/projects/trending.html.haml
index e4e612175f5..ed508fa2506 100644
--- a/app/views/explore/projects/trending.html.haml
+++ b/app/views/explore/projects/trending.html.haml
@@ -5,10 +5,9 @@
= render_dashboard_gold_trial(current_user)
- if current_user
- = render 'dashboard/projects_head', is_explore: true, is_explore_trending: true
+ = render 'dashboard/projects_head', project_tab_filter: :explore_trending
- else
= render 'explore/head'
-- unless Feature.enabled?(:project_list_filter_bar)
- = render 'explore/projects/nav'
+= render 'explore/projects/nav' unless Feature.enabled?(:project_list_filter_bar) && current_user
= render 'projects', projects: @projects