mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
[website] [minor] moving to framework
This commit is contained in:
69
config.json
69
config.json
@@ -43,12 +43,6 @@
|
|||||||
"color": "#7f8c8d",
|
"color": "#7f8c8d",
|
||||||
"icon": "icon-cogs"
|
"icon": "icon-cogs"
|
||||||
},
|
},
|
||||||
"Website": {
|
|
||||||
"type": "module",
|
|
||||||
"link": "website-home",
|
|
||||||
"color": "#16a085",
|
|
||||||
"icon": "icon-globe"
|
|
||||||
},
|
|
||||||
"HR": {
|
"HR": {
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"link": "hr-home",
|
"link": "hr-home",
|
||||||
@@ -80,28 +74,13 @@
|
|||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"pages": {
|
"pages": {
|
||||||
"about": {
|
|
||||||
"template": "app/website/templates/pages/about",
|
|
||||||
"args_method": "website.doctype.about_us_settings.about_us_settings.get_args"
|
|
||||||
},
|
|
||||||
"account": {
|
"account": {
|
||||||
"no_cache": true,
|
"no_cache": true,
|
||||||
"template": "app/website/templates/pages/account"
|
"template": "app/portal/templates/account.html"
|
||||||
},
|
|
||||||
"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"
|
|
||||||
},
|
},
|
||||||
"order": {
|
"order": {
|
||||||
"no_cache": true,
|
"no_cache": true,
|
||||||
"template": "app/website/templates/pages/sale",
|
"template": "app/portal/templates/sale.html",
|
||||||
"args_method": "utilities.website_transactions.get_order_args",
|
"args_method": "utilities.website_transactions.get_order_args",
|
||||||
"portal": {
|
"portal": {
|
||||||
"doctype": "Sales Order",
|
"doctype": "Sales Order",
|
||||||
@@ -112,12 +91,12 @@
|
|||||||
},
|
},
|
||||||
"orders": {
|
"orders": {
|
||||||
"no_cache": true,
|
"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"
|
"args_method": "utilities.website_transactions.order_list_args"
|
||||||
},
|
},
|
||||||
"invoice": {
|
"invoice": {
|
||||||
"no_cache": true,
|
"no_cache": true,
|
||||||
"template": "app/website/templates/pages/sale",
|
"template": "app/portal/templates/sale.html",
|
||||||
"args_method": "utilities.website_transactions.get_invoice_args",
|
"args_method": "utilities.website_transactions.get_invoice_args",
|
||||||
"portal": {
|
"portal": {
|
||||||
"doctype": "Sales Invoice",
|
"doctype": "Sales Invoice",
|
||||||
@@ -128,12 +107,12 @@
|
|||||||
},
|
},
|
||||||
"invoices": {
|
"invoices": {
|
||||||
"no_cache": true,
|
"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"
|
"args_method": "utilities.website_transactions.invoice_list_args"
|
||||||
},
|
},
|
||||||
"shipment": {
|
"shipment": {
|
||||||
"no_cache": true,
|
"no_cache": true,
|
||||||
"template": "app/website/templates/pages/sale",
|
"template": "app/portal/templates/sale.html",
|
||||||
"args_method": "utilities.website_transactions.get_shipment_args",
|
"args_method": "utilities.website_transactions.get_shipment_args",
|
||||||
"portal": {
|
"portal": {
|
||||||
"doctype": "Delivery Note",
|
"doctype": "Delivery Note",
|
||||||
@@ -144,69 +123,57 @@
|
|||||||
},
|
},
|
||||||
"shipments": {
|
"shipments": {
|
||||||
"no_cache": true,
|
"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"
|
"args_method": "utilities.website_transactions.shipment_list_args"
|
||||||
},
|
},
|
||||||
"product_search": {
|
"product_search": {
|
||||||
"template": "app/website/templates/pages/product_search"
|
"template": "app/stock/doctype/item/templates/product_search.html"
|
||||||
},
|
},
|
||||||
"ticket": {
|
"ticket": {
|
||||||
"no_cache": true,
|
"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",
|
"args_method": "support.doctype.support_ticket.support_ticket.get_website_args",
|
||||||
"portal": {
|
"portal": {
|
||||||
"doctype": "Support Ticket"
|
"doctype": "Support Ticket"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tickets": {
|
"tickets": {
|
||||||
"template": "app/website/templates/pages/tickets",
|
"template": "app/support/doctype/support_ticket/templates/tickets.html",
|
||||||
"args_method": "utilities.website_transactions.ticket_list_args"
|
"args_method": "utilities.website_transactions.ticket_list_args"
|
||||||
},
|
},
|
||||||
"address": {
|
"address": {
|
||||||
"no_cache": true,
|
"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"
|
"args_method": "utilities.doctype.address.address.get_website_args"
|
||||||
},
|
},
|
||||||
"addresses": {
|
"addresses": {
|
||||||
"template": "app/website/templates/pages/addresses"
|
"template": "app/utilities/doctype/address/templates/addresses.html"
|
||||||
},
|
|
||||||
"writers": {
|
|
||||||
"template": "app/website/templates/pages/writers",
|
|
||||||
"args_method": "website.doctype.blogger.blogger.get_writers_args"
|
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
"no_cache": true,
|
"no_cache": true,
|
||||||
"template": "app/website/templates/pages/profile",
|
"template": "app/portal/templates/profile.html",
|
||||||
"args_method": "startup.webutils.get_profile_args"
|
"args_method": "startup.webutils.get_profile_args"
|
||||||
},
|
},
|
||||||
"cart": {
|
"cart": {
|
||||||
"no_cache": true,
|
"no_cache": true,
|
||||||
"template": "app/website/templates/pages/cart.html"
|
"template": "app/portal/templates/cart.html"
|
||||||
},
|
},
|
||||||
"partners": {
|
"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"
|
"args_method": "setup.doctype.sales_partner.sales_partner.get_partner_args"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"generators": {
|
"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": {
|
"Item": {
|
||||||
"template": "app/website/templates/html/product_page.html",
|
"template": "app/stock/doctype/item/templates/item.html",
|
||||||
"condition_field": "show_in_website"
|
"condition_field": "show_in_website"
|
||||||
},
|
},
|
||||||
"Item Group":{
|
"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"
|
"condition_field": "show_in_website"
|
||||||
},
|
},
|
||||||
"Sales Partner": {
|
"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"
|
"condition_field": "show_in_website"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import get_base_path
|
from webnotes.utils import get_base_path
|
||||||
import os
|
import os, shutil
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
# remove pyc files
|
# remove pyc files
|
||||||
@@ -13,5 +13,5 @@ def execute():
|
|||||||
print exists
|
print exists
|
||||||
os.remove(utils_pyc)
|
os.remove(utils_pyc)
|
||||||
|
|
||||||
# TODO remove website folder
|
shutil.rmtree(os.path.join(get_base_path(), "app", "website"))
|
||||||
|
|
||||||
19
portal/templates/base.html
Normal file
19
portal/templates/base.html
Normal file
@@ -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 %}
|
||||||
@@ -44,7 +44,7 @@ class DocType(DocTypeNestedSet):
|
|||||||
webnotes.msgprint("An item exists with same name (%s), please change the \
|
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)
|
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, \
|
from selling.utils.product import get_product_list_for_group, \
|
||||||
get_parent_item_groups, get_group_item_count
|
get_parent_item_groups, get_group_item_count
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class DocType:
|
|||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def prepare_template_args(self):
|
def get_context(self):
|
||||||
address = webnotes.conn.get_value("Address",
|
address = webnotes.conn.get_value("Address",
|
||||||
{"sales_partner": self.doc.name, "is_primary_address": 1},
|
{"sales_partner": self.doc.name, "is_primary_address": 1},
|
||||||
"*", as_dict=True)
|
"*", as_dict=True)
|
||||||
|
|||||||
@@ -7,15 +7,6 @@ from webnotes.utils import cint, cstr, encode
|
|||||||
def get_templates_path():
|
def get_templates_path():
|
||||||
return os.path.join(os.path.dirname(conf.__file__), "app", "website", "templates")
|
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):
|
def update_template_args(page_name, args):
|
||||||
|
|
||||||
from webnotes.utils import get_request_site_address
|
from webnotes.utils import get_request_site_address
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ class DocType(DocListController):
|
|||||||
def get_tax_rate(self, tax_type):
|
def get_tax_rate(self, tax_type):
|
||||||
return { "tax_rate": webnotes.conn.get_value("Account", tax_type, "tax_rate") }
|
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
|
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.parent_groups = get_parent_item_groups(self.doc.item_group) + [{"name":self.doc.name}]
|
||||||
self.doc.title = self.doc.item_name
|
self.doc.title = self.doc.item_name
|
||||||
|
|||||||
Reference in New Issue
Block a user