Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix search view on mobile

Krzysztof Białogłowicz9dcaf7dbaa59
diff --git a/saleor/static/scss/dashboard/dashboard.scss b/saleor/static/scss/dashboard/dashboard.scss
index 3159b56907..8242e6c16a 100644
--- a/saleor/static/scss/dashboard/dashboard.scss
+++ b/saleor/static/scss/dashboard/dashboard.scss
@@ -217,6 +217,30 @@ $roboto-font-path: "~materialize-css/fonts/roboto/";
}
}
+.search-form {
+ input {
+ border: none;
+ color: $primary-color;
+ margin-bottom: 0;
+ width: 75%;
+ padding-left: 5%;
+ &::placeholder {
+ color: $primary-color;
+ }
+ &:focus:not([readonly]), &.valid, &:focus.valid, {
+ border: none;
+ box-shadow: none;
+ }
+ }
+ button {
+ width: 20%;
+ padding: 0;
+ i {
+ color: $primary-color;
+ }
+ }
+}
+
html {
background: #f5f5f5;
@media only screen and (min-width: 0) {
diff --git a/templates/dashboard/search/results.html b/templates/dashboard/search/results.html
index feebfd1df7..720c9adfa7 100644
--- a/templates/dashboard/search/results.html
+++ b/templates/dashboard/search/results.html
@@ -9,7 +9,7 @@
{% block breadcrumbs %}
<ul class="breadcrumbs">
- <li>{% trans "Search" context "Search breadcrumbs" %}</li>
+ <li class="visible-s">{% trans "Search" context "Search breadcrumbs" %}</li>
</ul>
{% endblock %}
@@ -18,20 +18,18 @@
{% block content %}
<div class="row">
<div class="col s12">
- <form class="hide-on-med-and-up row" method="get" action="{% url "dashboard:search" %}">
- <input id="icon_prefix" type="text" class="validate col s10"
- placeholder="{% trans "Search" context "Search form placeholder" %}"
- name="q" value="{% if query %}{{ query }}{% endif %}">
- <button class="btn-flat search-button col s2" type="submit">
- <i class="material-icons left right">search</i>
- </button>
- </form>
- <div class="row">
- <div class="col s12">
- <form class="row" method="get" action="{% url "dashboard:search" %}">
- <input type="hidden" class="validate" name="q" value="{% if query %}{{ query }}{% endif %}">
- </form>
- </div>
+ <div class="card search-form">
+ <form class="hide-on-med-and-up" method="get" action="{% url "dashboard:search" %}">
+ <input id="icon_prefix" type="text" class="validate left"
+ placeholder="{% trans "Search" context "Search form placeholder" %}"
+ name="q" value="{% if query %}{{ query }}{% endif %}">
+ <button class="btn-flat search-button left" type="submit">
+ <i class="material-icons left right">search</i>
+ </button>
+ </form>
+ <form class="hide-on-med-and-up row" method="get" action="{% url "dashboard:search" %}">
+ <input type="hidden" class="validate" name="q" value="{% if query %}{{ query }}{% endif %}">
+ </form>
</div>
{% if results %}
<ul class="collection list">
@@ -88,11 +86,15 @@
</ul>
{% include "dashboard/includes/_pagination.html" with page_obj=results %}
{% elif query %}
- <p>
- {% blocktrans trimmed with full_name=result.get_full_name context "No Search result message" %}
- No results for query "{{ query }}".
- {% endblocktrans %}
- </p>
+ <ul class="collection list">
+ <li class="collection-item list-item">
+ <p class="list-item-name--single">
+ {% blocktrans trimmed with full_name=result.get_full_name context "No Search result message" %}
+ No results for query "{{ query }}".
+ {% endblocktrans %}
+ </p>
+ </li>
+ </ul>
{% endif %}
</div>
</div>