summaryrefslogtreecommitdiff
path: root/app/views/shared
diff options
context:
space:
mode:
authorEzekiel Kigbo <ekigbo@gitlab.com>2019-04-12 14:14:28 +0200
committerEzekiel Kigbo <ekigbo@gitlab.com>2019-05-06 16:41:47 +0100
commitaebf22f639073ab4d5c0ff4970d60bf24e8879f0 (patch)
tree72f9b9c8f7f33990aab4410d746be2f267ad3f49 /app/views/shared
parentc1f5205d9123d7f497d56235b4330145ef80a652 (diff)
downloadgitlab-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/shared')
-rw-r--r--app/views/shared/projects/_dropdown.html.haml71
-rw-r--r--app/views/shared/projects/_search_bar.html.haml13
-rw-r--r--app/views/shared/projects/_sort_dropdown.html.haml38
3 files changed, 77 insertions, 45 deletions
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)