[css] portal
diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html
index f2104f9..afba9b8 100644
--- a/erpnext/templates/pages/cart.html
+++ b/erpnext/templates/pages/cart.html
@@ -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" %}
diff --git a/erpnext/templates/pages/home.html b/erpnext/templates/pages/home.html
index 5c0f330..e6cfc90 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 %}
-<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 %}
diff --git a/erpnext/templates/pages/home.py b/erpnext/templates/pages/home.py
index af75097..9488efe 100644
--- a/erpnext/templates/pages/home.py
+++ b/erpnext/templates/pages/home.py
@@ -9,6 +9,13 @@
 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 3252eb9..191b078 100644
--- a/erpnext/templates/pages/order.html
+++ b/erpnext/templates/pages/order.html
@@ -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>