diff options
author | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-04-12 14:14:28 +0200 |
---|---|---|
committer | Ezekiel Kigbo <ekigbo@gitlab.com> | 2019-05-06 16:41:47 +0100 |
commit | aebf22f639073ab4d5c0ff4970d60bf24e8879f0 (patch) | |
tree | 72f9b9c8f7f33990aab4410d746be2f267ad3f49 /app/views | |
parent | c1f5205d9123d7f497d56235b4330145ef80a652 (diff) | |
download | gitlab-ce-aebf22f639073ab4d5c0ff4970d60bf24e8879f0.tar.gz |
Ensure we dont apply changes to admin/projects
The changes introduced for the project filter bar should
not apply to the admin projects screen.
Remove "Owned by me", "Owned by anyone" options
Update the dropdown option Last created -> Created date.
Introduces fixes for spacing and minor styling across breakpoints.
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/dashboard/_projects_head.html.haml | 7 | ||||
-rw-r--r-- | app/views/explore/projects/_filter.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/projects/_dropdown.html.haml | 71 | ||||
-rw-r--r-- | app/views/shared/projects/_search_bar.html.haml | 13 | ||||
-rw-r--r-- | app/views/shared/projects/_sort_dropdown.html.haml | 38 |
5 files changed, 82 insertions, 49 deletions
diff --git a/app/views/dashboard/_projects_head.html.haml b/app/views/dashboard/_projects_head.html.haml index f52f4eec36a..e62ec3afd0b 100644 --- a/app/views/dashboard/_projects_head.html.haml +++ b/app/views/dashboard/_projects_head.html.haml @@ -1,6 +1,7 @@ - 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) +- feature_project_list_filter_bar = Feature.enabled?(:project_list_filter_bar) = content_for :flash_message do = render 'shared/project_limit' @@ -14,7 +15,7 @@ .top-area.scrolling-tabs-container.inner-page-scroll-tabs .fade-left= icon('angle-left') .fade-right= icon('angle-right') - %ul.nav-links.scrolling-tabs.mobile-separator.nav.nav-tabs.border-0 + %ul.nav-links.scrolling-tabs.mobile-separator.nav.nav-tabs{ class: feature_project_list_filter_bar ? "border-0" : "" } = nav_link(page: [dashboard_projects_path, root_path]) do = link_to dashboard_projects_path, class: 'shortcuts-activity', data: {placement: 'right'} do = _("Your projects") @@ -26,10 +27,10 @@ = nav_link(page: [explore_root_path, trending_explore_projects_path, starred_explore_projects_path, explore_projects_path]) do = link_to explore_root_path, data: {placement: 'right'} do = _("Explore projects") - - unless Feature.enabled?(:project_list_filter_bar) + - unless feature_project_list_filter_bar .nav-controls = render 'shared/projects/search_form' = render 'shared/projects/dropdown' -- if Feature.enabled?(:project_list_filter_bar) +- 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 diff --git a/app/views/explore/projects/_filter.html.haml b/app/views/explore/projects/_filter.html.haml index 5e321956f6e..bd21ba6cc71 100644 --- a/app/views/explore/projects/_filter.html.haml +++ b/app/views/explore/projects/_filter.html.haml @@ -1,6 +1,6 @@ - has_label = local_assigns[:has_label] ? local_assigns[:has_label] : false - if current_user - .dropdown + .dropdown.js-project-filter-dropdown-wrap %button.dropdown-menu-toggle{ href: '#', "data-toggle" => "dropdown", 'data-display' => 'static' } - if !has_label = icon('globe', class: 'mt-1') diff --git a/app/views/shared/projects/_dropdown.html.haml b/app/views/shared/projects/_dropdown.html.haml index 4cecfd16bc1..98b258d9275 100644 --- a/app/views/shared/projects/_dropdown.html.haml +++ b/app/views/shared/projects/_dropdown.html.haml @@ -1,46 +1,41 @@ - @sort ||= sort_value_latest_activity -.btn-group{ role: "group" } - .btn-group.dropdown.js-project-filter-dropdown-wrap.filter-with-icon{ role: "group" } - - toggle_text = projects_sort_option_titles[@sort] - %button.dropdown-menu-toggle{ id: 'sort-projects-dropdown', type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' } - = toggle_text - = icon('chevron-down') - %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable - %li.dropdown-header - Sort by - - projects_sort_options_hash.each do |value, title| - %li - = link_to filter_projects_path(sort: value), class: ("is-active" if projects_sort_option_titles[@sort] == title) do - = title +.dropdown.js-project-filter-dropdown-wrap + - toggle_text = projects_sort_options_hash[@sort] + = dropdown_toggle(toggle_text, { toggle: 'dropdown', display: 'static' }, { id: 'sort-projects-dropdown' }) + %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable + %li.dropdown-header + Sort by + - projects_sort_options_hash.each do |value, title| + %li + = link_to filter_projects_path(sort: value), class: ("is-active" if @sort == value) do + = title + %li.divider + %li + = link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do + Hide archived projects + %li + = link_to filter_projects_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do + Show archived projects + %li + = link_to filter_projects_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do + Show archived projects only + - if current_user %li.divider %li - = link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do - Hide archived projects - %li - = link_to filter_projects_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do - Show archived projects + = link_to filter_projects_path(personal: nil), class: ("is-active" unless params[:personal].present?) do + Owned by anyone %li - = link_to filter_projects_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do - Show archived projects only - - if current_user + = link_to filter_projects_path(personal: true), class: ("is-active" if params[:personal].present?) do + Owned by me + - if @group && @group.shared_projects.present? %li.divider %li - = link_to filter_projects_path(personal: nil), class: ("is-active" unless params[:personal].present?) do - Owned by anyone + = link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do + All projects %li - = link_to filter_projects_path(personal: true), class: ("is-active" if params[:personal].present?) do - Owned by me - - if @group && @group.shared_projects.present? - %li.divider - %li - = link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do - All projects - %li - = link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do - Hide shared projects - %li - = link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do - Hide group projects - - = project_sort_direction_button(@sort) + = link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do + Hide shared projects + %li + = link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do + Hide group projects diff --git a/app/views/shared/projects/_search_bar.html.haml b/app/views/shared/projects/_search_bar.html.haml index 7941a0b9173..8c5dd25bee8 100644 --- a/app/views/shared/projects/_search_bar.html.haml +++ b/app/views/shared/projects/_search_bar.html.haml @@ -3,29 +3,28 @@ - is_explore_trending = local_assigns.fetch(:is_explore_trending, false) - without_tabs = local_assigns.fetch(:without_tabs, false) .filtered-search-block.row-content-block - .filtered-search-wrapper.d-flex.mt-2.mt-lg-0 + .filtered-search-wrapper.d-flex - unless without_tabs .filtered-search-nav = render 'dashboard/projects/nav', is_explore: is_explore, is_explore_trending: is_explore_trending - .filtered-search.field-with-icon + .filtered-search{ class: without_tabs ? "extended-filtered-search-box" : "" } .btn-group{ role: "group" } .btn-group{ role: "group" } - .filtered-search-box{ class: without_tabs ? "extended-filtered-search-box" : "" } + .filtered-search-box .filtered-search-box-input-container.pl-2 = render 'shared/projects/search_form', admin_view: false, search_form_placeholder: _("Search projects...") -# TODO: since we are no longer triggering search when we type - -# we might be able to remove the `js-projects-list-filter` + -# we might be able to safely remove app/assets/javascripts/projects_list.js %button.btn.btn-secondary{ type: 'submit', form: 'project-filter-form' } = sprite_icon('search', size: 16, css_class: 'search-icon ') .filtered-search-dropdown .filtered-search-dropdown-label %span = _("Visibility") - .dropdown.js-project-filter-dropdown-wrap.inline-md - = render 'explore/projects/filter', has_label: true + = render 'explore/projects/filter', has_label: true .filtered-search-dropdown .filtered-search-dropdown-label %span = _("Sort by") - = render 'shared/projects/dropdown' + = render 'shared/projects/sort_dropdown' diff --git a/app/views/shared/projects/_sort_dropdown.html.haml b/app/views/shared/projects/_sort_dropdown.html.haml new file mode 100644 index 00000000000..504ca772815 --- /dev/null +++ b/app/views/shared/projects/_sort_dropdown.html.haml @@ -0,0 +1,38 @@ +- @sort ||= sort_value_latest_activity +.btn-group{ role: "group" } + .btn-group.dropdown.js-project-filter-dropdown-wrap{ role: "group" } + - toggle_text = projects_sort_option_titles[@sort] + %button.dropdown-menu-toggle{ id: 'sort-projects-dropdown', type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' } + = toggle_text + = icon('chevron-down') + %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable + %li.dropdown-header + Sort by + - projects_sort_options_hash.each do |value, title| + %li + = link_to filter_projects_path(sort: value), class: ("is-active" if projects_sort_option_titles[@sort] == title) do + = title + + %li.divider + %li + = link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do + Hide archived projects + %li + = link_to filter_projects_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do + Show archived projects + %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 + = link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do + All projects + %li + = link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do + Hide shared projects + %li + = link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do + Hide group projects + + = project_sort_direction_button(@sort) |