Merge branch 'master' of github.com:webnotes/erpnext into edge

Conflicts:
	hr/doctype/leave_application/locale/_messages_py.json
	hr/doctype/leave_block_list/locale/_messages_doc.json
	public/js/locale/_messages_js.json
	setup/doctype/email_digest/locale/_messages_doc.json
	setup/doctype/global_defaults/global_defaults.txt
This commit is contained in:
Anand Doshi 2013-02-21 11:09:43 +05:30
commit 59d8a76e60
36 changed files with 1595 additions and 110 deletions

View File

@ -29,6 +29,7 @@ wn.require('app/utilities/doctype/sms_control/sms_control.js');
// On Load // On Load
// ------- // -------
cur_frm.cscript.onload = function(doc,dt,dn) { cur_frm.cscript.onload = function(doc,dt,dn) {
cur_frm.cscript.manage_rounded_total();
if(!doc.customer && doc.debit_to) wn.meta.get_docfield(dt, 'debit_to', dn).print_hide = 0; if(!doc.customer && doc.debit_to) wn.meta.get_docfield(dt, 'debit_to', dn).print_hide = 0;
if (doc.__islocal) { if (doc.__islocal) {
if(!doc.due_date) set_multiple(dt,dn,{due_date:get_today()}); if(!doc.due_date) set_multiple(dt,dn,{due_date:get_today()});

View File

@ -16,6 +16,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import webnotes import webnotes
from webnotes.utils import cint
from setup.utils import get_company_currency from setup.utils import get_company_currency
from controllers.accounts_controller import AccountsController from controllers.accounts_controller import AccountsController
@ -27,8 +28,13 @@ class SellingController(AccountsController):
def set_total_in_words(self): def set_total_in_words(self):
from webnotes.utils import money_in_words from webnotes.utils import money_in_words
company_currency = get_company_currency(self.doc.company) company_currency = get_company_currency(self.doc.company)
disable_rounded_total = cint(webnotes.conn.get_value("Global Defaults", None,
"disable_rounded_total"))
if self.meta.get_field("in_words"): if self.meta.get_field("in_words"):
self.doc.in_words = money_in_words(self.doc.rounded_total, company_currency) self.doc.in_words = money_in_words(disable_rounded_total and
self.doc.grand_total or self.doc.rounded_total, company_currency)
if self.meta.get_field("in_words_export"): if self.meta.get_field("in_words_export"):
self.doc.in_words_export = money_in_words(self.doc.rounded_total_export, self.doc.in_words_export = money_in_words(disable_rounded_total and
self.doc.currency) self.doc.grand_total_export or self.doc.rounded_total_export, self.doc.currency)

View File

@ -1,4 +1,8 @@
erpnext.updates = [ erpnext.updates = [
["20th February, 2013", [
"Disable Rounded Total: If disable in 'Global Defaults', Rounding related fields \
in sales cycle transactions and in corresponding print formats will not be visible"
]],
["15th February, 2013", [ ["15th February, 2013", [
"Calendar: Added new FullCalendar, and Calendar Views", "Calendar: Added new FullCalendar, and Calendar Views",
"Leave Application: Added email notifications on Leave Application", "Leave Application: Added email notifications on Leave Application",
@ -7,29 +11,66 @@ erpnext.updates = [
"Employee: If Employee is linked to a Profile, copy Full Name, Date of Birth, \ "Employee: If Employee is linked to a Profile, copy Full Name, Date of Birth, \
Image and Gender to Profile", Image and Gender to Profile",
"Leave Application: Select Leave Approver by their Full Name", "Leave Application: Select Leave Approver by their Full Name",
"Fixes in C-Form",
]], ]],
["12th February, 2013", ["Fixes in Payment Reconciliation "]],
["6th February, 2013", [ ["6th February, 2013", [
"Bookmarks: Add bookmarks via toolbar by clicking on the <i class='icon-star'></i> sign.", "Bookmarks: Add bookmarks via toolbar by clicking on the <i class='icon-star'></i> sign.",
"Fixes in Voucher Import Tool",
]], ]],
["5th February, 2013", [ ["5th February, 2013", [
"Block Negative Account Balance: If enabled, system will not allow to post entry \
if balance goes into negative",
"Leave Block List: Block users from taking leave on certain days.", "Leave Block List: Block users from taking leave on certain days.",
"Added project column in 'To Be Delivered/Billed' report ",
]],
["4th February, 2013", [
"Make gl entry only if amount is there",
"Fixes in Stock Ledger Report"
]], ]],
["2nd February, 2013", [ ["2nd February, 2013", [
"Warehouse: Added table Warehouse User to restrict Warehouse Entry per user.", "Warehouse: Added table Warehouse User to restrict Warehouse Entry per user.",
"Fixes in Gl Entry for Purchase Invoice",
]],
["1st February, 2013", [
"Removed sales order pending items report",
"Fixes in Salary Register Report, Sales Invoice and Budget Control",
]],
["31st January, 2013", [
"New Report: Purchase order items pending to be received",
"GL Mapper deprecated",
]], ]],
["28st January, 2013", [ ["28st January, 2013", [
"List Views are now configurable: To set list views, check 'In List View' in Setup > Customize Form View in the fields table.", "List Views are now configurable: To set list views, check 'In List View' in Setup > Customize Form View in the fields table.",
"Fixes in Financial Statements and Features Setup",
]], ]],
["24st January, 2013", [ ["25th January, 2013", [
"Fixes for currency in all Modern/Classic/Spartan print formats",
"Stock Ageing Report: Added show zero values option"
]],
["24th January, 2013", [
"Sales Analytics based on Sales Order/Delivery Note/Sales Invoice",
"Integrated Languages in Profile and via browser settings. To set your language, click on your name in the toolbar then 'My Settings...'", "Integrated Languages in Profile and via browser settings. To set your language, click on your name in the toolbar then 'My Settings...'",
"Fixes in Recurring Invoice",
"Fixes for Territory link to Sales Browser ",
"Check item/item group with same name while creating item group/item",
]],
["22nd January, 2013", [
"Valuation Rate mandatory for opening Stock Reconciliation",
"Show analytics value based on valuation method defined in item master",
]], ]],
["21st January, 2013", [ ["21st January, 2013", [
"Number Formatting: Added Number Format to Global Defaults & Currency", "Number Formatting: Added Number Format to Global Defaults & Currency",
]], ]],
["20th January, 2013", [
"In payment matching tool only show outstanding invoices"
]],
["18th January, 2013", [ ["18th January, 2013", [
"Buying: Added Price List to purchase cycle", "Buying: Added Price List to purchase cycle",
"C-Form now submittable",
]], ]],
["16th January, 2013", [ ["16th January, 2013", [
"Incoming rate for sales return as per delivery note outgoing rate",
"Job Applicant: Track Job Applicants and extract them from a mailbox like 'jobs@example.com'. See <a href='#Form/Jobs Email Settings'>Jobs Email Settings</a>.", "Job Applicant: Track Job Applicants and extract them from a mailbox like 'jobs@example.com'. See <a href='#Form/Jobs Email Settings'>Jobs Email Settings</a>.",
"Extract leads: Extract Leads from a mailbox like 'sales@example.com'. See <a href='#Form/Sales Email Settings'>Sales Email Settings</a>.", "Extract leads: Extract Leads from a mailbox like 'sales@example.com'. See <a href='#Form/Sales Email Settings'>Sales Email Settings</a>.",
]], ]],

View File

@ -1,12 +1,13 @@
[ [
{ {
"creation": "2013-01-10 16:34:14", "creation": "2013-02-20 19:10:38",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:56:04", "modified": "2013-02-20 19:11:03",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
{ {
"allow_import": 1,
"autoname": "LAL/.#####", "autoname": "LAL/.#####",
"doctype": "DocType", "doctype": "DocType",
"is_submittable": 1, "is_submittable": 1,

View File

@ -2,6 +2,7 @@
"HR", "HR",
"To Date", "To Date",
"Leave Approver", "Leave Approver",
"Follow via Email",
"Employee", "Employee",
"Employee Name", "Employee Name",
"Status", "Status",
@ -9,6 +10,7 @@
"Apply / Approve Leaves", "Apply / Approve Leaves",
"Rejected", "Rejected",
"Reason", "Reason",
"File List",
"Half Day", "Half Day",
"More Info", "More Info",
"Approved", "Approved",

View File

@ -5,6 +5,7 @@
"Leave by", "Leave by",
"Employee", "Employee",
"Leave Blocked", "Leave Blocked",
"Holiday",
" (Half Day)", " (Half Day)",
"Leave Application" "Leave Application"
] ]

View File

@ -3,13 +3,13 @@
"Block Holidays on important days.", "Block Holidays on important days.",
"Block Days", "Block Days",
"HR", "HR",
"Allow the following users to approve Leave Applications for block days.",
"Company", "Company",
"Leave Block List", "Leave Block List",
"Stop users from making Leave Applications on following days.", "Stop users from making Leave Applications on following days.",
"Applies to Company", "Applies to Company",
"Year", "Year",
"If not checked, the list will have to be added to each Department where it has to be applied.", "If not checked, the list will have to be added to each Department where it has to be applied.",
"Allow the following users to make Leave Applications for block days.",
"Leave Block List Name", "Leave Block List Name",
"Leave Block List Allowed", "Leave Block List Allowed",
"Leave Block List Dates" "Leave Block List Dates"

View File

@ -242,6 +242,7 @@
"Workflow Document State", "Workflow Document State",
"Item Website Specification", "Item Website Specification",
"Mode of Payment", "Mode of Payment",
"Website Settings",
"Leave Block List Date", "Leave Block List Date",
"System Console", "System Console",
"To Do", "To Do",

View File

@ -28,6 +28,7 @@ wn.require('app/utilities/doctype/sms_control/sms_control.js');
// ONLOAD // ONLOAD
// =================================================================================== // ===================================================================================
cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.cscript.manage_rounded_total();
if(!doc.quotation_to) hide_field(['customer','customer_address','contact_person','customer_name','lead', 'lead_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email', 'territory', 'customer_group']); if(!doc.quotation_to) hide_field(['customer','customer_address','contact_person','customer_name','lead', 'lead_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email', 'territory', 'customer_group']);
if(!doc.price_list_name) set_multiple(cdt,cdn,{price_list_name:sys_defaults.price_list_name}); if(!doc.price_list_name) set_multiple(cdt,cdn,{price_list_name:sys_defaults.price_list_name});
if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'}); if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'});

View File

@ -189,20 +189,30 @@ cur_frm.cscript.hide_price_list_currency = function(doc, cdt, cdn, callback1) {
if (doc.conversion_rate != 1) if (doc.conversion_rate != 1)
set_multiple(cdt, cdn, {conversion_rate:1}); set_multiple(cdt, cdn, {conversion_rate:1});
hide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']); hide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']);
} else unhide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']); } else {
unhide_field(['conversion_rate', 'grand_total_export', 'in_words_export']);
if(!cint(sys_defaults.disable_rounded_total))
unhide_field("rounded_total_export");
}
if (r.message[1] == doc.price_list_currency) { if (r.message[1] == doc.price_list_currency) {
if (doc.plc_conversion_rate != 1) if (doc.plc_conversion_rate != 1)
set_multiple(cdt, cdn, {plc_conversion_rate:1}); set_multiple(cdt, cdn, {plc_conversion_rate:1});
hide_field('plc_conversion_rate'); hide_field('plc_conversion_rate');
} else unhide_field('plc_conversion_rate'); } else unhide_field('plc_conversion_rate');
cur_frm.cscript.dynamic_label(doc, cdt, cdn, r.message[1], callback1); cur_frm.cscript.dynamic_label(doc, cdt, cdn, r.message[1], callback1);
} }
}) })
} }
} }
cur_frm.cscript.manage_rounded_total = function() {
if(cint(sys_defaults.disable_rounded_total)) {
cur_frm.set_df_property("rounded_total", "print_hide", 1);
cur_frm.set_df_property("rounded_total_export", "print_hide", 1);
hide_field(["rounded_total", "rounded_total_export"]);
}
}
// TRIGGERS FOR CALCULATIONS // TRIGGERS FOR CALCULATIONS
// ===================================================================================================== // =====================================================================================================

