[website] [minor] moving to framework
diff --git a/config.json b/config.json
index 76ab832..0ce1c0c 100644
--- a/config.json
+++ b/config.json
@@ -43,12 +43,6 @@
 			"color": "#7f8c8d",
 			"icon": "icon-cogs"
 		},
-		"Website": {
-			"type": "module",
-			"link": "website-home",
-			"color": "#16a085",
-			"icon": "icon-globe"
-		},
 		"HR": {
 			"type": "module",
 			"link": "hr-home",
@@ -80,28 +74,13 @@
 	},
 	"web": {
 		"pages": {
-			"about": {
-				"template": "app/website/templates/pages/about",
-				"args_method": "website.doctype.about_us_settings.about_us_settings.get_args"
-			},
 			"account": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/account"
-			},
-			"blog": {
-				"template": "app/website/templates/pages/blog",
-				"args_method": "website.doctype.blog_post.blog_post.get_blog_template_args"
-			},
-			"contact": {
-				"template": "app/website/templates/pages/contact",
-				"args_doctype": "Contact Us Settings"
-			},
-			"index": {
-				"template": "app/website/templates/pages/index"
+				"template": "app/portal/templates/account.html"
 			},
 			"order": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/sale",
+				"template": "app/portal/templates/sale.html",
 				"args_method": "utilities.website_transactions.get_order_args",
 				"portal": {
 					"doctype": "Sales Order",
@@ -112,12 +91,12 @@
 			},
 			"orders": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/sales_transactions",
+				"template": "app/portal/templates/sales_transactions.html",
 				"args_method": "utilities.website_transactions.order_list_args"
 			},
 			"invoice": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/sale",
+				"template": "app/portal/templates/sale.html",
 				"args_method": "utilities.website_transactions.get_invoice_args",
 				"portal": {
 					"doctype": "Sales Invoice",
@@ -128,12 +107,12 @@
 			},
 			"invoices": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/sales_transactions",
+				"template": "app/portal/templates/sales_transactions.html",
 				"args_method": "utilities.website_transactions.invoice_list_args"
 			},
 			"shipment": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/sale",
+				"template": "app/portal/templates/sale.html",
 				"args_method": "utilities.website_transactions.get_shipment_args",
 				"portal": {
 					"doctype": "Delivery Note",
@@ -144,69 +123,57 @@
 			},
 			"shipments": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/sales_transactions",
+				"template": "app/portal/templates/sales_transactions.html",
 				"args_method": "utilities.website_transactions.shipment_list_args"
 			},
 			"product_search": {
-				"template": "app/website/templates/pages/product_search"
+				"template": "app/stock/doctype/item/templates/product_search.html"
 			},
 			"ticket": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/ticket",
+				"template": "app/support/doctype/support_ticket/templates/ticket.html",
 				"args_method": "support.doctype.support_ticket.support_ticket.get_website_args",
 				"portal": {
 					"doctype": "Support Ticket"
 				}
 			},
 			"tickets": {
-				"template": "app/website/templates/pages/tickets",
+				"template": "app/support/doctype/support_ticket/templates/tickets.html",
 				"args_method": "utilities.website_transactions.ticket_list_args"
 			},
 			"address": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/address",
+				"template": "app/utilities/doctype/address/templates/address.html",
 				"args_method": "utilities.doctype.address.address.get_website_args"
 			},
 			"addresses": {
-				"template": "app/website/templates/pages/addresses"
-			},
-			"writers": {
-				"template": "app/website/templates/pages/writers",
-				"args_method": "website.doctype.blogger.blogger.get_writers_args"
+				"template": "app/utilities/doctype/address/templates/addresses.html"
 			},
 			"profile": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/profile",
+				"template": "app/portal/templates/profile.html",
 				"args_method": "startup.webutils.get_profile_args"
 			},
 			"cart": {
 				"no_cache": true,
-				"template": "app/website/templates/pages/cart.html"
+				"template": "app/portal/templates/cart.html"
 			},
 			"partners": {
-				"template": "app/website/templates/pages/partners",
+				"template": "app/setup/doctype/sales_partners/templates/partners.html",
 				"args_method": "setup.doctype.sales_partner.sales_partner.get_partner_args"
 			}
 		},
 		"generators": {
-			"Web Page": {
-				"template": "app/website/templates/html/web_page.html",
-				"condition_field": "published"
-			},
-			"Blog Post": {
-				"template": "app/website/templates/html/blog_page.html",
-				"condition_field": "published"
-			},
 			"Item": {
-				"template": "app/website/templates/html/product_page.html",
+				"template": "app/stock/doctype/item/templates/item.html",
 				"condition_field": "show_in_website"
 			},
 			"Item Group":{
-				"template": "app/website/templates/html/product_group.html",
+				"template": "app/setup/doctype/item_group/templates/item_group.html",
 				"condition_field": "show_in_website"
 			},
 			"Sales Partner": {
-				"template": "app/website/templates/html/partner_page.html",
+				"template": "app/setup/doctype/sales_partner/templates/partner_page.html",
 				"condition_field": "show_in_website"
 			}
 		}
