Rushabh Mehta | ad45e31 | 2013-11-20 12:59:58 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
Rushabh Mehta | e67d1fb | 2013-08-05 14:59:54 +0530 | [diff] [blame] | 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
Anand Doshi | b0d996f | 2013-09-10 18:29:39 +0530 | [diff] [blame] | 4 | import webnotes |
| 5 | from webnotes.utils import cint |
Rushabh Mehta | f4de333 | 2013-09-10 15:49:18 +0530 | [diff] [blame] | 6 | |
Anand Doshi | 0748cb7 | 2013-09-11 15:31:58 +0530 | [diff] [blame] | 7 | def get_website_settings(context): |
| 8 | post_login = [] |
| 9 | cart_enabled = cint(webnotes.conn.get_default("shopping_cart_enabled")) |
| 10 | if cart_enabled: |
| 11 | post_login += [{"label": "Cart", "url": "cart", "icon": "icon-shopping-cart", "class": "cart-count"}, |
| 12 | {"class": "divider"}] |
| 13 | |
| 14 | post_login += [ |
| 15 | {"label": "Profile", "url": "profile", "icon": "icon-user"}, |
| 16 | {"label": "Addresses", "url": "addresses", "icon": "icon-map-marker"}, |
| 17 | {"label": "My Orders", "url": "orders", "icon": "icon-list"}, |
| 18 | {"label": "My Tickets", "url": "tickets", "icon": "icon-tags"}, |
| 19 | {"label": "Invoices", "url": "invoices", "icon": "icon-file-text"}, |
| 20 | {"label": "Shipments", "url": "shipments", "icon": "icon-truck"}, |
| 21 | {"class": "divider"} |
| 22 | ] |
| 23 | context.update({ |
| 24 | "shopping_cart_enabled": cart_enabled, |
| 25 | "post_login": post_login + context.get("post_login", []) |
Anand Doshi | 580bc7c | 2013-11-12 11:50:00 +0530 | [diff] [blame] | 26 | }) |
| 27 | |
| 28 | if not context.get("favicon"): |
| 29 | context["favicon"] = "app/images/favicon.ico" |