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:
authorDenys Mishunov <dmishunov@gitlab.com>2019-07-24 16:31:26 +0300
committerDenys Mishunov <dmishunov@gitlab.com>2019-08-07 12:57:38 +0300
commit5b5fc580f38174154af314b2e4c41f0c5d8c8b38 (patch)
tree4793b03800b46cd44ac165ee483badb83886c847 /app/views/search
parent4bb8a4e3d3cd74e6e7a40c5e7805dd3670fdfc37 (diff)
Properly labelling fields on Search page
Adding proper <label>s while removing labels from the fields themselves. This gives more space for the field's content
Diffstat (limited to 'app/views/search')
-rw-r--r--app/views/search/_filter.html.haml10
-rw-r--r--app/views/search/_form.html.haml22
2 files changed, 19 insertions, 13 deletions
diff --git a/app/views/search/_filter.html.haml b/app/views/search/_filter.html.haml
index c8b6a3258ab..6495eaedee7 100644
--- a/app/views/search/_filter.html.haml
+++ b/app/views/search/_filter.html.haml
@@ -3,9 +3,10 @@
- if params[:project_id].present?
= hidden_field_tag :project_id, params[:project_id]
.dropdown
- %button.dropdown-menu-toggle.js-search-group-dropdown{ type: "button", data: { toggle: "dropdown", default_label: _('Group:'), group_id: params[:group_id] } }
+ %label{ for: "dashboard_search_group" }
+ = _("Group")
+ %button.form-control.dropdown-menu-toggle.js-search-group-dropdown{ type: "button", id: "dashboard_search_group", data: { toggle: "dropdown", group_id: params[:group_id] } }
%span.dropdown-toggle-text
- = _("Group:")
- if @group.present?
= @group.name
- else
@@ -18,9 +19,10 @@
= dropdown_loading
.dropdown.project-filter
- %button.dropdown-menu-toggle.js-search-project-dropdown{ type: "button", data: { toggle: "dropdown", default_label: _('Project:') } }
+ %label{ for: "dashboard_search_project" }
+ = _("Project")
+ %button.form-control.dropdown-menu-toggle.js-search-project-dropdown{ type: "button", id: "dashboard_search_project", data: { toggle: "dropdown"} }
%span.dropdown-toggle-text
- = _("Project:")
- if @project.present?
= @project.full_name
- else
diff --git a/app/views/search/_form.html.haml b/app/views/search/_form.html.haml
index db0dcc8adfb..46756390538 100644
--- a/app/views/search/_form.html.haml
+++ b/app/views/search/_form.html.haml
@@ -3,14 +3,18 @@
= hidden_field_tag :scope, params[:scope]
.search-holder
- .search-field-holder
- = search_field_tag :search, params[:search], placeholder: _("Search for projects, issues, etc."), class: "form-control search-text-input js-search-input", id: "dashboard_search", autofocus: true, spellcheck: false
- = icon("search", class: "search-icon")
- %button.search-clear.js-search-clear{ class: ("hidden" if !params[:search].present?), type: "button", tabindex: "-1" }
- = icon("times-circle")
- %span.sr-only
- = _("Clear search")
+ .search-field-holder.form-group
+ %label{ for: "dashboard_search" }
+ = _("What are you searching for?")
+ .position-relative
+ = search_field_tag :search, params[:search], placeholder: _("Search for projects, issues, etc."), class: "form-control search-text-input js-search-input", id: "dashboard_search", autofocus: true, spellcheck: false
+ = icon("search", class: "search-icon")
+ %button.search-clear.js-search-clear{ class: ("hidden" if !params[:search].present?), type: "button", tabindex: "-1" }
+ = icon("times-circle")
+ %span.sr-only
+ = _("Clear search")
- unless params[:snippets].eql? 'true'
= render 'filter'
- = button_tag _("Search"), class: "btn btn-success btn-search"
- = render_if_exists 'search/form_elasticsearch'
+ .d-flex-center.flex-column.flex-lg-row
+ = button_tag _("Search"), class: "btn btn-success btn-search form-control"
+ = render_if_exists 'search/form_elasticsearch'