View File

@ -28,6 +28,8 @@ wn.require('app/utilities/doctype/sms_control/sms_control.js');
cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.cscript.manage_rounded_total();
if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'}); if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'});
if(!doc.transaction_date) set_multiple(cdt,cdn,{transaction_date:get_today()}); if(!doc.transaction_date) set_multiple(cdt,cdn,{transaction_date:get_today()});
if(!doc.price_list_currency) set_multiple(cdt, cdn, {price_list_currency: doc.currency, plc_conversion_rate: 1}); if(!doc.price_list_currency) set_multiple(cdt, cdn, {price_list_currency: doc.currency, plc_conversion_rate: 1});

View File

@ -41,7 +41,8 @@ keydict = {
'account_url':'account_url', 'account_url':'account_url',
'allow_negative_stock' : 'allow_negative_stock', 'allow_negative_stock' : 'allow_negative_stock',
'maintain_same_rate' : 'maintain_same_rate', 'maintain_same_rate' : 'maintain_same_rate',
'session_expiry': 'session_expiry' 'session_expiry': 'session_expiry',
'disable_rounded_total': 'disable_rounded_total',
} }
class DocType: class DocType:

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-02-18 13:36:21", "creation": "2013-02-19 12:28:27",
"docstatus": 0, "docstatus": 0,
"modified": "2013-02-18 13:44:56", "modified": "2013-02-20 14:08:70",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -27,6 +27,8 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"name": "__common__", "name": "__common__",
@ -332,6 +334,13 @@
"label": "Delivery Note Required", "label": "Delivery Note Required",
"options": "No\nYes" "options": "No\nYes"
}, },
{
"description": "If disable, 'Rounded Total' field will not be visible in any transaction",
"doctype": "DocField",
"fieldname": "disable_rounded_total",
"fieldtype": "Check",
"label": "Disable Rounded Total"
},
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "buying", "fieldname": "buying",
@ -408,11 +417,6 @@
"fieldtype": "Data", "fieldtype": "Data",
"label": "SMS Sender Name" "label": "SMS Sender Name"
}, },
{
"amend": 0,
"cancel": 0,
"doctype": "DocPerm"
},
{ {
"doctype": "DocPerm" "doctype": "DocPerm"
} }

