diff --git a/config.json b/config.json index f9c71b4b19..6656ed37de 100644 --- a/config.json +++ b/config.json @@ -106,14 +106,24 @@ }, "orders": { "no_cache": true, - "template": "app/website/templates/pages/transaction_list", + "template": "app/website/templates/pages/sales_transactions", "args_method": "website.helpers.transaction.order_list_args" }, "invoices": { "no_cache": true, - "template": "app/website/templates/pages/transaction_list", + "template": "app/website/templates/pages/sales_transactions", "args_method": "website.helpers.transaction.invoice_list_args" }, + "shipments": { + "no_cache": true, + "template": "app/website/templates/pages/sales_transactions", + "args_method": "website.helpers.transaction.shipment_list_args" + }, + "messages": { + "no_cache": true, + "template": "app/website/templates/pages/messages", + "args_method": "website.helpers.transaction.message_list_args" + }, "product_search": { "template": "app/website/templates/pages/product_search" }, @@ -123,7 +133,8 @@ "args_method": "support.doctype.support_ticket.support_ticket.get_website_args" }, "tickets": { - "template": "app/website/templates/pages/tickets" + "template": "app/website/templates/pages/tickets", + "args_method": "website.helpers.transaction.ticket_list_args" }, "address": { "no_cache": true, diff --git a/public/js/website_utils.js b/public/js/website_utils.js index d22d7655fc..1b7f0f728d 100644 --- a/public/js/website_utils.js +++ b/public/js/website_utils.js @@ -2,8 +2,8 @@ // License: GNU General Public License v3. See license.txt -var erpnext = {}; -var wn = {}; +if(!window.erpnext) erpnext = {}; +if(!window.wn) wn = {}; // Add / update a new Lead / Communication // subject, sender, description @@ -229,4 +229,17 @@ $.extend(wn.cart, { if(cart_count) $(".cart-count").html("( "+ cart_count +" )") } -}); \ No newline at end of file +}); + +function remove_script_and_style(txt) { + return (!txt || (txt.indexOf(" -{% endblock %} \ No newline at end of file +var status_label = { + "Open": "label-success", + "Waiting for Customer": "label-danger", + "Closed": "label-default" +} + +var render = function(doc) { + doc.status = doc.status.trim(); + doc.label_class = status_label[doc.status] || "label-default"; + if(doc.status==="Waiting for Customer") doc.status = "To Reply"; + + $(repl('\ +
\ +
\ +
%(name)s
\ +
%(subject)s
\ +
\ +
\ +
\ + %(status)s\ +
\ +
\ + %(creation)s\ +
\ +
\ +
\ +
', doc)).appendTo($list); +}; +{%- endblock %} \ No newline at end of file diff --git a/website/templates/pages/transaction_list.html b/website/templates/pages/transaction_list.html deleted file mode 100644 index e92764a5ff..0000000000 --- a/website/templates/pages/transaction_list.html +++ /dev/null @@ -1,69 +0,0 @@ -{% extends "app/website/templates/html/page.html" %} - -{% block content %} -
- -
-
-
-
-
-
- - -{% endblock %} \ No newline at end of file