diff --git a/patches/september_2013/p03_move_website_to_framework.py b/patches/september_2013/p03_move_website_to_framework.py
index 69bd505..4aac892 100644
--- a/patches/september_2013/p03_move_website_to_framework.py
+++ b/patches/september_2013/p03_move_website_to_framework.py
@@ -4,7 +4,7 @@
 from __future__ import unicode_literals
 import webnotes
 from webnotes.utils import get_base_path
-import os
+import os, shutil
 
 def execute():
 	# remove pyc files
@@ -13,5 +13,5 @@
 		print exists
 		os.remove(utils_pyc)
 	
-	# TODO remove website folder
+	shutil.rmtree(os.path.join(get_base_path(), "app", "website"))
 	
\ No newline at end of file
diff --git a/portal/templates/base.html b/portal/templates/base.html
new file mode 100644
index 0000000..57388d6
--- /dev/null
+++ b/portal/templates/base.html
@@ -0,0 +1,19 @@
+{% extends "lib/website/templates/base.html" %}
+
+{% block toolbar %}
+<div class="pull-right" style="margin:4px;" id="user-tools">
+	{% if shopping_cart_enabled -%}
+	<a href="cart" title="Shopping Cart"><i class="icon-shopping-cart"></i> 
+		<span class="cart-count"></span></a> |
+	{%- endif %}
+	<a id="login-link" href="login">Login</a>
+</div>
+<div class="pull-right hide" style="margin:4px;" id="user-tools-post-login">
+	<a href="account" title="My Account" id="user-full-name"></a> |
+	{% if shopping_cart_enabled -%}
+	<a href="cart" title="Shopping Cart"><i class="icon-shopping-cart"></i> 
+		<span class="cart-count"></span></a> |
+	{%- endif %}
+	<a href="server.py?cmd=web_logout" title="Sign Out"><i class="icon-signout"></i></a>
+</div>
+{% endblock %}
\ No newline at end of file
diff --git a/setup/doctype/item_group/item_group.py b/setup/doctype/item_group/item_group.py
index ccc6c29..5eae4d1 100644
--- a/setup/doctype/item_group/item_group.py
+++ b/setup/doctype/item_group/item_group.py
@@ -44,7 +44,7 @@
 			webnotes.msgprint("An item exists with same name (%s), please change the \
 				item group name or rename the item" % self.doc.name, raise_exception=1)
 	
-	def prepare_template_args(self):
+	def get_context(self):
 		from selling.utils.product import get_product_list_for_group, \
 			get_parent_item_groups, get_group_item_count
 
diff --git a/stock/doctype/item/templates/product_group.html b/setup/doctype/item_group/templates/item_group.html
similarity index 100%
rename from stock/doctype/item/templates/product_group.html
rename to setup/doctype/item_group/templates/item_group.html
diff --git a/setup/doctype/sales_partner/sales_partner.py b/setup/doctype/sales_partner/sales_partner.py
index d63376d..545ae71 100644
--- a/setup/doctype/sales_partner/sales_partner.py
+++ b/setup/doctype/sales_partner/sales_partner.py
@@ -29,7 +29,7 @@
 		else:
 			return ''
 			
-	def prepare_template_args(self):
+	def get_context(self):
 		address = webnotes.conn.get_value("Address", 
 			{"sales_partner": self.doc.name, "is_primary_address": 1}, 
 			"*", as_dict=True)
diff --git a/startup/webutils.py b/startup/webutils.py
index b9b6182..9ce3f0a 100644
--- a/startup/webutils.py
+++ b/startup/webutils.py
@@ -7,15 +7,6 @@
 def get_templates_path():
 	return os.path.join(os.path.dirname(conf.__file__), "app", "website", "templates")
 
-def get_home_page():
-	doc_name = webnotes.conn.get_value('Website Settings', None, 'home_page')
-	if doc_name:
-		page_name = webnotes.conn.get_value('Web Page', doc_name, 'page_name')
-	else:
-		page_name = 'login'
-
-	return page_name
-
 def update_template_args(page_name, args):
 	
 	from webnotes.utils import get_request_site_address
diff --git a/stock/doctype/item/item.py b/stock/doctype/item/item.py
index f6f8d51..25f3feb 100644
--- a/stock/doctype/item/item.py
+++ b/stock/doctype/item/item.py
@@ -258,7 +258,7 @@
 	def get_tax_rate(self, tax_type):
 		return { "tax_rate": webnotes.conn.get_value("Account", tax_type, "tax_rate") }
 
-	def prepare_template_args(self):
+	def get_context(self):
 		from selling.utils.product import get_parent_item_groups
 		self.parent_groups = get_parent_item_groups(self.doc.item_group) + [{"name":self.doc.name}]
 		self.doc.title = self.doc.item_name
diff --git a/stock/doctype/item/templates/product_page.html b/stock/doctype/item/templates/item.html
similarity index 100%
rename from stock/doctype/item/templates/product_page.html
rename to stock/doctype/item/templates/item.html