Skip to content

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

Add drag-and-drop icon, fix inputs and order filter view

weronkad37cf087f3fe
diff --git a/saleor/static/js/dashboard.js b/saleor/static/js/dashboard.js
index 0c647d6570..39a9d6d572 100644
--- a/saleor/static/js/dashboard.js
+++ b/saleor/static/js/dashboard.js
@@ -125,7 +125,7 @@ Dropzone.options.productImageForm = {
var el = document.getElementById('product-gallery')
if (el) {
Sortable.create(el, {
- handle: '.card-image',
+ handle: '.sortable__handle',
onUpdate: function () {
$.ajax({
dataType: 'json',
diff --git a/saleor/static/scss/dashboard.scss b/saleor/static/scss/dashboard.scss
index ffb30bc1b6..94efd0d3cc 100644
--- a/saleor/static/scss/dashboard.scss
+++ b/saleor/static/scss/dashboard.scss
@@ -19,8 +19,8 @@ $roboto-font-path: "~materialize-css/fonts/roboto/";
url('~material-design-icons/iconfont/MaterialIcons-Regular.ttf') format('truetype');
}
-.header {
- @media (min-width: $large-screen-up) {
+.header, main {
+ @media (min-width: $medium-screen-up) {
margin-left: 240px;
}
@@ -147,14 +147,17 @@ $roboto-font-path: "~materialize-css/fonts/roboto/";
}
}
-table {
- .row {
- .col {
- float: none;
- padding: $gutter-width/2;
+.data-table-container {
+ overflow: auto;
+ table {
+ .row {
+ .col {
+ float: none;
+ padding: $gutter-width/2;
- .responsive-img {
- display: block;
+ .responsive-img {
+ display: block;
+ }
}
}
}
diff --git a/saleor/static/scss/widget/_product-gallery.scss b/saleor/static/scss/widget/_product-gallery.scss
index c857c2a389..5735c7a403 100644
--- a/saleor/static/scss/widget/_product-gallery.scss
+++ b/saleor/static/scss/widget/_product-gallery.scss
@@ -19,9 +19,6 @@
}
&-image {
- img {
- cursor: move;
- }
&--ghost {
background: map_get($grey, lighten-5);
@@ -59,6 +56,16 @@
white-space: nowrap;
}
}
+ .sortable__drag-area {
+ position: absolute;
+ top: 0;
+ right: 0;
+ padding: .5rem 1rem;
+ cursor: move;
+ i {
+ font-size: 1.5rem;
+ }
+ }
.sortable-ghost {
opacity: .4;
diff --git a/templates/dashboard/includes/_status_filters.html b/templates/dashboard/includes/_status_filters.html
index 78675d49f5..bd83edd720 100644
--- a/templates/dashboard/includes/_status_filters.html
+++ b/templates/dashboard/includes/_status_filters.html
@@ -3,7 +3,7 @@
<form method="get">
<div class="row">
- {{ form|materializecss:"s8 m4 l3" }}
+ {{ form|materializecss:"s8 m4" }}
<div class="col s4 m2 l1 right-align">
<button type="submit" class="btn btn--inline">{% trans "Filter" %}</button>
</div>
diff --git a/templates/dashboard/order/detail.html b/templates/dashboard/order/detail.html
index ead3c010c2..6f4952065c 100644
--- a/templates/dashboard/order/detail.html
+++ b/templates/dashboard/order/detail.html
@@ -61,10 +61,10 @@
<div class="row tab-content" id="order-details">
<div class="col s12 l4 switch-two-columns">
<div class="card grey lighten-4">
- <div class="card-content">
+ <div class="card-content data-table-container">
<span class="card-title black-text">Order summary</span>
- <table class="order-summary">
+ <table class="order-summary responsive-table">
<tbody>
<tr>
<td>{% trans "Account" %}</td>
diff --git a/templates/dashboard/order/list.html b/templates/dashboard/order/list.html
index 09b84b20f9..80888e1af7 100644
--- a/templates/dashboard/order/list.html
+++ b/templates/dashboard/order/list.html
@@ -16,9 +16,8 @@
{% block menu_sales_class %} active{% endblock %}
{% block content %}
+ {% include "dashboard/includes/_status_filters.html" %}
{% if object_list %}
- {% include "dashboard/includes/_status_filters.html" %}
-
<div class="card">
{% include "dashboard/includes/_orders_table.html" with orders=object_list %}
</div>
diff --git a/templates/dashboard/shipping/method_form.html b/templates/dashboard/shipping/method_form.html
index 31832c3012..aa72cb8f90 100644
--- a/templates/dashboard/shipping/method_form.html
+++ b/templates/dashboard/shipping/method_form.html
@@ -52,9 +52,9 @@
{% for form in price_per_country_formset %}
<div class="row">
{{ form.id }}
- {{ form.country_code|materializecss:"input-field s12 l6" }}
+ {{ form.country_code|materializecss:"input-field s12 l5" }}
{{ form.price|materializecss:"input-field s12 l5" }}
- {{ form.DELETE|materializecss:"input-field s12 l1" }}
+ {{ form.DELETE|materializecss:"input-field s12 l2" }}
</div>
{% if form.non_field_errors %}
{% for error in form.non_field_errors %}