added website page, home, patch
diff --git a/erpnext/patches/jan_mar_2012/subdomain_login_patch.py b/erpnext/patches/jan_mar_2012/subdomain_login_patch.py
index ced5c68..5c58b08 100644
--- a/erpnext/patches/jan_mar_2012/subdomain_login_patch.py
+++ b/erpnext/patches/jan_mar_2012/subdomain_login_patch.py
@@ -15,8 +15,15 @@
delete_doc("DocType", "SSO Control")
delete_doc("DocType", "WN ERP Client Control")
delete_doc("DocType", "DocTrigger")
+
+ # cleanup control panel
delete_doc("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
where field like 'startup_%' and doctype='Control Panel'""")
diff --git a/erpnext/patches/jan_mar_2012/website.py b/erpnext/patches/jan_mar_2012/website.py
new file mode 100644
index 0000000..a19cd44
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/website.py
@@ -0,0 +1,17 @@
+# website patch
+
+import webnotes
+def execute():
+ 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 update_patch_log():
+ webnotes.conn.commit()
+ webnotes.conn.sql("""alter table __PatchLog engine=InnoDB""")
+ webnotes.conn.begin()
diff --git a/erpnext/startup/modules.js b/erpnext/startup/modules.js
index 29adfcb..3dd7b3e 100644
--- a/erpnext/startup/modules.js
+++ b/erpnext/startup/modules.js
@@ -215,7 +215,8 @@
}
}
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
if(has_reports) {
diff --git a/erpnext/website/Module Def/Website/Website.txt b/erpnext/website/Module Def/Website/Website.txt
index 0a5e1b8..7e67c3c 100644
--- a/erpnext/website/Module Def/Website/Website.txt
+++ b/erpnext/website/Module Def/Website/Website.txt
@@ -5,7 +5,7 @@
{
'creation': '2012-01-23 17:05:32',
'docstatus': 0,
- 'modified': '2012-01-24 10:29:53',
+ 'modified': '2012-01-24 15:57:51',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -21,9 +21,6 @@
# 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',
'name': '__common__',
'parent': 'Website',
@@ -49,6 +46,17 @@
# 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'
},
diff --git a/erpnext/website/css/website.css b/erpnext/website/css/website.css
new file mode 100644
index 0000000..025856d
--- /dev/null
+++ b/erpnext/website/css/website.css
@@ -0,0 +1,9 @@
+#body_div {
+ width: 900px;
+ margin: auto;
+}
+
+header .topbar .container {
+ width: 900px;
+ margin: auto;
+}
\ No newline at end of file
diff --git a/erpnext/website/doctype/home_settings/__init__.py b/erpnext/website/doctype/home_settings/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/website/doctype/home_settings/__init__.py
diff --git a/erpnext/website/doctype/home_settings/home_settings.txt b/erpnext/website/doctype/home_settings/home_settings.txt
new file mode 100644
index 0000000..b95be64
--- /dev/null
+++ b/erpnext/website/doctype/home_settings/home_settings.txt
@@ -0,0 +1,75 @@
+# DocType, Home Settings
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-01-24 15:56:06',
+ 'docstatus': 0,
+ 'modified': '2012-01-24 15:56:06',
+ 'modified_by': 'Administrator',
+ 'owner': 'Administrator'
+ },
+
+ # These values are common for all DocType
+ {
+ 'colour': 'White:FFF',
+ 'doctype': 'DocType',
+ 'issingle': 1,
+ 'module': 'Website',
+ 'name': '__common__',
+ 'section_style': 'Simple',
+ 'show_in_menu': 0,
+ 'version': 1
+ },
+
+ # These values are common for all DocField
+ {
+ 'colour': 'White:FFF',
+ 'description': 'HTML that will appear on the top part of the home page. Usually should contain a headline and image.',
+ 'doctype': 'DocField',
+ 'fieldname': 'banner_html',
+ 'fieldtype': 'Code',
+ 'label': 'Banner HTML',
+ '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
+ {
+ 'doctype': 'DocField'
+ }
+]
\ No newline at end of file
diff --git a/erpnext/website/js/topbar.js b/erpnext/website/js/topbar.js
index 49ec700..85d975b 100644
--- a/erpnext/website/js/topbar.js
+++ b/erpnext/website/js/topbar.js
@@ -36,8 +36,9 @@
for(var i=0;i<items.length;i++) {
var item = items[i];
if(!item.parent_label) {
- $('header .nav:first').append(repl('<li><a href="#" data-label="%(label)s">\
- %(label)s</a></li>', item))
+ item.route = item.std_page.toLowerCase();
+ $('header .nav:first').append(repl('<li><a href="#!%(route)s" \
+ data-label="%(label)s">%(label)s</a></li>', item))
}
}
}
diff --git a/erpnext/website/page/__init__.py b/erpnext/website/page/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/website/page/__init__.py
diff --git a/erpnext/website/page/home/__init__.py b/erpnext/website/page/home/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/website/page/home/__init__.py
diff --git a/erpnext/website/page/home/home.html b/erpnext/website/page/home/home.html
new file mode 100644
index 0000000..3c1bc5e
--- /dev/null
+++ b/erpnext/website/page/home/home.html
@@ -0,0 +1,17 @@
+#!python
+
+from webnotes.model.doc import getsingle
+
+home_settings = getsingle('Home Settings')
+
+html= """
+<div class="layout_wrapper">
+ <div id="content-home">
+ %(banner_html)s
+ </div>
+</div>
+""" % home_settings
+
+out = {
+ "content": html
+}
\ No newline at end of file
diff --git a/erpnext/website/page/home/home.txt b/erpnext/website/page/home/home.txt
new file mode 100644
index 0000000..c8bc806
--- /dev/null
+++ b/erpnext/website/page/home/home.txt
@@ -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'
+ }
+]
\ No newline at end of file