[css] portal

This commit is contained in:
Anand Doshi 2016-04-22 18:53:21 +05:30
parent e0818f8f46
commit e3bd78e912
28 changed files with 932 additions and 108 deletions

View File

@ -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",

View File

@ -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"))

View File

@ -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 = {

View File

@ -11,3 +11,4 @@ Support
Utilities
Shopping Cart
Hub Node
Portal

View File

View File

View File

@ -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');
}
}
});
}
}
});

View File

@ -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
}

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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) {
}
});

View File

@ -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
}

View File

@ -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'

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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)

View File

@ -1,7 +1,6 @@
{% macro product_image_square(website_image, css_class="") %}
<div class="product-image product-image-square {% if not website_image -%} missing-image {%- endif %} {{ css_class }}"
{% if website_image -%} style="background-image: url('{{ frappe.utils.quoted(website_image) | abs_url }}');" {%- endif %}>
{% if not website_image -%}<i class="centered octicon octicon-device-camera"></i>{%- endif %}
</div>
{% endmacro %}
@ -9,8 +8,6 @@
<div class="product-image {% if not website_image -%} missing-image {%- endif %} {{ css_class }}">
{% if website_image -%}
<img src="{{ frappe.utils.quoted(website_image) | abs_url }}" class="img-responsive">
{%- else -%}
<i class="centered octicon octicon-device-camera"></i>
{%- endif %}
</div>
{% endmacro %}

View File

@ -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;
}

View File

@ -1,20 +1,20 @@
{% if doc.taxes %}
<div class="row tax-net-total-row">
<div class="col-xs-6 text-right">{{ _("Net Total") }}</div>
<div class="col-xs-6 text-right">
<div class="col-xs-8 text-right">{{ _("Net Total") }}</div>
<div class="col-xs-4 text-right">
{{ doc.get_formatted("net_total") }}</div>
</div>
{% endif %}
{% for d in doc.taxes %}
<div class="row tax-row">
<div class="col-xs-6 text-right">{{ d.description }}</div>
<div class="col-xs-6 text-right">
<div class="row tax-row">
<div class="col-xs-8 text-right">{{ d.description }}</div>
<div class="col-xs-4 text-right">
{{ d.get_formatted("base_tax_amount") }}</div>
</div>
{% endfor %}
<div class="row tax-grand-total-row">
<div class="col-xs-6 text-right">{{ _("Grand Total") }}</div>
<div class="col-xs-6 text-right">
<div class="col-xs-8 text-right">{{ _("Grand Total") }}</div>
<div class="col-xs-4 text-right">
<span class="tax-grand-total">
{{ doc.get_formatted("grand_total") }}
</span>

View File

@ -1,17 +1,27 @@
<div class="web-list-item">
<a href="/{{ pathname }}/{{ doc.name }}">
<div class="row">
<div class="col-sm-6">
<div class="web-list-item transaction-list-item">
<a href="/{{ pathname }}/{{ doc.name }}">
<div class="row">
<div class="col-sm-6">
<span>{{ doc.name }}</span>
<div class="small text-muted items-preview text-ellipsis">
{{ doc.items_preview }}
</div>
</div>
<div class="col-sm-4">
<span class="indicator {{ doc.indicator_color or "darkgrey" }}">
{{ doc.indicator_title or doc.status }}
</span>
<div class="small text-muted transaction-time"
title="{{ frappe.utils.format_datetime(doc.modified, "medium") }}">
{{ frappe.utils.pretty_date(doc.modified) }}
</div>
</div>
<div class="col-sm-2 text-right">
{{ doc.get_formatted("grand_total") }}
</div>
<!-- <div class="col-sm-3 text-right">
<span class="indicator {{ doc.indicator_color or "darkgrey" }}">{{ doc.name }}</span>
<div class="small text-muted">{{ doc.items_preview }}</div>
</div>
<div class="col-sm-3 col-xs-5">
{{ doc.get_formatted("grand_total") }}
</div>
<div class="col-sm-3 small text-muted text-right" title="{{ frappe.utils.format_datetime(doc.creation, "medium") }}">
{{ frappe.utils.pretty_date(doc.creation) }}</div>
</div>
</a>
</div> -->
</div>
</a>
</div>

View File

