added website page, home, patch

This commit is contained in:
Rushabh Mehta 2012-01-25 10:37:35 +05:30
parent 17a8a3697d
commit a8ad3907db
14 changed files with 186 additions and 9 deletions

View File

@ -15,8 +15,15 @@ def cleanup():
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'""")

View File

@ -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()

View File

@ -215,7 +215,8 @@ SidebarItem.prototype.show_items = function() {
}
}
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) {

View File

@ -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'
},

View File

@ -0,0 +1,9 @@
#body_div {
width: 900px;
margin: auto;
}
header .topbar .container {
width: 900px;
margin: auto;
}

View File

@ -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'
}
]

View File

@ -36,8 +36,9 @@ erpnext.topbar.TopBar = Class.extend({
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))
}
}
}

View File

View File

View File

@ -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
}

View 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'
}
]

View File

@ -3,7 +3,7 @@
<meta charset="utf-8">
<title>ERPNext</title>
<meta name="author" content="">
<script type="text/javascript">window._version_number="176";
<script type="text/javascript">window._version_number="191";
/*
* lib/js/wn/class.js

View File

@ -1 +1 @@
176
191