Merge pull request #5296 from KanchanChauhan/websitemakeover
New look to the website
This commit is contained in:
commit
c711b82889
@ -667,9 +667,12 @@ class SalesInvoice(SellingController):
|
|||||||
def get_list_context(context=None):
|
def get_list_context(context=None):
|
||||||
from erpnext.controllers.website_list_for_contact import get_list_context
|
from erpnext.controllers.website_list_for_contact import get_list_context
|
||||||
list_context = get_list_context(context)
|
list_context = get_list_context(context)
|
||||||
list_context["title"] = _("My Invoices")
|
list_context.update({
|
||||||
list_context["show_sidebar"] = True
|
'show_sidebar': True,
|
||||||
list_context["show_search"] = True
|
'show_search': True,
|
||||||
|
'no_breadcrumbs': True,
|
||||||
|
'title': _('Invoices'),
|
||||||
|
})
|
||||||
return list_context
|
return list_context
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
@ -257,7 +257,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2016-04-22 05:57:06.261401",
|
"modified": "2016-04-25 15:51:52.811124",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Portal",
|
"module": "Portal",
|
||||||
"name": "Homepage Featured Product",
|
"name": "Homepage Featured Product",
|
||||||
|
@ -185,7 +185,8 @@ def get_list_context(context=None):
|
|||||||
return {
|
return {
|
||||||
"show_sidebar": True,
|
"show_sidebar": True,
|
||||||
"show_search": True,
|
"show_search": True,
|
||||||
"title": _("My Projects"),
|
'no_breadcrumbs': True,
|
||||||
|
"title": _("Projects"),
|
||||||
"get_list": get_project_list,
|
"get_list": get_project_list,
|
||||||
"row_template": "templates/includes/projects/project_row.html"
|
"row_template": "templates/includes/projects/project_row.html"
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,6 @@
|
|||||||
background-color: #fafbfc;
|
background-color: #fafbfc;
|
||||||
}
|
}
|
||||||
.transaction-list-item .indicator {
|
.transaction-list-item .indicator {
|
||||||
font-size: inherit;
|
|
||||||
font-weight: inherit;
|
font-weight: inherit;
|
||||||
color: #8D99A6;
|
color: #8D99A6;
|
||||||
margin-left: -15px;
|
margin-left: -15px;
|
||||||
@ -126,6 +125,75 @@
|
|||||||
border-top: 1px solid #d1d8dd;
|
border-top: 1px solid #d1d8dd;
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
}
|
}
|
||||||
|
.cart-container {
|
||||||
|
margin: 50px 0px;
|
||||||
|
}
|
||||||
|
.cart-container .cart-item-header .h6 {
|
||||||
|
padding: 7px 15px;
|
||||||
|
}
|
||||||
|
.cart-container .cart-items {
|
||||||
|
margin: 30px 0px 0px;
|
||||||
|
}
|
||||||
|
.cart-container .cart-item-table {
|
||||||
|
margin: 0px -15px;
|
||||||
|
}
|
||||||
|
.cart-container .cart-item-header {
|
||||||
|
border-bottom: 1px solid #d1d8dd;
|
||||||
|
}
|
||||||
|
.cart-container .cart-image-col {
|
||||||
|
padding-right: 0px;
|
||||||
|
}
|
||||||
|
.cart-container .cart-image {
|
||||||
|
max-width: 55px;
|
||||||
|
max-height: 55px;
|
||||||
|
margin-top: -5px;
|
||||||
|
}
|
||||||
|
.cart-container .cart-taxes {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
.cart-container .cart-taxes .row {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
.cart-container .tax-grand-total-row {
|
||||||
|
border-top: 1px solid #d1d8dd;
|
||||||
|
padding-top: 15px;
|
||||||
|
}
|
||||||
|
.cart-container .cart-addresses {
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
.cart-items .cart-dropdown,
|
||||||
|
.item_name_dropdown {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.cart-dropdown-container {
|
||||||
|
width: 350px;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
.cart-dropdown-container .item-price {
|
||||||
|
display: block !important;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
.cart-dropdown-container .cart-item-header {
|
||||||
|
border-bottom: 1px solid #d1d8dd;
|
||||||
|
}
|
||||||
|
.cart-dropdown-container .cart-items .cart-dropdown {
|
||||||
|
display: block;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
.cart-dropdown-container .item_name_dropdown {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.cart-dropdown-container .item-description,
|
||||||
|
.cart-dropdown-container .cart-items .checkout,
|
||||||
|
.cart-dropdown-container .item_name_and_description {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.cart-dropdown-container .checkout-btn {
|
||||||
|
margin: 15px;
|
||||||
|
}
|
||||||
|
.cart-dropdown-container .col-name-description {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
.product-list-link .row {
|
.product-list-link .row {
|
||||||
border-bottom: 1px solid #EBEFF2;
|
border-bottom: 1px solid #EBEFF2;
|
||||||
}
|
}
|
||||||
@ -147,3 +215,36 @@
|
|||||||
max-width: 350px;
|
max-width: 350px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.item-group-content {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
.product-image-img {
|
||||||
|
border: 1px solid #EBEFF2;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
.product-text {
|
||||||
|
border-top: 1px solid #EBEFF2;
|
||||||
|
padding: 15px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
height: 75px;
|
||||||
|
}
|
||||||
|
.product-image-wrapper {
|
||||||
|
padding-bottom: 30px;
|
||||||
|
}
|
||||||
|
.featured-product-heading,
|
||||||
|
.all-products {
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
.all-products {
|
||||||
|
font-weight: 300;
|
||||||
|
padding-left: 25px;
|
||||||
|
padding-right: 25px;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
.homepage-tagline {
|
||||||
|
font-size: 40px !important;
|
||||||
|
}
|
||||||
|
@ -12,6 +12,19 @@ frappe.ready(function() {
|
|||||||
}
|
}
|
||||||
// update login
|
// update login
|
||||||
shopping_cart.set_cart_count();
|
shopping_cart.set_cart_count();
|
||||||
|
|
||||||
|
$(".shopping-cart").on('shown.bs.dropdown', function() {
|
||||||
|
if (!$('.shopping-cart-menu .cart-container').length) {
|
||||||
|
return frappe.call({
|
||||||
|
method: 'erpnext.shopping_cart.cart.get_shopping_cart_menu',
|
||||||
|
callback: function(r) {
|
||||||
|
if (r.message) {
|
||||||
|
$('.shopping-cart-menu').html(r.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$.extend(shopping_cart, {
|
$.extend(shopping_cart, {
|
||||||
@ -33,6 +46,10 @@ $.extend(shopping_cart, {
|
|||||||
btn: opts.btn,
|
btn: opts.btn,
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
shopping_cart.set_cart_count();
|
shopping_cart.set_cart_count();
|
||||||
|
if (r.message.shopping_cart_menu) {
|
||||||
|
$('.shopping-cart-menu').html(r.message.shopping_cart_menu);
|
||||||
|
}
|
||||||
|
|
||||||
if(opts.callback)
|
if(opts.callback)
|
||||||
opts.callback(r);
|
opts.callback(r);
|
||||||
}
|
}
|
||||||
@ -43,13 +60,8 @@ $.extend(shopping_cart, {
|
|||||||
set_cart_count: function() {
|
set_cart_count: function() {
|
||||||
var cart_count = getCookie("cart_count");
|
var cart_count = getCookie("cart_count");
|
||||||
|
|
||||||
if($(".cart-icon").length == 0) {
|
if(cart_count) {
|
||||||
$('<div class="cart-icon small" style="float:right;padding:3px;border-radius:10px;\
|
$(".shopping-cart").toggle(true);
|
||||||
border: 1px solid #7575ff;">\
|
|
||||||
<a href="/cart" style="color:#7575ff; text-decoration: none">\
|
|
||||||
Cart\
|
|
||||||
<span style="color:#7575ff;" class="badge" id="cart-count">5</span>\
|
|
||||||
</a></div>').appendTo($('.shopping-cart'))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var $cart = $('.cart-icon');
|
var $cart = $('.cart-icon');
|
||||||
|
@ -94,7 +94,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.indicator {
|
.indicator {
|
||||||
font-size: inherit;
|
|
||||||
font-weight: inherit;
|
font-weight: inherit;
|
||||||
color: @text-muted;
|
color: @text-muted;
|
||||||
margin-left: -15px;
|
margin-left: -15px;
|
||||||
@ -161,6 +160,95 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cart-container {
|
||||||
|
margin: 50px 0px;
|
||||||
|
|
||||||
|
.cart-item-header .h6 {
|
||||||
|
padding: 7px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-items {
|
||||||
|
margin: 30px 0px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-item-table {
|
||||||
|
margin: 0px -15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-item-header {
|
||||||
|
border-bottom: 1px solid #d1d8dd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-image-col {
|
||||||
|
padding-right: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-image {
|
||||||
|
max-width: 55px;
|
||||||
|
max-height: 55px;
|
||||||
|
margin-top: -5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-taxes {
|
||||||
|
margin-top: 30px;
|
||||||
|
|
||||||
|
.row {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tax-grand-total-row {
|
||||||
|
border-top: 1px solid @border-color;
|
||||||
|
padding-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-addresses {
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-items .cart-dropdown,
|
||||||
|
.item_name_dropdown {
|
||||||
|
display:none;
|
||||||
|
|
||||||
|
}
|
||||||
|
.cart-dropdown-container {
|
||||||
|
width: 350px;
|
||||||
|
padding: 15px;
|
||||||
|
|
||||||
|
.item-price {
|
||||||
|
display: block !important;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-item-header {
|
||||||
|
border-bottom: 1px solid #d1d8dd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-items .cart-dropdown {
|
||||||
|
display:block;
|
||||||
|
margin-top:15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item_name_dropdown {
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-description,
|
||||||
|
.cart-items .checkout,
|
||||||
|
.item_name_and_description {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkout-btn {
|
||||||
|
margin:15px;
|
||||||
|
}
|
||||||
|
.col-name-description {
|
||||||
|
margin-bottom:8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.product-list-link {
|
.product-list-link {
|
||||||
.row {
|
.row {
|
||||||
border-bottom: 1px solid @light-border-color;
|
border-bottom: 1px solid @light-border-color;
|
||||||
@ -189,3 +277,43 @@
|
|||||||
max-width: 350px;
|
max-width: 350px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-group-content {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image-img {
|
||||||
|
border: 1px solid @light-border-color;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-text {
|
||||||
|
border-top: 1px solid @light-border-color;
|
||||||
|
padding: 15px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
height: 75px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image-wrapper {
|
||||||
|
padding-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.featured-product-heading, .all-products {
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.all-products {
|
||||||
|
font-weight: 300;
|
||||||
|
padding-left: 25px;
|
||||||
|
padding-right: 25px;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.homepage-tagline {
|
||||||
|
font-size:40px !important;
|
||||||
|
}
|
@ -58,7 +58,7 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
|||||||
if start < 0:
|
if start < 0:
|
||||||
start = 0
|
start = 0
|
||||||
context.update({
|
context.update({
|
||||||
"items": get_product_list_for_group(product_group = self.name, start=start, limit=24, search=frappe.form_dict.get("q")),
|
"items": get_product_list_for_group(product_group = self.name, start=start, limit=24, search=frappe.form_dict.get("search")),
|
||||||
"parent_groups": get_parent_item_groups(self.name),
|
"parent_groups": get_parent_item_groups(self.name),
|
||||||
"title": self.name,
|
"title": self.name,
|
||||||
"products_as_list": cint(frappe.db.get_single_value('Website Settings', 'products_as_list'))
|
"products_as_list": cint(frappe.db.get_single_value('Website Settings', 'products_as_list'))
|
||||||
|
@ -92,8 +92,9 @@ def update_cart(item_code, qty, with_items=False):
|
|||||||
|
|
||||||
set_cart_count(quotation)
|
set_cart_count(quotation)
|
||||||
|
|
||||||
if with_items:
|
context = get_cart_quotation(quotation)
|
||||||
context = get_cart_quotation(quotation)
|
|
||||||
|
if cint(with_items):
|
||||||
return {
|
return {
|
||||||
"items": frappe.render_template("templates/includes/cart/cart_items.html",
|
"items": frappe.render_template("templates/includes/cart/cart_items.html",
|
||||||
context),
|
context),
|
||||||
@ -101,7 +102,17 @@ def update_cart(item_code, qty, with_items=False):
|
|||||||
context),
|
context),
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
return quotation.name
|
return {
|
||||||
|
'name': quotation.name,
|
||||||
|
'shopping_cart_menu': get_shopping_cart_menu(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_shopping_cart_menu(context=None):
|
||||||
|
if not context:
|
||||||
|
context = get_cart_quotation()
|
||||||
|
|
||||||
|
return frappe.render_template('templates/includes/cart/cart_dropdown.html', context)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def update_cart_address(address_fieldname, address_name):
|
def update_cart_address(address_fieldname, address_name):
|
||||||
|
@ -329,9 +329,12 @@ def update_billed_amount_based_on_so(so_detail, update_modified=True):
|
|||||||
def get_list_context(context=None):
|
def get_list_context(context=None):
|
||||||
from erpnext.controllers.website_list_for_contact import get_list_context
|
from erpnext.controllers.website_list_for_contact import get_list_context
|
||||||
list_context = get_list_context(context)
|
list_context = get_list_context(context)
|
||||||
list_context["title"] = _("My Shipments")
|
list_context.update({
|
||||||
list_context["show_sidebar"] = True
|
'show_sidebar': True,
|
||||||
list_context["show_search"] = True
|
'show_search': True,
|
||||||
|
'no_breadcrumbs': True,
|
||||||
|
'title': _('Shipments'),
|
||||||
|
})
|
||||||
return list_context
|
return list_context
|
||||||
|
|
||||||
def get_invoiced_qty_map(delivery_note):
|
def get_invoiced_qty_map(delivery_note):
|
||||||
|
@ -148,6 +148,7 @@ class Item(WebsiteGenerator):
|
|||||||
"file_url": self.website_image
|
"file_url": self.website_image
|
||||||
}, fields=["name", "is_private"], order_by="is_private asc", limit_page_length=1)
|
}, fields=["name", "is_private"], order_by="is_private asc", limit_page_length=1)
|
||||||
|
|
||||||
|
|
||||||
if file:
|
if file:
|
||||||
file = file[0]
|
file = file[0]
|
||||||
|
|
||||||
|
@ -55,11 +55,12 @@ class Issue(Document):
|
|||||||
|
|
||||||
def get_list_context(context=None):
|
def get_list_context(context=None):
|
||||||
return {
|
return {
|
||||||
"title": _("My Issues"),
|
"title": _("Issues"),
|
||||||
"get_list": get_issue_list,
|
"get_list": get_issue_list,
|
||||||
"row_template": "templates/includes/issue_row.html",
|
"row_template": "templates/includes/issue_row.html",
|
||||||
"show_sidebar": True,
|
"show_sidebar": True,
|
||||||
"show_search": True
|
"show_search": True,
|
||||||
|
'no_breadcrumbs': True
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_issue_list(doctype, txt, filters, limit_start, limit_page_length=20):
|
def get_issue_list(doctype, txt, filters, limit_start, limit_page_length=20):
|
||||||
|
@ -52,8 +52,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div style="min-height: 100px; margin: 10px 0;">
|
<div style="min-height: 100px; margin: 10px 0;">
|
||||||
<h4 class="item-price" itemprop="price"></h4>
|
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
|
||||||
<div class="item-stock" itemprop="availablity"></div>
|
<h4 class="item-price" itemprop="price"></h4>
|
||||||
|
<div class="item-stock" itemprop="availability"></div>
|
||||||
|
</div>
|
||||||
<div class="item-cart hide">
|
<div class="item-cart hide">
|
||||||
<div id="item-add-to-cart">
|
<div id="item-add-to-cart">
|
||||||
<button class="btn btn-primary btn-sm">
|
<button class="btn btn-primary btn-sm">
|
||||||
@ -71,7 +73,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row item-website-description" style="margin-top:30px; margin-bottom:20px">
|
<div class="row item-website-description" style="margin-top:30px; margin-bottom:20px">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<h4>{{ _("DESCRIPTION") }}</h4>
|
<div class="h6 text-uppercase">{{ _("Description") }}</div>
|
||||||
<div itemprop="description" class="item-desc">
|
<div itemprop="description" class="item-desc">
|
||||||
{{ web_long_description or description or _("No description given") }}
|
{{ web_long_description or description or _("No description given") }}
|
||||||
</div>
|
</div>
|
||||||
@ -81,7 +83,7 @@
|
|||||||
{% if website_specifications -%}
|
{% if website_specifications -%}
|
||||||
<div class="row item-website-specification" style="margin-top: 40px">
|
<div class="row item-website-specification" style="margin-top: 40px">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<h4>{{ _("SPECIFICATIONS") }}</h4>
|
<div class="h6 text-uppercase">{{ _("Specifications") }}</div>
|
||||||
|
|
||||||
<table class="table borderless" style="width: 100%">
|
<table class="table borderless" style="width: 100%">
|
||||||
{% for d in website_specifications -%}
|
{% for d in website_specifications -%}
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
{% extends "templates/web.html" %}
|
{% extends "templates/web.html" %}
|
||||||
|
|
||||||
{#{% block header_actions %}
|
|
||||||
{% include 'templates/includes/product_search_box.html' %}
|
|
||||||
{% endblock %}#}
|
|
||||||
{% block header %}<h1>{{ _("Products") }}</h1>{% endblock %}
|
{% block header %}<h1>{{ _("Products") }}</h1>{% endblock %}
|
||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
<div class="page-breadcrumbs" data-html-block="breadcrumbs">
|
<div class="page-breadcrumbs" data-html-block="breadcrumbs">
|
||||||
@ -16,7 +13,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block page_content %}
|
{% block page_content %}
|
||||||
<div class="item-group-content">
|
<div class="item-group-content" itemscope itemtype="http://schema.org/Product">
|
||||||
<div>
|
<div>
|
||||||
{% if slideshow %}<!-- slideshow -->
|
{% if slideshow %}<!-- slideshow -->
|
||||||
{% include "templates/includes/slideshow.html" %}
|
{% include "templates/includes/slideshow.html" %}
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
.cart-content {
|
|
||||||
min-height: 400px;
|
|
||||||
margin-top: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-header, .cart-footer {
|
|
||||||
margin-bottom: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-item-header {
|
|
||||||
padding-bottom: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
border-bottom: 1px solid #d1d8dd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tax-grand-total-row {
|
|
||||||
font-size: 14px;
|
|
||||||
margin-top: 30px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-addresses {
|
|
||||||
margin-top: 80px;
|
|
||||||
margin-bottom: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-link {
|
|
||||||
margin-top: 40px;
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -16,6 +16,7 @@ $.extend(shopping_cart, {
|
|||||||
shopping_cart.bind_address_select();
|
shopping_cart.bind_address_select();
|
||||||
shopping_cart.bind_place_order();
|
shopping_cart.bind_place_order();
|
||||||
shopping_cart.bind_change_qty();
|
shopping_cart.bind_change_qty();
|
||||||
|
shopping_cart.bind_remove_item();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -72,6 +73,24 @@ $.extend(shopping_cart, {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
bind_remove_item: function() {
|
||||||
|
$(".cart-items").on("click", ".remove-item", function() {
|
||||||
|
var item_code = $(this).attr("data-item-code");
|
||||||
|
shopping_cart.update_cart({
|
||||||
|
item_code: item_code,
|
||||||
|
qty: "0",
|
||||||
|
callback: function(r) {
|
||||||
|
location.reload();
|
||||||
|
if(!r.exc) {
|
||||||
|
$(".cart-items").html(r.message.items);
|
||||||
|
$(".cart-tax-items").html(r.message.taxes);
|
||||||
|
$(".cart-icon").hide();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
render_tax_row: function($cart_taxes, doc, shipping_rules) {
|
render_tax_row: function($cart_taxes, doc, shipping_rules) {
|
||||||
var shipping_selector;
|
var shipping_selector;
|
||||||
if(shipping_rules) {
|
if(shipping_rules) {
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
{% from "erpnext/templates/includes/cart/cart_macros.html"
|
{% from "erpnext/templates/includes/cart/cart_macros.html" import show_address %}
|
||||||
import show_address %}
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% if addresses|length == 1%}
|
{% if addresses|length == 1%}
|
||||||
{% set select_address = True %}
|
{% set select_address = True %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h4>{{ _("Shipping Address") }}</h4>
|
<div class="h6 text-uppercase">{{ _("Shipping Address") }}</div>
|
||||||
<div id="cart-shipping-address" class="panel-group"
|
<div id="cart-shipping-address" class="panel-group"
|
||||||
data-fieldname="shipping_address_name">
|
data-fieldname="shipping_address_name">
|
||||||
{% for address in addresses %}
|
{% for address in addresses %}
|
||||||
@ -16,7 +15,7 @@
|
|||||||
{{ _("Manage Addresses") }}</a>
|
{{ _("Manage Addresses") }}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h4>Billing Address</h4>
|
<div class="h6 text-uppercase">Billing Address</div>
|
||||||
<div id="cart-billing-address" class="panel-group"
|
<div id="cart-billing-address" class="panel-group"
|
||||||
data-fieldname="customer_address">
|
data-fieldname="customer_address">
|
||||||
{% for address in addresses %}
|
{% for address in addresses %}
|
||||||
|
26
erpnext/templates/includes/cart/cart_dropdown.html
Normal file
26
erpnext/templates/includes/cart/cart_dropdown.html
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<div class="cart-dropdown-container">
|
||||||
|
<div id="cart-error" class="alert alert-danger"
|
||||||
|
style="display: none;"></div>
|
||||||
|
<div class="row cart-items-dropdown cart-item-header text-muted">
|
||||||
|
<div class="col-sm-7 col-xs-6 h6 text-uppercase">
|
||||||
|
{{ _("Item") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 col-xs-2 text-right h6 text-uppercase">
|
||||||
|
{{ _("Qty") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 col-xs-2 text-right h6 text-uppercase">
|
||||||
|
{{ _("Price") }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if doc.items %}
|
||||||
|
<div class="cart-items">
|
||||||
|
{% include "templates/includes/cart/cart_items.html" %}
|
||||||
|
</div>
|
||||||
|
<div class="text-center checkout-btn">
|
||||||
|
<p class="text-center"><a href="/cart" class="btn btn-primary">{{ _("Checkout") }}</a></p>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<p>{{ _("Cart is Empty") }}</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
@ -1,23 +1,34 @@
|
|||||||
{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %}
|
{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %}
|
||||||
|
|
||||||
{% for d in doc.items %}
|
{% for d in doc.items %}
|
||||||
<div class="cart-item">
|
<div class="row cart-items checkout">
|
||||||
<div class="row">
|
<div class="col-sm-8 col-xs-6 col-name-description">
|
||||||
<div class="col-sm-8 col-xs-6" style="margin-bottom: 10px;">
|
{{ item_name_and_description(d) }}
|
||||||
{{ item_name_and_description(d) }}
|
</div>
|
||||||
</div>
|
<div class="col-sm-2 col-xs-3 text-right col-qty">
|
||||||
<div class="col-sm-2 col-xs-3 text-right">
|
<span style="max-width: 50px; display: inline-block">
|
||||||
<span style="max-width: 50px; display: inline-block">
|
<input class="form-control text-right cart-qty"
|
||||||
<input class="form-control text-right cart-qty"
|
value = "{{ d.get_formatted('qty') }}"
|
||||||
value = "{{ d.get_formatted('qty') }}"
|
data-item-code="{{ d.item_code }}"></span>
|
||||||
data-item-code="{{ d.item_code }}"></span>
|
<span class="text-muted small remove-item" data-item-code="{{ d.item_code }}">{{_("Remove")}}</span>
|
||||||
<p class="text-muted small" style="margin-top: 10px;">
|
</div>
|
||||||
{{ _("Rate") + ': ' + d.get_formatted("rate") }}
|
<div class="col-sm-2 col-xs-3 text-right col-amount">
|
||||||
</p>
|
{{ d.get_formatted("amount") }}
|
||||||
</div>
|
<p class="text-muted small item-rate">{{
|
||||||
<div class="col-sm-2 col-xs-3 text-right">
|
_("Rate: {0}").format(d.get_formatted("rate")) }}</p>
|
||||||
{{ d.get_formatted("amount") }}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row cart-items cart-dropdown">
|
||||||
|
<div class="col-sm-7 col-xs-6 col-name-description">
|
||||||
|
{{ item_name_and_description(d) }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 col-xs-2 text-right col-qty">
|
||||||
|
{{ d.get_formatted('qty') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 col-xs-2 text-right col-amount">
|
||||||
|
{{ d.get_formatted("amount") }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
@ -1,11 +1,11 @@
|
|||||||
<div class="web-list-item">
|
<div class="web-list-item transaction-list-item">
|
||||||
<a class="no-decoration" href="/issues?name={{ doc.name }}">
|
<a href="/issues?name={{ doc.name }}">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-8">
|
<div class="col-xs-8">
|
||||||
<span class="indicator {{ "red" if doc.status=="Open" else "darkgrey" }}">
|
<span class="indicator {{ "red" if doc.status=="Open" else "darkgrey" }}">
|
||||||
{{ doc.name }}</span>
|
{{ doc.name }}</span>
|
||||||
<span style="margin-left: 15px;">
|
<div class="items-preview text-ellipsis">
|
||||||
{{ doc.subject }}</span>
|
{{ doc.subject }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4 text-right small text-muted">
|
<div class="col-xs-4 text-right small text-muted">
|
||||||
{{ frappe.format_date(doc.modified) }}
|
{{ frappe.format_date(doc.modified) }}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{% macro product_image_square(website_image, css_class="") %}
|
{% macro product_image_square(website_image, css_class="") %}
|
||||||
|
{% if website_image -%} <meta itemprop="image" content="{{ frappe.utils.quoted(website_image) | abs_url }}"></meta>{%- endif %}
|
||||||
<div class="product-image product-image-square {% if not website_image -%} missing-image {%- endif %} {{ 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 website_image -%} style="background-image: url('{{ frappe.utils.quoted(website_image) | abs_url }}');" {%- endif %}>
|
||||||
</div>
|
</div>
|
||||||
@ -7,7 +8,7 @@
|
|||||||
{% macro product_image(website_image, css_class="") %}
|
{% macro product_image(website_image, css_class="") %}
|
||||||
<div class="product-image {% if not website_image -%} missing-image {%- endif %} {{ css_class }}">
|
<div class="product-image {% if not website_image -%} missing-image {%- endif %} {{ css_class }}">
|
||||||
{% if website_image -%}
|
{% if website_image -%}
|
||||||
<img src="{{ frappe.utils.quoted(website_image) | abs_url }}" class="img-responsive">
|
<img itemprop="image" src="{{ frappe.utils.quoted(website_image) | abs_url }}" class="img-responsive">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
12
erpnext/templates/includes/navbar/navbar_items.html
Normal file
12
erpnext/templates/includes/navbar/navbar_items.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{% extends 'frappe/templates/includes/navbar/navbar_items.html' %}
|
||||||
|
|
||||||
|
{% block navbar_right_extension %}
|
||||||
|
<li class="dropdown shopping-cart">
|
||||||
|
<div class="cart-icon small">
|
||||||
|
<a class="dropdown-toggle" href="#" data-toggle="dropdown" id="navLogin">
|
||||||
|
Cart <span class="badge-wrapper" id="cart-count"></span>
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu shopping-cart-menu"></div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{% endblock %}
|
@ -1,7 +1,7 @@
|
|||||||
{% from "erpnext/templates/includes/macros.html" import product_image_square %}
|
{% from "erpnext/templates/includes/macros.html" import product_image_square %}
|
||||||
|
|
||||||
{% macro item_name_and_description(d) %}
|
{% macro item_name_and_description(d) %}
|
||||||
<div class="row">
|
<div class="row item_name_and_description">
|
||||||
<div class="col-xs-4 col-sm-2 order-image-col">
|
<div class="col-xs-4 col-sm-2 order-image-col">
|
||||||
<div class="order-image">
|
<div class="order-image">
|
||||||
{{ product_image_square(d.image) }}
|
{{ product_image_square(d.image) }}
|
||||||
@ -9,7 +9,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-xs-8 col-sm-10">
|
<div class="col-xs-8 col-sm-10">
|
||||||
{{ d.item_code }}
|
{{ d.item_code }}
|
||||||
<p class="text-muted small">{{ d.description }}</p>
|
<p class="text-muted small item-description">{{ d.description }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row item_name_dropdown">
|
||||||
|
<div class="col-xs-4 col-sm-4 order-image-col">
|
||||||
|
<div class="order-image">
|
||||||
|
{{ product_image_square(d.image) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-8 col-sm-8">
|
||||||
|
{{ d.item_code }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
@ -1,8 +1,10 @@
|
|||||||
{% from "erpnext/templates/includes/macros.html" import product_image_square %}
|
{% from "erpnext/templates/includes/macros.html" import product_image_square %}
|
||||||
|
|
||||||
<a class="product-link" href="{{ (route or page_name)|abs_url }}">
|
<a class="product-link" href="{{ (route or page_name)|abs_url }}">
|
||||||
<div class="col-sm-2 col-xs-4 product-image-wrapper">
|
<div class="col-sm-4 col-xs-4 product-image-wrapper">
|
||||||
|
<div class="product-image-img">
|
||||||
{{ product_image_square(thumbnail or website_image) }}
|
{{ product_image_square(thumbnail or website_image) }}
|
||||||
<div class="text-ellipsis inline-block small product-text">{{ item_name }}</div>
|
<div class="product-text" itemprop="name">{{ item_name }}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -83,7 +83,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.progress-hg{
|
.progress-hg{
|
||||||
margin-bottom: 0!important;
|
margin-bottom: 30!important;
|
||||||
margin-top: 30px!important;
|
height:2px;
|
||||||
height:5px;
|
|
||||||
}
|
}
|
@ -2,21 +2,17 @@
|
|||||||
<a href="/{{ pathname }}/{{ doc.name }}">
|
<a href="/{{ pathname }}/{{ doc.name }}">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<span>{{ doc.name }}</span>
|
<span class="indicator small {{ doc.indicator_color or "darkgrey" }}">
|
||||||
<div class="small text-muted items-preview text-ellipsis">
|
{{ doc.name }}</span>
|
||||||
|
<div class="items-preview text-ellipsis">
|
||||||
{{ doc.items_preview }}
|
{{ doc.items_preview }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-6 text-right">
|
||||||
<span class="indicator {{ doc.indicator_color or "darkgrey" }}">
|
|
||||||
{{ doc.indicator_title or doc.status }}
|
|
||||||
</span>
|
|
||||||
<div class="small text-muted transaction-time"
|
<div class="small text-muted transaction-time"
|
||||||
title="{{ frappe.utils.format_datetime(doc.modified, "medium") }}">
|
title="{{ frappe.utils.format_datetime(doc.modified, "medium") }}">
|
||||||
{{ frappe.utils.pretty_date(doc.modified) }}
|
{{ frappe.utils.format_datetime(doc.modified, "medium") }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="col-sm-2 text-right">
|
|
||||||
{{ doc.get_formatted("grand_total") }}
|
{{ doc.get_formatted("grand_total") }}
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-sm-3 text-right">
|
<!-- <div class="col-sm-3 text-right">
|
||||||
|
@ -8,12 +8,6 @@
|
|||||||
<script>{% include "templates/includes/cart.js" %}</script>
|
<script>{% include "templates/includes/cart.js" %}</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block style %}
|
|
||||||
<style>
|
|
||||||
{% include "templates/includes/cart.css" %}
|
|
||||||
</style>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
|
|
||||||
{% block header_actions %}
|
{% block header_actions %}
|
||||||
{% if doc.items %}
|
{% if doc.items %}
|
||||||
@ -27,57 +21,55 @@
|
|||||||
|
|
||||||
{% from "templates/includes/macros.html" import item_name_and_description %}
|
{% from "templates/includes/macros.html" import item_name_and_description %}
|
||||||
|
|
||||||
<div class="cart-content">
|
<div class="cart-container">
|
||||||
<div id="cart-container">
|
<div id="cart-error" class="alert alert-danger"
|
||||||
<div id="cart-error" class="alert alert-danger"
|
style="display: none;"></div>
|
||||||
style="display: none;"></div>
|
<div class="row cart-items cart-item-header text-muted">
|
||||||
<div id="cart-items">
|
<div class="col-sm-8 col-xs-6 h6 text-uppercase">
|
||||||
<div class="row cart-item-header">
|
{{ _("Item") }}
|
||||||
<div class="col-sm-8 col-xs-6">
|
</div>
|
||||||
Items
|
<div class="col-sm-2 col-xs-3 text-right h6 text-uppercase">
|
||||||
</div>
|
{{ _("Qty") }}
|
||||||
<div class="col-sm-2 col-xs-3 text-right">
|
</div>
|
||||||
Qty
|
<div class="col-sm-2 col-xs-3 text-right h6 text-uppercase">
|
||||||
</div>
|
{{ _("Subtotal") }}
|
||||||
<div class="col-sm-2 col-xs-3 text-right">
|
</div>
|
||||||
Amount
|
</div>
|
||||||
</div>
|
{% if doc.items %}
|
||||||
</div>
|
<div class="cart-items">
|
||||||
{% if doc.items %}
|
{% include "templates/includes/cart/cart_items.html" %}
|
||||||
<div class="cart-items">
|
</div>
|
||||||
{% include "templates/includes/cart/cart_items.html" %}
|
{% else %}
|
||||||
</div>
|
<p>{{ _("Cart is Empty") }}</p>
|
||||||
{% else %}
|
{% endif %}
|
||||||
<p>{{ _("Cart is Empty") }}</p>
|
|
||||||
{% endif %}
|
{% if doc.items %}
|
||||||
</div>
|
<!-- taxes -->
|
||||||
{% if doc.items %}
|
<div class="row cart-taxes">
|
||||||
<!-- taxes -->
|
<div class="col-sm-6"><!-- empty --></div>
|
||||||
<div class="cart-taxes row small">
|
<div class="col-sm-6 text-right">
|
||||||
<div class="col-sm-8"><!-- empty --></div>
|
{% include "templates/includes/order/order_taxes.html" %}
|
||||||
<div class="col-sm-4 cart-tax-items">
|
</div>
|
||||||
{% include "templates/includes/order/order_taxes.html" %}
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
{% if doc.tc_name %}
|
||||||
<div id="cart-totals">
|
<div class="cart-terms" style="display: none;" title={{doc.tc_name}}>
|
||||||
</div>
|
{{doc.tc_name}}
|
||||||
{% if doc.tc_name %}
|
{{doc.terms}}
|
||||||
<div class="cart-terms" style="display: none;" title={{doc.tc_name}}>
|
</div>
|
||||||
{{doc.tc_name}}
|
<div class="cart-link">
|
||||||
{{doc.terms}}
|
<a href="#" onclick="show_terms();return false;">*Terms and Conditions</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="cart-link">
|
{% endif %}
|
||||||
<a href="#" onclick="show_terms();return false;">*Terms and Conditions</a>
|
|
||||||
</div>
|
<div class="cart-addresses">
|
||||||
{% endif %}
|
{% include "templates/includes/cart/cart_address.html" %}
|
||||||
<div class="cart-addresses">
|
</div>
|
||||||
{% include "templates/includes/cart/cart_address.html" %}
|
|
||||||
</div>
|
<p class="cart-footer text-right">
|
||||||
<p class="cart-footer text-right">
|
<button class="btn btn-primary btn-place-order btn-sm" type="button">
|
||||||
<button class="btn btn-primary btn-place-order btn-sm" type="button">
|
{{ _("Place Order") }}</button></p>
|
||||||
{{ _("Place Order") }}</button></p>
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- no-sidebar -->
|
<!-- no-sidebar -->
|
||||||
|
@ -7,32 +7,27 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<h2 class="text-center">{{ homepage.tag_line or '' }}</h2>
|
<div class="homepage-tagline h1 text-center">{{ homepage.tag_line or '' }}</div>
|
||||||
<p class="lead text-center">{{ homepage.description or '' }}</p>
|
<p class="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 %}
|
{% if homepage.products %}
|
||||||
<!-- TODO: styling of this section -->
|
<div class='featured-products-section' itemscope itemtype="http://schema.org/Product">
|
||||||
<div class='featured-products-section'>
|
<h5 class='featured-product-heading'>{{ _("Featured Products") }}</h5>
|
||||||
<h5 class='text-uppercase'>{{ _("Featured Products") }}</h5>
|
|
||||||
<div class="featured-products">
|
<div class="featured-products">
|
||||||
<div id="search-list" class="row" style="margin-top:40px;">
|
<div id="search-list" class="row" style="margin-top:40px;">
|
||||||
{% for item in homepage.products %}
|
{% for item in homepage.products %}
|
||||||
<a class="product-link" href="{{ item.route | abs_url }}">
|
<a class="product-link" href="{{ item.route|abs_url }}">
|
||||||
<div class="col-sm-4 product-image-wrapper">
|
<div class="col-sm-4 col-xs-4 product-image-wrapper">
|
||||||
{{ product_image_square(item.thumbnail or item.image) }}
|
<div class="product-image-img">
|
||||||
<div class="text-ellipsis inline-block small product-text">
|
{{ product_image_square(item.thumbnail or item.image) }}
|
||||||
{{ item.item_name }}
|
<div class="product-text" itemprop="name">{{ item.item_name }}</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- TODO: remove hardcoding of /products -->
|
<!-- TODO: remove hardcoding of /products -->
|
||||||
<p class="text-center"><a href="/products" class="btn btn-primary">More Products</a></p>
|
<div class=" text-center text-uppercase"><a href="/products" class="btn btn-primary all-products"> {{ _("View All Products") }}</a></div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
@ -42,7 +37,16 @@
|
|||||||
{% block style %}
|
{% block style %}
|
||||||
<style>
|
<style>
|
||||||
.featured-products-section {
|
.featured-products-section {
|
||||||
margin-top: 75px;
|
margin-top: 95px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.home-login {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
.btn-login {
|
||||||
|
width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -11,34 +11,11 @@ no_sitemap = 1
|
|||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
homepage = frappe.get_doc('Homepage')
|
homepage = frappe.get_doc('Homepage')
|
||||||
|
|
||||||
|
for item in homepage.products:
|
||||||
|
item.route = '/' + '/'.join(frappe.db.get_value('Item', item.item_code, ['parent_website_route', 'page_name']))
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'homepage': homepage
|
'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
|
|
||||||
|
|
||||||
# base query
|
|
||||||
query = """select name, item_name, page_name, website_image, thumbnail, item_group,
|
|
||||||
web_long_description as website_description, parent_website_route
|
|
||||||
from `tabItem`
|
|
||||||
where show_in_website = 1
|
|
||||||
and disabled=0
|
|
||||||
and (end_of_life is null or end_of_life='0000-00-00' or end_of_life > %(today)s)
|
|
||||||
and (variant_of is null or variant_of = '')"""
|
|
||||||
|
|
||||||
# order by
|
|
||||||
query += """ order by weightage desc, idx desc, modified desc limit %s, %s""" % (start, limit)
|
|
||||||
|
|
||||||
data = frappe.db.sql(query, {
|
|
||||||
"today": nowdate()
|
|
||||||
}, as_dict=1)
|
|
||||||
|
|
||||||
for d in data:
|
|
||||||
d.route = ((d.parent_website_route + "/") if d.parent_website_route else "") \
|
|
||||||
+ (d.page_name or "")
|
|
||||||
|
|
||||||
return [get_item_for_list_in_html(r) for r in data]
|
|
||||||
|
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
{% block breadcrumbs %}
|
{% block breadcrumbs %}
|
||||||
{% include "templates/includes/breadcrumbs.html" %}
|
{% include "templates/includes/breadcrumbs.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block title %}
|
||||||
|
{{ doc.name }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<h1>{{ doc.name }}</h1>
|
<h1>{{ doc.name }}</h1>
|
||||||
|
@ -3,27 +3,10 @@
|
|||||||
{% block title %}{{ doc.project_name }}{% endblock %}
|
{% block title %}{{ doc.project_name }}{% endblock %}
|
||||||
|
|
||||||
{%- from "templates/includes/projects/macros.html" import back_link -%}
|
{%- from "templates/includes/projects/macros.html" import back_link -%}
|
||||||
{% block header %}<h1>{{ doc.project_name }}</h1>{% endblock %}
|
{% block header %}
|
||||||
{% block header_actions %}{% if doc.percent_complete %}
|
<h1>{{ doc.project_name }}</h1>
|
||||||
<div class="progress progress-hg">
|
|
||||||
<div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success" }} active" role="progressbar"
|
|
||||||
aria-valuenow="{{ doc.percent_complete|round|int }}"
|
|
||||||
aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}{% endblock %}
|
|
||||||
{% block breadcrumbs %}
|
|
||||||
<div class="page-breadcrumbs" data-html-block="breadcrumbs">
|
|
||||||
<ul class="breadcrumb">
|
|
||||||
<li>
|
|
||||||
<span class="icon icon-angle-left"></span>
|
|
||||||
<a href="/project">Projects</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block style %}
|
{% block style %}
|
||||||
<style>
|
<style>
|
||||||
{% include "templates/includes/projects.css" %}
|
{% include "templates/includes/projects.css" %}
|
||||||
@ -32,7 +15,13 @@
|
|||||||
|
|
||||||
|
|
||||||
{% block page_content %}
|
{% block page_content %}
|
||||||
|
{% if doc.percent_complete %}
|
||||||
|
<div class="progress progress-hg">
|
||||||
|
<div class="progress-bar progress-bar-{{ "warning" if doc.percent_complete|round < 100 else "success" }} active" role="progressbar" aria-valuenow="{{ doc.percent_complete|round|int }}"
|
||||||
|
aria-valuemin="0" aria-valuemax="100" style="width:{{ doc.percent_complete|round|int }}%;">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<h4 style="float: left;">{{ _("Tasks") }}</h4>
|
<h4 style="float: left;">{{ _("Tasks") }}</h4>
|
||||||
|
@ -18,10 +18,10 @@ def get_context(context):
|
|||||||
project.has_permission('read')
|
project.has_permission('read')
|
||||||
|
|
||||||
project.tasks = get_tasks(project.name, start=0, item_status='open',
|
project.tasks = get_tasks(project.name, start=0, item_status='open',
|
||||||
search=frappe.form_dict.get("q"))
|
search=frappe.form_dict.get("search"))
|
||||||
|
|
||||||
project.timelogs = get_timelogs(project.name, start=0,
|
project.timelogs = get_timelogs(project.name, start=0,
|
||||||
search=frappe.form_dict.get("q"))
|
search=frappe.form_dict.get("search"))
|
||||||
|
|
||||||
|
|
||||||
context.doc = project
|
context.doc = project
|
||||||
|
@ -122,9 +122,10 @@ def get_territory_from_address(address):
|
|||||||
def get_list_context(context=None):
|
def get_list_context(context=None):
|
||||||
from erpnext.shopping_cart.cart import get_address_docs
|
from erpnext.shopping_cart.cart import get_address_docs
|
||||||
return {
|
return {
|
||||||
"title": _("My Addresses"),
|
"title": _("Addresses"),
|
||||||
"get_list": get_address_docs,
|
"get_list": get_address_docs,
|
||||||
"row_template": "templates/includes/address_row.html",
|
"row_template": "templates/includes/address_row.html",
|
||||||
|
'no_breadcrumbs': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
def has_website_permission(doc, ptype, user, verbose=False):
|
def has_website_permission(doc, ptype, user, verbose=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user