Merge branch 'latest' of github.com:webnotes/erpnext into latest
Conflicts: version.num
This commit is contained in:
commit
af1ad9a31e
0
blank.html
Normal file
0
blank.html
Normal file
@ -15,8 +15,15 @@ def cleanup():
|
|||||||
delete_doc("DocType", "SSO Control")
|
delete_doc("DocType", "SSO Control")
|
||||||
delete_doc("DocType", "WN ERP Client Control")
|
delete_doc("DocType", "WN ERP Client Control")
|
||||||
delete_doc("DocType", "DocTrigger")
|
delete_doc("DocType", "DocTrigger")
|
||||||
|
|
||||||
|
# cleanup control panel
|
||||||
delete_doc("DocType", "Control Panel")
|
delete_doc("DocType", "Control Panel")
|
||||||
reload_doc("core", "doctype", "control_panel")
|
reload_doc("core", "doctype", "control_panel")
|
||||||
|
|
||||||
|
# cleanup page
|
||||||
|
delete_doc("DocType", "Control Panel")
|
||||||
|
reload_doc("core", "doctype", "control_panel")
|
||||||
|
|
||||||
webnotes.conn.sql("""delete from tabSingles
|
webnotes.conn.sql("""delete from tabSingles
|
||||||
where field like 'startup_%' and doctype='Control Panel'""")
|
where field like 'startup_%' and doctype='Control Panel'""")
|
||||||
|
|
||||||
|
24
erpnext/patches/jan_mar_2012/website.py
Normal file
24
erpnext/patches/jan_mar_2012/website.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# website patch
|
||||||
|
|
||||||
|
import webnotes
|
||||||
|
def execute():
|
||||||
|
cleanup_file_data()
|
||||||
|
return
|
||||||
|
update_patch_log()
|
||||||
|
from webnotes.modules import reload_doc
|
||||||
|
reload_doc('website', 'Module Def', 'Website')
|
||||||
|
reload_doc('website', 'Role', 'Website Manager')
|
||||||
|
reload_doc('website', 'doctype', 'home_settings')
|
||||||
|
reload_doc('website', 'doctype', 'top_bar_settings')
|
||||||
|
reload_doc('website', 'doctype', 'top_bar_item')
|
||||||
|
reload_doc('website', 'page', 'home')
|
||||||
|
|
||||||
|
def cleanup_file_data():
|
||||||
|
webnotes.conn.commit()
|
||||||
|
webnotes.conn.sql("""alter table `tabFile Data` drop column blob_content""")
|
||||||
|
webnotes.conn.begin()
|
||||||
|
|
||||||
|
def update_patch_log():
|
||||||
|
webnotes.conn.commit()
|
||||||
|
webnotes.conn.sql("""alter table __PatchLog engine=InnoDB""")
|
||||||
|
webnotes.conn.begin()
|
@ -50,4 +50,4 @@ def get_letter_heads():
|
|||||||
"""load letter heads with startup"""
|
"""load letter heads with startup"""
|
||||||
import webnotes
|
import webnotes
|
||||||
ret = webnotes.conn.sql("select name, content from `tabLetter Head` where ifnull(disabled,0)=0")
|
ret = webnotes.conn.sql("select name, content from `tabLetter Head` where ifnull(disabled,0)=0")
|
||||||
dict(ret)
|
return dict(ret)
|
||||||
|
@ -215,7 +215,8 @@ SidebarItem.prototype.show_items = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(me.il[i].doc_type=='Reports') has_reports = 1;
|
if(me.il[i].doc_type=='Reports') has_reports = 1;
|
||||||
if(in_list(['Single DocType', 'Pages', 'Setup Forms'], me.il[i].doc_type)) has_tools = 1;
|
if(in_list(['Single DocType', 'Pages', 'Setup Forms'], me.il[i].doc_type))
|
||||||
|
has_tools = 1;
|
||||||
}
|
}
|
||||||
// reports
|
// reports
|
||||||
if(has_reports) {
|
if(has_reports) {
|
||||||
|
@ -11,10 +11,13 @@ erpnext.startup.set_globals = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
erpnext.startup.start = function() {
|
erpnext.startup.start = function() {
|
||||||
|
$('#startup_div').html('Starting up...').toggle(true);
|
||||||
|
|
||||||
erpnext.startup.set_globals();
|
erpnext.startup.set_globals();
|
||||||
|
|
||||||
if(user == 'Guest'){
|
if(user == 'Guest'){
|
||||||
$dh(page_body.left_sidebar);
|
$dh(page_body.left_sidebar);
|
||||||
|
wn.require('erpnext/website/css/website.css');
|
||||||
wn.require('erpnext/website/js/topbar.js');
|
wn.require('erpnext/website/js/topbar.js');
|
||||||
} else {
|
} else {
|
||||||
// modules
|
// modules
|
||||||
@ -32,6 +35,7 @@ erpnext.startup.start = function() {
|
|||||||
$('footer').html('<div class="erpnext-footer">\
|
$('footer').html('<div class="erpnext-footer">\
|
||||||
Powered by <a href="https://erpnext.com">ERPNext</a></div>');
|
Powered by <a href="https://erpnext.com">ERPNext</a></div>');
|
||||||
|
|
||||||
|
$('#startup_div').toggle(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// chart of accounts
|
// chart of accounts
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
{
|
{
|
||||||
'creation': '2012-01-23 17:05:32',
|
'creation': '2012-01-23 17:05:32',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2012-01-24 10:29:53',
|
'modified': '2012-01-24 15:57:51',
|
||||||
'modified_by': 'Administrator',
|
'modified_by': 'Administrator',
|
||||||
'owner': 'Administrator'
|
'owner': 'Administrator'
|
||||||
},
|
},
|
||||||
@ -21,9 +21,6 @@
|
|||||||
|
|
||||||
# These values are common for all Module Def Item
|
# These values are common for all Module Def Item
|
||||||
{
|
{
|
||||||
'display_name': 'Top Bar Settings',
|
|
||||||
'doc_name': 'Top Bar Settings',
|
|
||||||
'doc_type': 'Single DocType',
|
|
||||||
'doctype': 'Module Def Item',
|
'doctype': 'Module Def Item',
|
||||||
'name': '__common__',
|
'name': '__common__',
|
||||||
'parent': 'Website',
|
'parent': 'Website',
|
||||||
@ -49,6 +46,17 @@
|
|||||||
|
|
||||||
# Module Def Item
|
# Module Def Item
|
||||||
{
|
{
|
||||||
|
'display_name': 'Top Bar Settings',
|
||||||
|
'doc_name': 'Top Bar Settings',
|
||||||
|
'doc_type': 'Single DocType',
|
||||||
|
'doctype': 'Module Def Item'
|
||||||
|
},
|
||||||
|
|
||||||
|
# Module Def Item
|
||||||
|
{
|
||||||
|
'display_name': 'Home Settings',
|
||||||
|
'doc_name': 'Home Settings',
|
||||||
|
'doc_type': 'Forms',
|
||||||
'doctype': 'Module Def Item'
|
'doctype': 'Module Def Item'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
21
erpnext/website/css/website.css
Normal file
21
erpnext/website/css/website.css
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#body_div {
|
||||||
|
width: 900px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
header .topbar .container {
|
||||||
|
width: 900px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.web-main-section {
|
||||||
|
width: 65%;
|
||||||
|
float: left;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.web-side-section {
|
||||||
|
width: 30%;
|
||||||
|
float: right;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
0
erpnext/website/doctype/home_settings/__init__.py
Normal file
0
erpnext/website/doctype/home_settings/__init__.py
Normal file
26
erpnext/website/doctype/home_settings/home_settings.py
Normal file
26
erpnext/website/doctype/home_settings/home_settings.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
"""
|
||||||
|
generate home html
|
||||||
|
"""
|
||||||
|
|
||||||
|
class DocType:
|
||||||
|
def __init__(self, d, dl):
|
||||||
|
self.doc, self.doclist = d, dl
|
||||||
|
|
||||||
|
def on_update(self):
|
||||||
|
"""make home html"""
|
||||||
|
import os, jinja2, markdown2
|
||||||
|
import webnotes
|
||||||
|
|
||||||
|
# markdown
|
||||||
|
self.doc.main_section_html = markdown2.markdown(self.doc.main_section or '', \
|
||||||
|
extras=["wiki-tables"])
|
||||||
|
self.doc.side_section_html = markdown2.markdown(self.doc.side_section or '', \
|
||||||
|
extras=["wiki-tables"])
|
||||||
|
|
||||||
|
# write template
|
||||||
|
with open(os.path.join(os.path.dirname(__file__), 'template.html'), 'r') as f:
|
||||||
|
temp = jinja2.Template(f.read())
|
||||||
|
|
||||||
|
html = temp.render(doc = self.doc.fields)
|
||||||
|
webnotes.conn.set_value('Page', 'Home', 'content', html)
|
||||||
|
|
118
erpnext/website/doctype/home_settings/home_settings.txt
Normal file
118
erpnext/website/doctype/home_settings/home_settings.txt
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
# DocType, Home Settings
|
||||||
|
[
|
||||||
|
|
||||||
|
# These values are common in all dictionaries
|
||||||
|
{
|
||||||
|
'creation': '2012-01-24 15:56:06',
|
||||||
|
'docstatus': 0,
|
||||||
|
'modified': '2012-01-25 13:31:56',
|
||||||
|
'modified_by': 'Administrator',
|
||||||
|
'owner': 'Administrator'
|
||||||
|
},
|
||||||
|
|
||||||
|
# These values are common for all DocType
|
||||||
|
{
|
||||||
|
'_last_update': '1327476129',
|
||||||
|
'allow_attach': 1,
|
||||||
|
'colour': 'White:FFF',
|
||||||
|
'doctype': 'DocType',
|
||||||
|
'issingle': 1,
|
||||||
|
'max_attachments': 5,
|
||||||
|
'module': 'Website',
|
||||||
|
'name': '__common__',
|
||||||
|
'section_style': 'Simple',
|
||||||
|
'show_in_menu': 0,
|
||||||
|
'version': 4
|
||||||
|
},
|
||||||
|
|
||||||
|
# These values are common for all DocField
|
||||||
|
{
|
||||||
|
'doctype': 'DocField',
|
||||||
|
'name': '__common__',
|
||||||
|
'parent': 'Home Settings',
|
||||||
|
'parentfield': 'fields',
|
||||||
|
'parenttype': 'DocType',
|
||||||
|
'permlevel': 0
|
||||||
|
},
|
||||||
|
|
||||||
|
# These values are common for all DocPerm
|
||||||
|
{
|
||||||
|
'create': 1,
|
||||||
|
'doctype': 'DocPerm',
|
||||||
|
'name': '__common__',
|
||||||
|
'parent': 'Home Settings',
|
||||||
|
'parentfield': 'permissions',
|
||||||
|
'parenttype': 'DocType',
|
||||||
|
'permlevel': 0,
|
||||||
|
'read': 1,
|
||||||
|
'write': 1
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocType, Home Settings
|
||||||
|
{
|
||||||
|
'doctype': 'DocType',
|
||||||
|
'name': 'Home Settings'
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocPerm
|
||||||
|
{
|
||||||
|
'doctype': 'DocPerm',
|
||||||
|
'role': 'System Manager'
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocPerm
|
||||||
|
{
|
||||||
|
'doctype': 'DocPerm',
|
||||||
|
'role': 'Website Manager'
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocField
|
||||||
|
{
|
||||||
|
'colour': 'White:FFF',
|
||||||
|
'description': 'HTML that will appear on the top part of the home page. For no headline, leave blank',
|
||||||
|
'doctype': 'DocField',
|
||||||
|
'fieldname': 'headline',
|
||||||
|
'fieldtype': 'Text',
|
||||||
|
'label': 'Headline'
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocField
|
||||||
|
{
|
||||||
|
'doctype': 'DocField',
|
||||||
|
'fieldname': 'banner',
|
||||||
|
'fieldtype': 'Select',
|
||||||
|
'label': 'Banner',
|
||||||
|
'options': 'attach_files:'
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocField
|
||||||
|
{
|
||||||
|
'colour': 'White:FFF',
|
||||||
|
'description': 'For formatting, use \n<a href="http://warpedvisions.org/projects/markdown-cheat-sheet/" \ntarget = "_blank">markdown</a>',
|
||||||
|
'doctype': 'DocField',
|
||||||
|
'fieldname': 'main_section',
|
||||||
|
'fieldtype': 'Code',
|
||||||
|
'label': 'Main Section'
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocField
|
||||||
|
{
|
||||||
|
'colour': 'White:FFF',
|
||||||
|
'description': 'For formatting, use \n<a href="http://warpedvisions.org/projects/markdown-cheat-sheet/" \ntarget = "_blank">markdown</a>',
|
||||||
|
'doctype': 'DocField',
|
||||||
|
'fieldname': 'side_section',
|
||||||
|
'fieldtype': 'Code',
|
||||||
|
'label': 'Side Section'
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocField
|
||||||
|
{
|
||||||
|
'doctype': 'DocField',
|
||||||
|
'fieldname': 'file_list',
|
||||||
|
'fieldtype': 'Text',
|
||||||
|
'hidden': 1,
|
||||||
|
'label': 'File List',
|
||||||
|
'no_copy': 1,
|
||||||
|
'print_hide': 1
|
||||||
|
}
|
||||||
|
]
|
17
erpnext/website/doctype/home_settings/template.html
Normal file
17
erpnext/website/doctype/home_settings/template.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<div class="layout_wrapper">
|
||||||
|
<div id="content-home">
|
||||||
|
{% if doc.headline %}
|
||||||
|
<h1>{{ doc.headline }}</h1>
|
||||||
|
{% endif %}
|
||||||
|
{% if doc.banner %}
|
||||||
|
<img src="files/{{ doc.banner }}" style="width: 870px; margin-bottom: 20px" />
|
||||||
|
{% endif %}
|
||||||
|
<div class="web-main-section">
|
||||||
|
{{ doc.main_section_html }}
|
||||||
|
</div>
|
||||||
|
<div class="web-side-section">
|
||||||
|
{{ doc.side_section_html }}
|
||||||
|
</div>
|
||||||
|
<div style="clear: both"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -36,8 +36,9 @@ erpnext.topbar.TopBar = Class.extend({
|
|||||||
for(var i=0;i<items.length;i++) {
|
for(var i=0;i<items.length;i++) {
|
||||||
var item = items[i];
|
var item = items[i];
|
||||||
if(!item.parent_label) {
|
if(!item.parent_label) {
|
||||||
$('header .nav:first').append(repl('<li><a href="#" data-label="%(label)s">\
|
item.route = item.std_page.toLowerCase();
|
||||||
%(label)s</a></li>', item))
|
$('header .nav:first').append(repl('<li><a href="#!%(route)s" \
|
||||||
|
data-label="%(label)s">%(label)s</a></li>', item))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
0
erpnext/website/page/__init__.py
Normal file
0
erpnext/website/page/__init__.py
Normal file
0
erpnext/website/page/home/__init__.py
Normal file
0
erpnext/website/page/home/__init__.py
Normal file
42
erpnext/website/page/home/home.txt
Normal file
42
erpnext/website/page/home/home.txt
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# Page, home
|
||||||
|
[
|
||||||
|
|
||||||
|
# These values are common in all dictionaries
|
||||||
|
{
|
||||||
|
'creation': '2012-01-24 16:08:44',
|
||||||
|
'docstatus': 0,
|
||||||
|
'modified': '2012-01-24 16:08:44',
|
||||||
|
'modified_by': 'Administrator',
|
||||||
|
'owner': 'Administrator'
|
||||||
|
},
|
||||||
|
|
||||||
|
# These values are common for all Page
|
||||||
|
{
|
||||||
|
'doctype': 'Page',
|
||||||
|
'module': 'Website',
|
||||||
|
'name': '__common__',
|
||||||
|
'page_name': 'home',
|
||||||
|
'standard': 'Yes'
|
||||||
|
},
|
||||||
|
|
||||||
|
# These values are common for all Page Role
|
||||||
|
{
|
||||||
|
'doctype': 'Page Role',
|
||||||
|
'name': '__common__',
|
||||||
|
'parent': 'home',
|
||||||
|
'parentfield': 'roles',
|
||||||
|
'parenttype': 'Page',
|
||||||
|
'role': 'Guest'
|
||||||
|
},
|
||||||
|
|
||||||
|
# Page, home
|
||||||
|
{
|
||||||
|
'doctype': 'Page',
|
||||||
|
'name': 'home'
|
||||||
|
},
|
||||||
|
|
||||||
|
# Page Role
|
||||||
|
{
|
||||||
|
'doctype': 'Page Role'
|
||||||
|
}
|
||||||
|
]
|
@ -3,7 +3,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>ERPNext</title>
|
<title>ERPNext</title>
|
||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
<script type="text/javascript">window._version_number="169";
|
<script type="text/javascript">window._version_number="201";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* lib/js/wn/class.js
|
* lib/js/wn/class.js
|
||||||
|
@ -1 +1 @@
|
|||||||
169
|
201
|
||||||
|
Loading…
x
Reference in New Issue
Block a user