View File

@ -64,6 +64,7 @@ class DocType(DocTypeNestedSet):
self.doc.items = get_product_list_for_group(product_group = self.doc.name, limit=20) self.doc.items = get_product_list_for_group(product_group = self.doc.name, limit=20)
self.parent_groups = get_parent_item_groups(self.doc.name) self.parent_groups = get_parent_item_groups(self.doc.name)
self.doc.title = self.doc.name
if self.doc.slideshow: if self.doc.slideshow:
from website.helpers.slideshow import get_slideshow from website.helpers.slideshow import get_slideshow

View File

@ -106,23 +106,3 @@ def check_if_expired():
webnotes.response['message'] = 'Account Expired' webnotes.response['message'] = 'Account Expired'
raise webnotes.AuthenticationError raise webnotes.AuthenticationError
#### website
def get_web_script():
"""returns web startup script"""
return webnotes.conn.get_value('Website Script', None, 'javascript') or ''
def get_web_style():
"""returns web css"""
return webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
def get_web_header(page_name):
"""get website header"""
from website.utils import get_header
return get_header(page_name)
def get_web_footer(page_name):
"""get website footer"""
from website.utils import get_footer
return get_footer(page_name)

View File

@ -27,6 +27,7 @@ wn.require('app/utilities/doctype/sms_control/sms_control.js');
// ONLOAD // ONLOAD
// ================================================================================================ // ================================================================================================
cur_frm.cscript.onload = function(doc, dt, dn) { cur_frm.cscript.onload = function(doc, dt, dn) {
cur_frm.cscript.manage_rounded_total();
if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); if(!doc.status) set_multiple(dt,dn,{status:'Draft'});
if(!doc.transaction_date) set_multiple(dt,dn,{transaction_date:get_today()}); if(!doc.transaction_date) set_multiple(dt,dn,{transaction_date:get_today()});
if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()}); if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});

