-
-
-
{% trans "Stock Item Notes" %}
-
-
-
-
-
+
+
{% trans "Stock Item Notes" %}
+ {% include "spacer.html" %}
+
+ {% include "notes_buttons.html" %}
- {% if item.notes %}
- {{ item.notes | markdownify }}
- {% endif %}
+
@@ -235,18 +227,21 @@
reload: true,
}
);
- });
- $('#edit-notes').click(function() {
- constructForm('{% url "api-stock-detail" item.pk %}', {
- fields: {
- notes: {
- multiline: true,
- }
- },
- title: '{% trans "Edit Notes" %}',
- reload: true,
- });
+ });
+
+ onPanelLoad('notes', function() {
+ setupNotesField(
+ 'stock-notes',
+ '{% url "api-stock-detail" item.pk %}',
+ {
+ {% if roles.stock.change and user_owns_item %}
+ editable: true,
+ {% else %}
+ editable: false,
+ {% endif %}
+ }
+ );
});
enableDragAndDrop(