Skip to content

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

Fix order notes view

dominik-zeglen47462890938d
diff --git a/saleor/static/scss/layouts/_order-details.scss b/saleor/static/scss/layouts/_order-details.scss
index 5d9920296f..c4fb839bc2 100644
--- a/saleor/static/scss/layouts/_order-details.scss
+++ b/saleor/static/scss/layouts/_order-details.scss
@@ -1,6 +1,6 @@
.order-details {
&__header {
- margin-bottom: $global-margin * 2;
+ margin: $global-margin 0 $global-margin * 2;
}
&__addresses {
margin-top: $global-margin * 2;
@@ -44,6 +44,9 @@
padding-left: calc(60px + #{$global-padding} * 2);
}
}
+ &__table-header {
+ margin-top: 2rem;
+ }
}
.order-notes {
diff --git a/templates/order/_ordered_items_table.html b/templates/order/_ordered_items_table.html
index 3f1b60f76e..0b1fb4519b 100644
--- a/templates/order/_ordered_items_table.html
+++ b/templates/order/_ordered_items_table.html
@@ -26,7 +26,7 @@
</div>
</div>
{% endif %}
-<div class="table__header d-none d-sm-block">
+<div class="table__header order-details__table-header d-none d-sm-block">
<div class="row">
<div class="col-md-6">
<small>
diff --git a/templates/order/details.html b/templates/order/details.html
index bb6697584a..02503bdad0 100644
--- a/templates/order/details.html
+++ b/templates/order/details.html
@@ -65,23 +65,29 @@
{% if notes %}
<h2 class="order-notes__header">{% trans "Notes" context "Order notes list" %}</h2>
{% for note in notes %}
- <small>
+ <small>
+ {% if note.user %}
{% if note.user == user %}
{% blocktrans with date=note.date %}
{{ date }} by you
{% endblocktrans %}
{% elif note.user.is_staff %}
- {% trans 'staff' context 'Order note author is staff' as note_author_staff%}
+ {% trans 'staff' context 'Order note author is staff' as note_author_staff %}
{% blocktrans with author=note_author_staff date=note.date %}
{{ date }} by <span class="text-muted">{{ author }}</span>
{% endblocktrans %}
{% else %}
- {% blocktrans with author=note.author date=note.date %}
+ {% blocktrans with author=note.user date=note.date %}
{{ date }} by {{ author }}
{% endblocktrans %}
{% endif %}
- </small>
- <p>{{note.content}}</p>
+ {% else %}
+ {% blocktrans with date=note.date %}
+ {{ date }} by anonymous customer
+ {% endblocktrans %}
+ {% endif %}
+ </small>
+ <p>{{ note.content }}</p>
{% endfor %}
{% endif %}
{% if order.is_open %}