[cleanup] homepage
diff --git a/erpnext/templates/generators/item.html b/erpnext/templates/generators/item.html
index e074fa3..cf6f89b 100644
--- a/erpnext/templates/generators/item.html
+++ b/erpnext/templates/generators/item.html
@@ -20,7 +20,7 @@
</div>
<div class="col-sm-6" style="padding-left:20px;">
<h2 itemprop="name" style="margin-top: 0px;">{{ item_name }}</h2>
-
+
<p class="text-muted">
{{ _("Item Code") }}: <span itemprop="productID">{{ variant and variant.name or name }}</span></p>
<br>
@@ -55,7 +55,7 @@
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<h4 class="item-price" itemprop="price"></h4>
<div class="item-stock" itemprop="availability"></div>
- </div>
+ </div>
<div class="item-cart hide">
<div id="item-add-to-cart">
<button class="btn btn-primary btn-sm">
@@ -79,7 +79,7 @@
</div>
</div>
</div>
-
+
{% if website_specifications -%}
<div class="row item-website-specification" style="margin-top: 40px">
<div class="col-md-12">
diff --git a/erpnext/templates/includes/order/order_macros.html b/erpnext/templates/includes/order/order_macros.html
index 1bb7b2c..3f8affe 100644
--- a/erpnext/templates/includes/order/order_macros.html
+++ b/erpnext/templates/includes/order/order_macros.html
@@ -9,15 +9,15 @@
</div>
<div class="col-xs-8 col-sm-10">
{{ d.item_code }}
- <p class="text-muted small item-description">{{ d.description }}</p>
+ <div class="text-muted small item-description">{{ d.description }}</div>
</div>
</div>
-
+
<div class="row item_name_dropdown">
<div class="col-xs-4 col-sm-4 order-image-col">
<div class="order-image">
<span class="cart-count-badge pull-right small"> {{ d.get_formatted('qty') }} </span>{{ product_image_square(d.image) }}
- </div>
+ </div>
</div>
<div class="col-xs-8 col-sm-8">
{{ d.item_code }}
diff --git a/erpnext/templates/includes/order/order_taxes.html b/erpnext/templates/includes/order/order_taxes.html
index 564e31e..24ae088 100644
--- a/erpnext/templates/includes/order/order_taxes.html
+++ b/erpnext/templates/includes/order/order_taxes.html
@@ -13,9 +13,9 @@
</div>
{% endfor %}
<div class="row tax-grand-total-row">
- <div class="col-xs-8 text-right">{{ _("Grand Total") }}</div>
+ <div class="col-xs-8 text-right text-uppercase h6 text-muted">{{ _("Grand Total") }}</div>
<div class="col-xs-4 text-right">
- <span class="tax-grand-total">
+ <span class="tax-grand-total bold">
{{ doc.get_formatted("grand_total") }}
</span>
</div>
diff --git a/erpnext/templates/includes/transaction_row.html b/erpnext/templates/includes/transaction_row.html
index 2165a06..17f9b90 100644
--- a/erpnext/templates/includes/transaction_row.html
+++ b/erpnext/templates/includes/transaction_row.html
@@ -3,17 +3,17 @@
<div class="row">
<div class="col-sm-5">
<span class="indicator small {{ doc.indicator_color or "darkgrey" }}">
- {{ doc.name }}</span>
+ {{ doc.name }}</span>
<div class="small text-muted transaction-time"
title="{{ frappe.utils.format_datetime(doc.modified, "medium") }}">
{{ frappe.utils.format_datetime(doc.modified, "medium") }}
- </div>
+ </div>
</div>
<div class="col-sm-4 items-preview text-ellipsis">
{{ doc.items_preview }}
</div>
- <div class="col-sm-3 text-right">
- {{ doc.get_formatted("grand_total") }}
+ <div class="col-sm-3 text-right bold">
+ {{ doc.get_formatted("grand_total") }}
</div>
<!-- <div class="col-sm-3 text-right">
diff --git a/erpnext/templates/pages/home.html b/erpnext/templates/pages/home.html
index 5ec396d..689d94e 100644
--- a/erpnext/templates/pages/home.html
+++ b/erpnext/templates/pages/home.html
@@ -27,7 +27,7 @@
</div>
</div>
<!-- TODO: remove hardcoding of /products -->
- <div class=" text-center text-uppercase"><a href="/products" class="btn btn-primary all-products"> {{ _("View All Products") }}</a></div>
+ <div class="text-center"><a href="/products" class="btn btn-primary all-products"> {{ _("View All Products") }}</a></div>
</div>
{% endif %}
</div>
@@ -46,7 +46,7 @@
.btn-login {
width: 80px;
}
-
-
+
+
</style>
{% endblock %}
diff --git a/erpnext/templates/pages/home.py b/erpnext/templates/pages/home.py
index e7ff2ce..4440f7e 100644
--- a/erpnext/templates/pages/home.py
+++ b/erpnext/templates/pages/home.py
@@ -3,19 +3,27 @@
from __future__ import unicode_literals
import frappe
-from frappe.utils import cstr, nowdate
-from erpnext.setup.doctype.item_group.item_group import get_item_for_list_in_html
no_cache = 1
no_sitemap = 1
def get_context(context):
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']))
-
-
+ parent_website_route, page_name = frappe.db.get_value('Item', item.item_code,
+ ['parent_website_route', 'page_name'])
+ item.route = '/' + '/'.join(filter(None, [parent_website_route, page_name]))
+
+ # show atleast 3 products
+ if len(homepage.products) < 3:
+ for i in xrange(3 - len(homepage.products)):
+ homepage.append('products', {
+ 'item_code': 'product-{0}'.format(i),
+ 'item_name': frappe._('Product {0}').format(i),
+ 'route': '#'
+ })
+
return {
'homepage': homepage
}
\ No newline at end of file
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html
index 98f7431..61b4546 100644
--- a/erpnext/templates/pages/order.html
+++ b/erpnext/templates/pages/order.html
@@ -59,7 +59,7 @@
<div class="col-sm-2 col-xs-3 text-right">
{{ d.get_formatted("amount") }}
<p class="text-muted small">{{
- _("Rate: {0}").format(d.get_formatted("rate")) }}</p>
+ _("@ {0}").format(d.get_formatted("rate")) }}</p>
</div>
</div>
{% endfor %}