summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorEzekiel Kigbo <ekigbo@gitlab.com>2019-04-19 10:36:16 +0200
committerEzekiel Kigbo <ekigbo@gitlab.com>2019-05-06 16:42:44 +0100
commit6accad69e214f44ac84f3ceac4159c712aa9af2e (patch)
tree5b07c67d5be2667a1187c13efb37424a6356af41 /app/views
parentb736a9f000d1e1f6c2c94ea74a700abf5a44139e (diff)
downloadgitlab-ce-6accad69e214f44ac84f3ceac4159c712aa9af2e.tar.gz
Added blank lines to meet style guide
Un-nest title variable output Update spec test names Rename sort_value_most_stars -> sort_value_stars_desc Rename sorted_by_stars -> sorted_by_stars_desc Renname sort_value_most_stars_asc -> sort_value_stars_asc Invert feature check, assign feature condition to a variable Inline conditional nav bar rendering Invert conditional label Added follow up task Fix filters returning 0 projects show the wrong view Move click action out of test expectation Use proper variable name for project in before block Rename projects_sort_admin_options_hash Renamed projects_sort_admin_options_has to old_projects_sort_options_hash as its not only used on the admin screen Fix extra whitespace errors Stub project_list_filter_bar in the projects_helper specs Added follow up task for `show_projects?` Removed url test expectations
Diffstat (limited to 'app/views')
-rw-r--r--app/views/dashboard/_projects_head.html.haml1
-rw-r--r--app/views/dashboard/projects/_nav.html.haml16
-rw-r--r--app/views/dashboard/projects/index.html.haml3
-rw-r--r--app/views/explore/projects/_filter.html.haml3
-rw-r--r--app/views/explore/projects/_nav.html.haml1
-rw-r--r--app/views/shared/projects/_search_bar.html.haml1
-rw-r--r--app/views/shared/projects/_sort_dropdown.html.haml5
7 files changed, 17 insertions, 13 deletions
diff --git a/app/views/dashboard/_projects_head.html.haml b/app/views/dashboard/_projects_head.html.haml
index 128a766374e..1d349572091 100644
--- a/app/views/dashboard/_projects_head.html.haml
+++ b/app/views/dashboard/_projects_head.html.haml
@@ -1,5 +1,6 @@
- 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'
diff --git a/app/views/dashboard/projects/_nav.html.haml b/app/views/dashboard/projects/_nav.html.haml
index 2da24e37c86..fdab2bde095 100644
--- a/app/views/dashboard/projects/_nav.html.haml
+++ b/app/views/dashboard/projects/_nav.html.haml
@@ -2,14 +2,10 @@
- active_class = 'btn p-2 active'
- project_tab_filter = local_assigns.fetch(:project_tab_filter, "")
- is_explore_trending = project_tab_filter == :explore_trending
+- feature_project_list_filter_bar = Feature.enabled?(:project_list_filter_bar)
+
.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
- = 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)
- - else
+ - if feature_project_list_filter_bar
.btn-group.button-filter-group.d-flex.m-0.p-0
- 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
@@ -17,3 +13,9 @@
- else
= link_to s_('DashboardProjects|All'), dashboard_projects_path, class: params[:personal].present? ? inactive_class : active_class
= link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true), class: params[:personal].present? ? active_class : inactive_class
+ - else
+ %ul.nav-links.mobile-separator.nav.nav-tabs
+ = 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 9d0a4219446..0298f539b4b 100644
--- a/app/views/dashboard/projects/index.html.haml
+++ b/app/views/dashboard/projects/index.html.haml
@@ -13,8 +13,7 @@
= render "projects/last_push"
- if show_projects?(@projects, params)
= render 'dashboard/projects_head'
- - unless Feature.enabled?(:project_list_filter_bar)
- = render 'nav'
+ = render 'nav' unless Feature.enabled?(:project_list_filter_bar)
= render 'projects'
- else
= render "zero_authorized_projects"
diff --git a/app/views/explore/projects/_filter.html.haml b/app/views/explore/projects/_filter.html.haml
index 4606f3ec674..ebc3f6b85ce 100644
--- a/app/views/explore/projects/_filter.html.haml
+++ b/app/views/explore/projects/_filter.html.haml
@@ -1,8 +1,9 @@
- 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' }
- - if !has_label
+ - unless has_label
= icon('globe', class: 'mt-1')
%span.light.ml-3= _("Visibility:")
- if params[:visibility_level].present?
diff --git a/app/views/explore/projects/_nav.html.haml b/app/views/explore/projects/_nav.html.haml
index 9ec2122d5a3..bf65c19b720 100644
--- a/app/views/explore/projects/_nav.html.haml
+++ b/app/views/explore/projects/_nav.html.haml
@@ -15,4 +15,3 @@
= render 'shared/projects/search_form'
= render 'shared/projects/dropdown'
= render 'filter'
-
diff --git a/app/views/shared/projects/_search_bar.html.haml b/app/views/shared/projects/_search_bar.html.haml
index e44d8692eea..0620cd86db7 100644
--- a/app/views/shared/projects/_search_bar.html.haml
+++ b/app/views/shared/projects/_search_bar.html.haml
@@ -1,5 +1,6 @@
- @sort ||= sort_value_latest_activity
- project_tab_filter = local_assigns.fetch(:project_tab_filter, "")
+
.filtered-search-block.row-content-block.bt-0
.filtered-search-wrapper.d-flex.flex-nowrap.flex-column.flex-sm-wrap.flex-sm-row.flex-xl-nowrap
- unless project_tab_filter == :starred
diff --git a/app/views/shared/projects/_sort_dropdown.html.haml b/app/views/shared/projects/_sort_dropdown.html.haml
index 65f175efcf7..0bb2eb371dc 100644
--- a/app/views/shared/projects/_sort_dropdown.html.haml
+++ b/app/views/shared/projects/_sort_dropdown.html.haml
@@ -1,5 +1,6 @@
- @sort ||= sort_value_latest_activity
- toggle_text = projects_sort_option_titles[@sort]
+
.btn-group.w-100{ role: "group" }
.btn-group.w-100.dropdown.js-project-filter-dropdown-wrap{ role: "group" }
%button.dropdown-menu-toggle{ id: 'sort-projects-dropdown', type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' }
@@ -10,8 +11,7 @@
= _("Sort by")
- projects_sort_options_hash.each do |value, title|
%li
- = link_to filter_projects_path(sort: value), class: ("is-active" if toggle_text == title) do
- = title
+ = link_to title, filter_projects_path(sort: value), class: ("is-active" if toggle_text == title)
%li.divider
%li
@@ -23,6 +23,7 @@
%li
= link_to filter_projects_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do
= _("Show archived projects only")
+
- if current_user && @group && @group.shared_projects.present?
%li.divider
%li