Remove unused templates

This commit is contained in:
Oliver 2021-07-13 20:04:12 +10:00
parent 970f08260c
commit 9889e314a9
5 changed files with 0 additions and 198 deletions

View File

@ -1,56 +0,0 @@
{% extends "order/sales_order_base.html" %}
{% load inventree_extras %}
{% load i18n %}
{% load static %}
{% load markdownify %}
{% load status_codes %}
{% block menubar %}
{% include 'order/so_navbar.html' with tab='notes' %}
{% endblock %}
{% block heading %}
{% trans "Sales Order Notes" %}
{% if roles.sales_order.change and not editing %}
<button title='{% trans "Edit notes" %}' class='btn btn-default' id='edit-notes'><span class='fas fa-edit'></span></button>
{% endif %}
{% endblock %}
{% block details %}
{% if editing %}
<form method='POST'>
{% csrf_token %}
{{ form }}
<hr>
<button type="submit" class='btn btn-default'>{% trans "Save" %}</button>
</form>
{{ form.media }}
{% else %}
<div class='panel panel-default'>
<div class='panel-content'>
{{ order.notes | markdownify }}
</div>
</div>
{% endif %}
{% endblock %}
{% block js_ready %}
{{ block.super }}
{% if editing %}
{% else %}
$("#edit-notes").click(function() {
location.href = "{% url 'so-notes' order.id %}?edit=1";
});
{% endif %}
{% endblock %}

View File

@ -1,83 +0,0 @@
{% extends "order/sales_order_base.html" %}
{% load inventree_extras %}
{% load i18n %}
{% load static %}
{% block menubar %}
{% include 'order/so_navbar.html' with tab='attachments' %}
{% endblock %}
{% block heading %}
{% trans "Sales Order Attachments" %}
{% endblock %}
{% block details %}
{% include "attachment_table.html" with attachments=order.attachments.all %}
{% endblock %}
{% block js_ready %}
{{ block.super }}
enableDragAndDrop(
'#attachment-dropzone',
'{% url "api-so-attachment-list" %}',
{
data: {
order: {{ order.id }},
},
label: 'attachment',
success: function(data, status, xhr) {
location.reload();
}
}
);
loadAttachmentTable(
'{% url "api-so-attachment-list" %}',
{
filters: {
order: {{ order.pk }},
},
onEdit: function(pk) {
var url = `/api/order/so/attachment/${pk}/`;
constructForm(url, {
fields: {
comment: {},
},
onSuccess: reloadAttachmentTable,
title: '{% trans "Edit Attachment" %}',
});
},
onDelete: function(pk) {
constructForm(`/api/order/so/attachment/${pk}/`, {
method: 'DELETE',
confirmMessage: '{% trans "Confirm Delete Operation" %}',
title: '{% trans "Delete Attachment" %}',
onSuccess: reloadAttachmentTable,
});
}
}
);
$("#new-attachment").click(function() {
constructForm('{% url "api-so-attachment-list" %}', {
method: 'POST',
fields: {
attachment: {},
comment: {},
order: {
value: {{ order.pk }},
hidden: true
}
},
onSuccess: reloadAttachmentTable,
title: '{% trans "Add Attachment" %}'
});
});
{% endblock %}

View File

@ -1,33 +0,0 @@
{% extends "order/sales_order_base.html" %}
{% load inventree_extras %}
{% load i18n %}
{% load static %}
{% block menubar %}
{% include 'order/so_navbar.html' with tab='builds' %}
{% endblock %}
{% block heading %}
{% trans "Build Orders" %}
{% endblock %}
{% block details %}
<table class='table table-striped table-condensed' id='builds-table'></table>
{% endblock %}
{% block js_ready %}
{{ block.super }}
loadBuildTable($("#builds-table"), {
url: "{% url 'api-build-list' %}",
params: {
sales_order: {{ order.id }},
},
});
{% endblock %}

View File

@ -42,10 +42,6 @@ sales_order_detail_urls = [
url(r'^cancel/', views.SalesOrderCancel.as_view(), name='so-cancel'),
url(r'^ship/', views.SalesOrderShip.as_view(), name='so-ship'),
url(r'^builds/', views.SalesOrderDetail.as_view(template_name='order/so_builds.html'), name='so-builds'),
url(r'^attachments/', views.SalesOrderDetail.as_view(template_name='order/so_attachments.html'), name='so-attachments'),
url(r'^notes/', views.SalesOrderNotes.as_view(), name='so-notes'),
url(r'^.*$', views.SalesOrderDetail.as_view(), name='so-detail'),
]

View File

@ -122,28 +122,6 @@ class PurchaseOrderNotes(InvenTreeRoleMixin, UpdateView):
return ctx
class SalesOrderNotes(InvenTreeRoleMixin, UpdateView):
""" View for editing the 'notes' field of a SalesORder """
context_object_name = 'order'
template_name = 'order/sales_order_notes.html'
model = SalesOrder
role_required = 'sales_order.view'
fields = ['notes']
def get_success_url(self):
return reverse('so-notes', kwargs={'pk': self.get_object().pk})
def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
ctx['editing'] = str2bool(self.request.GET.get('edit', False))
return ctx
class PurchaseOrderCancel(AjaxUpdateView):
""" View for cancelling a purchase order """