diff --git a/erpnext/config/website.py b/erpnext/config/website.py index 5f77d9fb263..237c49c9afb 100644 --- a/erpnext/config/website.py +++ b/erpnext/config/website.py @@ -5,6 +5,11 @@ def get_data(): { "label": _("Portal"), "items": [ + { + "type": "doctype", + "name": "Homepage", + "description": _("Settings for website homepage"), + }, { "type": "doctype", "name": "Shopping Cart Settings", diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py index a1982ef515a..6b514b23d07 100644 --- a/erpnext/controllers/website_list_for_contact.py +++ b/erpnext/controllers/website_list_for_contact.py @@ -49,7 +49,7 @@ def get_transaction_list(doctype, txt=None, filters=None, limit_start=0, limit_p order_by = "modified desc")) else: return [] - + return post_process(doctype, get_list(doctype, txt, filters, limit_start, limit_page_length, fields="name", order_by = "modified desc")) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index d37c4beb4a4..85fee1f39ad 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -139,7 +139,11 @@ doc_events = { 'Supplier Quotation', 'Purchase Order', 'Purchase Receipt', 'Purchase Invoice', 'Project', 'Issue'): { 'on_change': 'erpnext.accounts.party_status.notify_status' - } + }, + + "Website Settings": { + "validate": "erpnext.portal.doctype.products_settings.products_settings.home_page_is_products" + } } scheduler_events = { diff --git a/erpnext/modules.txt b/erpnext/modules.txt index dfca2f27c5b..8a495478f9c 100644 --- a/erpnext/modules.txt +++ b/erpnext/modules.txt @@ -11,3 +11,4 @@ Support Utilities Shopping Cart Hub Node +Portal \ No newline at end of file diff --git a/erpnext/portal/__init__.py b/erpnext/portal/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/portal/doctype/__init__.py b/erpnext/portal/doctype/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/portal/doctype/homepage/__init__.py b/erpnext/portal/doctype/homepage/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/portal/doctype/homepage/homepage.js b/erpnext/portal/doctype/homepage/homepage.js new file mode 100644 index 00000000000..df7f5ce6ae9 --- /dev/null +++ b/erpnext/portal/doctype/homepage/homepage.js @@ -0,0 +1,39 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Homepage', { + refresh: function(frm) { + + }, +}); + +frappe.ui.form.on('Homepage Featured Product', { + item_code: function(frm, cdt, cdn) { + var featured_product = frappe.model.get_doc(cdt, cdn); + if (featured_product.item_code) { + frappe.call({ + method: 'frappe.client.get_value', + args: { + 'doctype': 'Item', + 'filters': featured_product.item_code, + 'fieldname': [ + 'item_name', + 'web_long_description', + 'description', + 'image', + 'thumbnail' + ] + }, + callback: function(r) { + if (!r.exc) { + $.extend(featured_product, r.message); + if (r.message.web_long_description) { + featured_product.description = r.message.web_long_description; + } + frm.refresh_field('products'); + } + } + }); + } + } +}); diff --git a/erpnext/portal/doctype/homepage/homepage.json b/erpnext/portal/doctype/homepage/homepage.json new file mode 100644 index 00000000000..7078ef9a580 --- /dev/null +++ b/erpnext/portal/doctype/homepage/homepage.json @@ -0,0 +1,208 @@ +{ + "allow_copy": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "", + "creation": "2016-04-22 05:27:52.109319", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "fields": [ + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "company", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Company", + "length": 0, + "no_copy": 0, + "options": "Company", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "Company Tagline for website homepage", + "fieldname": "tag_line", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Tag Line", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "Company Description for website homepage", + "fieldname": "description", + "fieldtype": "Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "products_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Products", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "Products to be shown on website homepage", + "fieldname": "products", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Products", + "length": 0, + "no_copy": 0, + "options": "Homepage Featured Product", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, + "width": "40px" + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 1, + "istable": 0, + "max_attachments": 0, + "modified": "2016-04-22 05:57:38.701653", + "modified_by": "Administrator", + "module": "Portal", + "name": "Homepage", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Administrator", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", + "sort_order": "DESC", + "title_field": "company", + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/portal/doctype/homepage/homepage.py b/erpnext/portal/doctype/homepage/homepage.py new file mode 100644 index 00000000000..6f55a59e62b --- /dev/null +++ b/erpnext/portal/doctype/homepage/homepage.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class Homepage(Document): + pass diff --git a/erpnext/portal/doctype/homepage_featured_product/__init__.py b/erpnext/portal/doctype/homepage_featured_product/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json new file mode 100644 index 00000000000..fe93098d126 --- /dev/null +++ b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json @@ -0,0 +1,273 @@ +{ + "allow_copy": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "hash", + "creation": "2016-04-22 05:57:06.261401", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "fields": [ + { + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "fieldname": "item_code", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 1, + "set_only_once": 0, + "unique": 0, + "width": "150px" + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "col_break1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "item_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Item Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150", + "read_only": 1, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0, + "width": "150" + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "fieldname": "section_break_5", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "description", + "fieldtype": "Text Editor", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Description", + "length": 0, + "no_copy": 0, + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "300px", + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, + "width": "300px" + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "column_break_7", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "image", + "fieldtype": "Attach Image", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Image", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "thumbnail", + "fieldtype": "Attach Image", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Thumbnail", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "route", + "fieldtype": "Small Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "route", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2016-04-22 05:57:06.261401", + "modified_by": "Administrator", + "module": "Portal", + "name": "Homepage Featured Product", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py new file mode 100644 index 00000000000..936e07d34ea --- /dev/null +++ b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class HomepageFeaturedProduct(Document): + pass diff --git a/erpnext/portal/doctype/products_settings/__init__.py b/erpnext/portal/doctype/products_settings/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/portal/doctype/products_settings/products_settings.js b/erpnext/portal/doctype/products_settings/products_settings.js new file mode 100644 index 00000000000..7a57abaf9b5 --- /dev/null +++ b/erpnext/portal/doctype/products_settings/products_settings.js @@ -0,0 +1,8 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Products Settings', { + refresh: function(frm) { + + } +}); diff --git a/erpnext/portal/doctype/products_settings/products_settings.json b/erpnext/portal/doctype/products_settings/products_settings.json new file mode 100644 index 00000000000..90de96c8443 --- /dev/null +++ b/erpnext/portal/doctype/products_settings/products_settings.json @@ -0,0 +1,106 @@ +{ + "allow_copy": 0, + "allow_import": 0, + "allow_rename": 0, + "creation": "2016-04-22 09:11:55.272398", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "fields": [ + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "If checked, the Home page will be the default Item Group for the website", + "fieldname": "home_page_is_products", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Home Page is Products", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "products_as_list", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Show Products as a List", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 1, + "istable": 0, + "max_attachments": 0, + "modified": "2016-04-22 09:11:59.537639", + "modified_by": "Administrator", + "module": "Portal", + "name": "Products Settings", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Website Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/portal/doctype/products_settings/products_settings.py b/erpnext/portal/doctype/products_settings/products_settings.py new file mode 100644 index 00000000000..f17ae9fee9e --- /dev/null +++ b/erpnext/portal/doctype/products_settings/products_settings.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.utils import cint +from frappe.model.document import Document + +class ProductsSettings(Document): + def validate(self): + if self.home_page_is_products: + website_settings = frappe.get_doc('Website Settings') + website_settings.home_page = 'products' + website_settings.save() + +def home_page_is_products(doc, method): + '''Called on saving Website Settings''' + home_page_is_products = cint(frappe.db.get_single_value('Products Settings', 'home_page_is_products')) + if home_page_is_products: + doc.home_page = 'products' + diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css index a57bf33f375..8b5b900ce5b 100644 --- a/erpnext/public/css/website.css +++ b/erpnext/public/css/website.css @@ -23,7 +23,7 @@ background-size: cover; background-repeat: no-repeat; background-position: center top; - border-bottom: 1px dashed #EBEFF2; + border-radius: 4px; } .product-image.missing-image { width: 100%; @@ -32,8 +32,9 @@ background-size: cover; background-repeat: no-repeat; background-position: center top; + border-radius: 4px; position: relative; - border-bottom: 1px dashed #EBEFF2; + background-color: #EBEFF2; } .product-image.missing-image .octicon { font-size: 32px; @@ -66,3 +67,60 @@ .featured-products { border-top: 1px solid #EBEFF2; } +.transaction-list-item { + border-bottom: none; + padding: 30px; + margin: 0px -30px; +} +.transaction-list-item:hover, +.transaction-list-item:active, +.transaction-list-item:focus { + background-color: #fafbfc; +} +.transaction-list-item .indicator { + font-size: inherit; + font-weight: inherit; + color: #8D99A6; + margin-left: -15px; +} +.transaction-list-item .items-preview, +.transaction-list-item .transaction-time { + margin-top: 5px; +} +.transaction-subheading .indicator { + font-weight: inherit; + color: #8D99A6; +} +.order-container { + margin: 50px 0px; +} +.order-container .order-item-header .h6 { + padding: 7px 15px; +} +.order-container .order-items { + margin: 30px 0px 0px; +} +.order-container .order-item-table { + margin: 0px -15px; +} +.order-container .order-item-header { + border-bottom: 1px solid #d1d8dd; +} +.order-container .order-image-col { + padding-right: 0px; +} +.order-container .order-image { + max-width: 55px; + max-height: 55px; + margin-top: -5px; +} +.order-container .order-taxes { + margin-top: 30px; +} +.order-container .order-taxes .row { + margin-top: 15px; +} +.order-container .tax-grand-total-row { + border-top: 1px solid #d1d8dd; + padding-top: 15px; +} diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less index 7b0f1d651fe..b420ba6d8eb 100644 --- a/erpnext/public/less/website.less +++ b/erpnext/public/less/website.less @@ -1,10 +1,13 @@ @border-color: #d1d8dd; -@light-border-color: #EBEFF2; +@light-border-color: #EBEFF2; +@text-muted: #8D99A6; +@light-bg: #fafbfc; .web-long-description { font-size: 18px; line-height: 200%; } + .item-stock { margin-bottom: 10px !important; } @@ -14,10 +17,6 @@ text-align: center; } -.product-image-wrapper { - -} - @media (max-width: 767px) { .product-image { height: 0px; @@ -33,13 +32,13 @@ background-size: cover; background-repeat: no-repeat; background-position: center top; - border-bottom: 1px dashed @light-border-color; + border-radius: 4px; } .product-image.missing-image { .product-image-square; position: relative; - border-bottom: 1px dashed @light-border-color; + background-color: @light-border-color; } .product-image.missing-image .octicon { @@ -78,3 +77,83 @@ .featured-products { border-top: 1px solid @light-border-color; } + +.transaction-list-item { + border-bottom: none; + padding: 30px; + margin: 0px -30px; + + &:hover, + &:active, + &:focus { + background-color: @light-bg; + } + + .indicator { + font-size: inherit; + font-weight: inherit; + color: @text-muted; + margin-left: -15px; + } + + .transaction-time { + // margin-left: 15px; + } + + .items-preview, + .transaction-time { + margin-top: 5px; + } +} + +// order.html +.transaction-subheading { + .indicator { + font-weight: inherit; + color: @text-muted; + } +} + +.order-container { + margin: 50px 0px; + + .order-item-header .h6 { + padding: 7px 15px; + } + + .order-items { + margin: 30px 0px 0px; + } + + .order-item-table { + margin: 0px -15px; + } + + .order-item-header { + border-bottom: 1px solid #d1d8dd; + } + + .order-image-col { + padding-right: 0px; + } + + .order-image { + max-width: 55px; + max-height: 55px; + margin-top: -5px; + } + + .order-taxes { + margin-top: 30px; + + .row { + margin-top: 15px; + } + } + + .tax-grand-total-row { + border-top: 1px solid @border-color; + padding-top: 15px; + } +} + diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 878eb9b8649..c8a8d7daa04 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -310,10 +310,13 @@ class SalesOrder(SellingController): def get_list_context(context=None): from erpnext.controllers.website_list_for_contact import get_list_context list_context = get_list_context(context) - list_context["show_sidebar"] = True - list_context["show_search"] = True - list_context["title"] = _("My Orders") - list_context["parents"] = [{"title": _("My Account"), "name": "me"}] + list_context.update({ + 'show_sidebar': True, + 'show_search': True, + 'no_breadcrumbs': True, + 'title': _('Orders'), + }) + return list_context @frappe.whitelist() @@ -338,10 +341,10 @@ def close_or_unclose_sales_orders(names, status): def make_material_request(source_name, target_doc=None): def postprocess(source, doc): doc.material_request_type = "Purchase" - + def update_item(source, target, source_parent): target.project = source_parent.project - + so = frappe.get_doc("Sales Order", source_name) diff --git a/erpnext/templates/includes/macros.html b/erpnext/templates/includes/macros.html index 81a10c2779c..05181c089a5 100644 --- a/erpnext/templates/includes/macros.html +++ b/erpnext/templates/includes/macros.html @@ -1,7 +1,6 @@ {% macro product_image_square(website_image, css_class="") %}
- {% if not website_image -%}{%- endif %}
{% endmacro %} @@ -9,8 +8,6 @@
{% if website_image -%} - {%- else -%} - {%- endif %}
{% endmacro %} diff --git a/erpnext/templates/includes/order/order.css b/erpnext/templates/includes/order/order.css deleted file mode 100644 index 54c8d0ffe2d..00000000000 --- a/erpnext/templates/includes/order/order.css +++ /dev/null @@ -1,25 +0,0 @@ -.order-container { - margin: 50px 0px; -} - -.order-items { - margin: 20px 0px; -} - -.order-item-table { - margin: 0px -15px; -} - -.order-item-header { - border-bottom: 1px solid #d1d8dd; -} - -.order-image-col { - padding-right: 0px; -} - -.order-image { - max-width: 55px; - max-height: 55px; - margin-top: -5px; -} diff --git a/erpnext/templates/includes/order/order_taxes.html b/erpnext/templates/includes/order/order_taxes.html index 8c8e88621b8..564e31ecf0a 100644 --- a/erpnext/templates/includes/order/order_taxes.html +++ b/erpnext/templates/includes/order/order_taxes.html @@ -1,20 +1,20 @@ {% if doc.taxes %}
-
{{ _("Net Total") }}
-
+
{{ _("Net Total") }}
+
{{ doc.get_formatted("net_total") }}
{% endif %} {% for d in doc.taxes %} -
-
{{ d.description }}
-
+
+
{{ d.description }}
+
{{ d.get_formatted("base_tax_amount") }}
{% endfor %}
-
{{ _("Grand Total") }}
-
+
{{ _("Grand Total") }}
+
{{ doc.get_formatted("grand_total") }} diff --git a/erpnext/templates/includes/transaction_row.html b/erpnext/templates/includes/transaction_row.html index a52bb603066..05aed90e20e 100644 --- a/erpnext/templates/includes/transaction_row.html +++ b/erpnext/templates/includes/transaction_row.html @@ -1,17 +1,27 @@ -
- -
-
+ diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html index f2104f9ecb1..afba9b83138 100644 --- a/erpnext/templates/pages/cart.html +++ b/erpnext/templates/pages/cart.html @@ -68,7 +68,7 @@
+
{% endif %}
{% include "templates/includes/cart/cart_address.html" %} diff --git a/erpnext/templates/pages/home.html b/erpnext/templates/pages/home.html index 5c0f3308925..e6cfc9097f4 100644 --- a/erpnext/templates/pages/home.html +++ b/erpnext/templates/pages/home.html @@ -1,31 +1,48 @@ {% extends "templates/web.html" %} +{% from "erpnext/templates/includes/macros.html" import product_image_square %} -{% block title %}{{brand_html}}{% endblock %} +{% block title %}{{ brand_html }}{% endblock %} {% block page_content %} - - -
-

{{ tag_line }}

-

{{ description }}

-

Login

-
-
{{_("FEATURED PRODUCTS")}}
- + {% endif %}
{% endblock %} + +{% block style %} + +{% endblock %} diff --git a/erpnext/templates/pages/home.py b/erpnext/templates/pages/home.py index af7509706c9..9488efe6af5 100644 --- a/erpnext/templates/pages/home.py +++ b/erpnext/templates/pages/home.py @@ -9,6 +9,13 @@ from erpnext.setup.doctype.item_group.item_group import get_item_for_list_in_htm no_cache = 1 no_sitemap = 1 +def get_context(context): + homepage = frappe.get_doc('Homepage') + return { + 'homepage': homepage + } + + @frappe.whitelist(allow_guest=True) def get_product_list(search=None, start=0, limit=6): # limit = 12 because we show 12 items in the grid view diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index 3252eb9eb53..191b078c80d 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -1,32 +1,24 @@ {% extends "templates/web.html" %} - -{% block header %} -

{{ doc.name }}

- -{% endblock %} +{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %} {% block breadcrumbs %} {% include "templates/includes/breadcrumbs.html" %} {% endblock %} -{% block style %} - +{% block header %} +

{{ doc.name }}

{% endblock %} {% block page_content %} -{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %} - -
+
{{ doc.indicator_title or doc.status or "Submitted" }}
-
- {{ doc.get_formatted("transaction_date") }} +
+ {{ frappe.utils.formatdate(doc.transaction_date, 'medium') }}
@@ -38,14 +30,14 @@
-
-
+
+
{{ _("Item") }}
-
+
{{ _("Quantity") }}
-
+
{{ _("Amount") }}
@@ -71,9 +63,9 @@
-
-
-
+
+
+
{% include "erpnext/templates/includes/order/order_taxes.html" %}