@ -68,7 +68,7 @@
</div>
<div class="cart-link">
<a href="#" onclick="show_terms();return false;">*Terms and Conditions</a>
</div>
</div>
{% endif %}
<div class="cart-addresses">
{% include "templates/includes/cart/cart_address.html" %}

View File

@ -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 %}
<script>{% include "templates/includes/product_list.js" %}</script>
<script>
frappe.ready(function() {
window.start = 0;
window.get_product_list();
});
</script>
<div class="row">
<div class="col-sm-12">
<h2 class="text-center">{{ tag_line }}</h2>
<p class="lead text-center">{{ description }}</p>
<p class="text-center"><a href="/login" class="btn btn-primary text-center">Login</a></p>
<div style="margin-top:75px;">
<h5>{{_("FEATURED PRODUCTS")}}</h5>
<div class="featured-products">
<div id="search-list" class="row" style="margin-top:40px;">
<h2 class="text-center">{{ homepage.tag_line or '' }}</h2>
<p class="lead text-center">{{ homepage.description or '' }}</p>
<p class="text-center">
<a href="/login" class="btn btn-primary text-center">Login</a>
</p>
{% if homepage.products %}
<!-- TODO: styling of this section -->
<div class='featured-products-section'>
<h5 class='text-uppercase'>{{ _("Featured Products") }}</h5>
<div class="featured-products">
<div id="search-list" class="row" style="margin-top:40px;">
{% for item in homepage.products %}
<a class="product-link" href="{{ item.route | abs_url }}">
<div class="col-sm-4 product-image-wrapper">
{{ product_image_square(item.thumbnail or item.image) }}
<div class="text-ellipsis inline-block small product-text">
{{ item.item_name }}
</div>
</div>
</a>
{% endfor %}
</div>
</div>
<!-- TODO: remove hardcoding of /products -->
<p class="text-center"><a href="/products" class="btn btn-primary">More Products</a></p>
</div>
</div>
<p class="text-center"><a href="/products" class="btn btn-primary">More Products</a></p>
</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block style %}
<style>
.featured-products-section {
margin-top: 75px;
}
</style>
{% endblock %}

View File

@ -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

View File

@ -1,32 +1,24 @@
{% extends "templates/web.html" %}
{% block header %}
<h1>{{ doc.name }}</h1>
<!-- <h6 class="text-muted">{{ doc._title or doc.doctype }}</h6> -->
{% endblock %}
{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %}
{% block breadcrumbs %}
{% include "templates/includes/breadcrumbs.html" %}
{% endblock %}
{% block style %}
<style>
{% include "templates/includes/order/order.css" %}
</style>
{% block header %}
<h1>{{ doc.name }}</h1>
{% endblock %}
{% block page_content %}
{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %}
<div class="row">
<div class="row transaction-subheading">
<div class="col-xs-6">
<span class="indicator {{ doc.indicator_color or "darkgrey" }}">
{{ doc.indicator_title or doc.status or "Submitted" }}
</span>
</div>
<div class="col-xs-6 text-muted text-right h6">
{{ doc.get_formatted("transaction_date") }}
<div class="col-xs-6 text-muted text-right small">
{{ frappe.utils.formatdate(doc.transaction_date, 'medium') }}
</div>
</div>
@ -38,14 +30,14 @@
<!-- items -->
<div class="order-item-table">
<div class="row order-items order-item-header">
<div class="col-sm-8 col-xs-6 h6">
<div class="row order-items order-item-header text-muted">
<div class="col-sm-8 col-xs-6 h6 text-uppercase">
{{ _("Item") }}
</div>
<div class="col-sm-2 col-xs-3 text-right h6">
<div class="col-sm-2 col-xs-3 text-right h6 text-uppercase">
{{ _("Quantity") }}
</div>
<div class="col-sm-2 col-xs-3 text-right h6">
<div class="col-sm-2 col-xs-3 text-right h6 text-uppercase">
{{ _("Amount") }}
</div>
</div>
@ -71,9 +63,9 @@
</div>
<!-- taxes -->
<div class="order-taxes row small">
<div class="col-sm-8"><!-- empty --></div>
<div class="col-sm-4">
<div class="order-taxes row">
<div class="col-sm-6"><!-- empty --></div>
<div class="col-sm-6 text-right">
{% include "erpnext/templates/includes/order/order_taxes.html" %}
</div>
</div>