View File

@ -217,6 +217,8 @@ class DocType:
from website.helpers.product import get_parent_item_groups, url_for_website from website.helpers.product import get_parent_item_groups, url_for_website
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.website_image = url_for_website(self.doc.website_image) self.doc.website_image = url_for_website(self.doc.website_image)
self.doc.title = self.doc.item_name == self.doc.name and self.doc.item_name or \
(self.doc.item_name + " [" + self.doc.name + "]")
if self.doc.slideshow: if self.doc.slideshow:
from website.helpers.slideshow import get_slideshow from website.helpers.slideshow import get_slideshow

1313
translations/th.csv Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,12 +5,18 @@
div#body_div { div#body_div {
padding: 0px; padding: 0px;
min-height: 400px; min-height: 400px;
margin: 40px auto; margin: 40px auto 10px auto;
box-shadow: 1px 1px 3px 3px #bbb; box-shadow: 1px 1px 3px 3px #bbb;
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
} }
footer {
text-align: left;
width: 720px;
margin: auto;
}
.navbar-inner { .navbar-inner {
border: 0px; border: 0px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
@ -33,9 +39,21 @@ p, li {
padding: 30px; padding: 30px;
} }
.web-footer-menu { .social-icons {
margin-bottom: 7px; font-size: 120%;
float: right;
text-align: right;
} }
.social-icons a:hover {
text-decoration: none;
}
.social-icons a i:hover {
text-decoration: none;
}
.social-icons i {
margin-left: 5px;
}
.web-footer-menu ul { .web-footer-menu ul {
list-style: none; list-style: none;
@ -45,16 +63,8 @@ p, li {
.web-footer-menu ul li { .web-footer-menu ul li {
display: inline; display: inline;
padding: 2px 15px; padding: 2px 14px 2px 0px;
border-right: 1px solid #999; margin: 0px;
}
.web-footer-menu ul li:first-child {
padding-left: 0px;
}
.web-footer-menu ul li:last-child {
border-right: 0px solid #777 !important;
} }
.two-column { .two-column {

View File

@ -1,8 +1,8 @@
[ [
{ {
"creation": "2013-01-10 16:34:33", "creation": "2013-01-25 11:35:10",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:59:43", "modified": "2013-02-21 10:05:09",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -24,17 +24,14 @@
"permlevel": 0 "permlevel": 0
}, },
{ {
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"name": "__common__", "name": "__common__",
"parent": "Website Settings", "parent": "Website Settings",
"parentfield": "permissions", "parentfield": "permissions",
"parenttype": "DocType", "parenttype": "DocType",
"permlevel": 0,
"read": 1, "read": 1,
"report": 0, "report": 0,
"submit": 0, "submit": 0
"write": 1
}, },
{ {
"doctype": "DocType", "doctype": "DocType",
@ -128,6 +125,55 @@
"label": "Footer Items", "label": "Footer Items",
"options": "Top Bar Item" "options": "Top Bar Item"
}, },
{
"doctype": "DocField",
"fieldname": "integrations",
"fieldtype": "Section Break",
"label": "Integrations"
},
{
"description": "Add Google Analytics ID: eg. UA-89XXX57-1. Please search help on Google Analytics for more information.",
"doctype": "DocField",
"fieldname": "google_analytics_id",
"fieldtype": "Data",
"label": "Google Analytics ID"
},
{
"doctype": "DocField",
"fieldname": "column_break_17",
"fieldtype": "Column Break"
},
{
"doctype": "DocField",
"fieldname": "google_plus_one",
"fieldtype": "Check",
"label": "Google Plus One"
},
{
"doctype": "DocField",
"fieldname": "facebook_share",
"fieldtype": "Check",
"label": "Facebook Share"
},
{
"doctype": "DocField",
"fieldname": "linked_in_share",
"fieldtype": "Check",
"label": "Linked In Share"
},
{
"doctype": "DocField",
"fieldname": "twitter_share",
"fieldtype": "Check",
"label": "Twitter Share"
},
{
"description": "Tweet will be shared via your user account (if specified)",
"doctype": "DocField",
"fieldname": "twitter_share_via",
"fieldtype": "Data",
"label": "Twitter Share via"
},
{ {
"doctype": "DocField", "doctype": "DocField",
"fieldname": "misc_section", "fieldname": "misc_section",
@ -170,11 +216,25 @@
"print_hide": 1 "print_hide": 1
}, },
{ {
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"role": "System Manager" "permlevel": 0,
"role": "System Manager",
"write": 1
}, },
{ {
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"role": "Website Manager" "permlevel": 0,
"role": "Website Manager",
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"permlevel": 1,
"role": "All"
} }
] ]

View File

@ -1,11 +1,11 @@
# Copyright (c) 2012 Web Notes Technologies Pvt Ltd. # Copyright (c) 2012 Web Notes Technologies Pvt Ltd.
# License: GNU General Public License (v3). For more information see license.txt # License: GNU General Public License (v3). For more information see license.txt
import os
import webnotes
import website.utils
def make(): def make():
import os
import webnotes
import website.utils
import startup.event_handlers
if not webnotes.conn: if not webnotes.conn:
webnotes.connect() webnotes.connect()
@ -16,17 +16,45 @@ def make():
if os.path.basename(os.path.abspath('.'))!='public': if os.path.basename(os.path.abspath('.'))!='public':
fname = os.path.join('public', fname) fname = os.path.join('public', fname)
if hasattr(startup.event_handlers, 'get_web_script'):
with open(fname, 'w') as f: with open(fname, 'w') as f:
script = 'window.home_page = "%s";\n' % home_page f.write(get_web_script())
script += startup.event_handlers.get_web_script()
f.write(script)
fname = 'css/wn-web.css' fname = 'css/wn-web.css'
if os.path.basename(os.path.abspath('.'))!='public': if os.path.basename(os.path.abspath('.'))!='public':
fname = os.path.join('public', fname) fname = os.path.join('public', fname)
# style - wn.css # style - wn.css
if hasattr(startup.event_handlers, 'get_web_style'):
with open(fname, 'w') as f: with open(fname, 'w') as f:
f.write(startup.event_handlers.get_web_style()) f.write(get_web_style())
def get_web_script():
"""returns web startup script"""
user_script = ""
ws = webnotes.doc("Website Settings", "Website Settings")
if ws.google_analytics_id:
user_script += google_analytics_template % ws.google_analytics_id
user_script += (webnotes.conn.get_value('Website Script', None, 'javascript') or '')
return user_script
def get_web_style():
"""returns web css"""
return webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
google_analytics_template = """
// Google Analytics template
window._gaq = window._gaq || [];
window._gaq.push(['_setAccount', '%s']);
window._gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
"""

View File

@ -3,7 +3,6 @@
"", "",
"Settings for Contact Us Page", "Settings for Contact Us Page",
"Cross Listing of Item in multiple groups", "Cross Listing of Item in multiple groups",
"A Product is shown on the website and is linked to an item.",
"Product Category for website", "Product Category for website",
"Slideshow like display for the website", "Slideshow like display for the website",
"Page to show on the website", "Page to show on the website",

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{% block title %}{% endblock %}</title> <title>{{ title }}</title>
<meta name="generator" content="wnframework"> <meta name="generator" content="wnframework">
<script type="text/javascript" src="lib/js/lib/jquery/jquery.min.js"></script> <script type="text/javascript" src="lib/js/lib/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/all-web.min.js"></script> <script type="text/javascript" src="js/all-web.min.js"></script>

View File

@ -13,7 +13,7 @@
style="margin-bottom: 0px;"> style="margin-bottom: 0px;">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container"> <div class="container">
<a class="brand" href="index.html">{{ brand_html }}</a> <a class="brand" href="/">{{ brand_html }}</a>
<ul class="nav"> <ul class="nav">
{% for page in top_bar_items %} {% for page in top_bar_items %}
{% if not page.parent_label %} {% if not page.parent_label %}
@ -54,7 +54,7 @@
</ul> </ul>
<img src="lib/images/ui/spinner.gif" id="spinner"/> <img src="lib/images/ui/spinner.gif" id="spinner"/>
<ul class="nav pull-right"> <ul class="nav pull-right">
<li id="login-topbar-item"><a href="login.html">Login</a></li> <li id="login-topbar-item"><a href="login">Login</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -67,6 +67,29 @@
</div> </div>
</div> </div>
<footer><div class="web-footer"> <footer><div class="web-footer">
{% if facebook_share or google_plus_one or twitter_share or linked_in_share %}
<div class="social-icons" style="">
<span style="font-size: 11px;">{{ share_text or "Share this page on: "}}</span>
{% if google_plus_one %}
<a href="https://plus.google.com/share?url={{ url }}"
target="_blank"><i class="icon-google-plus"></i></a>
{% endif %}
{% if twitter_share %}
<a href="https://twitter.com/intent/tweet?url={{ url }}&text={{ encoded_title }}"
target="_blank" ><i class="icon-twitter"></i></a>
{% endif %}
{% if facebook_share %}
<a href="https://www.facebook.com/sharer.php?u={{ url }}&t={{ encoded_title }}&via={{ twitter_share_via }}"
target="_blank"><i class="icon-facebook"></i></a>
{% endif %}
{% if linked_in_share %}
<a href="http://www.linkedin.com/shareArticle?mini=true&url={{ url }}&title={{ encoded_title }}"
target="_blank"><i class="icon-linkedin"></i></a>
{% endif %}
</div>
{% endif %}
<p style="float: right; clear: right;">
<a style="font-size: 90%; color: #888;" href="attributions">ERPNext Powered</a></p>
<div class="web-footer-menu"><ul> <div class="web-footer-menu"><ul>
{% for item in footer_items %} {% for item in footer_items %}
<li><a href="{{ item.url }}" {{ item.target }} <li><a href="{{ item.url }}" {{ item.target }}
@ -79,7 +102,6 @@
{% if address %} {% if address %}
{{ address }} {{ address }}
{% endif %} {% endif %}
<p><a style="font-size: 90%;" href="attributions.html">ERPNext Powered</a></p>
</div> </div>
</footer> </footer>

View File

@ -1,7 +1,5 @@
{% extends "html/page.html" %} {% extends "html/page.html" %}
{% block title %}{{ name }}{% endblock %}
{% block content %} {% block content %}
<div class="layout-wrapper layout-wrapper-background"> <div class="layout-wrapper layout-wrapper-background">

View File

@ -8,14 +8,6 @@
{% include "css/product_page.css" %} {% include "css/product_page.css" %}
{% endblock %} {% endblock %}
{% block title %}
{% if item_name != name %}
{{ item_name }} [{{ name }}]
{% else %}
{{ item_name or name }}
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<div class="layout-wrapper layout-wrapper-background"> <div class="layout-wrapper layout-wrapper-background">
<div class="web-content" id="content-product-{{ name }}"> <div class="web-content" id="content-product-{{ name }}">

View File

@ -1,5 +1,7 @@
{% extends "html/outer.html" %} {% extends "html/outer.html" %}
{% set title="Not Found" %}
{% block content %} {% block content %}
<div class="content"> <div class="content">
<div class="layout-wrapper layout-main"> <div class="layout-wrapper layout-main">

View File

@ -1,8 +1,6 @@
{% extends "html/page.html" %} {% extends "html/page.html" %}
{% block title %} {% set title="About Us" %}
About Us
{% endblock %}
{% block content %} {% block content %}
<div class="layout-wrapper"> <div class="layout-wrapper">

View File

@ -8,9 +8,7 @@
</style> </style>
{% endblock %} {% endblock %}
{% block title %} {% set title="ERPNext - Web Based, Open Source ERP" %}
ERPNext - Web Based, Open Source ERP
{% endblock %}
{% block content %} {% block content %}
<div class="layout-attributions"> <div class="layout-attributions">

View File

@ -8,7 +8,7 @@
{% include "css/blog.css" %} {% include "css/blog.css" %}
{% endblock %} {% endblock %}
{% block title %}Blog{% endblock %} {% set title="Blog" %}
{% block content %} {% block content %}
<div class="layout-wrapper layout-wrapper-background"> <div class="layout-wrapper layout-wrapper-background">

View File

@ -4,9 +4,7 @@
{% include "js/contact.js" %} {% include "js/contact.js" %}
{% endblock %} {% endblock %}
{% block title %} {% set title="Contact Us" %}
Contact Us
{% endblock %}
{% block content %} {% block content %}
<div class="layout-wrapper"> <div class="layout-wrapper">

View File

@ -1,5 +1,7 @@
{% extends "html/outer.html" %} {% extends "html/outer.html" %}
{% set title="Error" %}
{% block content %} {% block content %}
<div class="content"> <div class="content">
<div class="layout-wrapper layout-main"> <div class="layout-wrapper layout-main">

View File

@ -7,9 +7,7 @@
{% include "css/login.css" %} {% include "css/login.css" %}
{% endblock %} {% endblock %}
{% block title %} {% set title="Login" %}
Login Page
{% endblock %}
{% block body %} {% block body %}
<div id='login_wrapper'> <div id='login_wrapper'>

View File

@ -1,6 +1,6 @@
{% extends "html/page.html" %} {% extends "html/page.html" %}
{% block title %}Product Search{% endblock %} {% set title="Product Search" %}
{% block javascript %} {% block javascript %}
{% include "js/product_list.js" %} {% include "js/product_list.js" %}

View File

@ -1,5 +1,7 @@
{% extends "html/outer.html" %} {% extends "html/outer.html" %}
{% set title="Unsubscribed" %}
{% block content %} {% block content %}
<div class="content"> <div class="content">
<div class="layout-wrapper layout-main"> <div class="layout-wrapper layout-main">

View File

@ -162,7 +162,7 @@ def prepare_args(page_name):
if not args: if not args:
return False return False
args.update(get_outer_env()) get_outer_env(page_name, args)
return args return args
@ -203,7 +203,10 @@ def get_source_doc(page_name):
return None, None return None, None
def get_outer_env(): def get_outer_env(page_name, args):
from webnotes.utils import get_request_site_address
from urllib import quote
all_top_items = webnotes.conn.sql("""\ all_top_items = webnotes.conn.sql("""\
select * from `tabTop Bar Item` select * from `tabTop Bar Item`
where parent='Website Settings' and parentfield='top_bar_items' where parent='Website Settings' and parentfield='top_bar_items'
@ -242,16 +245,23 @@ def get_outer_env():
'int':int 'int':int
}) })
settings = webnotes.doc("Website Settings", "Website Settings") args.update(ret)
for k in ["brand_html", "copyright", "address", "top_bar_background", "favicon"]:
if k in settings.fields:
ret[k] = settings.fields[k]
if not ret.brand_html: settings = webnotes.doc("Website Settings", "Website Settings")
ret.brand_html = "ERPNext" for k in ["brand_html", "copyright", "address", "top_bar_background", "favicon",
if not ret.top_bar_background: "facebook_share", "google_plus_one", "twitter_share", "linked_in_share", "twitter_share_via"]:
ret.top_bar_background = "Black" if k in settings.fields:
return ret args[k] = settings.fields.get(k)
if not args.brand_html:
args.brand_html = "ERPNext"
if not args.top_bar_background:
args.top_bar_background = "Black"
args.url = quote(get_request_site_address(full_address=True), "")
args.encoded_title = quote(args.title or "", "")
return args
def get_home_page(): def get_home_page():
doc_name = webnotes.conn.get_value('Website Settings', None, 'home_page') doc_name = webnotes.conn.get_value('Website Settings', None, 'home_page')